diff stateview.c @ 1640:3602f3b20072

Small cleanup of vdp_context struct layout and removal of separately allocated buffers
author Michael Pavone <pavone@retrodev.com>
date Fri, 16 Nov 2018 19:56:24 -0800
parents 0174759e559f
children c9695252eff4
line wrap: on
line diff
--- a/stateview.c	Thu Nov 15 22:21:09 2018 -0800
+++ b/stateview.c	Fri Nov 16 19:56:24 2018 -0800
@@ -116,17 +116,16 @@
 	width = width < 320 ? def_width : width;
 	height = height < 240 ? (width/320) * 240 : height;
 
-	vdp_context context;
 	render_init(width, height, "GST State Viewer", 0);
-	init_vdp_context(&context, 0);
-	vdp_load_gst(&context, state_file);
-	vdp_run_to_vblank(&context);
-	vdp_print_sprite_table(&context);
-	printf("Display %s\n", (context.regs[REG_MODE_2] & DISPLAY_ENABLE) ? "enabled" : "disabled");
-	if (!(context.regs[REG_MODE_2] & DISPLAY_ENABLE)) {
+	vdp_context *context = init_vdp_context(0);
+	vdp_load_gst(context, state_file);
+	vdp_run_to_vblank(context);
+	vdp_print_sprite_table(context);
+	printf("Display %s\n", (context->regs[REG_MODE_2] & DISPLAY_ENABLE) ? "enabled" : "disabled");
+	if (!(context->regs[REG_MODE_2] & DISPLAY_ENABLE)) {
 		puts("Forcing display on");
-		vdp_control_port_write(&context, 0x8000 | REG_MODE_2 << 8 | context.regs[REG_MODE_2] | DISPLAY_ENABLE);
+		vdp_control_port_write(context, 0x8000 | REG_MODE_2 << 8 | context->regs[REG_MODE_2] | DISPLAY_ENABLE);
 	}
-    render_wait_quit(&context);
+    render_wait_quit(context);
     return 0;
 }