summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-06-17 03:33:24 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-06-17 03:33:24 +0000
commitb8f916e17ed8d232a0a340d04e22512ae1f9c923 (patch)
treeb9ef803c2525a66a70c64a4e60b8ca1b854a5ea6
parentd4775b8e562be8fcc86d6737d72ec8a1ff622440 (diff)
Change cpu_device into a base class. Rename old cpu_device to legacy_cpu_device.
Update interfaces as appropriate.
-rw-r--r--src/emu/cpu/adsp2100/adsp2100.c6
-rw-r--r--src/emu/cpu/alph8201/alph8201.c4
-rw-r--r--src/emu/cpu/am29000/am29000.c2
-rw-r--r--src/emu/cpu/apexc/apexc.c4
-rw-r--r--src/emu/cpu/arm/arm.c4
-rw-r--r--src/emu/cpu/arm7/arm7.c2
-rw-r--r--src/emu/cpu/arm7/arm7core.c2
-rw-r--r--src/emu/cpu/arm7/arm7core.h2
-rw-r--r--src/emu/cpu/asap/asap.c4
-rw-r--r--src/emu/cpu/avr8/avr8.c4
-rw-r--r--src/emu/cpu/ccpu/ccpu.c4
-rw-r--r--src/emu/cpu/cdp1802/cdp1802.c2
-rw-r--r--src/emu/cpu/cop400/cop400.c4
-rw-r--r--src/emu/cpu/cp1610/cp1610.c4
-rw-r--r--src/emu/cpu/cubeqcpu/cubeqcpu.c20
-rw-r--r--src/emu/cpu/dsp32/dsp32.c4
-rw-r--r--src/emu/cpu/dsp56k/dsp56def.h2
-rw-r--r--src/emu/cpu/dsp56k/dsp56k.h2
-rw-r--r--src/emu/cpu/e132xs/e132xs.c12
-rw-r--r--src/emu/cpu/esrip/esrip.c4
-rw-r--r--src/emu/cpu/f8/f8.c4
-rw-r--r--src/emu/cpu/g65816/g65816.c2
-rw-r--r--src/emu/cpu/g65816/g65816cm.h2
-rw-r--r--src/emu/cpu/h6280/h6280.c2
-rw-r--r--src/emu/cpu/h6280/h6280.h2
-rw-r--r--src/emu/cpu/h83002/h8priv.h4
-rw-r--r--src/emu/cpu/hd6309/hd6309.c6
-rw-r--r--src/emu/cpu/i386/i386.c6
-rw-r--r--src/emu/cpu/i386/i386priv.h4
-rw-r--r--src/emu/cpu/i4004/i4004.c4
-rw-r--r--src/emu/cpu/i8008/i8008.c4
-rw-r--r--src/emu/cpu/i8085/i8085.c6
-rw-r--r--src/emu/cpu/i86/i286.c4
-rw-r--r--src/emu/cpu/i86/i86.c4
-rw-r--r--src/emu/cpu/i860/i860.h4
-rw-r--r--src/emu/cpu/i960/i960.c4
-rw-r--r--src/emu/cpu/jaguar/jaguar.c8
-rw-r--r--src/emu/cpu/konami/konami.c4
-rw-r--r--src/emu/cpu/lh5801/lh5801.c4
-rw-r--r--src/emu/cpu/lr35902/lr35902.c4
-rw-r--r--src/emu/cpu/m37710/m37710cm.h4
-rw-r--r--src/emu/cpu/m6502/m4510.c6
-rw-r--r--src/emu/cpu/m6502/m6502.c8
-rw-r--r--src/emu/cpu/m6502/m6502.h2
-rw-r--r--src/emu/cpu/m6502/m6509.c4
-rw-r--r--src/emu/cpu/m6502/m65ce02.c4
-rw-r--r--src/emu/cpu/m6800/m6800.c4
-rw-r--r--src/emu/cpu/m68000/m68kcpu.c2
-rw-r--r--src/emu/cpu/m68000/m68kcpu.h2
-rw-r--r--src/emu/cpu/m6805/m6805.c6
-rw-r--r--src/emu/cpu/m6809/m6809.c4
-rw-r--r--src/emu/cpu/mb86233/mb86233.c4
-rw-r--r--src/emu/cpu/mb88xx/mb88xx.c4
-rw-r--r--src/emu/cpu/mc68hc11/mc68hc11.c4
-rw-r--r--src/emu/cpu/mcs48/mcs48.c12
-rw-r--r--src/emu/cpu/mcs51/mcs51.c4
-rw-r--r--src/emu/cpu/minx/minx.c4
-rw-r--r--src/emu/cpu/mips/mips3com.c4
-rw-r--r--src/emu/cpu/mips/mips3com.h4
-rw-r--r--src/emu/cpu/mips/mips3drc.c4
-rw-r--r--src/emu/cpu/mips/psx.c6
-rw-r--r--src/emu/cpu/mips/r3000.c4
-rw-r--r--src/emu/cpu/mn10200/mn10200.c4
-rw-r--r--src/emu/cpu/nec/nec.c6
-rw-r--r--src/emu/cpu/pdp1/pdp1.c4
-rw-r--r--src/emu/cpu/pdp1/tx0.c6
-rw-r--r--src/emu/cpu/pic16c5x/pic16c5x.c4
-rw-r--r--src/emu/cpu/pic16c62x/pic16c62x.c4
-rw-r--r--src/emu/cpu/powerpc/ppc.c2
-rw-r--r--src/emu/cpu/powerpc/ppccom.c10
-rw-r--r--src/emu/cpu/powerpc/ppccom.h4
-rw-r--r--src/emu/cpu/powerpc/ppcdrc.c4
-rw-r--r--src/emu/cpu/rsp/rsp.c2
-rw-r--r--src/emu/cpu/rsp/rsp.h2
-rw-r--r--src/emu/cpu/rsp/rspdrc.c4
-rw-r--r--src/emu/cpu/s2650/s2650.c7
-rw-r--r--src/emu/cpu/saturn/saturn.c4
-rw-r--r--src/emu/cpu/sc61860/sc61860.c4
-rw-r--r--src/emu/cpu/scmp/scmp.c4
-rw-r--r--src/emu/cpu/se3208/se3208.c4
-rw-r--r--src/emu/cpu/sh2/sh2comn.c6
-rw-r--r--src/emu/cpu/sh2/sh2comn.h4
-rw-r--r--src/emu/cpu/sh2/sh2drc.c2
-rw-r--r--src/emu/cpu/sh4/sh4.c2
-rw-r--r--src/emu/cpu/sh4/sh4comn.c2
-rw-r--r--src/emu/cpu/sh4/sh4comn.h2
-rw-r--r--src/emu/cpu/sharc/sharc.c4
-rw-r--r--src/emu/cpu/sm8500/sm8500.c6
-rw-r--r--src/emu/cpu/sm8500/sm8500.h2
-rw-r--r--src/emu/cpu/spc700/spc700.c6
-rw-r--r--src/emu/cpu/ssem/ssem.c4
-rw-r--r--src/emu/cpu/ssp1601/ssp1601.c4
-rw-r--r--src/emu/cpu/superfx/superfx.c6
-rw-r--r--src/emu/cpu/t11/t11.c4
-rw-r--r--src/emu/cpu/tlcs90/tlcs90.c6
-rw-r--r--src/emu/cpu/tlcs900/tlcs900.c4
-rw-r--r--src/emu/cpu/tms0980/tms0980.c4
-rw-r--r--src/emu/cpu/tms32010/tms32010.c4
-rw-r--r--src/emu/cpu/tms32025/tms32025.c4
-rw-r--r--src/emu/cpu/tms32031/tms32031.c4
-rw-r--r--src/emu/cpu/tms32051/tms32051.c4
-rw-r--r--src/emu/cpu/tms34010/tms34010.c4
-rw-r--r--src/emu/cpu/tms57002/tms57002.c2
-rw-r--r--src/emu/cpu/tms7000/tms7000.c4
-rw-r--r--src/emu/cpu/tms9900/99xxcore.h6
-rw-r--r--src/emu/cpu/unsp/unsp.c2
-rw-r--r--src/emu/cpu/unsp/unsp.h2
-rw-r--r--src/emu/cpu/upd7810/upd7810.c4
-rw-r--r--src/emu/cpu/v30mz/v30mz.c6
-rw-r--r--src/emu/cpu/v60/v60.c6
-rw-r--r--src/emu/cpu/v810/v810.c4
-rw-r--r--src/emu/cpu/z180/z180.c4
-rw-r--r--src/emu/cpu/z8/z8.c2
-rw-r--r--src/emu/cpu/z80/z80.c4
-rw-r--r--src/emu/cpu/z8000/z8000.c4
-rw-r--r--src/emu/debug/debugcpu.c2
-rw-r--r--src/emu/devcpu.c93
-rw-r--r--src/emu/devcpu.h136
-rw-r--r--src/mame/drivers/stv.c7
-rw-r--r--src/mame/includes/stv.h4
120 files changed, 401 insertions, 332 deletions
diff --git a/src/emu/cpu/adsp2100/adsp2100.c b/src/emu/cpu/adsp2100/adsp2100.c
index 80bcff65db5..73c04e6870b 100644
--- a/src/emu/cpu/adsp2100/adsp2100.c
+++ b/src/emu/cpu/adsp2100/adsp2100.c
@@ -242,7 +242,7 @@ typedef struct
UINT8 irq_state[9];
UINT8 irq_latch[9];
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
/* other internal states */
int icount;
@@ -308,7 +308,7 @@ INLINE adsp2100_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_ADSP2105 ||
cpu_get_type(device) == CPU_ADSP2115 ||
cpu_get_type(device) == CPU_ADSP2181);
- return (adsp2100_state *)downcast<cpu_device *>(device)->token();
+ return (adsp2100_state *)downcast<legacy_cpu_device *>(device)->token();
}
@@ -563,7 +563,7 @@ static void set_irq_line(adsp2100_state *adsp, int irqline, int state)
INITIALIZATION AND SHUTDOWN
***************************************************************************/
-static adsp2100_state *adsp21xx_init(cpu_device *device, device_irq_callback irqcallback, int chiptype)
+static adsp2100_state *adsp21xx_init(legacy_cpu_device *device, device_irq_callback irqcallback, int chiptype)
{
const adsp21xx_config *config = (const adsp21xx_config *)device->baseconfig().static_config();
adsp2100_state *adsp = get_safe_token(device);
diff --git a/src/emu/cpu/alph8201/alph8201.c b/src/emu/cpu/alph8201/alph8201.c
index f15bd07604c..104ac854660 100644
--- a/src/emu/cpu/alph8201/alph8201.c
+++ b/src/emu/cpu/alph8201/alph8201.c
@@ -197,7 +197,7 @@ struct _alpha8201_state
UINT8 halt; /* halt input line */
#endif
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int icount;
int inst_cycles;
@@ -230,7 +230,7 @@ INLINE alpha8201_state *get_safe_token(running_device *device)
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_ALPHA8201 ||
cpu_get_type(device) == CPU_ALPHA8301);
- return (alpha8201_state *)downcast<cpu_device *>(device)->token();
+ return (alpha8201_state *)downcast<legacy_cpu_device *>(device)->token();
}
/* Get next opcode argument and increment program counter */
diff --git a/src/emu/cpu/am29000/am29000.c b/src/emu/cpu/am29000/am29000.c
index 62148d97ff3..c63f672fb10 100644
--- a/src/emu/cpu/am29000/am29000.c
+++ b/src/emu/cpu/am29000/am29000.c
@@ -146,7 +146,7 @@ INLINE am29000_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_AM29000);
- return (am29000_state *)downcast<cpu_device *>(device)->token();
+ return (am29000_state *)downcast<legacy_cpu_device *>(device)->token();
}
static CPU_INIT( am29000 )
diff --git a/src/emu/cpu/apexc/apexc.c b/src/emu/cpu/apexc/apexc.c
index 9f86db68b1a..bcc8f92810b 100644
--- a/src/emu/cpu/apexc/apexc.c
+++ b/src/emu/cpu/apexc/apexc.c
@@ -358,7 +358,7 @@ struct _apexc_state
/* running: flag implied by the existence of the stop instruction */
UINT32 pc; /* address of next instruction for the disassembler */
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
int icount;
@@ -373,7 +373,7 @@ INLINE apexc_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_APEXC);
- return (apexc_state *)downcast<cpu_device *>(device)->token();
+ return (apexc_state *)downcast<legacy_cpu_device *>(device)->token();
}
diff --git a/src/emu/cpu/arm/arm.c b/src/emu/cpu/arm/arm.c
index c5a96ce00fc..eb3370a8648 100644
--- a/src/emu/cpu/arm/arm.c
+++ b/src/emu/cpu/arm/arm.c
@@ -234,7 +234,7 @@ typedef struct
UINT8 pendingIrq;
UINT8 pendingFiq;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
} ARM_REGS;
@@ -255,7 +255,7 @@ INLINE ARM_REGS *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_ARM);
- return (ARM_REGS *)downcast<cpu_device *>(device)->token();
+ return (ARM_REGS *)downcast<legacy_cpu_device *>(device)->token();
}
INLINE void cpu_write32( ARM_REGS* cpustate, int addr, UINT32 data )
diff --git a/src/emu/cpu/arm7/arm7.c b/src/emu/cpu/arm7/arm7.c
index 365d2afa0ec..46c83a716a8 100644
--- a/src/emu/cpu/arm7/arm7.c
+++ b/src/emu/cpu/arm7/arm7.c
@@ -73,7 +73,7 @@ INLINE arm_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_ARM7 || cpu_get_type(device) == CPU_ARM9 || cpu_get_type(device) == CPU_PXA255);
- return (arm_state *)downcast<cpu_device *>(device)->token();
+ return (arm_state *)downcast<legacy_cpu_device *>(device)->token();
}
INLINE INT64 saturate_qbit_overflow(arm_state *cpustate, INT64 res)
diff --git a/src/emu/cpu/arm7/arm7core.c b/src/emu/cpu/arm7/arm7core.c
index cfa44714ee2..ccc9c181b40 100644
--- a/src/emu/cpu/arm7/arm7core.c
+++ b/src/emu/cpu/arm7/arm7core.c
@@ -543,7 +543,7 @@ static void arm7_core_init(running_device *device, const char *cpuname)
}
// CPU RESET
-static void arm7_core_reset(cpu_device *device)
+static void arm7_core_reset(legacy_cpu_device *device)
{
arm_state *cpustate = get_safe_token(device);
diff --git a/src/emu/cpu/arm7/arm7core.h b/src/emu/cpu/arm7/arm7core.h
index c96db086c27..2a42572ae6a 100644
--- a/src/emu/cpu/arm7/arm7core.h
+++ b/src/emu/cpu/arm7/arm7core.h
@@ -161,7 +161,7 @@ enum
UINT8 pendingSwi; \
INT32 iCount; \
device_irq_callback irq_callback; \
- cpu_device *device; \
+ legacy_cpu_device *device; \
const address_space *program;
diff --git a/src/emu/cpu/asap/asap.c b/src/emu/cpu/asap/asap.c
index b52d6dd3baf..8ccc95cf86e 100644
--- a/src/emu/cpu/asap/asap.c
+++ b/src/emu/cpu/asap/asap.c
@@ -87,7 +87,7 @@ struct _asap_state
int icount;
device_irq_callback irq_callback;
const address_space *program;
- cpu_device *device;
+ legacy_cpu_device *device;
/* src2val table, registers are at the end */
UINT32 src2val[65536];
@@ -273,7 +273,7 @@ INLINE asap_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_ASAP);
- return (asap_state *)downcast<cpu_device *>(device)->token();
+ return (asap_state *)downcast<legacy_cpu_device *>(device)->token();
}
diff --git a/src/emu/cpu/avr8/avr8.c b/src/emu/cpu/avr8/avr8.c
index 8ffd49e1b4c..f9ed105e1e3 100644
--- a/src/emu/cpu/avr8/avr8.c
+++ b/src/emu/cpu/avr8/avr8.c
@@ -26,7 +26,7 @@ struct _avr8_state
{
UINT32 pc;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
int icount;
@@ -80,7 +80,7 @@ INLINE avr8_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_AVR8);
- return (avr8_state *)downcast<cpu_device *>(device)->token();
+ return (avr8_state *)downcast<legacy_cpu_device *>(device)->token();
}
/*****************************************************************************/
diff --git a/src/emu/cpu/ccpu/ccpu.c b/src/emu/cpu/ccpu/ccpu.c
index b95de31381c..d79fb77aef2 100644
--- a/src/emu/cpu/ccpu/ccpu.c
+++ b/src/emu/cpu/ccpu/ccpu.c
@@ -43,7 +43,7 @@ struct _ccpu_state
int icount;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *data;
const address_space *io;
@@ -55,7 +55,7 @@ INLINE ccpu_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_CCPU);
- return (ccpu_state *)downcast<cpu_device *>(device)->token();
+ return (ccpu_state *)downcast<legacy_cpu_device *>(device)->token();
}
diff --git a/src/emu/cpu/cdp1802/cdp1802.c b/src/emu/cpu/cdp1802/cdp1802.c
index ec5b8cf1853..a218e5ee38e 100644
--- a/src/emu/cpu/cdp1802/cdp1802.c
+++ b/src/emu/cpu/cdp1802/cdp1802.c
@@ -72,7 +72,7 @@ INLINE cdp1802_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_CDP1802);
- return (cdp1802_state *)downcast<cpu_device *>(device)->token();
+ return (cdp1802_state *)downcast<legacy_cpu_device *>(device)->token();
}
#define OPCODE_R(addr) memory_decrypted_read_byte(cpustate->program, addr)
diff --git a/src/emu/cpu/cop400/cop400.c b/src/emu/cpu/cop400/cop400.c
index 5506053aff2..6ecf2b90a56 100644
--- a/src/emu/cpu/cop400/cop400.c
+++ b/src/emu/cpu/cop400/cop400.c
@@ -216,7 +216,7 @@ INLINE cop400_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_COP426 ||
cpu_get_type(device) == CPU_COP444 ||
cpu_get_type(device) == CPU_COP445);
- return (cop400_state *)downcast<cpu_device *>(device)->token();
+ return (cop400_state *)downcast<legacy_cpu_device *>(device)->token();
}
INLINE void PUSH(cop400_state *cpustate, UINT16 data)
@@ -865,7 +865,7 @@ static void define_state_table(running_device *device)
state->state_add(COP400_T, "T", cpustate->t);
}
-static void cop400_init(cpu_device *device, UINT8 g_mask, UINT8 d_mask, UINT8 in_mask, int has_counter, int has_inil)
+static void cop400_init(legacy_cpu_device *device, UINT8 g_mask, UINT8 d_mask, UINT8 in_mask, int has_counter, int has_inil)
{
cop400_state *cpustate = get_safe_token(device);
diff --git a/src/emu/cpu/cp1610/cp1610.c b/src/emu/cpu/cp1610/cp1610.c
index 220d6d51e1b..beca0530d9a 100644
--- a/src/emu/cpu/cp1610/cp1610.c
+++ b/src/emu/cpu/cp1610/cp1610.c
@@ -46,7 +46,7 @@ struct _cp1610_state
int intr_pending;
int intrm_pending;
int mask_interrupts;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int icount;
};
@@ -56,7 +56,7 @@ INLINE cp1610_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_CP1610);
- return (cp1610_state *)downcast<cpu_device *>(device)->token();
+ return (cp1610_state *)downcast<legacy_cpu_device *>(device)->token();
}
#define cp1610_readop(A) memory_read_word_16be(cpustate->program, (A)<<1)
diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.c b/src/emu/cpu/cubeqcpu/cubeqcpu.c
index f6d8f9a278c..a1827f6d702 100644
--- a/src/emu/cpu/cubeqcpu/cubeqcpu.c
+++ b/src/emu/cpu/cubeqcpu/cubeqcpu.c
@@ -97,7 +97,7 @@ typedef struct
cubeqst_dac_w_func dac_w;
UINT16 *sound_data;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int icount;
} cquestsnd_state;
@@ -137,8 +137,8 @@ typedef struct
UINT8 rc;
UINT8 clkcnt;
- cpu_device *device;
- cpu_device *lindevice;
+ legacy_cpu_device *device;
+ legacy_cpu_device *lindevice;
const address_space *program;
int icount;
} cquestrot_state;
@@ -183,8 +183,8 @@ typedef struct
UINT32 *e_stack;
UINT32 *o_stack;
- cpu_device *device;
- cpu_device *rotdevice;
+ legacy_cpu_device *device;
+ legacy_cpu_device *rotdevice;
const address_space *program;
int icount;
} cquestlin_state;
@@ -198,7 +198,7 @@ INLINE cquestsnd_state *get_safe_token_snd(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_CQUESTSND);
- return (cquestsnd_state *)downcast<cpu_device *>(device)->token();
+ return (cquestsnd_state *)downcast<legacy_cpu_device *>(device)->token();
}
INLINE cquestrot_state *get_safe_token_rot(running_device *device)
@@ -206,7 +206,7 @@ INLINE cquestrot_state *get_safe_token_rot(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_CQUESTROT);
- return (cquestrot_state *)downcast<cpu_device *>(device)->token();
+ return (cquestrot_state *)downcast<legacy_cpu_device *>(device)->token();
}
INLINE cquestlin_state *get_safe_token_lin(running_device *device)
@@ -214,7 +214,7 @@ INLINE cquestlin_state *get_safe_token_lin(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_CQUESTLIN);
- return (cquestlin_state *)downcast<cpu_device *>(device)->token();
+ return (cquestlin_state *)downcast<legacy_cpu_device *>(device)->token();
}
/***************************************************************************
@@ -362,7 +362,7 @@ static CPU_INIT( cquestrot )
cpustate->sram = auto_alloc_array(device->machine, UINT16, 2048); /* Private */
cpustate->device = device;
- cpustate->lindevice = device->machine->device<cpu_device>(rotconfig->lin_cpu_tag);
+ cpustate->lindevice = device->machine->device<legacy_cpu_device>(rotconfig->lin_cpu_tag);
cpustate->program = device->space(AS_PROGRAM);
cquestrot_state_register(device);
@@ -447,7 +447,7 @@ static CPU_INIT( cquestlin )
cpustate->o_stack = auto_alloc_array(device->machine, UINT32, 32768); /* Stack DRAM: 32kx20 */
cpustate->device = device;
- cpustate->rotdevice = device->machine->device<cpu_device>(linconfig->rot_cpu_tag);
+ cpustate->rotdevice = device->machine->device<legacy_cpu_device>(linconfig->rot_cpu_tag);
cpustate->program = device->space(AS_PROGRAM);
cquestlin_state_register(device);
diff --git a/src/emu/cpu/dsp32/dsp32.c b/src/emu/cpu/dsp32/dsp32.c
index 215e51af6d1..0d39d587654 100644
--- a/src/emu/cpu/dsp32/dsp32.c
+++ b/src/emu/cpu/dsp32/dsp32.c
@@ -184,7 +184,7 @@ struct _dsp32_state
UINT8 lastpins;
UINT32 ppc;
void (*output_pins_changed)(running_device *device, UINT32 pins);
- cpu_device * device;
+ legacy_cpu_device * device;
const address_space *program;
};
@@ -207,7 +207,7 @@ INLINE dsp32_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_DSP32C);
- return (dsp32_state *)downcast<cpu_device *>(device)->token();
+ return (dsp32_state *)downcast<legacy_cpu_device *>(device)->token();
}
diff --git a/src/emu/cpu/dsp56k/dsp56def.h b/src/emu/cpu/dsp56k/dsp56def.h
index 213d9669e94..342eedcca0f 100644
--- a/src/emu/cpu/dsp56k/dsp56def.h
+++ b/src/emu/cpu/dsp56k/dsp56def.h
@@ -417,5 +417,5 @@ INLINE dsp56k_core *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_DSP56156);
- return (dsp56k_core *)downcast<cpu_device *>(device)->token();
+ return (dsp56k_core *)downcast<legacy_cpu_device *>(device)->token();
}
diff --git a/src/emu/cpu/dsp56k/dsp56k.h b/src/emu/cpu/dsp56k/dsp56k.h
index e0717024b45..320ab5e3c29 100644
--- a/src/emu/cpu/dsp56k/dsp56k.h
+++ b/src/emu/cpu/dsp56k/dsp56k.h
@@ -232,7 +232,7 @@ typedef struct
UINT32 op;
int interrupt_cycles;
void (*output_pins_changed)(UINT32 pins);
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *data;
} dsp56k_core;
diff --git a/src/emu/cpu/e132xs/e132xs.c b/src/emu/cpu/e132xs/e132xs.c
index 5e647f88737..5b712d5db74 100644
--- a/src/emu/cpu/e132xs/e132xs.c
+++ b/src/emu/cpu/e132xs/e132xs.c
@@ -319,7 +319,7 @@ struct _hyperstone_state
struct _delay delay;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
UINT32 opcodexor;
@@ -431,7 +431,7 @@ INLINE hyperstone_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_GMS30C2132 ||
cpu_get_type(device) == CPU_GMS30C2216 ||
cpu_get_type(device) == CPU_GMS30C2232);
- return (hyperstone_state *)downcast<cpu_device *>(device)->token();
+ return (hyperstone_state *)downcast<legacy_cpu_device *>(device)->token();
}
/* Return the entry point for a determinated trap */
@@ -637,7 +637,7 @@ static void adjust_timer_interrupt(hyperstone_state *cpustate)
static TIMER_CALLBACK( e132xs_timer_callback )
{
- cpu_device *device = (cpu_device *)ptr;
+ legacy_cpu_device *device = (legacy_cpu_device *)ptr;
hyperstone_state *cpustate = get_safe_token(device);
int update = param;
@@ -1527,7 +1527,7 @@ static void set_irq_line(hyperstone_state *cpustate, int irqline, int state)
ISR &= ~(1 << irqline);
}
-static void hyperstone_init(cpu_device *device, device_irq_callback irqcallback, int scale_mask)
+static void hyperstone_init(legacy_cpu_device *device, device_irq_callback irqcallback, int scale_mask)
{
hyperstone_state *cpustate = get_safe_token(device);
@@ -1549,7 +1549,7 @@ static void hyperstone_init(cpu_device *device, device_irq_callback irqcallback,
cpustate->clock_scale_mask = scale_mask;
}
-static void e116_init(cpu_device *device, device_irq_callback irqcallback, int scale_mask)
+static void e116_init(legacy_cpu_device *device, device_irq_callback irqcallback, int scale_mask)
{
hyperstone_state *cpustate = get_safe_token(device);
hyperstone_init(device, irqcallback, scale_mask);
@@ -1586,7 +1586,7 @@ static CPU_INIT( gms30c2216 )
e116_init(device, irqcallback, 0);
}
-static void e132_init(cpu_device *device, device_irq_callback irqcallback, int scale_mask)
+static void e132_init(legacy_cpu_device *device, device_irq_callback irqcallback, int scale_mask)
{
hyperstone_state *cpustate = get_safe_token(device);
hyperstone_init(device, irqcallback, scale_mask);
diff --git a/src/emu/cpu/esrip/esrip.c b/src/emu/cpu/esrip/esrip.c
index 18e7de7f1ab..1f8079af78b 100644
--- a/src/emu/cpu/esrip/esrip.c
+++ b/src/emu/cpu/esrip/esrip.c
@@ -109,7 +109,7 @@ typedef struct
UINT16 *ipt_ram;
UINT8 *lbrm;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int icount;
@@ -125,7 +125,7 @@ INLINE esrip_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_ESRIP);
- return (esrip_state *)downcast<cpu_device *>(device)->token();
+ return (esrip_state *)downcast<legacy_cpu_device *>(device)->token();
}
diff --git a/src/emu/cpu/f8/f8.c b/src/emu/cpu/f8/f8.c
index 11953684229..86f3be933a9 100644
--- a/src/emu/cpu/f8/f8.c
+++ b/src/emu/cpu/f8/f8.c
@@ -53,7 +53,7 @@ struct _f8_Regs
UINT16 io; /* last I/O address */
UINT16 irq_vector;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *iospace;
int icount;
@@ -66,7 +66,7 @@ INLINE f8_Regs *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_F8);
- return (f8_Regs *)downcast<cpu_device *>(device)->token();
+ return (f8_Regs *)downcast<legacy_cpu_device *>(device)->token();
}
/* timer shifter polynome values (will be used for timer interrupts) */
diff --git a/src/emu/cpu/g65816/g65816.c b/src/emu/cpu/g65816/g65816.c
index 5d641075998..0b3ed96c9fb 100644
--- a/src/emu/cpu/g65816/g65816.c
+++ b/src/emu/cpu/g65816/g65816.c
@@ -100,7 +100,7 @@ INLINE g65816i_cpu_struct *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_G65816 || cpu_get_type(device) == CPU_5A22);
- return (g65816i_cpu_struct *)downcast<cpu_device *>(device)->token();
+ return (g65816i_cpu_struct *)downcast<legacy_cpu_device *>(device)->token();
}
/* Temporary Variables */
diff --git a/src/emu/cpu/g65816/g65816cm.h b/src/emu/cpu/g65816/g65816cm.h
index c20624ae661..1cd7a9a5159 100644
--- a/src/emu/cpu/g65816/g65816cm.h
+++ b/src/emu/cpu/g65816/g65816cm.h
@@ -94,7 +94,7 @@ struct _g65816i_cpu_struct
uint ir; /* Instruction Register */
uint irq_delay; /* delay 1 instruction before checking irq */
device_irq_callback int_ack; /* Interrupt Acknowledge */
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
read8_space_func read_vector; /* Read vector override */
uint stopped; /* Sets how the CPU is stopped */
diff --git a/src/emu/cpu/h6280/h6280.c b/src/emu/cpu/h6280/h6280.c
index 2df7d213f32..60e154a61fd 100644
--- a/src/emu/cpu/h6280/h6280.c
+++ b/src/emu/cpu/h6280/h6280.c
@@ -122,7 +122,7 @@ INLINE h6280_Regs *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_H6280);
- return (h6280_Regs *)downcast<cpu_device *>(device)->token();
+ return (h6280_Regs *)downcast<legacy_cpu_device *>(device)->token();
}
/* include the opcode macros, functions and function pointer tables */
diff --git a/src/emu/cpu/h6280/h6280.h b/src/emu/cpu/h6280/h6280.h
index 0d6b5416707..991e19354fd 100644
--- a/src/emu/cpu/h6280/h6280.h
+++ b/src/emu/cpu/h6280/h6280.h
@@ -61,7 +61,7 @@ typedef struct
UINT8 irq_state[3];
UINT8 irq_pending;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
diff --git a/src/emu/cpu/h83002/h8priv.h b/src/emu/cpu/h83002/h8priv.h
index 8b8f39d4846..e7fd0ab5d0d 100644
--- a/src/emu/cpu/h83002/h8priv.h
+++ b/src/emu/cpu/h83002/h8priv.h
@@ -26,7 +26,7 @@ struct _h83xx_state
UINT8 incheckirqs;
device_irq_callback irq_cb;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
@@ -55,7 +55,7 @@ INLINE h83xx_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_H83007 ||
cpu_get_type(device) == CPU_H83044 ||
cpu_get_type(device) == CPU_H83334);
- return (h83xx_state *)downcast<cpu_device *>(device)->token();
+ return (h83xx_state *)downcast<legacy_cpu_device *>(device)->token();
}
UINT8 h8_register_read8(h83xx_state *h8, UINT32 address);
diff --git a/src/emu/cpu/hd6309/hd6309.c b/src/emu/cpu/hd6309/hd6309.c
index 36310cc5cd0..79cc6f070f6 100644
--- a/src/emu/cpu/hd6309/hd6309.c
+++ b/src/emu/cpu/hd6309/hd6309.c
@@ -132,7 +132,7 @@ struct _m68_state_t
int extra_cycles; /* cycles used up by interrupts */
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
int icount;
PAIR ea; /* effective address */
@@ -156,7 +156,7 @@ INLINE m68_state_t *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_HD6309);
- return (m68_state_t *)downcast<cpu_device *>(device)->token();
+ return (m68_state_t *)downcast<legacy_cpu_device *>(device)->token();
}
static void check_irq_lines( m68_state_t *m68_state );
@@ -505,7 +505,7 @@ static void check_irq_lines( m68_state_t *m68_state )
static STATE_POSTLOAD( hd6309_postload )
{
- running_device *device = (cpu_device *)param;
+ running_device *device = (legacy_cpu_device *)param;
m68_state_t *m68_state = get_safe_token(device);
UpdateState(m68_state);
diff --git a/src/emu/cpu/i386/i386.c b/src/emu/cpu/i386/i386.c
index ecd11ce4bc2..d706b6e6784 100644
--- a/src/emu/cpu/i386/i386.c
+++ b/src/emu/cpu/i386/i386.c
@@ -463,7 +463,7 @@ static void I386OP(decode_two_byte)(i386_state *cpustate)
static UINT64 i386_debug_segbase(void *globalref, void *ref, UINT32 params, const UINT64 *param)
{
- cpu_device *device = (cpu_device *)ref;
+ legacy_cpu_device *device = (legacy_cpu_device *)ref;
i386_state *cpustate = get_safe_token(device);
UINT32 result;
I386_SREG seg;
@@ -484,7 +484,7 @@ static UINT64 i386_debug_segbase(void *globalref, void *ref, UINT32 params, cons
static UINT64 i386_debug_seglimit(void *globalref, void *ref, UINT32 params, const UINT64 *param)
{
- cpu_device *device = (cpu_device *)ref;
+ legacy_cpu_device *device = (legacy_cpu_device *)ref;
i386_state *cpustate = get_safe_token(device);
UINT32 result = 0;
I386_SREG seg;
@@ -509,7 +509,7 @@ static CPU_DEBUG_INIT( i386 )
static STATE_POSTLOAD( i386_postload )
{
- cpu_device *device = (cpu_device *)param;
+ legacy_cpu_device *device = (legacy_cpu_device *)param;
i386_state *cpustate = get_safe_token(device);
int i;
for (i = 0; i < 6; i++)
diff --git a/src/emu/cpu/i386/i386priv.h b/src/emu/cpu/i386/i386priv.h
index 03ded7858b2..421661889cd 100644
--- a/src/emu/cpu/i386/i386priv.h
+++ b/src/emu/cpu/i386/i386priv.h
@@ -227,7 +227,7 @@ struct _i386_state
UINT8 irq_state;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
UINT32 a20_mask;
@@ -265,7 +265,7 @@ INLINE i386_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_I486 ||
cpu_get_type(device) == CPU_PENTIUM ||
cpu_get_type(device) == CPU_MEDIAGX);
- return (i386_state *)downcast<cpu_device *>(device)->token();
+ return (i386_state *)downcast<legacy_cpu_device *>(device)->token();
}
extern int i386_parity_table[256];
diff --git a/src/emu/cpu/i4004/i4004.c b/src/emu/cpu/i4004/i4004.c
index 817db1df935..b82ad9517ad 100644
--- a/src/emu/cpu/i4004/i4004.c
+++ b/src/emu/cpu/i4004/i4004.c
@@ -33,7 +33,7 @@ struct _i4004_state
PAIR PC; // It is in fact one of ADDR regs
UINT8 flags; // used for I/O only
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *data;
const address_space *io;
@@ -56,7 +56,7 @@ INLINE i4004_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_I4004);
- return (i4004_state *)downcast<cpu_device *>(device)->token();
+ return (i4004_state *)downcast<legacy_cpu_device *>(device)->token();
}
INLINE UINT8 ROP(i4004_state *cpustate)
diff --git a/src/emu/cpu/i8008/i8008.c b/src/emu/cpu/i8008/i8008.c
index cee78e7f855..cb23f8eb96b 100644
--- a/src/emu/cpu/i8008/i8008.c
+++ b/src/emu/cpu/i8008/i8008.c
@@ -33,7 +33,7 @@ struct _i8008_state
UINT8 PF; // Parity flag
UINT8 HALT;
UINT8 flags; // temporary I/O only
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
int icount;
@@ -59,7 +59,7 @@ INLINE i8008_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_I8008);
- return (i8008_state *)downcast<cpu_device *>(device)->token();
+ return (i8008_state *)downcast<legacy_cpu_device *>(device)->token();
}
INLINE void PUSH_STACK(i8008_state *cpustate)
diff --git a/src/emu/cpu/i8085/i8085.c b/src/emu/cpu/i8085/i8085.c
index a93d09bf394..2ac29a184a5 100644
--- a/src/emu/cpu/i8085/i8085.c
+++ b/src/emu/cpu/i8085/i8085.c
@@ -183,7 +183,7 @@ struct _i8085_state
UINT8 ietemp; /* import/export temp space */
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
int icount;
@@ -278,7 +278,7 @@ INLINE i8085_state *get_safe_token(running_device *device)
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_8080 ||
cpu_get_type(device) == CPU_8085A);
- return (i8085_state *)downcast<cpu_device *>(device)->token();
+ return (i8085_state *)downcast<legacy_cpu_device *>(device)->token();
}
INLINE void set_sod(i8085_state *cpustate, int state)
@@ -967,7 +967,7 @@ static void init_tables (int type)
}
-static void init_808x_common(cpu_device *device, device_irq_callback irqcallback, int type)
+static void init_808x_common(legacy_cpu_device *device, device_irq_callback irqcallback, int type)
{
i8085_state *cpustate = get_safe_token(device);
diff --git a/src/emu/cpu/i86/i286.c b/src/emu/cpu/i86/i286.c
index acf8aaaccba..77fd00b66fc 100644
--- a/src/emu/cpu/i86/i286.c
+++ b/src/emu/cpu/i86/i286.c
@@ -58,7 +58,7 @@ struct _i80286_state
UINT8 rights;
} ldtr, tr;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
INT32 AuxVal, OverVal, SignVal, ZeroVal, CarryVal, DirVal; /* 0 or non-0 valued flags */
@@ -86,7 +86,7 @@ INLINE i80286_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_I80286);
- return (i80286_state *)downcast<cpu_device *>(device)->token();
+ return (i80286_state *)downcast<legacy_cpu_device *>(device)->token();
}
#define INT_IRQ 0x01
diff --git a/src/emu/cpu/i86/i86.c b/src/emu/cpu/i86/i86.c
index 47faeea7820..45277efee8e 100644
--- a/src/emu/cpu/i86/i86.c
+++ b/src/emu/cpu/i86/i86.c
@@ -59,7 +59,7 @@ struct _i8086_state
memory_interface mem;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
int icount;
@@ -78,7 +78,7 @@ INLINE i8086_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_I8088 ||
cpu_get_type(device) == CPU_I80186 ||
cpu_get_type(device) == CPU_I80188);
- return (i8086_state *)downcast<cpu_device *>(device)->token();
+ return (i8086_state *)downcast<legacy_cpu_device *>(device)->token();
}
diff --git a/src/emu/cpu/i860/i860.h b/src/emu/cpu/i860/i860.h
index 5643430ee62..f3c8a3a1aca 100644
--- a/src/emu/cpu/i860/i860.h
+++ b/src/emu/cpu/i860/i860.h
@@ -169,7 +169,7 @@ typedef struct {
/*
* MAME-specific stuff.
*/
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
UINT32 ppc;
int icount;
@@ -181,7 +181,7 @@ INLINE i860_state_t *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_I860);
- return (i860_state_t *)downcast<cpu_device *>(device)->token();
+ return (i860_state_t *)downcast<legacy_cpu_device *>(device)->token();
}
diff --git a/src/emu/cpu/i960/i960.c b/src/emu/cpu/i960/i960.c
index 24abf28d74f..4280121ab3e 100644
--- a/src/emu/cpu/i960/i960.c
+++ b/src/emu/cpu/i960/i960.c
@@ -34,7 +34,7 @@ struct _i960_state_t {
int immediate_irq, immediate_vector, immediate_pri;
device_irq_callback irq_cb;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int icount;
@@ -45,7 +45,7 @@ INLINE i960_state_t *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_I960);
- return (i960_state_t *)downcast<cpu_device *>(device)->token();
+ return (i960_state_t *)downcast<legacy_cpu_device *>(device)->token();
}
static void do_call(i960_state_t *i960, UINT32 adr, int type, UINT32 stack);
diff --git a/src/emu/cpu/jaguar/jaguar.c b/src/emu/cpu/jaguar/jaguar.c
index a841c790c8f..c7444ee4f51 100644
--- a/src/emu/cpu/jaguar/jaguar.c
+++ b/src/emu/cpu/jaguar/jaguar.c
@@ -100,7 +100,7 @@ struct _jaguar_state
void (*const *table)(jaguar_state *jaguar, UINT16 op);
device_irq_callback irq_callback;
jaguar_int_func cpu_interrupt;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
};
@@ -254,7 +254,7 @@ INLINE jaguar_state *get_safe_token(running_device *device)
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_JAGUARGPU ||
cpu_get_type(device) == CPU_JAGUARDSP);
- return (jaguar_state *)downcast<cpu_device *>(device)->token();
+ return (jaguar_state *)downcast<legacy_cpu_device *>(device)->token();
}
INLINE void update_register_banks(jaguar_state *jaguar)
@@ -401,7 +401,7 @@ static void init_tables(void)
static STATE_POSTLOAD( jaguar_postload )
{
- cpu_device *device = (cpu_device *)param;
+ legacy_cpu_device *device = (legacy_cpu_device *)param;
jaguar_state *jaguar = get_safe_token(device);
update_register_banks(jaguar);
@@ -409,7 +409,7 @@ static STATE_POSTLOAD( jaguar_postload )
}
-static void init_common(int isdsp, cpu_device *device, device_irq_callback irqcallback)
+static void init_common(int isdsp, legacy_cpu_device *device, device_irq_callback irqcallback)
{
const jaguar_cpu_config *configdata = (const jaguar_cpu_config *)device->baseconfig().static_config();
jaguar_state *jaguar = get_safe_token(device);
diff --git a/src/emu/cpu/konami/konami.c b/src/emu/cpu/konami/konami.c
index 592d0a566bb..32355634445 100644
--- a/src/emu/cpu/konami/konami.c
+++ b/src/emu/cpu/konami/konami.c
@@ -61,7 +61,7 @@ struct _konami_state
UINT8 nmi_state;
UINT8 nmi_pending;
int icount;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
konami_set_lines_func setlines_callback;
};
@@ -71,7 +71,7 @@ INLINE konami_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_KONAMI);
- return (konami_state *)downcast<cpu_device *>(device)->token();
+ return (konami_state *)downcast<legacy_cpu_device *>(device)->token();
}
/* flag bits in the cc register */
diff --git a/src/emu/cpu/lh5801/lh5801.c b/src/emu/cpu/lh5801/lh5801.c
index a50b642196a..8eddb9505e6 100644
--- a/src/emu/cpu/lh5801/lh5801.c
+++ b/src/emu/cpu/lh5801/lh5801.c
@@ -50,7 +50,7 @@ typedef struct _lh5810_state lh5801_state;
struct _lh5810_state
{
const lh5801_cpu_core *config;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
PAIR s, p, u, x, y;
@@ -73,7 +73,7 @@ INLINE lh5801_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_LH5801);
- return (lh5801_state *)downcast<cpu_device *>(device)->token();
+ return (lh5801_state *)downcast<legacy_cpu_device *>(device)->token();
}
#define P cpustate->p.w.l
diff --git a/src/emu/cpu/lr35902/lr35902.c b/src/emu/cpu/lr35902/lr35902.c
index c1a9dbafbbc..f87e2f1c44b 100644
--- a/src/emu/cpu/lr35902/lr35902.c
+++ b/src/emu/cpu/lr35902/lr35902.c
@@ -65,7 +65,7 @@ typedef struct {
int irq_state;
int ei_delay;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int icount;
/* Timer stuff */
@@ -118,7 +118,7 @@ INLINE lr35902_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_LR35902);
- return (lr35902_state *)downcast<cpu_device *>(device)->token();
+ return (lr35902_state *)downcast<legacy_cpu_device *>(device)->token();
}
typedef int (*OpcodeEmulator) (lr35902_state *cpustate);
diff --git a/src/emu/cpu/m37710/m37710cm.h b/src/emu/cpu/m37710/m37710cm.h
index af631ef4073..5f2deabf3a3 100644
--- a/src/emu/cpu/m37710/m37710cm.h
+++ b/src/emu/cpu/m37710/m37710cm.h
@@ -109,7 +109,7 @@ struct _m37710i_cpu_struct
uint source; /* temp register */
uint destination; /* temp register */
device_irq_callback int_ack;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
uint stopped; /* Sets how the CPU is stopped */
@@ -133,7 +133,7 @@ INLINE m37710i_cpu_struct *get_safe_token(running_device *device)
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_M37710 ||
cpu_get_type(device) == CPU_M37702);
- return (m37710i_cpu_struct *)downcast<cpu_device *>(device)->token();
+ return (m37710i_cpu_struct *)downcast<legacy_cpu_device *>(device)->token();
}
extern uint m37710i_adc_tbl[];
diff --git a/src/emu/cpu/m6502/m4510.c b/src/emu/cpu/m6502/m4510.c
index d99ea8e99fa..abec94bac80 100644
--- a/src/emu/cpu/m6502/m4510.c
+++ b/src/emu/cpu/m6502/m4510.c
@@ -143,7 +143,7 @@ struct _m4510_Regs {
UINT32 mem[8];
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *space;
int icount;
@@ -161,7 +161,7 @@ INLINE m4510_Regs *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_M4510);
- return (m4510_Regs *)downcast<cpu_device *>(device)->token();
+ return (m4510_Regs *)downcast<legacy_cpu_device *>(device)->token();
}
/***************************************************************
@@ -349,7 +349,7 @@ static void m4510_set_irq_line(m4510_Regs *cpustate, int irqline, int state)
}
}
-UINT8 m4510_get_port(cpu_device *device)
+UINT8 m4510_get_port(legacy_cpu_device *device)
{
m4510_Regs *cpustate = get_safe_token(device);
return (cpustate->port & cpustate->ddr) | (cpustate->ddr ^ 0xff);
diff --git a/src/emu/cpu/m6502/m6502.c b/src/emu/cpu/m6502/m6502.c
index 52bd2860774..163a4212d1f 100644
--- a/src/emu/cpu/m6502/m6502.c
+++ b/src/emu/cpu/m6502/m6502.c
@@ -69,7 +69,7 @@ struct _m6502_Regs
UINT8 so_state;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *space;
const address_space *io;
int int_occured;
@@ -97,7 +97,7 @@ INLINE m6502_Regs *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_M65C02 ||
cpu_get_type(device) == CPU_M65SC02 ||
cpu_get_type(device) == CPU_DECO16);
- return (m6502_Regs *)downcast<cpu_device *>(device)->token();
+ return (m6502_Regs *)downcast<legacy_cpu_device *>(device)->token();
}
static UINT8 default_rdmem_id(const address_space *space, offs_t offset) { return memory_read_byte_8le(space, offset); }
@@ -128,7 +128,7 @@ static void default_wdmem_id(const address_space *space, offs_t offset, UINT8 da
*
*****************************************************************************/
-static void m6502_common_init(cpu_device *device, device_irq_callback irqcallback, UINT8 subtype, void (*const *insn)(m6502_Regs *cpustate), const char *type)
+static void m6502_common_init(legacy_cpu_device *device, device_irq_callback irqcallback, UINT8 subtype, void (*const *insn)(m6502_Regs *cpustate), const char *type)
{
m6502_Regs *cpustate = get_safe_token(device);
const m6502_interface *intf = (const m6502_interface *)device->baseconfig().static_config();
@@ -355,7 +355,7 @@ static CPU_RESET( m6510 )
cpustate->ddr = 0x00;
}
-UINT8 m6510_get_port(cpu_device *device)
+UINT8 m6510_get_port(legacy_cpu_device *device)
{
m6502_Regs *cpustate = get_safe_token(device);
return (cpustate->port & cpustate->ddr) | (cpustate->ddr ^ 0xff);
diff --git a/src/emu/cpu/m6502/m6502.h b/src/emu/cpu/m6502/m6502.h
index 2b454492262..1506c871322 100644
--- a/src/emu/cpu/m6502/m6502.h
+++ b/src/emu/cpu/m6502/m6502.h
@@ -91,7 +91,7 @@ extern CPU_GET_INFO( m6510 );
extern CPU_DISASSEMBLE( m6510 );
-UINT8 m6510_get_port(cpu_device *device);
+UINT8 m6510_get_port(legacy_cpu_device *device);
#define M6510T_A M6502_A
#define M6510T_X M6502_X
diff --git a/src/emu/cpu/m6502/m6509.c b/src/emu/cpu/m6502/m6509.c
index e64211bd5da..460d06a75a0 100644
--- a/src/emu/cpu/m6502/m6509.c
+++ b/src/emu/cpu/m6502/m6509.c
@@ -78,7 +78,7 @@ struct _m6509_Regs {
UINT8 irq_state;
UINT8 so_state;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *space;
int icount;
@@ -92,7 +92,7 @@ INLINE m6509_Regs *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_M6509);
- return (m6509_Regs *)downcast<cpu_device *>(device)->token();
+ return (m6509_Regs *)downcast<legacy_cpu_device *>(device)->token();
}
/***************************************************************
diff --git a/src/emu/cpu/m6502/m65ce02.c b/src/emu/cpu/m6502/m65ce02.c
index 0ac421539ae..8ef4020b301 100644
--- a/src/emu/cpu/m6502/m65ce02.c
+++ b/src/emu/cpu/m6502/m65ce02.c
@@ -75,7 +75,7 @@ struct _m65ce02_Regs {
UINT8 irq_state;
int icount;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *space;
read8_space_func rdmem_id; /* readmem callback for indexed instructions */
write8_space_func wrmem_id; /* writemem callback for indexed instructions */
@@ -86,7 +86,7 @@ INLINE m65ce02_Regs *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_M65CE02);
- return (m65ce02_Regs *)downcast<cpu_device *>(device)->token();
+ return (m65ce02_Regs *)downcast<legacy_cpu_device *>(device)->token();
}
/***************************************************************
diff --git a/src/emu/cpu/m6800/m6800.c b/src/emu/cpu/m6800/m6800.c
index 62dcf901dfc..3a5743fe157 100644
--- a/src/emu/cpu/m6800/m6800.c
+++ b/src/emu/cpu/m6800/m6800.c
@@ -113,7 +113,7 @@ struct _m6800_state
UINT8 ic_eddge; /* InputCapture eddge , b.0=fall,b.1=raise */
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
/* Memory spaces */
const address_space *program;
@@ -164,7 +164,7 @@ INLINE m6800_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_M6808 ||
cpu_get_type(device) == CPU_HD63701 ||
cpu_get_type(device) == CPU_NSC8105);
- return (m6800_state *)downcast<cpu_device *>(device)->token();
+ return (m6800_state *)downcast<legacy_cpu_device *>(device)->token();
}
#if 0
diff --git a/src/emu/cpu/m68000/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c
index 80eb551eb4c..3ca4ea72011 100644
--- a/src/emu/cpu/m68000/m68kcpu.c
+++ b/src/emu/cpu/m68000/m68kcpu.c
@@ -508,7 +508,7 @@ INLINE m68ki_cpu_core *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_M68EC040 ||
cpu_get_type(device) == CPU_M68040 ||
cpu_get_type(device) == CPU_SCC68070);
- return (m68ki_cpu_core *)downcast<cpu_device *>(device)->token();
+ return (m68ki_cpu_core *)downcast<legacy_cpu_device *>(device)->token();
}
/* ======================================================================== */
diff --git a/src/emu/cpu/m68000/m68kcpu.h b/src/emu/cpu/m68000/m68kcpu.h
index 4b3aabfc4ef..75ce67c757e 100644
--- a/src/emu/cpu/m68000/m68kcpu.h
+++ b/src/emu/cpu/m68000/m68kcpu.h
@@ -627,7 +627,7 @@ struct _m68ki_cpu_core
m68k_rte_func rte_instr_callback; /* Called when a RTE instruction is encountered */
m68k_tas_func tas_instr_callback; /* Called when a TAS instruction is encountered, allows / disallows writeback */
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
m68k_memory_interface memory;
offs_t encrypted_start;
diff --git a/src/emu/cpu/m6805/m6805.c b/src/emu/cpu/m6805/m6805.c
index 2a7b974968a..d567a0aa758 100644
--- a/src/emu/cpu/m6805/m6805.c
+++ b/src/emu/cpu/m6805/m6805.c
@@ -61,7 +61,7 @@ typedef struct
UINT16 pending_interrupts; /* MB */
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int irq_state[9]; /* KW Additional lines for HD63705 */
int nmi_state;
@@ -74,7 +74,7 @@ INLINE m6805_Regs *get_safe_token(running_device *device)
assert(cpu_get_type(device) == CPU_M6805 ||
cpu_get_type(device) == CPU_M68705 ||
cpu_get_type(device) == CPU_HD63705);
- return (m6805_Regs *)downcast<cpu_device *>(device)->token();
+ return (m6805_Regs *)downcast<legacy_cpu_device *>(device)->token();
}
/****************************************************************************/
@@ -441,7 +441,7 @@ static void Interrupt( m6805_Regs *cpustate )
}
}
-static void state_register(m6805_Regs *cpustate, const char *type, cpu_device *device)
+static void state_register(m6805_Regs *cpustate, const char *type, legacy_cpu_device *device)
{
state_save_register_device_item(device, 0, A);
state_save_register_device_item(device, 0, PC);
diff --git a/src/emu/cpu/m6809/m6809.c b/src/emu/cpu/m6809/m6809.c
index 0fb48b0837c..3f7c23e1f34 100644
--- a/src/emu/cpu/m6809/m6809.c
+++ b/src/emu/cpu/m6809/m6809.c
@@ -99,7 +99,7 @@ struct _m68_state_t
int extra_cycles; /* cycles used up by interrupts */
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const m6809_config *config;
int icount;
PAIR ea; /* effective address */
@@ -117,7 +117,7 @@ INLINE m68_state_t *get_safe_token(running_device *device)
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_M6809 ||
cpu_get_type(device) == CPU_M6809E);
- return (m68_state_t *)downcast<cpu_device *>(device)->token();
+ return (m68_state_t *)downcast<legacy_cpu_device *>(device)->token();
}
static void check_irq_lines( m68_state_t *m68_state );
diff --git a/src/emu/cpu/mb86233/mb86233.c b/src/emu/cpu/mb86233/mb86233.c
index 1ce202ecbc7..6cbc166ee8c 100644
--- a/src/emu/cpu/mb86233/mb86233.c
+++ b/src/emu/cpu/mb86233/mb86233.c
@@ -50,7 +50,7 @@ struct _mb86233_state
UINT32 gpr[16];
UINT32 extport[0x30];
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int icount;
@@ -70,7 +70,7 @@ INLINE mb86233_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_MB86233);
- return (mb86233_state *)downcast<cpu_device *>(device)->token();
+ return (mb86233_state *)downcast<legacy_cpu_device *>(device)->token();
}
/***************************************************************************
diff --git a/src/emu/cpu/mb88xx/mb88xx.c b/src/emu/cpu/mb88xx/mb88xx.c
index c55cc1100b0..dd70bd7f6bf 100644
--- a/src/emu/cpu/mb88xx/mb88xx.c
+++ b/src/emu/cpu/mb88xx/mb88xx.c
@@ -74,7 +74,7 @@ struct _mb88_state
/* IRQ handling */
UINT8 pending_interrupt;
device_irq_callback irqcallback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *data;
const address_space *io;
@@ -90,7 +90,7 @@ INLINE mb88_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_MB8842 ||
cpu_get_type(device) == CPU_MB8843 ||
cpu_get_type(device) == CPU_MB8844);
- return (mb88_state *)downcast<cpu_device *>(device)->token();
+ return (mb88_state *)downcast<legacy_cpu_device *>(device)->token();
}
static TIMER_CALLBACK( serial_timer );
diff --git a/src/emu/cpu/mc68hc11/mc68hc11.c b/src/emu/cpu/mc68hc11/mc68hc11.c
index 473be5b9a62..8efff6c9766 100644
--- a/src/emu/cpu/mc68hc11/mc68hc11.c
+++ b/src/emu/cpu/mc68hc11/mc68hc11.c
@@ -61,7 +61,7 @@ struct _hc11_state
device_irq_callback irq_callback;
UINT8 irq_state[2];
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
int icount;
@@ -83,7 +83,7 @@ INLINE hc11_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_MC68HC11);
- return (hc11_state *)downcast<cpu_device *>(device)->token();
+ return (hc11_state *)downcast<legacy_cpu_device *>(device)->token();
}
#define HC11OP(XX) hc11_##XX
diff --git a/src/emu/cpu/mcs48/mcs48.c b/src/emu/cpu/mcs48/mcs48.c
index 76b5dc263a7..f9aee62af00 100644
--- a/src/emu/cpu/mcs48/mcs48.c
+++ b/src/emu/cpu/mcs48/mcs48.c
@@ -150,7 +150,7 @@ struct _mcs48_state
UINT16 a11; /* A11 value, either 0x000 or 0x800 */
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
int icount;
/* Memory spaces */
@@ -238,7 +238,7 @@ INLINE mcs48_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_MB8884 ||
cpu_get_type(device) == CPU_N7751 ||
cpu_get_type(device) == CPU_M58715);
- return (mcs48_state *)downcast<cpu_device *>(device)->token();
+ return (mcs48_state *)downcast<legacy_cpu_device *>(device)->token();
}
@@ -840,7 +840,7 @@ static const mcs48_ophandler opcode_table[256]=
mcs48_init - generic MCS-48 initialization
-------------------------------------------------*/
-static void mcs48_init(cpu_device *device, device_irq_callback irqcallback, UINT8 feature_mask, UINT16 romsize)
+static void mcs48_init(legacy_cpu_device *device, device_irq_callback irqcallback, UINT8 feature_mask, UINT16 romsize)
{
mcs48_state *cpustate = get_safe_token(device);
@@ -1186,7 +1186,7 @@ UINT8 upi41_master_r(running_device *device, UINT8 a0)
static TIMER_CALLBACK( master_callback )
{
- cpu_device *device = (cpu_device *)ptr;
+ legacy_cpu_device *device = (legacy_cpu_device *)ptr;
mcs48_state *cpustate = get_safe_token(device);
UINT8 a0 = (param >> 8) & 1;
UINT8 data = param;
@@ -1211,7 +1211,7 @@ static TIMER_CALLBACK( master_callback )
void upi41_master_w(running_device *_device, UINT8 a0, UINT8 data)
{
- cpu_device *device = downcast<cpu_device *>(_device);
+ legacy_cpu_device *device = downcast<legacy_cpu_device *>(_device);
timer_call_after_resynch(device->machine, (void *)device, (a0 << 8) | data, master_callback);
}
@@ -1415,7 +1415,7 @@ static CPU_GET_INFO( mcs48 )
CPU-SPECIFIC CONTEXT ACCESS
***************************************************************************/
-static void mcs48_generic_get_info(const device_config *devconfig, cpu_device *device, UINT32 state, cpuinfo *info, UINT8 features, int romsize, int ramsize, const char *name)
+static void mcs48_generic_get_info(const device_config *devconfig, legacy_cpu_device *device, UINT32 state, cpuinfo *info, UINT8 features, int romsize, int ramsize, const char *name)
{
switch (state)
{
diff --git a/src/emu/cpu/mcs51/mcs51.c b/src/emu/cpu/mcs51/mcs51.c
index 0a13c9c9ed5..609d8e9aeb1 100644
--- a/src/emu/cpu/mcs51/mcs51.c
+++ b/src/emu/cpu/mcs51/mcs51.c
@@ -282,7 +282,7 @@ struct _mcs51_state_t
/* Interrupt Callback */
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
/* Memory spaces */
const address_space *program;
@@ -666,7 +666,7 @@ INLINE mcs51_state_t *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_I87C52 ||
cpu_get_type(device) == CPU_AT89C4051 ||
cpu_get_type(device) == CPU_DS5002FP);
- return (mcs51_state_t *)downcast<cpu_device *>(device)->token();
+ return (mcs51_state_t *)downcast<legacy_cpu_device *>(device)->token();
}
INLINE void clear_current_irq(mcs51_state_t *mcs51_state)
diff --git a/src/emu/cpu/minx/minx.c b/src/emu/cpu/minx/minx.c
index 80162384ab8..1e839441278 100644
--- a/src/emu/cpu/minx/minx.c
+++ b/src/emu/cpu/minx/minx.c
@@ -84,7 +84,7 @@ typedef struct {
UINT8 halted;
UINT8 interrupt_pending;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int icount;
} minx_state;
@@ -99,7 +99,7 @@ INLINE minx_state *get_safe_token(running_device *device)
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_MINX);
- return (minx_state *)downcast<cpu_device *>(device)->token();
+ return (minx_state *)downcast<legacy_cpu_device *>(device)->token();
}
INLINE UINT16 rd16( minx_state *minx, UINT32 offset )
diff --git a/src/emu/cpu/mips/mips3com.c b/src/emu/cpu/mips/mips3com.c
index 73cc775078a..71fdc477f7f 100644
--- a/src/emu/cpu/mips/mips3com.c
+++ b/src/emu/cpu/mips/mips3com.c
@@ -69,7 +69,7 @@ INLINE int tlb_entry_is_global(const mips3_tlb_entry *entry)
structure based on the configured type
-------------------------------------------------*/
-void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, cpu_device *device, device_irq_callback irqcallback)
+void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, legacy_cpu_device *device, device_irq_callback irqcallback)
{
const mips3_config *config = (const mips3_config *)device->baseconfig().static_config();
int tlbindex;
@@ -751,7 +751,7 @@ void mips3com_get_info(mips3_state *mips, UINT32 state, cpuinfo *info)
static TIMER_CALLBACK( compare_int_callback )
{
- cpu_device *device = (cpu_device *)ptr;
+ legacy_cpu_device *device = (legacy_cpu_device *)ptr;
cpu_set_input_line(device, MIPS3_IRQ5, ASSERT_LINE);
}
diff --git a/src/emu/cpu/mips/mips3com.h b/src/emu/cpu/mips/mips3com.h
index 40affea6712..d88321f9492 100644
--- a/src/emu/cpu/mips/mips3com.h
+++ b/src/emu/cpu/mips/mips3com.h
@@ -195,7 +195,7 @@ struct _mips3_state
/* internal stuff */
mips3_flavor flavor;
device_irq_callback irq_callback;
- cpu_device * device;
+ legacy_cpu_device * device;
const address_space *program;
UINT32 system_clock;
UINT32 cpu_clock;
@@ -229,7 +229,7 @@ struct _mips3_state
FUNCTION PROTOTYPES
***************************************************************************/
-void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, cpu_device *device, device_irq_callback irqcallback);
+void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, legacy_cpu_device *device, device_irq_callback irqcallback);
void mips3com_exit(mips3_state *mips);
void mips3com_reset(mips3_state *mips);
diff --git a/src/emu/cpu/mips/mips3drc.c b/src/emu/cpu/mips/mips3drc.c
index e12d24d7c8b..54b0cdd0b1c 100644
--- a/src/emu/cpu/mips/mips3drc.c
+++ b/src/emu/cpu/mips/mips3drc.c
@@ -293,7 +293,7 @@ INLINE mips3_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_QED5271LE ||
cpu_get_type(device) == CPU_RM7000BE ||
cpu_get_type(device) == CPU_RM7000LE);
- return *(mips3_state **)downcast<cpu_device *>(device)->token();
+ return *(mips3_state **)downcast<legacy_cpu_device *>(device)->token();
}
@@ -359,7 +359,7 @@ INLINE void save_fast_iregs(mips3_state *mips3, drcuml_block *block)
mips3_init - initialize the processor
-------------------------------------------------*/
-static void mips3_init(mips3_flavor flavor, int bigendian, cpu_device *device, device_irq_callback irqcallback)
+static void mips3_init(mips3_flavor flavor, int bigendian, legacy_cpu_device *device, device_irq_callback irqcallback)
{
drcfe_config feconfig =
{
diff --git a/src/emu/cpu/mips/psx.c b/src/emu/cpu/mips/psx.c
index 75e8b542368..f4eae8b5197 100644
--- a/src/emu/cpu/mips/psx.c
+++ b/src/emu/cpu/mips/psx.c
@@ -185,7 +185,7 @@ struct _psxcpu_state
UINT32 multiplier_operand1;
UINT32 multiplier_operand2;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int bus_attached;
UINT32 bad_byte_address_mask;
@@ -199,7 +199,7 @@ INLINE psxcpu_state *get_safe_token(running_device *device)
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_PSXCPU ||
cpu_get_type(device) == CPU_CXD8661R);
- return (psxcpu_state *)downcast<cpu_device *>(device)->token();
+ return (psxcpu_state *)downcast<legacy_cpu_device *>(device)->token();
}
static const UINT32 mips_mtc0_writemask[]=
@@ -1605,7 +1605,7 @@ static STATE_POSTLOAD( mips_postload )
mips_update_scratchpad( psxcpu->program );
}
-static void mips_state_register( const char *type, cpu_device *device )
+static void mips_state_register( const char *type, legacy_cpu_device *device )
{
psxcpu_state *psxcpu = get_safe_token(device);
diff --git a/src/emu/cpu/mips/r3000.c b/src/emu/cpu/mips/r3000.c
index a9f96982fdb..2e18b3f2d7e 100644
--- a/src/emu/cpu/mips/r3000.c
+++ b/src/emu/cpu/mips/r3000.c
@@ -138,7 +138,7 @@ struct _r3000_state
int interrupt_cycles;
int hasfpu;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
/* endian-dependent load/store */
@@ -170,7 +170,7 @@ INLINE r3000_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_R3000LE ||
cpu_get_type(device) == CPU_R3041BE ||
cpu_get_type(device) == CPU_R3041LE);
- return (r3000_state *)downcast<cpu_device *>(device)->token();
+ return (r3000_state *)downcast<legacy_cpu_device *>(device)->token();
}
diff --git a/src/emu/cpu/mn10200/mn10200.c b/src/emu/cpu/mn10200/mn10200.c
index 179c12a2b2a..f651c49ea82 100644
--- a/src/emu/cpu/mn10200/mn10200.c
+++ b/src/emu/cpu/mn10200/mn10200.c
@@ -64,7 +64,7 @@ struct _mn102_info
int cycles;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
};
@@ -152,7 +152,7 @@ INLINE mn102_info *get_safe_token(running_device *device)
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_MN10200);
- return (mn102_info *)downcast<cpu_device *>(device)->token();
+ return (mn102_info *)downcast<legacy_cpu_device *>(device)->token();
}
static void mn102_take_irq(mn102_info *mn102, int level, int group)
diff --git a/src/emu/cpu/nec/nec.c b/src/emu/cpu/nec/nec.c
index 1b4bdbad5b7..d6a090616e8 100644
--- a/src/emu/cpu/nec/nec.c
+++ b/src/emu/cpu/nec/nec.c
@@ -161,7 +161,7 @@ struct _nec_state_t
UINT8 no_interrupt;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
int icount;
@@ -190,7 +190,7 @@ INLINE nec_state_t *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_V30 ||
cpu_get_type(device) == CPU_V33 ||
cpu_get_type(device) == CPU_V35);
- return (nec_state_t *)downcast<cpu_device *>(device)->token();
+ return (nec_state_t *)downcast<legacy_cpu_device *>(device)->token();
}
/* The interrupt number of a pending external interrupt pending NMI is 2. */
@@ -1100,7 +1100,7 @@ static CPU_DISASSEMBLE( nec )
return necv_dasm_one(buffer, pc, oprom, nec_state->config);
}
-static void nec_init(cpu_device *device, device_irq_callback irqcallback, int type)
+static void nec_init(legacy_cpu_device *device, device_irq_callback irqcallback, int type)
{
const nec_config *config = device->baseconfig().static_config() ? (const nec_config *)device->baseconfig().static_config() : &default_config;
nec_state_t *nec_state = get_safe_token(device);
diff --git a/src/emu/cpu/pdp1/pdp1.c b/src/emu/cpu/pdp1/pdp1.c
index c02b9de44f6..aba3900c068 100644
--- a/src/emu/cpu/pdp1/pdp1.c
+++ b/src/emu/cpu/pdp1/pdp1.c
@@ -417,7 +417,7 @@ struct _pdp1_state
/* 1 for 16-line sequence break system, 0 for default break system */
int type_20_sbs;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int icount;
};
@@ -427,7 +427,7 @@ INLINE pdp1_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_PDP1);
- return (pdp1_state *)downcast<cpu_device *>(device)->token();
+ return (pdp1_state *)downcast<legacy_cpu_device *>(device)->token();
}
static void execute_instruction(pdp1_state *cpustate);
diff --git a/src/emu/cpu/pdp1/tx0.c b/src/emu/cpu/pdp1/tx0.c
index fbc8aff8098..fa0abe16c4a 100644
--- a/src/emu/cpu/pdp1/tx0.c
+++ b/src/emu/cpu/pdp1/tx0.c
@@ -64,7 +64,7 @@ struct _tx0_state
int icount;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
};
@@ -74,7 +74,7 @@ INLINE tx0_state *get_safe_token(running_device *device)
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_TX0_64KW ||
cpu_get_type(device) == CPU_TX0_8KW);
- return (tx0_state *)downcast<cpu_device *>(device)->token();
+ return (tx0_state *)downcast<legacy_cpu_device *>(device)->token();
}
#define READ_TX0_18BIT(A) ((signed)memory_read_dword_32be(cpustate->program, (A)<<2))
@@ -126,7 +126,7 @@ static void tx0_write(tx0_state *cpustate, offs_t address, int data)
;
}
-static void tx0_init_common(cpu_device *device, device_irq_callback irqcallback, int is_64kw)
+static void tx0_init_common(legacy_cpu_device *device, device_irq_callback irqcallback, int is_64kw)
{
tx0_state *cpustate = get_safe_token(device);
diff --git a/src/emu/cpu/pic16c5x/pic16c5x.c b/src/emu/cpu/pic16c5x/pic16c5x.c
index 88d9f565287..493b101c6eb 100644
--- a/src/emu/cpu/pic16c5x/pic16c5x.c
+++ b/src/emu/cpu/pic16c5x/pic16c5x.c
@@ -97,7 +97,7 @@ struct _pic16c5x_state
int inst_cycles;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *data;
const address_space *io;
@@ -112,7 +112,7 @@ INLINE pic16c5x_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_PIC16C56 ||
cpu_get_type(device) == CPU_PIC16C57 ||
cpu_get_type(device) == CPU_PIC16C58);
- return (pic16c5x_state *)downcast<cpu_device *>(device)->token();
+ return (pic16c5x_state *)downcast<legacy_cpu_device *>(device)->token();
}
diff --git a/src/emu/cpu/pic16c62x/pic16c62x.c b/src/emu/cpu/pic16c62x/pic16c62x.c
index 94c6612c4c4..c433a1fd59d 100644
--- a/src/emu/cpu/pic16c62x/pic16c62x.c
+++ b/src/emu/cpu/pic16c62x/pic16c62x.c
@@ -87,7 +87,7 @@ struct _pic16c62x_state
int inst_cycles;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *data;
const address_space *io;
@@ -104,7 +104,7 @@ INLINE pic16c62x_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_PIC16C621A ||
cpu_get_type(device) == CPU_PIC16C622 ||
cpu_get_type(device) == CPU_PIC16C622A);
- return (pic16c62x_state *)downcast<cpu_device *>(device)->token();
+ return (pic16c62x_state *)downcast<legacy_cpu_device *>(device)->token();
}
diff --git a/src/emu/cpu/powerpc/ppc.c b/src/emu/cpu/powerpc/ppc.c
index 8f7468eeef3..fc09e1e3c30 100644
--- a/src/emu/cpu/powerpc/ppc.c
+++ b/src/emu/cpu/powerpc/ppc.c
@@ -306,7 +306,7 @@ typedef struct {
UINT64 tb; /* 56-bit timebase register */
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
// STUFF added for the 6xx series
diff --git a/src/emu/cpu/powerpc/ppccom.c b/src/emu/cpu/powerpc/ppccom.c
index 88f50d4e136..8c871a729b4 100644
--- a/src/emu/cpu/powerpc/ppccom.c
+++ b/src/emu/cpu/powerpc/ppccom.c
@@ -286,7 +286,7 @@ INLINE int sign_double(double x)
structure based on the configured type
-------------------------------------------------*/
-void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, cpu_device *device, device_irq_callback irqcallback)
+void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy_cpu_device *device, device_irq_callback irqcallback)
{
const powerpc_config *config = (const powerpc_config *)device->baseconfig().static_config();
@@ -1980,7 +1980,7 @@ updateirq:
static READ8_HANDLER( ppc4xx_spu_r )
{
- powerpc_state *ppc = *(powerpc_state **)downcast<cpu_device *>(space->cpu)->token();
+ powerpc_state *ppc = *(powerpc_state **)downcast<legacy_cpu_device *>(space->cpu)->token();
UINT8 result = 0xff;
switch (offset)
@@ -2007,7 +2007,7 @@ static READ8_HANDLER( ppc4xx_spu_r )
static WRITE8_HANDLER( ppc4xx_spu_w )
{
- powerpc_state *ppc = *(powerpc_state **)downcast<cpu_device *>(space->cpu)->token();
+ powerpc_state *ppc = *(powerpc_state **)downcast<legacy_cpu_device *>(space->cpu)->token();
UINT8 oldstate, newstate;
if (PRINTF_SPU)
@@ -2084,7 +2084,7 @@ ADDRESS_MAP_END
void ppc4xx_spu_set_tx_handler(running_device *device, ppc4xx_spu_tx_handler handler)
{
- powerpc_state *ppc = *(powerpc_state **)downcast<cpu_device *>(device)->token();
+ powerpc_state *ppc = *(powerpc_state **)downcast<legacy_cpu_device *>(device)->token();
ppc->spu.tx_handler = handler;
}
@@ -2096,7 +2096,7 @@ void ppc4xx_spu_set_tx_handler(running_device *device, ppc4xx_spu_tx_handler han
void ppc4xx_spu_receive_byte(running_device *device, UINT8 byteval)
{
- powerpc_state *ppc = *(powerpc_state **)downcast<cpu_device *>(device)->token();
+ powerpc_state *ppc = *(powerpc_state **)downcast<legacy_cpu_device *>(device)->token();
ppc4xx_spu_rx_data(ppc, byteval);
}
diff --git a/src/emu/cpu/powerpc/ppccom.h b/src/emu/cpu/powerpc/ppccom.h
index c54b4439df2..072cc638db8 100644
--- a/src/emu/cpu/powerpc/ppccom.h
+++ b/src/emu/cpu/powerpc/ppccom.h
@@ -551,7 +551,7 @@ struct _powerpc_state
/* internal stuff */
device_irq_callback irq_callback;
- cpu_device * device;
+ legacy_cpu_device * device;
const address_space *program;
offs_t codexor;
UINT32 irq_pending;
@@ -571,7 +571,7 @@ struct _powerpc_state
FUNCTION PROTOTYPES
***************************************************************************/
-void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, cpu_device *device, device_irq_callback irqcallback);
+void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy_cpu_device *device, device_irq_callback irqcallback);
void ppccom_exit(powerpc_state *ppc);
void ppccom_reset(powerpc_state *ppc);
diff --git a/src/emu/cpu/powerpc/ppcdrc.c b/src/emu/cpu/powerpc/ppcdrc.c
index dcfae761e9b..db89255bb23 100644
--- a/src/emu/cpu/powerpc/ppcdrc.c
+++ b/src/emu/cpu/powerpc/ppcdrc.c
@@ -448,7 +448,7 @@ INLINE powerpc_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_PPC603R ||
cpu_get_type(device) == CPU_PPC604 ||
cpu_get_type(device) == CPU_MPC8240);
- return *(powerpc_state **)downcast<cpu_device *>(device)->token();
+ return *(powerpc_state **)downcast<legacy_cpu_device *>(device)->token();
}
/*-------------------------------------------------
@@ -547,7 +547,7 @@ INLINE UINT32 compute_spr(UINT32 spr)
ppcdrc_init - initialize the processor
-------------------------------------------------*/
-static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, cpu_device *device, device_irq_callback irqcallback)
+static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy_cpu_device *device, device_irq_callback irqcallback)
{
drcfe_config feconfig =
{
diff --git a/src/emu/cpu/rsp/rsp.c b/src/emu/cpu/rsp/rsp.c
index e953306bd4c..50cf86a3934 100644
--- a/src/emu/cpu/rsp/rsp.c
+++ b/src/emu/cpu/rsp/rsp.c
@@ -32,7 +32,7 @@ INLINE rsp_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_RSP);
- return (rsp_state *)downcast<cpu_device *>(device)->token();
+ return (rsp_state *)downcast<legacy_cpu_device *>(device)->token();
}
#define SIMM16 ((INT32)(INT16)(op))
diff --git a/src/emu/cpu/rsp/rsp.h b/src/emu/cpu/rsp/rsp.h
index 65b7f7ae245..bddfd64fc4d 100644
--- a/src/emu/cpu/rsp/rsp.h
+++ b/src/emu/cpu/rsp/rsp.h
@@ -209,7 +209,7 @@ struct _rsp_state
UINT32 nextpc;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int icount;
diff --git a/src/emu/cpu/rsp/rspdrc.c b/src/emu/cpu/rsp/rspdrc.c
index f8a5db7c524..692691b6108 100644
--- a/src/emu/cpu/rsp/rspdrc.c
+++ b/src/emu/cpu/rsp/rspdrc.c
@@ -353,7 +353,7 @@ INLINE rsp_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_RSP);
- return *(rsp_state **)downcast<cpu_device *>(device)->token();
+ return *(rsp_state **)downcast<legacy_cpu_device *>(device)->token();
}
/***************************************************************************
@@ -684,7 +684,7 @@ static const int vector_elements_2[16][8] =
{ 7, 7, 7, 7, 7, 7, 7, 7 }, // 7
};
-static void rspcom_init(rsp_state *rsp, cpu_device *device, device_irq_callback irqcallback)
+static void rspcom_init(rsp_state *rsp, legacy_cpu_device *device, device_irq_callback irqcallback)
{
int regIdx = 0;
int accumIdx;
diff --git a/src/emu/cpu/s2650/s2650.c b/src/emu/cpu/s2650/s2650.c
index c50acb1ca55..774f66a4c9e 100644
--- a/src/emu/cpu/s2650/s2650.c
+++ b/src/emu/cpu/s2650/s2650.c
@@ -42,7 +42,7 @@ struct _s2650_regs {
int icount;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
};
@@ -52,7 +52,7 @@ INLINE s2650_regs *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_S2650);
- return (s2650_regs *)downcast<cpu_device *>(device)->token();
+ return (s2650_regs *)downcast<legacy_cpu_device *>(device)->token();
}
/* condition code changes for a byte */
@@ -888,7 +888,8 @@ static CPU_EXECUTE( s2650 )
s2650_regs *s2650c = get_safe_token(device);
/* check for external irqs */
- s2650c->icount -= check_irq_line(s2650c);
+ int cycles = check_irq_line(s2650c);
+ s2650c->icount -= cycles;
do
{
diff --git a/src/emu/cpu/saturn/saturn.c b/src/emu/cpu/saturn/saturn.c
index 327f0f91a48..e9a46376762 100644
--- a/src/emu/cpu/saturn/saturn.c
+++ b/src/emu/cpu/saturn/saturn.c
@@ -82,7 +82,7 @@ struct _saturn_state
int monitor_id;
int monitor_in;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int icount;
};
@@ -92,7 +92,7 @@ INLINE saturn_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_SATURN);
- return (saturn_state *)downcast<cpu_device *>(device)->token();
+ return (saturn_state *)downcast<legacy_cpu_device *>(device)->token();
}
/***************************************************************
diff --git a/src/emu/cpu/sc61860/sc61860.c b/src/emu/cpu/sc61860/sc61860.c
index 0b235a238bf..098678b1611 100644
--- a/src/emu/cpu/sc61860/sc61860.c
+++ b/src/emu/cpu/sc61860/sc61860.c
@@ -55,7 +55,7 @@ struct _sc61860_state
struct { int t2ms, t512ms; int count;} timer;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int icount;
};
@@ -65,7 +65,7 @@ INLINE sc61860_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_SC61860);
- return (sc61860_state *)downcast<cpu_device *>(device)->token();
+ return (sc61860_state *)downcast<legacy_cpu_device *>(device)->token();
}
UINT8 *sc61860_internal_ram(running_device *device)
diff --git a/src/emu/cpu/scmp/scmp.c b/src/emu/cpu/scmp/scmp.c
index 4fd930c1f44..e88300cc8a6 100644
--- a/src/emu/cpu/scmp/scmp.c
+++ b/src/emu/cpu/scmp/scmp.c
@@ -32,7 +32,7 @@ struct _scmp_state
UINT8 ER;
UINT8 SR;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
int icount;
@@ -58,7 +58,7 @@ INLINE scmp_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_SCMP || cpu_get_type(device) == CPU_INS8060);
- return (scmp_state *)downcast<cpu_device *>(device)->token();
+ return (scmp_state *)downcast<legacy_cpu_device *>(device)->token();
}
INLINE UINT16 ADD12(UINT16 addr, INT8 val)
diff --git a/src/emu/cpu/se3208/se3208.c b/src/emu/cpu/se3208/se3208.c
index bc0c6f99255..8d4641f475d 100644
--- a/src/emu/cpu/se3208/se3208.c
+++ b/src/emu/cpu/se3208/se3208.c
@@ -23,7 +23,7 @@ struct _se3208_state_t
UINT32 PPC;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
UINT8 IRQ;
UINT8 NMI;
@@ -63,7 +63,7 @@ INLINE se3208_state_t *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_SE3208);
- return (se3208_state_t *)downcast<cpu_device *>(device)->token();
+ return (se3208_state_t *)downcast<legacy_cpu_device *>(device)->token();
}
INLINE UINT32 read_dword_unaligned(const address_space *space, UINT32 address)
diff --git a/src/emu/cpu/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c
index 0b3b42bf4c8..013408159ed 100644
--- a/src/emu/cpu/sh2/sh2comn.c
+++ b/src/emu/cpu/sh2/sh2comn.c
@@ -16,9 +16,9 @@
#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
#ifdef USE_SH2DRC
-#define GET_SH2(dev) *(SH2 **)downcast<cpu_device *>(dev)->token()
+#define GET_SH2(dev) *(SH2 **)downcast<legacy_cpu_device *>(dev)->token()
#else
-#define GET_SH2(dev) (SH2 *)downcast<cpu_device *>(dev)->token()
+#define GET_SH2(dev) (SH2 *)downcast<legacy_cpu_device *>(dev)->token()
#endif
@@ -699,7 +699,7 @@ void sh2_exception(SH2 *sh2, const char *message, int irqline)
#endif
}
-void sh2_common_init(SH2 *sh2, cpu_device *device, device_irq_callback irqcallback)
+void sh2_common_init(SH2 *sh2, legacy_cpu_device *device, device_irq_callback irqcallback)
{
const sh2_cpu_core *conf = (const sh2_cpu_core *)device->baseconfig().static_config();
diff --git a/src/emu/cpu/sh2/sh2comn.h b/src/emu/cpu/sh2/sh2comn.h
index bfec001a435..ad3b9ad2591 100644
--- a/src/emu/cpu/sh2/sh2comn.h
+++ b/src/emu/cpu/sh2/sh2comn.h
@@ -115,7 +115,7 @@ typedef struct
INT8 irq_line_state[17];
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *internal;
UINT32 *m;
@@ -172,7 +172,7 @@ typedef struct
#endif
} SH2;
-void sh2_common_init(SH2 *sh2, cpu_device *device, device_irq_callback irqcallback);
+void sh2_common_init(SH2 *sh2, legacy_cpu_device *device, device_irq_callback irqcallback);
void sh2_recalc_irq(SH2 *sh2);
void sh2_set_irq_line(SH2 *sh2, int irqline, int state);
void sh2_exception(SH2 *sh2, const char *message, int irqline);
diff --git a/src/emu/cpu/sh2/sh2drc.c b/src/emu/cpu/sh2/sh2drc.c
index 97e0e609b46..9e3b76fbaf6 100644
--- a/src/emu/cpu/sh2/sh2drc.c
+++ b/src/emu/cpu/sh2/sh2drc.c
@@ -143,7 +143,7 @@ INLINE SH2 *get_safe_token(running_device *device)
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_SH1 ||
cpu_get_type(device) == CPU_SH2);
- return *(SH2 **)downcast<cpu_device *>(device)->token();
+ return *(SH2 **)downcast<legacy_cpu_device *>(device)->token();
}
INLINE UINT16 RW(SH2 *sh2, offs_t A)
diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c
index f8280fb561d..5a2dd91fe9b 100644
--- a/src/emu/cpu/sh4/sh4.c
+++ b/src/emu/cpu/sh4/sh4.c
@@ -35,7 +35,7 @@ INLINE SH4 *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_SH4);
- return (SH4 *)downcast<cpu_device *>(device)->token();
+ return (SH4 *)downcast<legacy_cpu_device *>(device)->token();
}
/* Called for unimplemented opcodes */
diff --git a/src/emu/cpu/sh4/sh4comn.c b/src/emu/cpu/sh4/sh4comn.c
index ce8304887a9..5c7856de7ce 100644
--- a/src/emu/cpu/sh4/sh4comn.c
+++ b/src/emu/cpu/sh4/sh4comn.c
@@ -35,7 +35,7 @@ INLINE SH4 *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_SH4);
- return (SH4 *)downcast<cpu_device *>(device)->token();
+ return (SH4 *)downcast<legacy_cpu_device *>(device)->token();
}
void sh4_change_register_bank(SH4 *sh4, int to)
diff --git a/src/emu/cpu/sh4/sh4comn.h b/src/emu/cpu/sh4/sh4comn.h
index 97019604138..9feb8750318 100644
--- a/src/emu/cpu/sh4/sh4comn.h
+++ b/src/emu/cpu/sh4/sh4comn.h
@@ -62,7 +62,7 @@ typedef struct
INT8 irq_line_state[17];
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *internal;
const address_space *program;
const address_space *io;
diff --git a/src/emu/cpu/sharc/sharc.c b/src/emu/cpu/sharc/sharc.c
index 0d254d11de1..dc59a52a56b 100644
--- a/src/emu/cpu/sharc/sharc.c
+++ b/src/emu/cpu/sharc/sharc.c
@@ -125,7 +125,7 @@ struct _SHARC_REGS
UINT16 *internal_ram_block0, *internal_ram_block1;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *data;
void (*opcode_handler)(SHARC_REGS *cpustate);
@@ -189,7 +189,7 @@ INLINE SHARC_REGS *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_ADSP21062);
- return (SHARC_REGS *)downcast<cpu_device *>(device)->token();
+ return (SHARC_REGS *)downcast<legacy_cpu_device *>(device)->token();
}
INLINE void CHANGE_PC(SHARC_REGS *cpustate, UINT32 newpc)
diff --git a/src/emu/cpu/sm8500/sm8500.c b/src/emu/cpu/sm8500/sm8500.c
index 28558e7cded..5b1fa3b9c34 100644
--- a/src/emu/cpu/sm8500/sm8500.c
+++ b/src/emu/cpu/sm8500/sm8500.c
@@ -51,7 +51,7 @@ struct _sm8500_state
int halted;
int icount;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
UINT8 internal_ram[0x500];
};
@@ -61,7 +61,7 @@ INLINE sm8500_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_SM8500);
- return (sm8500_state *)downcast<cpu_device *>(device)->token();
+ return (sm8500_state *)downcast<legacy_cpu_device *>(device)->token();
}
static const UINT8 sm8500_b2w[8] = {
@@ -384,7 +384,7 @@ static void sm8500_set_irq_line( sm8500_state *cpustate, int irqline, int state
}
}
-UINT8 *sm8500_get_internal_ram(cpu_device *device)
+UINT8 *sm8500_get_internal_ram(legacy_cpu_device *device)
{
sm8500_state *cpustate = get_safe_token(device);
return cpustate->internal_ram;
diff --git a/src/emu/cpu/sm8500/sm8500.h b/src/emu/cpu/sm8500/sm8500.h
index 6b4fc639576..c63f5dd9445 100644
--- a/src/emu/cpu/sm8500/sm8500.h
+++ b/src/emu/cpu/sm8500/sm8500.h
@@ -37,6 +37,6 @@ extern CPU_GET_INFO( sm8500 );
extern CPU_DISASSEMBLE( sm8500 );
-UINT8 *sm8500_get_internal_ram(cpu_device *device);
+UINT8 *sm8500_get_internal_ram(legacy_cpu_device *device);
#endif /* __SM8500_H__ */
diff --git a/src/emu/cpu/spc700/spc700.c b/src/emu/cpu/spc700/spc700.c
index b1aaa410cae..022f6dbef7f 100644
--- a/src/emu/cpu/spc700/spc700.c
+++ b/src/emu/cpu/spc700/spc700.c
@@ -87,7 +87,7 @@ typedef struct
uint line_rst; /* Status of the RESET line */
uint ir; /* Instruction Register */
device_irq_callback int_ack;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
uint stopped; /* stopped status */
int ICount;
@@ -103,7 +103,7 @@ INLINE spc700i_cpu *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_SPC700);
- return (spc700i_cpu *)downcast<cpu_device *>(device)->token();
+ return (spc700i_cpu *)downcast<legacy_cpu_device *>(device)->token();
}
/* ======================================================================== */
@@ -1246,7 +1246,7 @@ INLINE void SET_FLAG_I(spc700i_cpu *cpustate, uint value)
/* ================================= API ================================== */
/* ======================================================================== */
-static void state_register( cpu_device *device )
+static void state_register( legacy_cpu_device *device )
{
spc700i_cpu *cpustate = get_safe_token(device);
diff --git a/src/emu/cpu/ssem/ssem.c b/src/emu/cpu/ssem/ssem.c
index a9161b784ef..7484a82fde3 100644
--- a/src/emu/cpu/ssem/ssem.c
+++ b/src/emu/cpu/ssem/ssem.c
@@ -21,7 +21,7 @@ struct _ssem_state
UINT32 a;
UINT32 halt;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int icount;
};
@@ -31,7 +31,7 @@ INLINE ssem_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_SSEM);
- return (ssem_state *)downcast<cpu_device *>(device)->token();
+ return (ssem_state *)downcast<legacy_cpu_device *>(device)->token();
}
#define INSTR ((op >> 13) & 7)
diff --git a/src/emu/cpu/ssp1601/ssp1601.c b/src/emu/cpu/ssp1601/ssp1601.c
index bb1f87a105e..0ce300a84b9 100644
--- a/src/emu/cpu/ssp1601/ssp1601.c
+++ b/src/emu/cpu/ssp1601/ssp1601.c
@@ -52,7 +52,7 @@ struct _ssp1601_state_t
int g_cycles;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
};
@@ -62,7 +62,7 @@ INLINE ssp1601_state_t *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_SSP1601);
- return (ssp1601_state_t *)downcast<cpu_device *>(device)->token();
+ return (ssp1601_state_t *)downcast<legacy_cpu_device *>(device)->token();
}
diff --git a/src/emu/cpu/superfx/superfx.c b/src/emu/cpu/superfx/superfx.c
index ecf2ebdea0e..e1ecbe79420 100644
--- a/src/emu/cpu/superfx/superfx.c
+++ b/src/emu/cpu/superfx/superfx.c
@@ -61,7 +61,7 @@ struct _superfx_state
cache_t cache;
pixelcache_t pixelcache[2];
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int icount;
};
@@ -71,7 +71,7 @@ INLINE superfx_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_SUPERFX);
- return (superfx_state *)downcast<cpu_device *>(device)->token();
+ return (superfx_state *)downcast<legacy_cpu_device *>(device)->token();
}
/*****************************************************************************/
@@ -669,7 +669,7 @@ void superfx_add_clocks(running_device *cpu, INT32 clocks)
/*****************************************************************************/
-static void superfx_register_save( cpu_device *device )
+static void superfx_register_save( legacy_cpu_device *device )
{
superfx_state *cpustate = get_safe_token(device);
int i;
diff --git a/src/emu/cpu/t11/t11.c b/src/emu/cpu/t11/t11.c
index 41b96ee4ccf..0fab8e1446e 100644
--- a/src/emu/cpu/t11/t11.c
+++ b/src/emu/cpu/t11/t11.c
@@ -33,7 +33,7 @@ struct _t11_state
UINT8 irq_state;
int icount;
device_irq_callback irq_callback;
- cpu_device * device;
+ legacy_cpu_device * device;
const address_space *program;
};
@@ -43,7 +43,7 @@ INLINE t11_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_T11);
- return (t11_state *)downcast<cpu_device *>(device)->token();
+ return (t11_state *)downcast<legacy_cpu_device *>(device)->token();
}
diff --git a/src/emu/cpu/tlcs90/tlcs90.c b/src/emu/cpu/tlcs90/tlcs90.c
index ef139ddef7b..7424bfd53eb 100644
--- a/src/emu/cpu/tlcs90/tlcs90.c
+++ b/src/emu/cpu/tlcs90/tlcs90.c
@@ -31,7 +31,7 @@ typedef struct
UINT8 halt, after_EI;
UINT16 irq_state, irq_mask;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
int icount;
@@ -68,7 +68,7 @@ INLINE t90_Regs *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_TMP90841 ||
cpu_get_type(device) == CPU_TMP91640 ||
cpu_get_type(device) == CPU_TMP91641);
- return (t90_Regs *)downcast<cpu_device *>(device)->token();
+ return (t90_Regs *)downcast<legacy_cpu_device *>(device)->token();
}
enum {
@@ -2633,7 +2633,7 @@ static WRITE8_HANDLER( t90_internal_registers_w )
cpustate->internal_registers[offset] = data;
}
-static void state_register( cpu_device *device )
+static void state_register( legacy_cpu_device *device )
{
t90_Regs *cpustate = get_safe_token(device);
diff --git a/src/emu/cpu/tlcs900/tlcs900.c b/src/emu/cpu/tlcs900/tlcs900.c
index 6c749badd52..c6a22c43f52 100644
--- a/src/emu/cpu/tlcs900/tlcs900.c
+++ b/src/emu/cpu/tlcs900/tlcs900.c
@@ -72,7 +72,7 @@ struct _tlcs900_state
int icount;
int regbank;
device_irq_callback irqcallback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
};
@@ -210,7 +210,7 @@ INLINE tlcs900_state *get_safe_token( running_device *device )
assert( device->type() == CPU );
assert( cpu_get_type(device) == CPU_TLCS900H );
- return (tlcs900_state *) downcast<cpu_device *>(device)->token();
+ return (tlcs900_state *) downcast<legacy_cpu_device *>(device)->token();
}
diff --git a/src/emu/cpu/tms0980/tms0980.c b/src/emu/cpu/tms0980/tms0980.c
index 552fd6c2624..cf9ea2fdf2c 100644
--- a/src/emu/cpu/tms0980/tms0980.c
+++ b/src/emu/cpu/tms0980/tms0980.c
@@ -457,7 +457,7 @@ INLINE tms0980_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_TMS1200 ||
cpu_get_type(device) == CPU_TMS1270 ||
cpu_get_type(device) == CPU_TMS1300 );
- return (tms0980_state *)downcast<cpu_device *>(device)->token();
+ return (tms0980_state *)downcast<legacy_cpu_device *>(device)->token();
}
@@ -491,7 +491,7 @@ static ADDRESS_MAP_START(data_7bit, ADDRESS_SPACE_DATA, 8)
ADDRESS_MAP_END
-static void cpu_init_tms_common( cpu_device *device, const UINT32* decode_table, UINT16 o_mask, UINT16 r_mask, UINT8 pc_size, UINT8 byte_size )
+static void cpu_init_tms_common( legacy_cpu_device *device, const UINT32* decode_table, UINT16 o_mask, UINT16 r_mask, UINT8 pc_size, UINT8 byte_size )
{
tms0980_state *cpustate = get_safe_token( device );
diff --git a/src/emu/cpu/tms32010/tms32010.c b/src/emu/cpu/tms32010/tms32010.c
index 5288f2f35a6..5f11b3887d8 100644
--- a/src/emu/cpu/tms32010/tms32010.c
+++ b/src/emu/cpu/tms32010/tms32010.c
@@ -91,7 +91,7 @@ struct _tms32010_state
UINT16 memaccess;
int addr_mask;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *data;
const address_space *io;
@@ -102,7 +102,7 @@ INLINE tms32010_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_TMS32010);
- return (tms32010_state *)downcast<cpu_device *>(device)->token();
+ return (tms32010_state *)downcast<legacy_cpu_device *>(device)->token();
}
/* opcode table entry */
diff --git a/src/emu/cpu/tms32025/tms32025.c b/src/emu/cpu/tms32025/tms32025.c
index f79d53a1bff..2a5acbbae10 100644
--- a/src/emu/cpu/tms32025/tms32025.c
+++ b/src/emu/cpu/tms32025/tms32025.c
@@ -173,7 +173,7 @@ struct _tms32025_state
int mHackIgnoreARP; /* special handling for lst, lst1 instructions */
int waiting_for_serial_frame;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *data;
const address_space *io;
@@ -188,7 +188,7 @@ INLINE tms32025_state *get_safe_token(running_device *device)
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_TMS32025 ||
cpu_get_type(device) == CPU_TMS32026);
- return (tms32025_state *)downcast<cpu_device *>(device)->token();
+ return (tms32025_state *)downcast<legacy_cpu_device *>(device)->token();
}
/* opcode table entry */
diff --git a/src/emu/cpu/tms32031/tms32031.c b/src/emu/cpu/tms32031/tms32031.c
index ecd3408531d..77628c9a7b2 100644
--- a/src/emu/cpu/tms32031/tms32031.c
+++ b/src/emu/cpu/tms32031/tms32031.c
@@ -119,7 +119,7 @@ struct _tms32031_state
tms32031_xf_func xf1_w;
tms32031_iack_func iack_w;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
};
@@ -129,7 +129,7 @@ INLINE tms32031_state *get_safe_token(running_device *device)
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_TMS32031 ||
cpu_get_type(device) == CPU_TMS32032);
- return (tms32031_state *)downcast<cpu_device *>(device)->token();
+ return (tms32031_state *)downcast<legacy_cpu_device *>(device)->token();
}
diff --git a/src/emu/cpu/tms32051/tms32051.c b/src/emu/cpu/tms32051/tms32051.c
index fded98f04a7..d01af3a6837 100644
--- a/src/emu/cpu/tms32051/tms32051.c
+++ b/src/emu/cpu/tms32051/tms32051.c
@@ -143,7 +143,7 @@ struct _tms32051_state
} shadow;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *data;
int icount;
@@ -154,7 +154,7 @@ INLINE tms32051_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_TMS32051);
- return (tms32051_state *)downcast<cpu_device *>(device)->token();
+ return (tms32051_state *)downcast<legacy_cpu_device *>(device)->token();
}
static void delay_slot(tms32051_state *cpustate, UINT16 startpc);
diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c
index aee35aa5c6b..f7dc82c1c4e 100644
--- a/src/emu/cpu/tms34010/tms34010.c
+++ b/src/emu/cpu/tms34010/tms34010.c
@@ -62,7 +62,7 @@ struct _tms34010_state
UINT8 external_host_access;
UINT8 executing;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const tms34010_config *config;
screen_device *screen;
@@ -86,7 +86,7 @@ INLINE tms34010_state *get_safe_token(running_device *device)
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_TMS34010 ||
cpu_get_type(device) == CPU_TMS34020);
- return (tms34010_state *)downcast<cpu_device *>(device)->token();
+ return (tms34010_state *)downcast<legacy_cpu_device *>(device)->token();
}
#include "34010ops.h"
diff --git a/src/emu/cpu/tms57002/tms57002.c b/src/emu/cpu/tms57002/tms57002.c
index df9012e6110..e94d2c2078b 100644
--- a/src/emu/cpu/tms57002/tms57002.c
+++ b/src/emu/cpu/tms57002/tms57002.c
@@ -114,7 +114,7 @@ INLINE tms57002_t *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_TMS57002);
- return (tms57002_t *)downcast<cpu_device *>(device)->token();
+ return (tms57002_t *)downcast<legacy_cpu_device *>(device)->token();
}
static void tms57002_cache_flush(tms57002_t *s);
diff --git a/src/emu/cpu/tms7000/tms7000.c b/src/emu/cpu/tms7000/tms7000.c
index 3d74a310675..ab83457b2e9 100644
--- a/src/emu/cpu/tms7000/tms7000.c
+++ b/src/emu/cpu/tms7000/tms7000.c
@@ -73,7 +73,7 @@ struct _tms7000_state
UINT8 rf[0x80]; /* Register file (SJE) */
UINT8 pf[0x100]; /* Perpherial file */
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
int icount;
@@ -91,7 +91,7 @@ INLINE tms7000_state *get_safe_token(running_device *device)
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_TMS7000 ||
cpu_get_type(device) == CPU_TMS7000_EXL);
- return (tms7000_state *)downcast<cpu_device *>(device)->token();
+ return (tms7000_state *)downcast<legacy_cpu_device *>(device)->token();
}
#define pPC cpustate->pc.w.l
diff --git a/src/emu/cpu/tms9900/99xxcore.h b/src/emu/cpu/tms9900/99xxcore.h
index 0dec954e622..6dc57309fce 100644
--- a/src/emu/cpu/tms9900/99xxcore.h
+++ b/src/emu/cpu/tms9900/99xxcore.h
@@ -436,7 +436,7 @@ struct _tms99xx_state
/* note that this callback is used by tms9900_set_irq_line(cpustate) and tms9980a_set_irq_line(cpustate) to
retreive the value on IC0-IC3 (non-standard behaviour) */
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
int icount;
@@ -514,7 +514,7 @@ INLINE tms99xx_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == TMS99XX_GET_INFO);
- return (tms99xx_state *)downcast<cpu_device *>(device)->token();
+ return (tms99xx_state *)downcast<legacy_cpu_device *>(device)->token();
}
#if (TMS99XX_MODEL == TMS9995_ID)
@@ -4631,7 +4631,7 @@ static CPU_SET_INFO( tms99xx )
* Generic get_info
**************************************************************************/
-void TMS99XX_GET_INFO(const device_config *devconfig, cpu_device *device, UINT32 state, cpuinfo *info)
+void TMS99XX_GET_INFO(const device_config *devconfig, legacy_cpu_device *device, UINT32 state, cpuinfo *info)
{
tms99xx_state *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL;
switch (state)
diff --git a/src/emu/cpu/unsp/unsp.c b/src/emu/cpu/unsp/unsp.c
index 70ae8967a71..4a94bac045e 100644
--- a/src/emu/cpu/unsp/unsp.c
+++ b/src/emu/cpu/unsp/unsp.c
@@ -15,7 +15,7 @@ INLINE unsp_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_UNSP);
- return (unsp_state *)downcast<cpu_device *>(device)->token();
+ return (unsp_state *)downcast<legacy_cpu_device *>(device)->token();
}
static void unsp_set_irq_line(unsp_state *unsp, int irqline, int state);
diff --git a/src/emu/cpu/unsp/unsp.h b/src/emu/cpu/unsp/unsp.h
index 11ddd4ea90e..229588bde40 100644
--- a/src/emu/cpu/unsp/unsp.h
+++ b/src/emu/cpu/unsp/unsp.h
@@ -23,7 +23,7 @@ struct _unsp_state
UINT8 sb;
UINT8 saved_sb;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
int icount;
diff --git a/src/emu/cpu/upd7810/upd7810.c b/src/emu/cpu/upd7810/upd7810.c
index 06b0a956f0b..cffd7f36362 100644
--- a/src/emu/cpu/upd7810/upd7810.c
+++ b/src/emu/cpu/upd7810/upd7810.c
@@ -499,7 +499,7 @@ struct _upd7810_state
void (*handle_timers)(upd7810_state *cpustate, int cycles);
UPD7810_CONFIG config;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
int icount;
@@ -514,7 +514,7 @@ INLINE upd7810_state *get_safe_token(running_device *device)
cpu_get_type(device) == CPU_UPD7801 ||
cpu_get_type(device) == CPU_UPD78C05 ||
cpu_get_type(device) == CPU_UPD78C06);
- return (upd7810_state *)downcast<cpu_device *>(device)->token();
+ return (upd7810_state *)downcast<legacy_cpu_device *>(device)->token();
}
#define CY 0x01
diff --git a/src/emu/cpu/v30mz/v30mz.c b/src/emu/cpu/v30mz/v30mz.c
index 76b65c863e0..0c5e268a837 100644
--- a/src/emu/cpu/v30mz/v30mz.c
+++ b/src/emu/cpu/v30mz/v30mz.c
@@ -84,7 +84,7 @@ struct _v30mz_state
UINT8 no_interrupt;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
int icount;
@@ -106,7 +106,7 @@ INLINE v30mz_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_V30MZ);
- return (v30mz_state *)downcast<cpu_device *>(device)->token();
+ return (v30mz_state *)downcast<legacy_cpu_device *>(device)->token();
}
/***************************************************************************/
@@ -932,7 +932,7 @@ static CPU_DISASSEMBLE( nec )
return necv_dasm_one(buffer, pc, oprom, cpustate->config);
}
-static void nec_init(cpu_device *device, device_irq_callback irqcallback, int type)
+static void nec_init(legacy_cpu_device *device, device_irq_callback irqcallback, int type)
{
v30mz_state *cpustate = get_safe_token(device);
diff --git a/src/emu/cpu/v60/v60.c b/src/emu/cpu/v60/v60.c
index 4dfe2b1645e..c77bc6f1457 100644
--- a/src/emu/cpu/v60/v60.c
+++ b/src/emu/cpu/v60/v60.c
@@ -78,7 +78,7 @@ struct _v60_state
UINT8 irq_line;
UINT8 nmi_line;
device_irq_callback irq_cb;
- cpu_device * device;
+ legacy_cpu_device * device;
const address_space *program;
const address_space *io;
UINT32 PPC;
@@ -117,7 +117,7 @@ INLINE v60_state *get_safe_token(running_device *device)
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_V60 ||
cpu_get_type(device) == CPU_V70);
- return (v60_state *)downcast<cpu_device *>(device)->token();
+ return (v60_state *)downcast<legacy_cpu_device *>(device)->token();
}
/*
@@ -311,7 +311,7 @@ static UINT32 opUNHANDLED(v60_state *cpustate)
// Opcode jump table
#include "optable.c"
-static void base_init(cpu_device *device, device_irq_callback irqcallback)
+static void base_init(legacy_cpu_device *device, device_irq_callback irqcallback)
{
v60_state *cpustate = get_safe_token(device);
diff --git a/src/emu/cpu/v810/v810.c b/src/emu/cpu/v810/v810.c
index d1690c20d7a..7a50be93fd0 100644
--- a/src/emu/cpu/v810/v810.c
+++ b/src/emu/cpu/v810/v810.c
@@ -30,7 +30,7 @@ struct _v810_state
UINT8 irq_line;
UINT8 nmi_line;
device_irq_callback irq_cb;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
UINT32 PPC;
@@ -42,7 +42,7 @@ INLINE v810_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_V810);
- return (v810_state *)downcast<cpu_device *>(device)->token();
+ return (v810_state *)downcast<legacy_cpu_device *>(device)->token();
}
#define R0 reg[0]
diff --git a/src/emu/cpu/z180/z180.c b/src/emu/cpu/z180/z180.c
index 2f3da15f981..81698c2d9b7 100644
--- a/src/emu/cpu/z180/z180.c
+++ b/src/emu/cpu/z180/z180.c
@@ -139,7 +139,7 @@ struct _z180_state
UINT8 dma1_cnt; /* dma1 counter / divide by 20 */
z80_daisy_chain daisy;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *iospace;
UINT8 rtemp;
@@ -154,7 +154,7 @@ INLINE z180_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_Z180);
- return (z180_state *)downcast<cpu_device *>(device)->token();
+ return (z180_state *)downcast<legacy_cpu_device *>(device)->token();
}
static void set_irq_line(z180_state *cpustate, int irqline, int state);
diff --git a/src/emu/cpu/z8/z8.c b/src/emu/cpu/z8/z8.c
index 2e43c3822d9..a903e91b591 100644
--- a/src/emu/cpu/z8/z8.c
+++ b/src/emu/cpu/z8/z8.c
@@ -198,7 +198,7 @@ INLINE z8_state *get_safe_token(running_device *device)
assert((cpu_get_type(device) == CPU_Z8601) ||
(cpu_get_type(device) == CPU_UB8830D) ||
(cpu_get_type(device) == CPU_Z8611));
- return (z8_state *)downcast<cpu_device *>(device)->token();
+ return (z8_state *)downcast<legacy_cpu_device *>(device)->token();
}
INLINE UINT8 fetch(z8_state *cpustate)
diff --git a/src/emu/cpu/z80/z80.c b/src/emu/cpu/z80/z80.c
index a027f1399d4..377ca95e507 100644
--- a/src/emu/cpu/z80/z80.c
+++ b/src/emu/cpu/z80/z80.c
@@ -149,7 +149,7 @@ struct _z80_state
UINT8 after_ei; /* are we in the EI shadow? */
UINT32 ea;
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
int icount;
@@ -168,7 +168,7 @@ INLINE z80_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_Z80 || cpu_get_type(device) == CPU_NSC800);
- return (z80_state *)downcast<cpu_device *>(device)->token();
+ return (z80_state *)downcast<legacy_cpu_device *>(device)->token();
}
#define CF 0x01
diff --git a/src/emu/cpu/z8000/z8000.c b/src/emu/cpu/z8000/z8000.c
index b1065b1a04c..8c81dd39bf8 100644
--- a/src/emu/cpu/z8000/z8000.c
+++ b/src/emu/cpu/z8000/z8000.c
@@ -82,7 +82,7 @@ struct _z8000_state
int nmi_state; /* NMI line state */
int irq_state[2]; /* IRQ line states (NVI, VI) */
device_irq_callback irq_callback;
- cpu_device *device;
+ legacy_cpu_device *device;
const address_space *program;
const address_space *io;
int icount;
@@ -95,7 +95,7 @@ INLINE z8000_state *get_safe_token(running_device *device)
assert(device != NULL);
assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_Z8001 || cpu_get_type(device) == CPU_Z8002);
- return (z8000_state *)downcast<cpu_device *>(device)->token();
+ return (z8000_state *)downcast<legacy_cpu_device *>(device)->token();
}
/* opcode execution table */
diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c
index 40be8c38b09..2996d9ac6cf 100644
--- a/src/emu/debug/debugcpu.c
+++ b/src/emu/debug/debugcpu.c
@@ -359,7 +359,7 @@ offs_t debug_cpu_disassemble(device_t *device, char *buffer, offs_t pc, const UI
/* check for disassembler override */
if (cpudebug->dasm_override != NULL)
- result = (*cpudebug->dasm_override)(cpudebug->cpudevice, buffer, pc, oprom, opram, 0);
+ result = (*cpudebug->dasm_override)(downcast<legacy_cpu_device *>(cpudebug->cpudevice), buffer, pc, oprom, opram, 0);
/* if we have a disassembler, run it */
if (result == 0)
diff --git a/src/emu/devcpu.c b/src/emu/devcpu.c
index b44d58f8424..b6bf588f690 100644
--- a/src/emu/devcpu.c
+++ b/src/emu/devcpu.c
@@ -54,7 +54,17 @@ cpu_device_config::cpu_device_config(const machine_config &mconfig, device_type
device_config_execute_interface(mconfig, *this),
device_config_memory_interface(mconfig, *this),
device_config_state_interface(mconfig, *this),
- device_config_disasm_interface(mconfig, *this),
+ device_config_disasm_interface(mconfig, *this)
+{
+}
+
+
+//-------------------------------------------------
+// legacy_cpu_device_config - constructor
+//-------------------------------------------------
+
+legacy_cpu_device_config::legacy_cpu_device_config(const machine_config &mconfig, device_type _type, const char *_tag, const device_config *_owner, UINT32 _clock)
+ : cpu_device_config(mconfig, _type, _tag, _owner, _clock),
m_cputype(NULL)
{
memset(m_space_config, 0, sizeof(m_space_config));
@@ -65,9 +75,9 @@ cpu_device_config::cpu_device_config(const machine_config &mconfig, device_type
// static_alloc_device_config - static allocator
//-------------------------------------------------
-device_config *cpu_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
+device_config *legacy_cpu_device_config::static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
{
- return global_alloc(cpu_device_config(mconfig, static_alloc_device_config, tag, owner, clock));
+ return global_alloc(legacy_cpu_device_config(mconfig, static_alloc_device_config, tag, owner, clock));
}
@@ -76,9 +86,9 @@ device_config *cpu_device_config::static_alloc_device_config(const machine_confi
// provided configuration
//-------------------------------------------------
-device_t *cpu_device_config::alloc_device(running_machine &machine) const
+device_t *legacy_cpu_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, cpu_device(machine, *this));
+ return auto_alloc(&machine, legacy_cpu_device(machine, *this));
}
@@ -87,7 +97,7 @@ device_t *cpu_device_config::alloc_device(running_machine &machine) const
// config callback for populating class data
//-------------------------------------------------
-bool cpu_device_config::device_process_token(UINT32 entrytype, const machine_config_token *&tokens)
+bool legacy_cpu_device_config::device_process_token(UINT32 entrytype, const machine_config_token *&tokens)
{
switch (entrytype)
{
@@ -122,7 +132,7 @@ bool cpu_device_config::device_process_token(UINT32 entrytype, const machine_con
// clock into cycles per second
//-------------------------------------------------
-UINT32 cpu_device_config::execute_clocks_to_cycles(UINT32 clocks) const
+UINT32 legacy_cpu_device_config::execute_clocks_to_cycles(UINT32 clocks) const
{
UINT32 multiplier = get_legacy_config_int(CPUINFO_INT_CLOCK_MULTIPLIER);
UINT32 divider = get_legacy_config_int(CPUINFO_INT_CLOCK_DIVIDER);
@@ -139,7 +149,7 @@ UINT32 cpu_device_config::execute_clocks_to_cycles(UINT32 clocks) const
// count back to raw clocks
//-------------------------------------------------
-UINT32 cpu_device_config::execute_cycles_to_clocks(UINT32 cycles) const
+UINT32 legacy_cpu_device_config::execute_cycles_to_clocks(UINT32 cycles) const
{
UINT32 multiplier = get_legacy_config_int(CPUINFO_INT_CLOCK_MULTIPLIER);
UINT32 divider = get_legacy_config_int(CPUINFO_INT_CLOCK_DIVIDER);
@@ -156,7 +166,7 @@ UINT32 cpu_device_config::execute_cycles_to_clocks(UINT32 cycles) const
// integer value
//-------------------------------------------------
-INT64 cpu_device_config::get_legacy_config_int(UINT32 state) const
+INT64 legacy_cpu_device_config::get_legacy_config_int(UINT32 state) const
{
cpuinfo info = { 0 };
(*m_cputype)(this, NULL, state, &info);
@@ -169,7 +179,7 @@ INT64 cpu_device_config::get_legacy_config_int(UINT32 state) const
// pointer value
//-------------------------------------------------
-void *cpu_device_config::get_legacy_config_ptr(UINT32 state) const
+void *legacy_cpu_device_config::get_legacy_config_ptr(UINT32 state) const
{
cpuinfo info = { 0 };
(*m_cputype)(this, NULL, state, &info);
@@ -182,7 +192,7 @@ void *cpu_device_config::get_legacy_config_ptr(UINT32 state) const
// function value
//-------------------------------------------------
-genf *cpu_device_config::get_legacy_config_fct(UINT32 state) const
+genf *legacy_cpu_device_config::get_legacy_config_fct(UINT32 state) const
{
cpuinfo info = { 0 };
(*m_cputype)(this, NULL, state, &info);
@@ -195,7 +205,7 @@ genf *cpu_device_config::get_legacy_config_fct(UINT32 state) const
// string value
//-------------------------------------------------
-const char *cpu_device_config::get_legacy_config_string(UINT32 state) const
+const char *legacy_cpu_device_config::get_legacy_config_string(UINT32 state) const
{
cpuinfo info;
info.s = get_temp_string_buffer();
@@ -219,7 +229,26 @@ cpu_device::cpu_device(running_machine &machine, const cpu_device_config &config
device_memory_interface(machine, config, *this),
device_state_interface(machine, config, *this),
device_disasm_interface(machine, config, *this),
- m_debug(NULL),
+ m_debug(NULL)
+{
+}
+
+
+//-------------------------------------------------
+// cpu_device - destructor
+//-------------------------------------------------
+
+cpu_device::~cpu_device()
+{
+}
+
+
+//-------------------------------------------------
+// legacy_cpu_device - constructor
+//-------------------------------------------------
+
+legacy_cpu_device::legacy_cpu_device(running_machine &machine, const legacy_cpu_device_config &config)
+ : cpu_device(machine, config),
m_cpu_config(config),
m_token(NULL),
m_set_info(reinterpret_cast<cpu_set_info_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_SET_INFO))),
@@ -248,10 +277,10 @@ cpu_device::cpu_device(running_machine &machine, const cpu_device_config &config
//-------------------------------------------------
-// cpu_device - destructor
+// legacy_cpu_device - destructor
//-------------------------------------------------
-cpu_device::~cpu_device()
+legacy_cpu_device::~legacy_cpu_device()
{
// call the CPU's exit function if present
if (m_exit != NULL)
@@ -263,7 +292,7 @@ cpu_device::~cpu_device()
// device_start - start up the device
//-------------------------------------------------
-void cpu_device::device_start()
+void legacy_cpu_device::device_start()
{
// standard init
cpu_init_func init = reinterpret_cast<cpu_init_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_INIT));
@@ -317,7 +346,7 @@ void cpu_device::device_start()
// device_reset - reset up the device
//-------------------------------------------------
-void cpu_device::device_reset()
+void legacy_cpu_device::device_reset()
{
cpu_reset_func reset = reinterpret_cast<cpu_reset_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_RESET));
if (reset != NULL)
@@ -330,7 +359,7 @@ void cpu_device::device_reset()
// cycles
//-------------------------------------------------
-void cpu_device::execute_run()
+void legacy_cpu_device::execute_run()
{
(*m_execute)(this);
}
@@ -340,7 +369,7 @@ void cpu_device::execute_run()
// execute_burn - burn the requested number of cycles
//-------------------------------------------------
-void cpu_device::execute_burn(INT32 cycles)
+void legacy_cpu_device::execute_burn(INT32 cycles)
{
if (m_burn != NULL)
(*m_burn)(this, cycles);
@@ -352,7 +381,7 @@ void cpu_device::execute_burn(INT32 cycles)
// on the provided address
//-------------------------------------------------
-bool cpu_device::memory_translate(int spacenum, int intention, offs_t &address)
+bool legacy_cpu_device::memory_translate(int spacenum, int intention, offs_t &address)
{
if (m_translate != NULL)
return (*m_translate)(this, spacenum, intention, &address) ? true : false;
@@ -365,7 +394,7 @@ bool cpu_device::memory_translate(int spacenum, int intention, offs_t &address)
// device specific overrides
//-------------------------------------------------
-bool cpu_device::memory_read(int spacenum, offs_t offset, int size, UINT64 &value)
+bool legacy_cpu_device::memory_read(int spacenum, offs_t offset, int size, UINT64 &value)
{
if (m_read != NULL)
return (*m_read)(this, spacenum, offset, size, &value) ? true : false;
@@ -378,7 +407,7 @@ bool cpu_device::memory_read(int spacenum, offs_t offset, int size, UINT64 &valu
// for device specific overrides
//-------------------------------------------------
-bool cpu_device::memory_write(int spacenum, offs_t offset, int size, UINT64 value)
+bool legacy_cpu_device::memory_write(int spacenum, offs_t offset, int size, UINT64 value)
{
if (m_write != NULL)
return (*m_write)(this, spacenum, offset, size, value) ? true : false;
@@ -391,7 +420,7 @@ bool cpu_device::memory_write(int spacenum, offs_t offset, int size, UINT64 valu
// allowing for device specific overrides
//-------------------------------------------------
-bool cpu_device::memory_readop(offs_t offset, int size, UINT64 &value)
+bool legacy_cpu_device::memory_readop(offs_t offset, int size, UINT64 &value)
{
if (m_readop != NULL)
return (*m_readop)(this, offset, size, &value) ? true : false;
@@ -404,7 +433,7 @@ bool cpu_device::memory_readop(offs_t offset, int size, UINT64 &value)
// debugging commands or state
//-------------------------------------------------
-void cpu_device::device_debug_setup()
+void legacy_cpu_device::device_debug_setup()
{
cpu_debug_init_func init = reinterpret_cast<cpu_debug_init_func>(m_cpu_config.get_legacy_config_fct(CPUINFO_FCT_DEBUG_INIT));
if (init != NULL)
@@ -417,7 +446,7 @@ void cpu_device::device_debug_setup()
// data to a buffer
//-------------------------------------------------
-offs_t cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
+offs_t legacy_cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
{
// if we have a callback, just use that
if (m_disassemble != NULL)
@@ -453,7 +482,7 @@ offs_t cpu_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *opro
// function to retrieve an integer value
//-------------------------------------------------
-INT64 cpu_device::get_legacy_runtime_int(UINT32 state)
+INT64 legacy_cpu_device::get_legacy_runtime_int(UINT32 state)
{
cpuinfo info = { 0 };
(*m_cpu_config.m_cputype)(&m_cpu_config, this, state, &info);
@@ -466,7 +495,7 @@ INT64 cpu_device::get_legacy_runtime_int(UINT32 state)
// function to retrieve a pointer value
//-------------------------------------------------
-void *cpu_device::get_legacy_runtime_ptr(UINT32 state)
+void *legacy_cpu_device::get_legacy_runtime_ptr(UINT32 state)
{
cpuinfo info = { 0 };
(*m_cpu_config.m_cputype)(&m_cpu_config, this, state, &info);
@@ -479,7 +508,7 @@ void *cpu_device::get_legacy_runtime_ptr(UINT32 state)
// function to retrieve a string value
//-------------------------------------------------
-const char *cpu_device::get_legacy_runtime_string(UINT32 state)
+const char *legacy_cpu_device::get_legacy_runtime_string(UINT32 state)
{
cpuinfo info;
info.s = get_temp_string_buffer();
@@ -493,7 +522,7 @@ const char *cpu_device::get_legacy_runtime_string(UINT32 state)
// function to set an integer value
//-------------------------------------------------
-void cpu_device::set_legacy_runtime_int(UINT32 state, INT64 value)
+void legacy_cpu_device::set_legacy_runtime_int(UINT32 state, INT64 value)
{
cpuinfo info = { 0 };
info.i = value;
@@ -502,7 +531,7 @@ void cpu_device::set_legacy_runtime_int(UINT32 state, INT64 value)
-void cpu_device::state_import(const device_state_entry &entry)
+void legacy_cpu_device::state_import(const device_state_entry &entry)
{
if (m_using_legacy_state)
{
@@ -516,7 +545,7 @@ void cpu_device::state_import(const device_state_entry &entry)
}
-void cpu_device::state_export(const device_state_entry &entry)
+void legacy_cpu_device::state_export(const device_state_entry &entry)
{
if (m_using_legacy_state)
{
@@ -535,7 +564,7 @@ void cpu_device::state_export(const device_state_entry &entry)
}
-void cpu_device::state_string_export(const device_state_entry &entry, astring &string)
+void legacy_cpu_device::state_string_export(const device_state_entry &entry, astring &string)
{
if (m_using_legacy_state)
{
diff --git a/src/emu/devcpu.h b/src/emu/devcpu.h
index 693bf3ceb06..81bd1d3ea3f 100644
--- a/src/emu/devcpu.h
+++ b/src/emu/devcpu.h
@@ -111,22 +111,22 @@ enum
CPUINFO_FCT_FIRST = DEVINFO_FCT_FIRST,
// CPU-specific additions
- CPUINFO_FCT_SET_INFO = DEVINFO_FCT_CLASS_SPECIFIC, // R/O: void (*set_info)(cpu_device *device, UINT32 state, INT64 data, void *ptr)
- CPUINFO_FCT_INIT, // R/O: void (*init)(cpu_device *device, int index, int clock, int (*irqcallback)(cpu_device *device, int))
- CPUINFO_FCT_RESET, // R/O: void (*reset)(cpu_device *device)
- CPUINFO_FCT_EXIT, // R/O: void (*exit)(cpu_device *device)
- CPUINFO_FCT_EXECUTE, // R/O: int (*execute)(cpu_device *device, int cycles)
- CPUINFO_FCT_BURN, // R/O: void (*burn)(cpu_device *device, int cycles)
- CPUINFO_FCT_DISASSEMBLE, // R/O: offs_t (*disassemble)(cpu_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options)
- CPUINFO_FCT_TRANSLATE, // R/O: int (*translate)(cpu_device *device, int space, int intention, offs_t *address)
- CPUINFO_FCT_READ, // R/O: int (*read)(cpu_device *device, int space, UINT32 offset, int size, UINT64 *value)
- CPUINFO_FCT_WRITE, // R/O: int (*write)(cpu_device *device, int space, UINT32 offset, int size, UINT64 value)
- CPUINFO_FCT_READOP, // R/O: int (*readop)(cpu_device *device, UINT32 offset, int size, UINT64 *value)
- CPUINFO_FCT_DEBUG_INIT, // R/O: void (*debug_init)(cpu_device *device)
- CPUINFO_FCT_IMPORT_STATE, // R/O: void (*import_state)(cpu_device *device, void *baseptr, const cpu_state_entry *entry)
- CPUINFO_FCT_EXPORT_STATE, // R/O: void (*export_state)(cpu_device *device, void *baseptr, const cpu_state_entry *entry)
- CPUINFO_FCT_IMPORT_STRING, // R/O: void (*import_string)(cpu_device *device, void *baseptr, const cpu_state_entry *entry, const char *format, char *string)
- CPUINFO_FCT_EXPORT_STRING, // R/O: void (*export_string)(cpu_device *device, void *baseptr, const cpu_state_entry *entry, const char *format, char *string)
+ CPUINFO_FCT_SET_INFO = DEVINFO_FCT_CLASS_SPECIFIC, // R/O: void (*set_info)(legacy_cpu_device *device, UINT32 state, INT64 data, void *ptr)
+ CPUINFO_FCT_INIT, // R/O: void (*init)(legacy_cpu_device *device, int index, int clock, int (*irqcallback)(legacy_cpu_device *device, int))
+ CPUINFO_FCT_RESET, // R/O: void (*reset)(legacy_cpu_device *device)
+ CPUINFO_FCT_EXIT, // R/O: void (*exit)(legacy_cpu_device *device)
+ CPUINFO_FCT_EXECUTE, // R/O: int (*execute)(legacy_cpu_device *device, int cycles)
+ CPUINFO_FCT_BURN, // R/O: void (*burn)(legacy_cpu_device *device, int cycles)
+ 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)
+ CPUINFO_FCT_TRANSLATE, // R/O: int (*translate)(legacy_cpu_device *device, int space, int intention, offs_t *address)
+ CPUINFO_FCT_READ, // R/O: int (*read)(legacy_cpu_device *device, int space, UINT32 offset, int size, UINT64 *value)
+ CPUINFO_FCT_WRITE, // R/O: int (*write)(legacy_cpu_device *device, int space, UINT32 offset, int size, UINT64 value)
+ CPUINFO_FCT_READOP, // R/O: int (*readop)(legacy_cpu_device *device, UINT32 offset, int size, UINT64 *value)
+ CPUINFO_FCT_DEBUG_INIT, // R/O: void (*debug_init)(legacy_cpu_device *device)
+ CPUINFO_FCT_IMPORT_STATE, // R/O: void (*import_state)(legacy_cpu_device *device, void *baseptr, const cpu_state_entry *entry)
+ CPUINFO_FCT_EXPORT_STATE, // R/O: void (*export_state)(legacy_cpu_device *device, void *baseptr, const cpu_state_entry *entry)
+ CPUINFO_FCT_IMPORT_STRING, // R/O: void (*import_string)(legacy_cpu_device *device, void *baseptr, const cpu_state_entry *entry, const char *format, char *string)
+ CPUINFO_FCT_EXPORT_STRING, // R/O: void (*export_string)(legacy_cpu_device *device, void *baseptr, const cpu_state_entry *entry, const char *format, char *string)
CPUINFO_FCT_CPU_SPECIFIC = DEVINFO_FCT_DEVICE_SPECIFIC, // R/W: CPU-specific values start here
@@ -187,67 +187,67 @@ enum
// CPU interface functions
#define CPU_GET_INFO_NAME(name) cpu_get_info_##name
-#define CPU_GET_INFO(name) void CPU_GET_INFO_NAME(name)(const device_config *devconfig, cpu_device *device, UINT32 state, cpuinfo *info)
+#define CPU_GET_INFO(name) void CPU_GET_INFO_NAME(name)(const device_config *devconfig, legacy_cpu_device *device, UINT32 state, cpuinfo *info)
#define CPU_GET_INFO_CALL(name) CPU_GET_INFO_NAME(name)(devconfig, device, state, info)
#define CPU_SET_INFO_NAME(name) cpu_set_info_##name
-#define CPU_SET_INFO(name) void CPU_SET_INFO_NAME(name)(cpu_device *device, UINT32 state, cpuinfo *info)
+#define CPU_SET_INFO(name) void CPU_SET_INFO_NAME(name)(legacy_cpu_device *device, UINT32 state, cpuinfo *info)
#define CPU_SET_INFO_CALL(name) CPU_SET_INFO_NAME(name)(device, state, info)
#define CPU_INIT_NAME(name) cpu_init_##name
-#define CPU_INIT(name) void CPU_INIT_NAME(name)(cpu_device *device, device_irq_callback irqcallback)
+#define CPU_INIT(name) void CPU_INIT_NAME(name)(legacy_cpu_device *device, device_irq_callback irqcallback)
#define CPU_INIT_CALL(name) CPU_INIT_NAME(name)(device, irqcallback)
#define CPU_RESET_NAME(name) cpu_reset_##name
-#define CPU_RESET(name) void CPU_RESET_NAME(name)(cpu_device *device)
+#define CPU_RESET(name) void CPU_RESET_NAME(name)(legacy_cpu_device *device)
#define CPU_RESET_CALL(name) CPU_RESET_NAME(name)(device)
#define CPU_EXIT_NAME(name) cpu_exit_##name
-#define CPU_EXIT(name) void CPU_EXIT_NAME(name)(cpu_device *device)
+#define CPU_EXIT(name) void CPU_EXIT_NAME(name)(legacy_cpu_device *device)
#define CPU_EXIT_CALL(name) CPU_EXIT_NAME(name)(device)
#define CPU_EXECUTE_NAME(name) cpu_execute_##name
-#define CPU_EXECUTE(name) void CPU_EXECUTE_NAME(name)(cpu_device *device)
+#define CPU_EXECUTE(name) void CPU_EXECUTE_NAME(name)(legacy_cpu_device *device)
#define CPU_EXECUTE_CALL(name) CPU_EXECUTE_NAME(name)(device, cycles)
#define CPU_BURN_NAME(name) cpu_burn_##name
-#define CPU_BURN(name) void CPU_BURN_NAME(name)(cpu_device *device, int cycles)
+#define CPU_BURN(name) void CPU_BURN_NAME(name)(legacy_cpu_device *device, int cycles)
#define CPU_BURN_CALL(name) CPU_BURN_NAME(name)(device, cycles)
#define CPU_TRANSLATE_NAME(name) cpu_translate_##name
-#define CPU_TRANSLATE(name) int CPU_TRANSLATE_NAME(name)(cpu_device *device, int space, int intention, offs_t *address)
+#define CPU_TRANSLATE(name) int CPU_TRANSLATE_NAME(name)(legacy_cpu_device *device, int space, int intention, offs_t *address)
#define CPU_TRANSLATE_CALL(name) CPU_TRANSLATE_NAME(name)(device, space, intention, address)
#define CPU_READ_NAME(name) cpu_read_##name
-#define CPU_READ(name) int CPU_READ_NAME(name)(cpu_device *device, int space, UINT32 offset, int size, UINT64 *value)
+#define CPU_READ(name) int CPU_READ_NAME(name)(legacy_cpu_device *device, int space, UINT32 offset, int size, UINT64 *value)
#define CPU_READ_CALL(name) CPU_READ_NAME(name)(device, space, offset, size, value)
#define CPU_WRITE_NAME(name) cpu_write_##name
-#define CPU_WRITE(name) int CPU_WRITE_NAME(name)(cpu_device *device, int space, UINT32 offset, int size, UINT64 value)
+#define CPU_WRITE(name) int CPU_WRITE_NAME(name)(legacy_cpu_device *device, int space, UINT32 offset, int size, UINT64 value)
#define CPU_WRITE_CALL(name) CPU_WRITE_NAME(name)(device, space, offset, size, value)
#define CPU_READOP_NAME(name) cpu_readop_##name
-#define CPU_READOP(name) int CPU_READOP_NAME(name)(cpu_device *device, UINT32 offset, int size, UINT64 *value)
+#define CPU_READOP(name) int CPU_READOP_NAME(name)(legacy_cpu_device *device, UINT32 offset, int size, UINT64 *value)
#define CPU_READOP_CALL(name) CPU_READOP_NAME(name)(device, offset, size, value)
#define CPU_DEBUG_INIT_NAME(name) cpu_debug_init_##name
-#define CPU_DEBUG_INIT(name) void CPU_DEBUG_INIT_NAME(name)(cpu_device *device)
+#define CPU_DEBUG_INIT(name) void CPU_DEBUG_INIT_NAME(name)(legacy_cpu_device *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) offs_t CPU_DISASSEMBLE_NAME(name)(cpu_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options)
+#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)
#define CPU_DISASSEMBLE_CALL(name) CPU_DISASSEMBLE_NAME(name)(device, buffer, pc, oprom, opram, options)
#define CPU_IMPORT_STATE_NAME(name) cpu_state_import_##name
-#define CPU_IMPORT_STATE(name) void CPU_IMPORT_STATE_NAME(name)(cpu_device *device, const device_state_entry &entry)
+#define CPU_IMPORT_STATE(name) void CPU_IMPORT_STATE_NAME(name)(legacy_cpu_device *device, const device_state_entry &entry)
#define CPU_IMPORT_STATE_CALL(name) CPU_IMPORT_STATE_NAME(name)(device, entry)
#define CPU_EXPORT_STATE_NAME(name) cpu_state_export_##name
-#define CPU_EXPORT_STATE(name) void CPU_EXPORT_STATE_NAME(name)(cpu_device *device, const device_state_entry &entry)
+#define CPU_EXPORT_STATE(name) void CPU_EXPORT_STATE_NAME(name)(legacy_cpu_device *device, const device_state_entry &entry)
#define CPU_EXPORT_STATE_CALL(name) CPU_EXPORT_STATE_NAME(name)(device, entry)
#define CPU_EXPORT_STRING_NAME(name) cpu_string_export_##name
-#define CPU_EXPORT_STRING(name) void CPU_EXPORT_STRING_NAME(name)(cpu_device *device, const device_state_entry &entry, astring &string)
+#define CPU_EXPORT_STRING(name) void CPU_EXPORT_STRING_NAME(name)(legacy_cpu_device *device, const device_state_entry &entry, astring &string)
#define CPU_EXPORT_STRING_CALL(name) CPU_EXPORT_STRING_NAME(name)(device, entry, string)
@@ -323,26 +323,27 @@ enum
// forward declaration of types
union cpuinfo;
class cpu_device;
+class legacy_cpu_device;
struct cpu_state_entry;
class cpu_debug_data;
// CPU interface functions
-typedef void (*cpu_get_info_func)(const device_config *devconfig, cpu_device *device, UINT32 state, cpuinfo *info);
-typedef void (*cpu_set_info_func)(cpu_device *device, UINT32 state, cpuinfo *info);
-typedef void (*cpu_init_func)(cpu_device *device, device_irq_callback irqcallback);
-typedef void (*cpu_reset_func)(cpu_device *device);
-typedef void (*cpu_exit_func)(cpu_device *device);
-typedef void (*cpu_execute_func)(cpu_device *device);
-typedef void (*cpu_burn_func)(cpu_device *device, int cycles);
-typedef int (*cpu_translate_func)(cpu_device *device, int space, int intention, offs_t *address);
-typedef int (*cpu_read_func)(cpu_device *device, int space, UINT32 offset, int size, UINT64 *value);
-typedef int (*cpu_write_func)(cpu_device *device, int space, UINT32 offset, int size, UINT64 value);
-typedef int (*cpu_readop_func)(cpu_device *device, UINT32 offset, int size, UINT64 *value);
-typedef void (*cpu_debug_init_func)(cpu_device *device);
-typedef offs_t (*cpu_disassemble_func)(cpu_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options);
-typedef void (*cpu_state_io_func)(cpu_device *device, const device_state_entry &entry);
-typedef void (*cpu_string_io_func)(cpu_device *device, const device_state_entry &entry, astring &string);
+typedef void (*cpu_get_info_func)(const device_config *devconfig, legacy_cpu_device *device, UINT32 state, cpuinfo *info);
+typedef void (*cpu_set_info_func)(legacy_cpu_device *device, UINT32 state, cpuinfo *info);
+typedef void (*cpu_init_func)(legacy_cpu_device *device, device_irq_callback irqcallback);
+typedef void (*cpu_reset_func)(legacy_cpu_device *device);
+typedef void (*cpu_exit_func)(legacy_cpu_device *device);
+typedef void (*cpu_execute_func)(legacy_cpu_device *device);
+typedef void (*cpu_burn_func)(legacy_cpu_device *device, int cycles);
+typedef int (*cpu_translate_func)(legacy_cpu_device *device, int space, int intention, offs_t *address);
+typedef int (*cpu_read_func)(legacy_cpu_device *device, int space, UINT32 offset, int size, UINT64 *value);
+typedef int (*cpu_write_func)(legacy_cpu_device *device, int space, UINT32 offset, int size, UINT64 value);
+typedef int (*cpu_readop_func)(legacy_cpu_device *device, UINT32 offset, int size, UINT64 *value);
+typedef void (*cpu_debug_init_func)(legacy_cpu_device *device);
+typedef offs_t (*cpu_disassemble_func)(legacy_cpu_device *device, char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, int options);
+typedef void (*cpu_state_io_func)(legacy_cpu_device *device, const device_state_entry &entry);
+typedef void (*cpu_string_io_func)(legacy_cpu_device *device, const device_state_entry &entry, astring &string);
// a cpu_type is just a pointer to the CPU's get_info function
@@ -410,8 +411,21 @@ class cpu_device_config : public device_config,
{
friend class cpu_device;
+protected:
// construction/destruction
cpu_device_config(const machine_config &mconfig, device_type _type, const char *_tag, const device_config *_owner, UINT32 _clock);
+};
+
+
+
+// ======================> legacy_cpu_device_config
+
+class legacy_cpu_device_config : public cpu_device_config
+{
+ friend class legacy_cpu_device;
+
+ // construction/destruction
+ legacy_cpu_device_config(const machine_config &mconfig, device_type _type, const char *_tag, const device_config *_owner, UINT32 _clock);
public:
// allocators
@@ -453,7 +467,7 @@ protected:
address_space_config m_space_config[3]; // array of address space configs
};
-const device_type CPU = cpu_device_config::static_alloc_device_config;
+const device_type CPU = legacy_cpu_device_config::static_alloc_device_config;
@@ -465,15 +479,32 @@ class cpu_device : public device_t,
public device_state_interface,
public device_disasm_interface
{
-
friend class cpu_device_config;
friend resource_pool_object<cpu_device>::~resource_pool_object();
+protected:
// construction/destruction
cpu_device(running_machine &machine, const cpu_device_config &config);
virtual ~cpu_device();
public:
+ cpu_debug_data * m_debug; // debugging data
+};
+
+
+
+// ======================> legacy_cpu_device
+
+class legacy_cpu_device : public cpu_device
+{
+ friend class legacy_cpu_device_config;
+ friend resource_pool_object<legacy_cpu_device>::~resource_pool_object();
+
+ // construction/destruction
+ legacy_cpu_device(running_machine &machine, const legacy_cpu_device_config &config);
+ virtual ~legacy_cpu_device();
+
+public:
// additional CPU-specific configuration properties ... pass through to underlying config
cpu_type cputype() const { return m_cpu_config.m_cputype; }
@@ -510,12 +541,9 @@ protected:
const char *get_legacy_runtime_string(UINT32 state);
void set_legacy_runtime_int(UINT32 state, INT64 value);
-public:
- cpu_debug_data * m_debug; // debugging data
-
protected:
// internal state
- const cpu_device_config &m_cpu_config; // reference to the config
+ const legacy_cpu_device_config &m_cpu_config; // reference to the config
void * m_token; // pointer to our state
cpu_set_info_func m_set_info; // extracted legacy function pointers
@@ -546,7 +574,7 @@ protected:
// return the type of the specified CPU
inline cpu_type cpu_get_type(device_t *device)
{
- return downcast<cpu_device *>(device)->cputype();
+ return downcast<legacy_cpu_device *>(device)->cputype();
}
// return a pointer to the given CPU's debugger data
diff --git a/src/mame/drivers/stv.c b/src/mame/drivers/stv.c
index 72e3db7ff5d..5bab92fb0cf 100644
--- a/src/mame/drivers/stv.c
+++ b/src/mame/drivers/stv.c
@@ -188,6 +188,9 @@ static UINT8 *smpc_ram;
UINT32* stv_workram_l;
UINT32* stv_workram_h;
+cpu_device *stv_maincpu;
+cpu_device *stv_slave;
+cpu_device *stv_audiocpu;
static UINT32* stv_backupram;
static UINT32* ioga;
static UINT16* scsp_regs;
@@ -2590,6 +2593,10 @@ static MACHINE_START( stv )
mame_system_time systime;
mame_get_base_datetime(machine, &systime);
+ stv_maincpu = machine->device<cpu_device>("maincpu");
+ stv_slave = machine->device<cpu_device>("slave");
+ stv_audiocpu = machine->device<cpu_device>("audiocpu");
+
scsp_set_ram_base(devtag_get_device(machine, "scsp"), sound_ram);
// save states
diff --git a/src/mame/includes/stv.h b/src/mame/includes/stv.h
index 678ed675568..fd3b7f59a98 100644
--- a/src/mame/includes/stv.h
+++ b/src/mame/includes/stv.h
@@ -8,6 +8,10 @@ extern int stv_enable_slave_sh2;
extern int minit_boost,sinit_boost;
extern attotime minit_boost_timeslice, sinit_boost_timeslice;
+extern cpu_device *stv_maincpu;
+extern cpu_device *stv_slave;
+extern cpu_device *stv_audiocpu;
+
DRIVER_INIT ( stv );