diff --git a/src/emu/devcpu.h b/src/emu/devcpu.h index 431a13cb3de..7afee93543d 100644 --- a/src/emu/devcpu.h +++ b/src/emu/devcpu.h @@ -290,7 +290,6 @@ enum #define cpu_get_reg(cpu, _reg) device_state(cpu)->state_value(_reg) #define cpu_get_previouspc(cpu) ((offs_t)device_state(cpu)->state_value(STATE_GENPCBASE)) #define cpu_get_pc(cpu) ((offs_t)device_state(cpu)->state_value(STATE_GENPC)) -#define cpu_get_sp(cpu) ((offs_t)device_state(cpu)->state_value(STATE_GENSP)) #define cpu_set_reg(cpu, _reg, val) device_state(cpu)->state_set_value(_reg, val) diff --git a/src/mame/drivers/groundfx.c b/src/mame/drivers/groundfx.c index 638ee0587a4..38ea51c09f5 100644 --- a/src/mame/drivers/groundfx.c +++ b/src/mame/drivers/groundfx.c @@ -443,13 +443,15 @@ ROM_END static READ32_HANDLER( irq_speedup_r_groundfx ) { + cpu_device *cpu = downcast(space->cpu); int ptr; - if ((cpu_get_sp(space->cpu)&2)==0) ptr=groundfx_ram[(cpu_get_sp(space->cpu)&0x1ffff)/4]; - else ptr=(((groundfx_ram[(cpu_get_sp(space->cpu)&0x1ffff)/4])&0x1ffff)<<16) | - (groundfx_ram[((cpu_get_sp(space->cpu)&0x1ffff)/4)+1]>>16); + offs_t sp = cpu->sp(); + if ((sp&2)==0) ptr=groundfx_ram[(sp&0x1ffff)/4]; + else ptr=(((groundfx_ram[(sp&0x1ffff)/4])&0x1ffff)<<16) | + (groundfx_ram[((sp&0x1ffff)/4)+1]>>16); - if (cpu_get_pc(space->cpu)==0x1ece && ptr==0x1b9a) - cpu_spinuntil_int(space->cpu); + if (cpu->pc()==0x1ece && ptr==0x1b9a) + cpu->spin_until_interrupt(); return groundfx_ram[0xb574/4]; } diff --git a/src/mame/drivers/namcos22.c b/src/mame/drivers/namcos22.c index 24b9aa9496c..cf7050a42eb 100644 --- a/src/mame/drivers/namcos22.c +++ b/src/mame/drivers/namcos22.c @@ -2430,7 +2430,7 @@ static WRITE32_HANDLER( alpinesa_prot_w ) } #else int i; - unsigned sptr = cpu_get_sp(space->cpu); + unsigned sptr = downcast(space->cpu)->sp(); mAlpineSurferProtData = 0; for(i=0;i<4;i++) {