- Ja es pot tancar la finestra amb el botó de tancar finestra normal
- Ara la finestra de debug nomes es mostra mentre s'està debugant - [NEW] "peek address" i "poke address value" des de la consola, per a modificar o consultar la memòria
This commit is contained in:
38
z80debug.cpp
38
z80debug.cpp
@@ -73,22 +73,36 @@ namespace z80debug
|
||||
|
||||
void processCommand();
|
||||
|
||||
void show()
|
||||
void init()
|
||||
{
|
||||
is_debugging = false;
|
||||
for (int i=0; i<65536; ++i) breakpoints[i]=0;
|
||||
//show();
|
||||
}
|
||||
|
||||
void show()
|
||||
{
|
||||
if (win) return;
|
||||
win = SDL_CreateWindow("Z80 Debugger", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 71*CHR_W, 34*CHR_H, SDL_WINDOW_RESIZABLE);
|
||||
ren = SDL_CreateRenderer(win, -1, 0);
|
||||
tex = SDL_CreateTextureFromSurface(ren, SDL_LoadBMP("font.bmp"));
|
||||
SDL_SetTextureBlendMode(tex, SDL_BLENDMODE_BLEND);
|
||||
|
||||
for (int i=0; i<65536; ++i) breakpoints[i]=0;
|
||||
|
||||
z80debug::refresh();
|
||||
}
|
||||
|
||||
void stop() { zx_ula::sound_disable(); is_debugging = true; breakpoints[z80::getPC()] &= ~8; refresh(); }
|
||||
void cont() { is_debugging = false; refresh(); zx_ula::sound_enable(); }
|
||||
void hide()
|
||||
{
|
||||
if (tex) SDL_DestroyTexture(tex);
|
||||
if (ren) SDL_DestroyRenderer(ren);
|
||||
if (win) SDL_DestroyWindow(win);
|
||||
tex = NULL;
|
||||
ren = NULL;
|
||||
win = NULL;
|
||||
}
|
||||
|
||||
void stop() { zx_ula::sound_disable(); is_debugging = true; breakpoints[z80::getPC()] &= ~8; show(); /*refresh();*/ }
|
||||
void cont() { is_debugging = false; hide();/*refresh()*/; zx_ula::sound_enable(); }
|
||||
const bool debugging() { return is_debugging; }
|
||||
|
||||
void box(int x, int y, int w, int h, uint8_t color)
|
||||
@@ -446,7 +460,19 @@ namespace z80debug
|
||||
} else if (strcmp(cmd, "play")==0) {
|
||||
zx_tape::play();
|
||||
}
|
||||
|
||||
} else if (strcmp(cmd, "poke")==0) {
|
||||
getcmd();
|
||||
int address = getnum(cmd);
|
||||
getcmd();
|
||||
int value = getnum(cmd);
|
||||
uint8_t *mem = z80::getMem();
|
||||
mem[address] = value;
|
||||
} else if (strcmp(cmd, "peek")==0) {
|
||||
getcmd();
|
||||
int address = getnum(cmd);
|
||||
uint8_t *mem = z80::getMem();
|
||||
int value = mem[address];
|
||||
SDL_itoa(value, console_error, 10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user