From b06d880614a16da1da6654beb00af7a145477456 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Thu, 11 Apr 2024 19:55:07 +0200 Subject: [PATCH] - Treballant en el visor de la pila --- z80debug.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/z80debug.cpp b/z80debug.cpp index 38b35f1..b5c1cf4 100644 --- a/z80debug.cpp +++ b/z80debug.cpp @@ -191,6 +191,32 @@ namespace z80debug printtxt(13,5, tohex(memory[z80::getDE()], 2), COLOR_GRAY); printtxt(21,5, tohex(memory[z80::getHL()], 2), COLOR_GRAY); + offset_x = offset_y = 0; + box(46,8,11,12,COLOR_WHITE); + printrect(48,8, 8,1, COLOR_DARK); + printtxt(49,8, "STACK:", COLOR_WHITE); + offset_x=47;offset_y=9; + uint16_t sp = z80::getSP()-8; + for (int i=0; i<10; ++i) { + uint8_t c1=COLOR_CYAN, c2=COLOR_GRAY; + if (sp == z80::getSP()) { + printrect(0,i,9,1,COLOR_BLUE); + c1 = c2 = COLOR_YELLOW; + } + printtxt(0,i, tohex(sp, 4), c1); + printtxt(5,i, tohex(*((uint16_t*)&memory[sp]),4), c2); + sp+=2; + } + + offset_x = offset_y = 0; + box(57,8,14,12,COLOR_WHITE); + printrect(59,8, 9,1, COLOR_DARK); + printtxt(60,8, "BREAKS:", COLOR_WHITE); + offset_x=58;offset_y=9; + printtxt(0,0, "#1", COLOR_CYAN); + printtxt(3,0, "FFFF", COLOR_WHITE); + printtxt(8,0, "read", COLOR_GRAY); + offset_x=offset_y=0; box(0,20,71,8,COLOR_WHITE); printrect(2,20, 9,1, COLOR_DARK);