summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/sh4/sh4.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/cpu/sh4/sh4.c')
-rw-r--r--src/emu/cpu/sh4/sh4.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c
index 11defd4522e..27f9b5f44f6 100644
--- a/src/emu/cpu/sh4/sh4.c
+++ b/src/emu/cpu/sh4/sh4.c
@@ -33,10 +33,9 @@ CPU_DISASSEMBLE( sh4 );
INLINE SH4 *get_safe_token(running_device *device)
{
assert(device != NULL);
- assert(device->token != NULL);
- assert(device->type == CPU);
+ assert(device->type() == CPU);
assert(cpu_get_type(device) == CPU_SH4);
- return (SH4 *)device->token;
+ return (SH4 *)downcast<cpu_device *>(device)->token();
}
/* Called for unimplemented opcodes */
@@ -3255,7 +3254,7 @@ static CPU_RESET( sh4 )
int savecpu_clock, savebus_clock, savepm_clock;
void (*f)(UINT32 data);
- cpu_irq_callback save_irqcallback;
+ device_irq_callback save_irqcallback;
m = sh4->m;
tsaved[0] = sh4->dma_timer[0];
@@ -3282,9 +3281,9 @@ static CPU_RESET( sh4 )
sh4->ftcsr_read_callback = f;
sh4->irq_callback = save_irqcallback;
sh4->device = device;
- sh4->internal = device->space(AS_PROGRAM);
- sh4->program = device->space(AS_PROGRAM);
- sh4->io = device->space(AS_IO);
+ sh4->internal = device_memory(device)->space(AS_PROGRAM);
+ sh4->program = device_memory(device)->space(AS_PROGRAM);
+ sh4->io = device_memory(device)->space(AS_IO);
sh4->dma_timer[0] = tsaved[0];
sh4->dma_timer[1] = tsaved[1];
@@ -3384,7 +3383,7 @@ static CPU_EXECUTE( sh4 )
static CPU_INIT( sh4 )
{
- const struct sh4_config *conf = (const struct sh4_config *)device->baseconfig().static_config;
+ const struct sh4_config *conf = (const struct sh4_config *)device->baseconfig().static_config();
SH4 *sh4 = get_safe_token(device);
sh4_common_init(device);
@@ -3393,9 +3392,9 @@ static CPU_INIT( sh4 )
sh4->irq_callback = irqcallback;
sh4->device = device;
- sh4->internal = device->space(AS_PROGRAM);
- sh4->program = device->space(AS_PROGRAM);
- sh4->io = device->space(AS_IO);
+ sh4->internal = device_memory(device)->space(AS_PROGRAM);
+ sh4->program = device_memory(device)->space(AS_PROGRAM);
+ sh4->io = device_memory(device)->space(AS_IO);
sh4_default_exception_priorities(sh4);
sh4->irln = 15;
sh4->test_irq = 0;
@@ -3675,7 +3674,7 @@ ADDRESS_MAP_END
CPU_GET_INFO( sh4 )
{
- SH4 *sh4 = (device != NULL && device->token != NULL) ? get_safe_token(device) : NULL;
+ SH4 *sh4 = (device != NULL && downcast<cpu_device *>(device)->token() != NULL) ? get_safe_token(device) : NULL;
switch (state)
{