comparison stateview.c @ 1692:5dacaef602a7 segacd

Merge from default
author Michael Pavone <pavone@retrodev.com>
date Sat, 05 Jan 2019 00:58:08 -0800
parents 3602f3b20072
children c9695252eff4
comparison
equal deleted inserted replaced
1504:95b3a1a8b26c 1692:5dacaef602a7
77 77
78 void handle_mouse_moved(int mouse, uint16_t x, uint16_t y, int16_t deltax, int16_t deltay) 78 void handle_mouse_moved(int mouse, uint16_t x, uint16_t y, int16_t deltax, int16_t deltay)
79 { 79 {
80 } 80 }
81 81
82 void controller_add_mappings()
83 {
84 }
85
82 tern_node * config; 86 tern_node * config;
83 int headless = 0; 87 int headless = 0;
84 88
85 int main(int argc, char ** argv) 89 int main(int argc, char ** argv)
86 { 90 {
110 def_width = 640; 114 def_width = 640;
111 } 115 }
112 width = width < 320 ? def_width : width; 116 width = width < 320 ? def_width : width;
113 height = height < 240 ? (width/320) * 240 : height; 117 height = height < 240 ? (width/320) * 240 : height;
114 118
115 vdp_context context;
116 render_init(width, height, "GST State Viewer", 0); 119 render_init(width, height, "GST State Viewer", 0);
117 init_vdp_context(&context, 0); 120 vdp_context *context = init_vdp_context(0);
118 vdp_load_gst(&context, state_file); 121 vdp_load_gst(context, state_file);
119 vdp_run_to_vblank(&context); 122 vdp_run_to_vblank(context);
120 vdp_print_sprite_table(&context); 123 vdp_print_sprite_table(context);
121 printf("Display %s\n", (context.regs[REG_MODE_2] & DISPLAY_ENABLE) ? "enabled" : "disabled"); 124 printf("Display %s\n", (context->regs[REG_MODE_2] & DISPLAY_ENABLE) ? "enabled" : "disabled");
122 if (!(context.regs[REG_MODE_2] & DISPLAY_ENABLE)) { 125 if (!(context->regs[REG_MODE_2] & DISPLAY_ENABLE)) {
123 puts("Forcing display on"); 126 puts("Forcing display on");
124 vdp_control_port_write(&context, 0x8000 | REG_MODE_2 << 8 | context.regs[REG_MODE_2] | DISPLAY_ENABLE); 127 vdp_control_port_write(context, 0x8000 | REG_MODE_2 << 8 | context->regs[REG_MODE_2] | DISPLAY_ENABLE);
125 } 128 }
126 render_wait_quit(&context); 129 render_wait_quit(context);
127 return 0; 130 return 0;
128 } 131 }