Improving debugger.

This commit is contained in:
2017-02-01 16:47:23 +01:00
parent 42d738b5fa
commit ad4b15514d
8 changed files with 71 additions and 57 deletions

View File

@@ -46,6 +46,8 @@ int main(int argc, char** argv) {
debug_init(vm_get_memory());
bool running = false;
static bool should_quit = false;
static SDL_Event sdlEvent;
SDL_Scancode just_pressed;
@@ -57,14 +59,16 @@ int main(int argc, char** argv) {
if (sdlEvent.type == SDL_WINDOWEVENT_CLOSE) { should_quit = true; break; }
if (sdlEvent.type == SDL_QUIT) { should_quit = true; break; }
else if (sdlEvent.type == SDL_KEYDOWN) {
anykey = true;
//anykey = true;
just_pressed = sdlEvent.key.keysym.scancode;
if (sdlEvent.key.keysym.scancode == SDL_SCANCODE_SPACE) { anykey = true; }
if (sdlEvent.key.keysym.scancode == SDL_SCANCODE_ESCAPE) { should_quit = true; }
if (sdlEvent.key.keysym.scancode == SDL_SCANCODE_F10) { vm_big_step(); debug_update(); }
if (sdlEvent.key.keysym.scancode == SDL_SCANCODE_F11) { vm_step(); debug_update(); }
if (sdlEvent.key.keysym.scancode == SDL_SCANCODE_F5) { running = !running; if (!running) debug_update(); }
}
}
//vm_step();
if (running) vm_step();
//if (SDL_GetTicks() - ticks >= 15) { vdp_flip(); ticks = SDL_GetTicks(); }
}