68K now uses run-time hooks for IRQ and instruction hook callbacks

This commit is contained in:
Bart Trzynadlowski 2022-11-02 15:38:52 -07:00 committed by trzy
parent 33c04ce345
commit 121f81c742
2 changed files with 32 additions and 31 deletions
Src/CPU/68K

View file

@ -1,7 +1,7 @@
/**
** Supermodel
** A Sega Model 3 Arcade Emulator.
** Copyright 2011 Bart Trzynadlowski, Nik Henson
** Copyright 2003-2022 The Supermodel Team
**
** This file is part of Supermodel.
**
@ -303,6 +303,7 @@ bool M68KInit(void)
s_Bus = NULL;
#ifdef SUPERMODEL_DEBUGGER
s_Debug = NULL;
m68k_set_instr_hook_callback(M68KDebugCallback);
#endif // SUPERMODEL_DEBUGGER
DebugLog("Initialized 68K\n");
return OKAY;

View file

@ -1,7 +1,7 @@
/**
** Supermodel
** A Sega Model 3 Arcade Emulator.
** Copyright 2011 Bart Trzynadlowski, Nik Henson
** Copyright 2003-2022 The Supermodel Team
**
** This file is part of Supermodel.
**
@ -96,8 +96,8 @@
* If off, all interrupts will be autovectored and all interrupt requests will
* auto-clear when the interrupt is serviced.
*/
#define M68K_EMULATE_INT_ACK OPT_SPECIFY_HANDLER
#define M68K_INT_ACK_CALLBACK(A) M68KIRQCallback(A)
#define M68K_EMULATE_INT_ACK OPT_ON
#define M68K_INT_ACK_CALLBACK(A) your_int_ack_handler_function(A)
/* If ON, CPU will call the breakpoint acknowledge callback when it encounters
@ -116,7 +116,7 @@
* instruction.
*/
#define M68K_EMULATE_RESET OPT_OFF
#define M68K_RESET_CALLBACK() M68KResetCallback()
#define M68K_RESET_CALLBACK() your_reset_instr_handler_function()
/* If ON, CPU will call the callback when it encounters a cmpi.l #v, dn
@ -154,12 +154,12 @@
* instruction.
*/
#ifdef SUPERMODEL_DEBUGGER
#define M68K_INSTRUCTION_HOOK OPT_SPECIFY_HANDLER
#define M68K_INSTRUCTION_CALLBACK() M68KDebugCallback()
#define M68K_INSTRUCTION_HOOK OPT_ON
#else
#define M68K_INSTRUCTION_HOOK OPT_OFF
#define M68K_INSTRUCTION_CALLBACK() your_instruction_hook_function()
#endif // SUPERMODEL_DEBUGGER
#define M68K_INSTRUCTION_CALLBACK() your_instruction_hook_function()
/* If ON, the CPU will emulate the 4-byte prefetch queue of a real 68000 */
#define M68K_EMULATE_PREFETCH OPT_OFF