- [NEW] Afegida l'opció de "break on interrupt"
This commit is contained in:
9
z80.cpp
9
z80.cpp
@@ -661,17 +661,22 @@ namespace z80
|
|||||||
if (!iff1) return;
|
if (!iff1) return;
|
||||||
exit_from_halt = true;
|
exit_from_halt = true;
|
||||||
PUSH(rPC);
|
PUSH(rPC);
|
||||||
|
uint16_t address;
|
||||||
if (im==1) {
|
if (im==1) {
|
||||||
rPC = 0x38;
|
rPC = 0x38;
|
||||||
} else if (im==2) {
|
} else if (im==2) {
|
||||||
const uint16_t address = (rI<<8) | 0xFE;
|
address = (rI<<8) | 0xFE;
|
||||||
rPC = READ_MEM_16(address);
|
rPC = READ_MEM_16(address);
|
||||||
} else if (im==0) {
|
} else if (im==0) {
|
||||||
printf("Interrupt mode 0!\n");
|
printf("Interrupt mode 0!\n");
|
||||||
z80debug::stop();
|
z80debug::stop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (options[Z80_OPTION_BREAK_ON_INTERRUPT]) z80debug::stop();
|
if (options[Z80_OPTION_BREAK_ON_INTERRUPT]) {
|
||||||
|
printf("Break on interrupt! 0x%2x, PC: 0x%2x\n", address, rPC);
|
||||||
|
z80debug::setcursor(rPC);
|
||||||
|
z80debug::stop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RST(uint8_t vec)
|
void RST(uint8_t vec)
|
||||||
|
|||||||
@@ -247,6 +247,7 @@ namespace z80debug
|
|||||||
|
|
||||||
void stop()
|
void stop()
|
||||||
{
|
{
|
||||||
|
//history::gototop();
|
||||||
zxscreen::setTitle(" (stopped)");
|
zxscreen::setTitle(" (stopped)");
|
||||||
pause();
|
pause();
|
||||||
is_debugging = true;
|
is_debugging = true;
|
||||||
@@ -623,7 +624,7 @@ namespace z80debug
|
|||||||
} else if (strcmp(cmd, "b")==0 || strcmp(cmd, "break")==0) {
|
} else if (strcmp(cmd, "b")==0 || strcmp(cmd, "break")==0) {
|
||||||
getcmd();
|
getcmd();
|
||||||
if (cmd[0] == 0) { breakpoints[z80::getPC()]=1; return; }
|
if (cmd[0] == 0) { breakpoints[z80::getPC()]=1; return; }
|
||||||
if (cmd[0] == 'i') { z80::setOption(Z80_OPTION_BREAK_ON_INTERRUPT, !z80::getOption(Z80_OPTION_BREAK_ON_INTERRUPT)); return; }
|
if (cmd[0] == 'i') { z80::setOption(Z80_OPTION_BREAK_ON_INTERRUPT, !z80::getOption(Z80_OPTION_BREAK_ON_INTERRUPT)); sendToConsoleLog("Break on interrupt."); return; }
|
||||||
int address = getnum(cmd);
|
int address = getnum(cmd);
|
||||||
if (address<0 || address>65536) { sendToConsoleLog("Illegal break address"); return; }
|
if (address<0 || address>65536) { sendToConsoleLog("Illegal break address"); return; }
|
||||||
getcmd();
|
getcmd();
|
||||||
|
|||||||
Reference in New Issue
Block a user