//Do this in makefile??? Yes! Could, but it's easier to define here...
//#define LOG_UNMAPPED_MEMORY_ACCESSES
//#define ABORT_ON_UNMAPPED_MEMORY_ACCESS
-#define ABORT_ON_ILLEGAL_INSTRUCTIONS
+//#define ABORT_ON_ILLEGAL_INSTRUCTIONS
//#define ABORT_ON_OFFICIAL_ILLEGAL_INSTRUCTION
#define CPU_DEBUG_MEMORY
//#define LOG_CD_BIOS_CALLS
+#define CPU_DEBUG_TRACING
// Private function prototypes
uint32 pcQueue[0x400];
uint32 pcQPtr = 0;
+bool startM68KTracing = false;
//
// Callback function to detect illegal instructions
instSeen++;
#endif
+// For code tracing...
+#ifdef CPU_DEBUG_TRACING
+ if (startM68KTracing)
+ {
+ static char buffer[2048];
+
+ m68k_disassemble(buffer, m68kPC, 0);
+ WriteLog("%06X: %s\n", m68kPC, buffer);
+ }
+#endif
+
// For tracebacks...
// Ideally, we'd save all the registers as well...
pcQueue[pcQPtr++] = m68kPC;
m68k_get_reg(NULL, M68K_REG_A0), m68k_get_reg(NULL, M68K_REG_A1),
m68k_get_reg(NULL, M68K_REG_D0), m68k_get_reg(NULL, M68K_REG_D1), m68k_get_reg(NULL, M68K_REG_D2));
}//*/
- if (m68kPC == 0x82E1A)
+/* if (m68kPC == 0x82E1A)
{
static char buffer[2048];
m68k_disassemble(buffer, m68kPC, 0);//M68K_CPU_TYPE_68000);
m68k_get_reg(NULL, M68K_REG_A0), m68k_get_reg(NULL, M68K_REG_A1),
m68k_get_reg(NULL, M68K_REG_D0), m68k_get_reg(NULL, M68K_REG_D1), m68k_get_reg(NULL, M68K_REG_D2));
}//*/
- if (m68kPC == 0x82E58)
+/* if (m68kPC == 0x82E58)
WriteLog("--> [Routine end]\n");
if (m68kPC == 0x80004)
{
#endif
int irq_ack_handler(int level)
{
+#ifdef CPU_DEBUG_TRACING
+ if (startM68KTracing)
+ {
+ WriteLog("irq_ack_handler: M68K PC=%06X\n", m68k_get_reg(NULL, M68K_REG_PC));
+ }
+#endif
+
// Tracing the IPL lines on the Jaguar schematic yields the following:
// IPL1 is connected to INTL on TOM (OUT to 68K)
// IPL0-2 are also tied to Vcc via 4.7K resistors!