Previous 199869 Revisions Next

r21636 Wednesday 6th March, 2013 at 14:07:11 UTC by smf
changed CPU_DISASSEMBLE to use cpu_device * instead of legacy_cpu_device *, so that class based cpu devices can also be passed.
[src/emu]devcpu.h
[src/emu/cpu/m6809]6809dasm.c m6809.c
[src/tools]unidasm.c

trunk/src/tools/unidasm.c
r21635r21636
4040#include "emu.h"
4141#include <ctype.h>
4242
43class m6809_base_device;
44
4543enum display_type
4644{
4745   _8bit,
r21635r21636
113111CPU_DISASSEMBLE( g65816_generic );
114112CPU_DISASSEMBLE( h6280 );
115113CPU_DISASSEMBLE( h8 );
116CPU_DISASSEMBLE( hd6309 )  { extern offs_t hd6309_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); return hd6309_disassemble(buffer, pc, oprom, opram, 0); }
114CPU_DISASSEMBLE( hd6309 );
117115CPU_DISASSEMBLE( i4004 );
118116CPU_DISASSEMBLE( i8008 );
119117CPU_DISASSEMBLE( i8085 );
r21635r21636
123121CPU_DISASSEMBLE( i960 );
124122CPU_DISASSEMBLE( jaguargpu );
125123CPU_DISASSEMBLE( jaguardsp );
126CPU_DISASSEMBLE( konami ) { extern offs_t konami_cpu_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); return konami_cpu_disassemble(buffer, pc, oprom, opram, 0); }
124CPU_DISASSEMBLE( konami );
127125CPU_DISASSEMBLE( lh5801 );
128126CPU_DISASSEMBLE( lr35902 );
129127CPU_DISASSEMBLE( m37710_generic );
r21635r21636
140138CPU_DISASSEMBLE( m68030 );
141139CPU_DISASSEMBLE( m68040 );
142140CPU_DISASSEMBLE( m6805 );
143CPU_DISASSEMBLE( m6809 ) { extern offs_t m6809_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options, m6809_base_device *m6809); return m6809_disassemble(buffer, pc, oprom, opram, 0, NULL); }
141CPU_DISASSEMBLE( m6809 );
144142CPU_DISASSEMBLE( mb86233 );
145143CPU_DISASSEMBLE( mb88 );
146144CPU_DISASSEMBLE( mcs48 );
trunk/src/emu/devcpu.h
r21635r21636
146146      CPUINFO_FCT_EXIT,                                   // R/O: void (*exit)(legacy_cpu_device *device)
147147      CPUINFO_FCT_EXECUTE,                                // R/O: int (*execute)(legacy_cpu_device *device, int cycles)
148148      CPUINFO_FCT_BURN,                                   // R/O: void (*burn)(legacy_cpu_device *device, int cycles)
149      CPUINFO_FCT_DISASSEMBLE,                            // R/O: offs_t (*disassemble)(legacy_cpu_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options)
149      CPUINFO_FCT_DISASSEMBLE,                            // R/O: offs_t (*disassemble)(cpu_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options)
150150      CPUINFO_FCT_TRANSLATE,                              // R/O: int (*translate)(legacy_cpu_device *device, address_spacenum space, int intention, offs_t *address)
151151      CPUINFO_FCT_READ,                                   // R/O: int (*read)(legacy_cpu_device *device, address_spacenum space, UINT32 offset, int size, UINT64 *value)
152152      CPUINFO_FCT_WRITE,                                  // R/O: int (*write)(legacy_cpu_device *device, address_spacenum space, UINT32 offset, int size, UINT64 value)
r21635r21636
278278#define CPU_DEBUG_INIT_CALL(name)       CPU_DEBUG_INIT_NAME(name)(device)
279279
280280#define CPU_DISASSEMBLE_NAME(name)      cpu_disassemble_##name
281#define CPU_DISASSEMBLE(name)           offs_t CPU_DISASSEMBLE_NAME(name)(legacy_cpu_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options)
281#define CPU_DISASSEMBLE(name)           offs_t CPU_DISASSEMBLE_NAME(name)(cpu_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options)
282282#define CPU_DISASSEMBLE_CALL(name)      CPU_DISASSEMBLE_NAME(name)(device, buffer, pc, oprom, opram, options)
283283
284284#define CPU_IMPORT_STATE_NAME(name)     cpu_state_import_##name
r21635r21636
324324typedef int (*cpu_write_func)(legacy_cpu_device *device, address_spacenum space, UINT32 offset, int size, UINT64 value);
325325typedef int (*cpu_readop_func)(legacy_cpu_device *device, UINT32 offset, int size, UINT64 *value);
326326typedef void (*cpu_debug_init_func)(legacy_cpu_device *device);
327typedef offs_t (*cpu_disassemble_func)(legacy_cpu_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options);
327typedef offs_t (*cpu_disassemble_func)(cpu_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options);
328328typedef void (*cpu_state_io_func)(legacy_cpu_device *device, const device_state_entry &entry);
329329typedef void (*cpu_string_io_func)(legacy_cpu_device *device, const device_state_entry &entry, astring &string);
330330
trunk/src/emu/cpu/m6809/m6809.c
r21635r21636
359359
360360offs_t m6809_base_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
361361{
362   extern offs_t m6809_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options, m6809_base_device *m6809);
363   return m6809_disassemble(buffer, pc, oprom, opram, options, this);
362   extern CPU_DISASSEMBLE( m6809 );
363   return CPU_DISASSEMBLE_NAME(m6809)(this, buffer, pc, oprom, opram, options);
364364}
365365
366366
trunk/src/emu/cpu/m6809/6809dasm.c
r21635r21636
364364   "A", "B", "CC", "DP", "inv", "inv", "inv", "inv"
365365};
366366
367offs_t m6809_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options, m6809_base_device *m6809)
367CPU_DISASSEMBLE( m6809 )
368368{
369369   UINT8 opcode, mode, pb, pbm, reg;
370370   const UINT8 *operandarray;
371371   unsigned int ea, flags;
372372   int numoperands, offset, indirect;
373373   bool encrypt_only_first_byte = false;
374   m6809_base_device *m6809 = static_cast<m6809_base_device *>(device);
374375   if (m6809 != NULL)
375376   {
376377      m6809_config &config = static_cast<m6809_config &>(*m6809);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team