Mercurial > repos > blastem
comparison 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 |
comparison
equal
deleted
inserted
replaced
32:8602ad493794 | 33:2e15fa26fe58 |
---|---|
12 FILE * state_file = fopen(argv[1], "rb"); | 12 FILE * state_file = fopen(argv[1], "rb"); |
13 if (!state_file) { | 13 if (!state_file) { |
14 fprintf(stderr, "Failed to open %s\n", argv[1]); | 14 fprintf(stderr, "Failed to open %s\n", argv[1]); |
15 exit(1); | 15 exit(1); |
16 } | 16 } |
17 int width = 320; | |
18 int height = 240; | |
19 if (argc > 2) { | |
20 width = atoi(argv[2]); | |
21 if (argc > 3) { | |
22 height = atoi(argv[3]); | |
23 } else { | |
24 height = (width/320) * 240; | |
25 } | |
26 } | |
17 vdp_context context; | 27 vdp_context context; |
18 init_vdp_context(&context); | 28 init_vdp_context(&context); |
19 vdp_load_savestate(&context, state_file); | 29 vdp_load_savestate(&context, state_file); |
20 vdp_run_to_vblank(&context); | 30 vdp_run_to_vblank(&context); |
21 render_init(); | 31 render_init(width, height); |
22 render_context(&context); | 32 render_context(&context); |
23 render_wait_quit(); | 33 render_wait_quit(); |
24 return 0; | 34 return 0; |
25 } | 35 } |