- [NEW] Added option for break on interrupt
This commit is contained in:
BIN
glaurung.sav
Normal file
BIN
glaurung.sav
Normal file
Binary file not shown.
7
z80.cpp
7
z80.cpp
@@ -10,7 +10,7 @@ namespace z80
|
|||||||
static uint8_t memtouched[65536];
|
static uint8_t memtouched[65536];
|
||||||
static uint32_t t = 0;
|
static uint32_t t = 0;
|
||||||
static uint16_t current_opcode_address = 0;
|
static uint16_t current_opcode_address = 0;
|
||||||
bool options[Z80_NUM_OPTIONS] = { true };
|
bool options[Z80_NUM_OPTIONS] = { true, false };
|
||||||
|
|
||||||
int (*in_ports[256])(int);
|
int (*in_ports[256])(int);
|
||||||
void (*out_ports[256])(int, int);
|
void (*out_ports[256])(int, int);
|
||||||
@@ -666,7 +666,12 @@ namespace z80
|
|||||||
} else if (im==2) {
|
} else if (im==2) {
|
||||||
const uint16_t address = (rI<<8) | 0xFE;
|
const uint16_t address = (rI<<8) | 0xFE;
|
||||||
rPC = READ_MEM_16(address);
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RST(uint8_t vec)
|
void RST(uint8_t vec)
|
||||||
|
|||||||
3
z80.h
3
z80.h
@@ -10,7 +10,8 @@ namespace z80
|
|||||||
#define MEMTAG_DATA 3
|
#define MEMTAG_DATA 3
|
||||||
|
|
||||||
#define Z80_OPTION_STOP_ON_INVALID 0
|
#define Z80_OPTION_STOP_ON_INVALID 0
|
||||||
#define Z80_NUM_OPTIONS 1
|
#define Z80_OPTION_BREAK_ON_INTERRUPT 1
|
||||||
|
#define Z80_NUM_OPTIONS 2
|
||||||
|
|
||||||
void reset(uint8_t* mem);
|
void reset(uint8_t* mem);
|
||||||
void connect_port(int num, int (*in_ptr)(int), void (*out_ptr)(int,int));
|
void connect_port(int num, int (*in_ptr)(int), void (*out_ptr)(int,int));
|
||||||
|
|||||||
@@ -623,6 +623,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; }
|
||||||
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