- [NEW] Afegida l'opció de "break on interrupt"

This commit is contained in:
2024-12-11 18:03:17 +01:00
parent 52de24a076
commit c70c3652bf
2 changed files with 9 additions and 3 deletions

View File

@@ -661,17 +661,22 @@ namespace z80
if (!iff1) return;
exit_from_halt = true;
PUSH(rPC);
uint16_t address;
if (im==1) {
rPC = 0x38;
} else if (im==2) {
const uint16_t address = (rI<<8) | 0xFE;
address = (rI<<8) | 0xFE;
rPC = READ_MEM_16(address);
} else if (im==0) {
printf("Interrupt mode 0!\n");
z80debug::stop();
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)