Debugger STEP and BIGSTEP.
This commit is contained in:
@@ -203,6 +203,10 @@ void debug_init(unsigned char* mem) {
|
||||
fclose(f);
|
||||
program[fsize] = 0;
|
||||
|
||||
debug_update();
|
||||
}
|
||||
|
||||
void debug_update() {
|
||||
debug_set_paper(128, 128, 128);
|
||||
debug_clear();
|
||||
|
||||
|
||||
3
debug.h
3
debug.h
@@ -1,3 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
void debug_init(unsigned char* mem);
|
||||
void debug_init(unsigned char* mem);
|
||||
void debug_update();
|
||||
|
||||
4
main.cpp
4
main.cpp
@@ -45,6 +45,7 @@ int main(int argc, char** argv) {
|
||||
vm_register_in_port(21, input_data_out);
|
||||
|
||||
debug_init(vm_get_memory());
|
||||
|
||||
static bool should_quit = false;
|
||||
static SDL_Event sdlEvent;
|
||||
SDL_Scancode just_pressed;
|
||||
@@ -59,9 +60,10 @@ int main(int argc, char** argv) {
|
||||
anykey = true;
|
||||
just_pressed = sdlEvent.key.keysym.scancode;
|
||||
if (sdlEvent.key.keysym.scancode == SDL_SCANCODE_ESCAPE) { should_quit = true; }
|
||||
if (sdlEvent.key.keysym.scancode == SDL_SCANCODE_RETURN) { vm_big_step(); debug_update(); }
|
||||
}
|
||||
}
|
||||
vm_step();
|
||||
//vm_step();
|
||||
//if (SDL_GetTicks() - ticks >= 15) { vdp_flip(); ticks = SDL_GetTicks(); }
|
||||
}
|
||||
|
||||
|
||||
6
vm.cpp
6
vm.cpp
@@ -241,6 +241,12 @@ const int vm_step() {
|
||||
return vm_cycles;
|
||||
}
|
||||
|
||||
const int vm_big_step() {
|
||||
word* lines = parser_get_lines();
|
||||
word current_line = lines[vm_pc];
|
||||
while (vm_pc > 32768 || lines[vm_pc] == current_line) { vm_step(); }
|
||||
return 0;
|
||||
}
|
||||
/*void vm_register_call(void(*callback)(t_stack&)) {
|
||||
external_calls[numcallbacks++] = callback;
|
||||
}*/
|
||||
|
||||
1
vm.h
1
vm.h
@@ -3,6 +3,7 @@
|
||||
|
||||
void vm_init(const char* filename);
|
||||
const int vm_step();
|
||||
const int vm_big_step();
|
||||
void vm_register_in_port(const unsigned char port, unsigned char(*callback)(void));
|
||||
void vm_register_out_port(const unsigned char port, void(*callback)(const unsigned char&));
|
||||
void vm_call_interrupt(const char num);
|
||||
|
||||
Reference in New Issue
Block a user