Disassemblers now get the CPU object.

This commit is contained in:
Aaron Giles 2008-11-16 15:40:41 +00:00
parent 7dd6db7738
commit 893b21cb33
3 changed files with 6 additions and 6 deletions

View File

@ -2748,7 +2748,7 @@ static void sharcop_idle(void)
static void sharcop_unimplemented(void) static void sharcop_unimplemented(void)
{ {
char dasm[1000]; char dasm[1000];
CPU_DISASSEMBLE_NAME(sharc)(dasm, sharc.pc, NULL, NULL); CPU_DISASSEMBLE_NAME(sharc)(NULL, dasm, sharc.pc, NULL, NULL);
mame_printf_debug("SHARC: %08X: %s\n", sharc.pc, dasm); mame_printf_debug("SHARC: %08X: %s\n", sharc.pc, dasm);
fatalerror("SHARC: Unimplemented opcode %04X%08X at %08X", (UINT16)(sharc.opcode >> 32), (UINT32)(sharc.opcode), sharc.pc); fatalerror("SHARC: Unimplemented opcode %04X%08X at %08X", (UINT16)(sharc.opcode >> 32), (UINT32)(sharc.opcode), sharc.pc);
} }

View File

@ -1372,11 +1372,11 @@ offs_t cpu_dasm(const device_config *device, char *buffer, offs_t pc, const UINT
/* check for disassembler override */ /* check for disassembler override */
if (classheader->dasm_override != NULL) if (classheader->dasm_override != NULL)
result = (*classheader->dasm_override)(buffer, pc, oprom, opram); result = (*classheader->dasm_override)(device, buffer, pc, oprom, opram);
/* if we have a disassembler, run it */ /* if we have a disassembler, run it */
if (result == 0 && classheader->disassemble != NULL) if (result == 0 && classheader->disassemble != NULL)
result = (*classheader->disassemble)(buffer, pc, oprom, opram); result = (*classheader->disassemble)(device, buffer, pc, oprom, opram);
/* if we still have nothing, output vanilla bytes */ /* if we still have nothing, output vanilla bytes */
if (result == 0) if (result == 0)

View File

@ -486,8 +486,8 @@ typedef enum _cpu_type cpu_type;
#define CPU_DEBUG_INIT_CALL(name) CPU_DEBUG_INIT_NAME(name)(device) #define CPU_DEBUG_INIT_CALL(name) CPU_DEBUG_INIT_NAME(name)(device)
#define CPU_DISASSEMBLE_NAME(name) cpu_disassemble_##name #define CPU_DISASSEMBLE_NAME(name) cpu_disassemble_##name
#define CPU_DISASSEMBLE(name) offs_t CPU_DISASSEMBLE_NAME(name)(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram) #define CPU_DISASSEMBLE(name) offs_t CPU_DISASSEMBLE_NAME(name)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram)
#define CPU_DISASSEMBLE_CALL(name) CPU_DISASSEMBLE_NAME(name)(buffer, pc, oprom, opram) #define CPU_DISASSEMBLE_CALL(name) CPU_DISASSEMBLE_NAME(name)(device, buffer, pc, oprom, opram)
#define CPU_VALIDITY_CHECK_NAME(name) cpu_validity_check_##name #define CPU_VALIDITY_CHECK_NAME(name) cpu_validity_check_##name
#define CPU_VALIDITY_CHECK(name) int CPU_VALIDITY_CHECK_NAME(name)(const game_driver *driver, const void *config) #define CPU_VALIDITY_CHECK(name) int CPU_VALIDITY_CHECK_NAME(name)(const game_driver *driver, const void *config)
@ -584,9 +584,9 @@ typedef int (*cpu_read_func)(const device_config *device, int space, UINT32 offs
typedef int (*cpu_write_func)(const device_config *device, int space, UINT32 offset, int size, UINT64 value); typedef int (*cpu_write_func)(const device_config *device, int space, UINT32 offset, int size, UINT64 value);
typedef int (*cpu_readop_func)(const device_config *device, UINT32 offset, int size, UINT64 *value); typedef int (*cpu_readop_func)(const device_config *device, UINT32 offset, int size, UINT64 *value);
typedef void (*cpu_debug_init_func)(const device_config *device); typedef void (*cpu_debug_init_func)(const device_config *device);
typedef offs_t (*cpu_disassemble_func)(const device_config *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
typedef int (*cpu_validity_check_func)(const game_driver *driver, const void *config); typedef int (*cpu_validity_check_func)(const game_driver *driver, const void *config);
typedef offs_t (*cpu_disassemble_func)(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram);
typedef void (*cpu_get_context_func)(void *buffer); typedef void (*cpu_get_context_func)(void *buffer);
typedef void (*cpu_set_context_func)(void *buffer); typedef void (*cpu_set_context_func)(void *buffer);