summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2013-12-17 04:12:11 +0000
committer R. Belmont <rb6502@users.noreply.github.com>2013-12-17 04:12:11 +0000
commit31301a5e60db2ccc7bb969dfee2eb5a9356a9996 (patch)
treefa0b30f999a1a0bd2e4aa748d8ac608ffccd78b3 /src
parent210a6c984614ac369bce5b4d3fc334c59bdb6c06 (diff)
m68k: add ability for externally-thrown bus errors to have proper details [R. Belmont]
Diffstat (limited to 'src')
-rw-r--r--src/emu/cpu/m68000/m68000.h1
-rw-r--r--src/emu/cpu/m68000/m68kcpu.c13
2 files changed, 11 insertions, 3 deletions
diff --git a/src/emu/cpu/m68000/m68000.h b/src/emu/cpu/m68000/m68000.h
index b9b181ebc92..544ce0196e7 100644
--- a/src/emu/cpu/m68000/m68000.h
+++ b/src/emu/cpu/m68000/m68000.h
@@ -789,5 +789,6 @@ extern UINT16 m68k_get_fc(m68000_base_device *device);
extern void m68k_set_encrypted_opcode_range(m68000_base_device *device, offs_t start, offs_t end);
extern void m68k_set_hmmu_enable(m68000_base_device *device, int enable);
extern void m68k_set_instruction_hook(m68000_base_device *device, instruction_hook_t ihook);
+extern void m68k_set_buserror_details(m68000_base_device *device, UINT32 fault_addr, UINT8 rw, UINT8 fc);
#endif /* __M68000_H__ */
diff --git a/src/emu/cpu/m68000/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c
index f1ee9e9afa0..42acf54ec3c 100644
--- a/src/emu/cpu/m68000/m68kcpu.c
+++ b/src/emu/cpu/m68000/m68kcpu.c
@@ -1612,6 +1612,16 @@ void m68k_set_reset_callback(m68000_base_device *device, m68k_reset_func callbac
device->reset_instr_callback = callback;
}
+// fault_addr = address to indicate fault at
+// rw = 0 for read, 1 for write
+// fc = 3-bit function code of access (usually you'd just put what m68k_get_fc() returns here)
+void m68k_set_buserror_details(m68000_base_device *device, UINT32 fault_addr, UINT8 rw, UINT8 fc)
+{
+ device->aerr_address = fault_addr;
+ device->aerr_write_mode = rw;
+ device->aerr_fc = fc;
+}
+
void m68k_set_cmpild_callback(m68000_base_device *device, m68k_cmpild_func callback)
{
device->cmpild_instr_callback = callback;
@@ -1632,9 +1642,6 @@ UINT16 m68k_get_fc(m68000_base_device *device)
return device->mmu_tmp_fc;
}
-
-
-
/****************************************************************************
* State definition
****************************************************************************/