diff --git a/z80.cpp b/z80.cpp index 3b02d9e..cd524b3 100644 --- a/z80.cpp +++ b/z80.cpp @@ -930,10 +930,11 @@ namespace z80 } } - void CPI() + uint8_t CPI() { bool keep_fC = (rF & fC); - CP(READ_MEM_8(rHL)); + const uint8_t hlmem = READ_MEM_8(rHL); + CP(hlmem); rHL++; rBC--; t+=2; @@ -941,12 +942,13 @@ namespace z80 if (keep_fC) SET_FLAGS(fC); if (rBC!=0) SET_FLAGS(fP); //if (READ_MEM_8(rHL)==rA) SET_FLAGS(fZ); + return hlmem; } void CPIR() { - CPI(); - if (rBC!=0 && READ_MEM_8(rHL)!=rA) + const uint8_t hlmem = CPI(); + if (rBC!=0 && hlmem!=rA) { rPC-=2; t+=2; @@ -996,7 +998,7 @@ namespace z80 } return val; } else - return 0xff; + return 0xFF; } void OUT(uint8_t val, int port = 0x10000) diff --git a/z80debug.cpp b/z80debug.cpp index 22eeba5..35bc93f 100644 --- a/z80debug.cpp +++ b/z80debug.cpp @@ -147,11 +147,13 @@ namespace z80debug z80debug::history::goforward(); z80debug::refresh(); z80analyze::refresh(); - /*} else if (e->key.keysym.scancode==SDL_SCANCODE_F6) { - z80debug::history::gototop(); - const uint8_t dt = z80::step(); - z80debug::refresh(); - zxscreen::refresh(dt);*/ + } else if (e->key.keysym.scancode==SDL_SCANCODE_F9) { + const uint16_t address = cursor; + if (breakpoints[line_address[address]]==0) + breakpoints[line_address[address]]=1; + else + breakpoints[line_address[address]]=0; + refresh(); } else if (e->key.keysym.scancode==SDL_SCANCODE_UP) { if (console_history_nav != console_history_pos+1 && console_history[console_history_nav-1][0]!=0) console_history_nav--; //z80debug::cursorback(); @@ -965,6 +967,15 @@ namespace z80debug } else { search(cmd); } + } else if (strcmp(cmd, "show")==0) { + getcmd(); + if (strcmp(cmd, "analyzer")==0) { + z80analyze::show(); + } else { + sendToConsoleLog("Unrecognized window. Usage: Show [analyzer]"); + } + } else { + sendToConsoleLog("Unrecognized command."); } } diff --git a/zx_screen.cpp b/zx_screen.cpp index a73e547..58bc8a0 100644 --- a/zx_screen.cpp +++ b/zx_screen.cpp @@ -186,7 +186,7 @@ namespace zxscreen } } - void refresh(const uint32_t dt) + void refresh(const uint32_t dt, const bool full) { const uint8_t* memory = z80::getMem(); const uint8_t border_color = zx_ula::get_border_color(); @@ -220,16 +220,20 @@ namespace zxscreen t_screen=0; ptr_pixel = zx_pixels; redraw(); - z80::interrupt(); + if (!full) z80::interrupt(); } } } void fullrefresh() { + uint32_t tmp = t_screen; t_screen = 0; + uint8_t * tmp_ptr = ptr_pixel; ptr_pixel = zx_pixels; - refresh(69888); + refresh(69888, true); + ptr_pixel = tmp_ptr; + t_screen = tmp; } void debugrefresh(const uint32_t dt) diff --git a/zx_screen.h b/zx_screen.h index 792efac..269a701 100644 --- a/zx_screen.h +++ b/zx_screen.h @@ -6,7 +6,7 @@ namespace zxscreen void init(); void reinit(); void focus(); - void refresh(const uint32_t dt); + void refresh(const uint32_t dt, const bool full=false); void fullrefresh(); void debugrefresh(); void redraw(const bool present=true);