comparison stateview.c @ 1931:374a5ae694e8 mame_interp

Merge from default
author Michael Pavone <pavone@retrodev.com>
date Sat, 18 Apr 2020 11:42:53 -0700
parents c3d49c338224
children
comparison
equal deleted inserted replaced
1843:13abdc98379e 1931:374a5ae694e8
111 } 111 }
112 width = width < 320 ? def_width : width; 112 width = width < 320 ? def_width : width;
113 height = height < 240 ? (width/320) * 240 : height; 113 height = height < 240 ? (width/320) * 240 : height;
114 114
115 render_init(width, height, "GST State Viewer", 0); 115 render_init(width, height, "GST State Viewer", 0);
116 vdp_context *context = init_vdp_context(0); 116 vdp_context *context = init_vdp_context(0, 0);
117 vdp_load_gst(context, state_file); 117 vdp_load_gst(context, state_file);
118 vdp_run_to_vblank(context); 118 vdp_run_to_vblank(context);
119 vdp_print_sprite_table(context); 119 vdp_print_sprite_table(context);
120 printf("Display %s\n", (context->regs[REG_MODE_2] & DISPLAY_ENABLE) ? "enabled" : "disabled"); 120 printf("Display %s\n", (context->regs[REG_MODE_2] & DISPLAY_ENABLE) ? "enabled" : "disabled");
121 if (!(context->regs[REG_MODE_2] & DISPLAY_ENABLE)) { 121 if (!(context->regs[REG_MODE_2] & DISPLAY_ENABLE)) {
122 puts("Forcing display on"); 122 puts("Forcing display on");
123 vdp_control_port_write(context, 0x8000 | REG_MODE_2 << 8 | context->regs[REG_MODE_2] | DISPLAY_ENABLE); 123 vdp_control_port_write(context, 0x8000 | REG_MODE_2 << 8 | context->regs[REG_MODE_2] | DISPLAY_ENABLE);
124 } 124 }
125 render_wait_quit(context); 125 render_wait_quit();
126 return 0; 126 return 0;
127 } 127 }