- [CHG] En proves: fer un IN a un port no usat ara torna 0x00 en compte de 0xFF. Probablement hi haurà que revertir-ho.

- [NEW] Amb F9 es pot ficar o llevar un breakpoint en l'adreça on estiga el cursor del desensamblador.
- [NEW] Nou comando de la consola "show analyzer"
- [FIX] Quan es fa un full refresh mentres se debugga no ha de causar interrupcions. A més, ara mantenim els t_states i el punter a pantalla.
- [FIX] La instrucció CPIR llegia mal la memòria apuntada per HL al considerar si hi havia coincidencia
This commit is contained in:
2024-12-18 13:22:56 +01:00
parent bdec53eb97
commit 6f45044a9a
4 changed files with 31 additions and 14 deletions

12
z80.cpp
View File

@@ -930,10 +930,11 @@ namespace z80
} }
} }
void CPI() uint8_t CPI()
{ {
bool keep_fC = (rF & fC); bool keep_fC = (rF & fC);
CP(READ_MEM_8(rHL)); const uint8_t hlmem = READ_MEM_8(rHL);
CP(hlmem);
rHL++; rHL++;
rBC--; rBC--;
t+=2; t+=2;
@@ -941,12 +942,13 @@ namespace z80
if (keep_fC) SET_FLAGS(fC); if (keep_fC) SET_FLAGS(fC);
if (rBC!=0) SET_FLAGS(fP); if (rBC!=0) SET_FLAGS(fP);
//if (READ_MEM_8(rHL)==rA) SET_FLAGS(fZ); //if (READ_MEM_8(rHL)==rA) SET_FLAGS(fZ);
return hlmem;
} }
void CPIR() void CPIR()
{ {
CPI(); const uint8_t hlmem = CPI();
if (rBC!=0 && READ_MEM_8(rHL)!=rA) if (rBC!=0 && hlmem!=rA)
{ {
rPC-=2; rPC-=2;
t+=2; t+=2;
@@ -996,7 +998,7 @@ namespace z80
} }
return val; return val;
} else } else
return 0xff; return 0xFF;
} }
void OUT(uint8_t val, int port = 0x10000) void OUT(uint8_t val, int port = 0x10000)

View File

@@ -147,11 +147,13 @@ namespace z80debug
z80debug::history::goforward(); z80debug::history::goforward();
z80debug::refresh(); z80debug::refresh();
z80analyze::refresh(); z80analyze::refresh();
/*} else if (e->key.keysym.scancode==SDL_SCANCODE_F6) { } else if (e->key.keysym.scancode==SDL_SCANCODE_F9) {
z80debug::history::gototop(); const uint16_t address = cursor;
const uint8_t dt = z80::step(); if (breakpoints[line_address[address]]==0)
z80debug::refresh(); breakpoints[line_address[address]]=1;
zxscreen::refresh(dt);*/ else
breakpoints[line_address[address]]=0;
refresh();
} else if (e->key.keysym.scancode==SDL_SCANCODE_UP) { } 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--; if (console_history_nav != console_history_pos+1 && console_history[console_history_nav-1][0]!=0) console_history_nav--;
//z80debug::cursorback(); //z80debug::cursorback();
@@ -965,6 +967,15 @@ namespace z80debug
} else { } else {
search(cmd); 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.");
} }
} }

View File

@@ -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* memory = z80::getMem();
const uint8_t border_color = zx_ula::get_border_color(); const uint8_t border_color = zx_ula::get_border_color();
@@ -220,16 +220,20 @@ namespace zxscreen
t_screen=0; t_screen=0;
ptr_pixel = zx_pixels; ptr_pixel = zx_pixels;
redraw(); redraw();
z80::interrupt(); if (!full) z80::interrupt();
} }
} }
} }
void fullrefresh() void fullrefresh()
{ {
uint32_t tmp = t_screen;
t_screen = 0; t_screen = 0;
uint8_t * tmp_ptr = ptr_pixel;
ptr_pixel = zx_pixels; ptr_pixel = zx_pixels;
refresh(69888); refresh(69888, true);
ptr_pixel = tmp_ptr;
t_screen = tmp;
} }
void debugrefresh(const uint32_t dt) void debugrefresh(const uint32_t dt)

View File

@@ -6,7 +6,7 @@ namespace zxscreen
void init(); void init();
void reinit(); void reinit();
void focus(); void focus();
void refresh(const uint32_t dt); void refresh(const uint32_t dt, const bool full=false);
void fullrefresh(); void fullrefresh();
void debugrefresh(); void debugrefresh();
void redraw(const bool present=true); void redraw(const bool present=true);