m68k: add ability for externally-thrown bus errors to have proper details [R. Belmont]

This commit is contained in:
R. Belmont 2013-12-17 04:12:11 +00:00
parent 210a6c9846
commit 31301a5e60
2 changed files with 11 additions and 3 deletions

View File

@ -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__ */

View File

@ -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
****************************************************************************/