Mercurial > repos > blastem
diff stateview.c @ 33:2e15fa26fe58
Add support for simple resolution scaling
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 08 Dec 2012 22:07:25 -0800 |
parents | f664eeb55cb4 |
children | 3fc57e1a2c56 |
line wrap: on
line diff
--- a/stateview.c Sat Dec 08 21:39:01 2012 -0800 +++ b/stateview.c Sat Dec 08 22:07:25 2012 -0800 @@ -14,11 +14,21 @@ fprintf(stderr, "Failed to open %s\n", argv[1]); exit(1); } + int width = 320; + int height = 240; + if (argc > 2) { + width = atoi(argv[2]); + if (argc > 3) { + height = atoi(argv[3]); + } else { + height = (width/320) * 240; + } + } vdp_context context; init_vdp_context(&context); vdp_load_savestate(&context, state_file); vdp_run_to_vblank(&context); - render_init(); + render_init(width, height); render_context(&context); render_wait_quit(); return 0;