Mercurial > repos > blastem
diff stateview.c @ 20:f664eeb55cb4
Mostly broken VDP core and savestate viewer
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 08 Dec 2012 02:00:54 -0800 |
parents | |
children | 2e15fa26fe58 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stateview.c Sat Dec 08 02:00:54 2012 -0800 @@ -0,0 +1,25 @@ +#include <stdlib.h> +#include <stdio.h> +#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; +}