Files
paco/main.cpp
2017-01-27 18:56:52 +01:00

35 lines
784 B
C++

#include <stdlib.h>
#include <stdio.h>
#include "vm.h"
#include "vdp.h"
#include <SDL.h>
int main(int argc, char** argv) {
vm_init("test.bin");
vdp_init();
vm_register_out_port(10, vdp_data_out);
vm_register_out_port(11, vdp_cmd_out);
static bool should_quit = false;
static SDL_Event sdlEvent;
SDL_Scancode just_pressed;
while (!should_quit) {
just_pressed = SDL_SCANCODE_UNKNOWN;
while (SDL_PollEvent(&sdlEvent)) {
if (sdlEvent.type == SDL_QUIT) { should_quit = true; break; }
else if (sdlEvent.type == SDL_KEYDOWN) {
//anyKey = true;
just_pressed = sdlEvent.key.keysym.scancode;
if (sdlEvent.key.keysym.scancode == SDL_SCANCODE_ESCAPE) { should_quit = true; }
}
}
vm_step();
}
vdp_quit();
return 0;
}