breakpoints, mem, run, console...

This commit is contained in:
2024-04-12 14:30:53 +02:00
parent b06d880614
commit eb4f2be4a4
6 changed files with 253 additions and 53 deletions

View File

@@ -39,17 +39,30 @@ int main(int argc, char *argv[])
while (SDL_PollEvent(&e))
{
if (e.type == SDL_QUIT) { should_exit=true; break; }
if (e.type == SDL_KEYDOWN) {
if (e.key.keysym.scancode==SDL_SCANCODE_ESCAPE) {
should_exit=true; break;
} else if (e.key.keysym.scancode==SDL_SCANCODE_RETURN) {
//uint16_t PC = z80::getPC();
//z80dis::getAsm(&memory[PC]);
t += z80::step();
z80debug::refresh();
if (z80debug::debugging()) {
if (e.type == SDL_KEYDOWN) {
if (e.key.keysym.scancode==SDL_SCANCODE_ESCAPE) {
should_exit=true; break;
} else if (e.key.keysym.scancode==SDL_SCANCODE_F10) {
t += z80::step();
z80debug::refresh();
} else if (e.key.keysym.scancode==SDL_SCANCODE_RETURN) {
z80debug::executeConsole();
} else if (e.key.keysym.scancode==SDL_SCANCODE_BACKSPACE) {
z80debug::DeleteCharConsole();
}
}
if (e.type == SDL_TEXTINPUT) {
z80debug::sendToConsole(e.text.text);
}
}
}
if (!z80debug::debugging()) {
if (z80debug::isbreak(z80::getPC()))
z80debug::stop();
else
t += z80::step();
}
}
return 0;