From 0fe3c72239c1bc454965bfe6877307667135bbac Mon Sep 17 00:00:00 2001 From: Mike Pavone Date: Sat, 8 Dec 2012 02:00:54 -0800 Subject: Mostly broken VDP core and savestate viewer --- stateview.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 stateview.c (limited to 'stateview.c') diff --git a/stateview.c b/stateview.c new file mode 100644 index 0000000..6da765e --- /dev/null +++ b/stateview.c @@ -0,0 +1,25 @@ +#include +#include +#include "vdp.h" +#include "render.h" + +int main(int argc, char ** argv) +{ + if (argc < 2) { + fprintf(stderr, "Usage: stateview FILENAME\n"); + exit(1); + } + FILE * state_file = fopen(argv[1], "rb"); + if (!state_file) { + fprintf(stderr, "Failed to open %s\n", argv[1]); + exit(1); + } + vdp_context context; + init_vdp_context(&context); + vdp_load_savestate(&context, state_file); + vdp_run_to_vblank(&context); + render_init(); + render_context(&context); + render_wait_quit(); + return 0; +} -- cgit v1.2.3