From edf8728b04101ff9a57d953f884bb86b6f9124b0 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Fri, 6 Dec 2024 12:23:30 +0100 Subject: [PATCH] =?UTF-8?q?-=20[FIX]=20El=20debugger=20se=20agarrotava=20q?= =?UTF-8?q?uan=20duia=20un=20rato=20-=20[FIX]=20No=20calculava=20correctam?= =?UTF-8?q?ent=20l'adre=C3=A7a=20a=20la=20que=20anar=20en=20una=20interrup?= =?UTF-8?q?ci=C3=B3=20de=20mode=202=20-=20[NEW]=20Afegit=20commando=20"got?= =?UTF-8?q?o=20adre=C3=A7a"=20al=20debugger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 4 ++-- z80.cpp | 2 +- z80debug.cpp | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 8c391d0..c3b7413 100644 --- a/main.cpp +++ b/main.cpp @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) zxscreen::redraw(); } if (e.type == SDL_MOUSEWHEEL) { - if (e.wheel.mouseX<46 && e.wheel.mouseY<20) { + if (e.wheel.mouseX<46*CHR_W && e.wheel.mouseY<20*CHR_H) { if (e.wheel.y>0) { z80debug::cursorback(); z80debug::refresh(); @@ -245,7 +245,7 @@ int main(int argc, char *argv[]) time = SDL_GetTicks(); } } - } else if (z80debug::paused()) { + } else if (!z80debug::debugging() && z80debug::paused()) { zxscreen::redraw(false); ui::menu::show(); zxscreen::present(); diff --git a/z80.cpp b/z80.cpp index 02ac5f0..34bb329 100644 --- a/z80.cpp +++ b/z80.cpp @@ -662,7 +662,7 @@ namespace z80 if (im==1) { rPC = 0x38; } else if (im==2) { - const uint8_t address = (rI<<8) | 0xFE; + const uint16_t address = (rI<<8) | 0xFE; rPC = READ_MEM_16(address); } } diff --git a/z80debug.cpp b/z80debug.cpp index 2a67b21..ec65fb5 100644 --- a/z80debug.cpp +++ b/z80debug.cpp @@ -453,6 +453,12 @@ namespace z80debug else if (strcmp(cmd, "l")==0) { getcmd(); int value = getnum(cmd); z80::getRegs()[6] = value; } else if (strcmp(cmd, "h")==0) { getcmd(); int value = getnum(cmd); z80::getRegs()[7] = value; } else { strcpy(console_error, "Syntax error: invalid register"); return; } + } else if (strcmp(cmd, "g")==0 || strcmp(cmd, "goto")==0) { + getcmd(); + int address = getnum(cmd); + if (address<0 || address>=65536) { strcpy(console_error, "Illegal address"); return; } + if (z80::getMemTag(address)!=MEMTAG_INST) address = find_previous_opcode(address); + z80debug::setcursor(address); } }