From 14d047cbb9b8f9200d55a14f18f554addb0b31bb Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Sat, 14 Dec 2024 12:22:30 +0100 Subject: [PATCH] =?UTF-8?q?-=20[NEW]=20En=20el=20debugger,=20en=20el=20vis?= =?UTF-8?q?or=20de=20mem=C3=B2ria,=20tambe=20es=20veu=20cada=20byte=20del?= =?UTF-8?q?=20color=20del=20seu=20tag=20-=20[NEW]=20En=20el=20debugger,=20?= =?UTF-8?q?en=20el=20visor=20de=20breakpoints,=20se=20marca=20uno=20si=20e?= =?UTF-8?q?stem=20en=20eixe=20breakpoint=20-=20[NEW]=20Opci=C3=B3=20per=20?= =?UTF-8?q?a=20sincronitzar=20el=20cursor=20del=20visor=20de=20mem=C3=B2ri?= =?UTF-8?q?a=20amb=20el=20cursor=20del=20desensamblador=20-=20[NEW]=20Clic?= =?UTF-8?q?k=20on=20breakpoint=20to=20goto=20its=20address=20-=20[FIX]=20I?= =?UTF-8?q?X,=20IX=20bit,=20IY=20i=20IY=20bit=20opcodes=20with=20displacem?= =?UTF-8?q?ent=20wher=20shown=20wrong=20on=20the=20disassembler=20-=20[NEW?= =?UTF-8?q?]=20Symbols=20module=20shows=20a=20symbol=20highlighted=20if=20?= =?UTF-8?q?the=20cursor=20is=20on=20its=20address=20-=20[NEW]=20Click=20on?= =?UTF-8?q?=20a=20symbol=20to=20move=20the=20cursor=20to=20its=20address?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- symbols.txt | 3 +-- z80debug.cpp | 69 +++++++++++++++++++++++++++++++++++++++++++++------- z80dis.cpp | 11 ++++----- 3 files changed, 66 insertions(+), 17 deletions(-) diff --git a/symbols.txt b/symbols.txt index 07279fe..adff646 100644 --- a/symbols.txt +++ b/symbols.txt @@ -1,2 +1 @@ -0xf72d MAINLOOP -0xf864 CHK_KEYB +0xfed5 COUNT500 diff --git a/z80debug.cpp b/z80debug.cpp index 602e90d..fdfd891 100644 --- a/z80debug.cpp +++ b/z80debug.cpp @@ -65,6 +65,9 @@ namespace z80debug uint8_t use[7][256]; uint16_t line_address[256]; + uint16_t line_breakpoint_address[256]; + int num_breakpoint_lines=0; + bool sync_mem_with_cursor = false; char temp[256]; const char *tohex(int value, int numdigits) @@ -185,6 +188,9 @@ namespace z80debug } } if (e->type == SDL_MOUSEBUTTONDOWN) { + const int chrx = e->button.x/CHR_W; + const int chry = e->button.y/CHR_H; + //printf("%ix%i\n", chrx, chry); if ( (e->button.xbutton.y<(mem_y-1)*CHR_H) && (e->button.y>CHR_H) ) { const uint16_t address = ((e->button.y)/CHR_H)-1; if (breakpoints[line_address[address]]==0) @@ -193,6 +199,26 @@ namespace z80debug breakpoints[line_address[address]]=0; refresh(); } + if (chrx>=midx+12 && chry>=9 && chrybreakpoint_selected) { + cursor = line_breakpoint_address[breakpoint_selected]; + refresh(); + } + } + + if (chrx>=10 && chrx<=12 && chry==mem_y) { + sync_mem_with_cursor = ! sync_mem_with_cursor; + refresh(); + } + + if (chrx>=midx+2 && chry>=sym_y+1) { + const int line = chry-(sym_y+1); + if (line9) break; } @@ -476,15 +512,23 @@ namespace z80debug ui::setoffset(0, 0); ui::box(0,mem_y,midx,mem_h,COLOR_WHITE); - ui::printrect(2,mem_y, 9,1, COLOR_DARK); + ui::printrect(2,mem_y, 11,1, COLOR_DARK); ui::printtxt(3,mem_y, "MEMORY:", COLOR_WHITE); + ui::printvoidrect(10,mem_y,3,1,COLOR_WHITE); + if (sync_mem_with_cursor) ui::printchar(11,mem_y,'X',COLOR_WHITE); + ui::setoffset(1, mem_y+1); uint16_t mem_viewer_cursor = mem_viewer_pos; for (int i=0; i4) { - opcode_size=4; - sprintf(buffer, base, (int8_t)*(memory+2)); - } else { - sprintf(buffer, base, (int8_t)*(memory+1)); - } + if (opcode_size>4) opcode_size=4; + sprintf(buffer, base, (int8_t)*(memory+3)); + //} else { + // sprintf(buffer, base, (int8_t)*(memory+1)); + //} } return buffer;