static READ16_HANDLER( ddp2_main_speedup_r ) { UINT16 data = pgm_mainram[0x0ee54/2]; int pc = cpu_get_pc(&space->device()); if (pc == 0x149dce) device_spin_until_interrupt(&space->device()); if (pc == 0x149cfe) device_spin_until_interrupt(&space->device()); return data; }
static WRITE32_HANDLER( speedup_w ) { policetr_state *state = space->machine().driver_data<policetr_state>(); COMBINE_DATA(state->m_speedup_data); /* see if the PC matches */ if ((cpu_get_previouspc(&space->device()) & 0x1fffffff) == state->m_speedup_pc) { UINT64 curr_cycles = space->machine().firstcpu->total_cycles(); /* if less than 50 cycles from the last time, count it */ if (curr_cycles - state->m_last_cycles < 50) { state->m_loop_count++; /* more than 2 in a row and we spin */ if (state->m_loop_count > 2) device_spin_until_interrupt(&space->device()); } else state->m_loop_count = 0; state->m_last_cycles = curr_cycles; } }
static READ32_HANDLER( kinst_control_r ) { kinst_state *state = space->machine().driver_data<kinst_state>(); UINT32 result; static const char *const portnames[] = { "P1", "P2", "VOLUME", "UNUSED", "DSW" }; /* apply shuffling */ offset = state->m_control_map[offset / 2]; result = state->m_control[offset]; switch (offset) { case 2: /* $90 -- sound return */ result = input_port_read(space->machine(), portnames[offset]); result &= ~0x0002; if (dcs_control_r(space->machine()) & 0x800) result |= 0x0002; break; case 0: /* $80 */ case 1: /* $88 */ case 3: /* $98 */ result = input_port_read(space->machine(), portnames[offset]); break; case 4: /* $a0 */ result = input_port_read(space->machine(), portnames[offset]); if (cpu_get_pc(&space->device()) == 0x802d428) device_spin_until_interrupt(&space->device()); break; } return result; }
static READ16_HANDLER( sub_cycle_r ) { superchs_state *state = space->machine().driver_data<superchs_state>(); if (cpu_get_pc(&space->device())==0x454) device_spin_until_interrupt(&space->device()); return state->m_ram[2]&0xffff; }
ROM_END READ32_MEMBER(gunbustr_state::main_cycle_r) { if (cpu_get_pc(&space.device())==0x55a && (m_ram[0x3acc/4]&0xff000000)==0) device_spin_until_interrupt(&space.device()); return m_ram[0x3acc/4]; }
ROM_END static READ32_HANDLER( main_cycle_r ) { gunbustr_state *state = space->machine().driver_data<gunbustr_state>(); if (cpu_get_pc(&space->device())==0x55a && (state->m_ram[0x3acc/4]&0xff000000)==0) device_spin_until_interrupt(&space->device()); return state->m_ram[0x3acc/4]; }
static READ16_HANDLER( thndzone_main_skip ) { dassault_state *state = space->machine().driver_data<dassault_state>(); int ret = state->m_ram[0]; if (cpu_get_pc(&space->device()) == 0x114c && ret & 0x8000) device_spin_until_interrupt(&space->device()); return ret; }
ROM_END static READ32_HANDLER( main_cycle_r ) { superchs_state *state = space->machine().driver_data<superchs_state>(); if (cpu_get_pc(&space->device())==0x702) device_spin_until_interrupt(&space->device()); return state->m_ram[0]; }
MACHINE_CONFIG_END READ32_MEMBER(calchase_state::calchase_idle_skip_r) { if(cpu_get_pc(&space.device())==0x1406f48) device_spin_until_interrupt(m_maincpu); return m_idle_skip_ram; }
static READ32_HANDLER( ddp2_speedup_r ) { pgm_arm_type2_state *state = space->machine().driver_data<pgm_arm_type2_state>(); int pc = cpu_get_pc(&space->device()); UINT32 data = state->m_arm_ram[0x300c/4]; if (pc==0x080109b4) { /* if we've hit the loop where this is read and both values are 0 then the only way out is an interrupt */ int r4 = (cpu_get_reg(&space->device(), ARM7_R4)); r4 += 0xe; if (r4==0x18002f9e) { UINT32 data2 = state->m_arm_ram[0x2F9C/4]&0xffff0000; if ((data==0x00000000) && (data2==0x00000000)) device_spin_until_interrupt(&space->device()); } } return data; }
ROM_END /************************************* * * Driver speedups * *************************************/ /* In-game hotspot @ 0180F8D8 */ READ32_MEMBER( beathead_state::speedup_r ) { int result = *m_speedup_data; if ((cpu_get_previouspc(&space.device()) & 0xfffff) == 0x006f0 && result == cpu_get_reg(&space.device(), ASAP_R3)) device_spin_until_interrupt(&space.device()); return result; }