From 893b21cb33f0782736cd88b394adf114f3e07554 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Sun, 16 Nov 2008 15:40:41 +0000 Subject: [PATCH] Disassemblers now get the CPU object. --- src/emu/cpu/sharc/sharcops.c | 2 +- src/emu/cpuintrf.c | 4 ++-- src/emu/cpuintrf.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/emu/cpu/sharc/sharcops.c b/src/emu/cpu/sharc/sharcops.c index 28c3a22cde0..fc73cbb8c5f 100644 --- a/src/emu/cpu/sharc/sharcops.c +++ b/src/emu/cpu/sharc/sharcops.c @@ -2748,7 +2748,7 @@ static void sharcop_idle(void) static void sharcop_unimplemented(void) { 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); fatalerror("SHARC: Unimplemented opcode %04X%08X at %08X", (UINT16)(sharc.opcode >> 32), (UINT32)(sharc.opcode), sharc.pc); } diff --git a/src/emu/cpuintrf.c b/src/emu/cpuintrf.c index 377fb36945a..22a07b05d60 100644 --- a/src/emu/cpuintrf.c +++ b/src/emu/cpuintrf.c @@ -1372,11 +1372,11 @@ offs_t cpu_dasm(const device_config *device, char *buffer, offs_t pc, const UINT /* check for disassembler override */ 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 (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 (result == 0) diff --git a/src/emu/cpuintrf.h b/src/emu/cpuintrf.h index 833ad3cccca..d3279e9c832 100644 --- a/src/emu/cpuintrf.h +++ b/src/emu/cpuintrf.h @@ -486,8 +486,8 @@ typedef enum _cpu_type cpu_type; #define CPU_DEBUG_INIT_CALL(name) CPU_DEBUG_INIT_NAME(name)(device) #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_CALL(name) CPU_DISASSEMBLE_NAME(name)(buffer, pc, oprom, 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)(device, buffer, pc, oprom, opram) #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) @@ -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_readop_func)(const device_config *device, UINT32 offset, int size, UINT64 *value); 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 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_set_context_func)(void *buffer);