comparison stateview.c @ 1103:22e87b739ad6

WIP split of ROM loading/argument parsing from Genesis emulation code. Compiles and doesn't crash, but nothing works. Still a few too many globals as well.
author Michael Pavone <pavone@retrodev.com>
date Fri, 09 Dec 2016 09:48:48 -0800
parents e2d345e351b5
children 928a65750345
comparison
equal deleted inserted replaced
1102:c15896605bf2 1103:22e87b739ad6
6 #include <stdlib.h> 6 #include <stdlib.h>
7 #include <stdio.h> 7 #include <stdio.h>
8 #include "vdp.h" 8 #include "vdp.h"
9 #include "render.h" 9 #include "render.h"
10 #include "util.h" 10 #include "util.h"
11 #include "blastem.h" 11 #include "genesis.h"
12 #include "config.h"
12 13
13 14
14 uint16_t read_dma_value(uint32_t address) 15 uint16_t read_dma_value(uint32_t address)
15 { 16 {
16 return 0; 17 return 0;
107 } 108 }
108 width = width < 320 ? def_width : width; 109 width = width < 320 ? def_width : width;
109 height = height < 240 ? (width/320) * 240 : height; 110 height = height < 240 ? (width/320) * 240 : height;
110 111
111 vdp_context context; 112 vdp_context context;
112 render_init(width, height, "GST State Viewer", 60, 0); 113 render_init(width, height, "GST State Viewer", 0);
113 init_vdp_context(&context, 0); 114 init_vdp_context(&context, 0);
114 vdp_load_gst(&context, state_file); 115 vdp_load_gst(&context, state_file);
115 vdp_run_to_vblank(&context); 116 vdp_run_to_vblank(&context);
116 vdp_print_sprite_table(&context); 117 vdp_print_sprite_table(&context);
117 printf("Display %s\n", (context.regs[REG_MODE_2] & DISPLAY_ENABLE) ? "enabled" : "disabled"); 118 printf("Display %s\n", (context.regs[REG_MODE_2] & DISPLAY_ENABLE) ? "enabled" : "disabled");