35 lines
784 B
C++
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.bas");
|
|
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;
|
|
} |