- [NEW] zxscreen
- [NEW] F8 para execució - [NEW] F5 continua execució - [NEW] ULA synch interrupt - [NEW] Break on read/write - [FIX] INC8 and DEC8 did wrong flags calculations - [FIX] INCMEM8 and DECMEM8 did no flags calculation at all - [NEW] Flags visualization - [DEL] run command replaced by cont command - [NEW] reset command - [NEW] Breakpoint delete command
This commit is contained in:
26
main.cpp
26
main.cpp
@@ -3,6 +3,7 @@
|
||||
#include "z80.h"
|
||||
#include "z80dis.h"
|
||||
#include "z80debug.h"
|
||||
#include "zxscreen.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -30,6 +31,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
SDL_Init(SDL_INIT_EVERYTHING);
|
||||
z80debug::show();
|
||||
zxscreen::show();
|
||||
|
||||
bool should_exit = false;
|
||||
SDL_Event e;
|
||||
@@ -45,7 +47,13 @@ int main(int argc, char *argv[])
|
||||
should_exit=true; break;
|
||||
} else if (e.key.keysym.scancode==SDL_SCANCODE_F10) {
|
||||
t += z80::step();
|
||||
if (t>=69888) { t=0; z80::interrupt(); }
|
||||
z80debug::refresh();
|
||||
zxscreen::refresh();
|
||||
} else if (e.key.keysym.scancode==SDL_SCANCODE_F5) {
|
||||
z80::step();
|
||||
z80debug::cont();
|
||||
zxscreen::refresh();
|
||||
} else if (e.key.keysym.scancode==SDL_SCANCODE_RETURN) {
|
||||
z80debug::executeConsole();
|
||||
} else if (e.key.keysym.scancode==SDL_SCANCODE_BACKSPACE) {
|
||||
@@ -55,13 +63,27 @@ int main(int argc, char *argv[])
|
||||
if (e.type == SDL_TEXTINPUT) {
|
||||
z80debug::sendToConsole(e.text.text);
|
||||
}
|
||||
} else {
|
||||
if (e.type == SDL_KEYDOWN) {
|
||||
if (e.key.keysym.scancode==SDL_SCANCODE_F8) {
|
||||
z80debug::stop();
|
||||
zxscreen::refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!z80debug::debugging()) {
|
||||
if (z80debug::isbreak(z80::getPC()))
|
||||
if (z80debug::isbreak(z80::getPC())) {
|
||||
z80debug::stop();
|
||||
else
|
||||
zxscreen::refresh();
|
||||
} else {
|
||||
t += z80::step();
|
||||
if (t>=69888) {
|
||||
t=0;
|
||||
zxscreen::refresh();
|
||||
z80::interrupt();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user