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 READ32_HANDLER( kinst_control_r ) { UINT32 result; /* apply shuffling */ offset = control_map[offset / 2]; result = kinst_control[offset]; switch (offset) { case 2: /* $90 -- sound return */ result = 0xffff0000 | readinputport(offset); result &= ~0x0002; if (dcs_control_r() & 0x800) result |= 0x0002; break; case 0: /* $80 */ case 1: /* $88 */ case 3: /* $98 */ result = 0xffff0000 | readinputport(offset); break; case 4: /* $a0 */ result = 0xffff0000 | readinputport(offset); if (activecpu_get_pc() == 0x802d428) cpu_spinuntil_int(); break; } return result; }
static READ32_HANDLER( kinst_control_r ) { UINT32 result; static const char *const portnames[] = { "P1", "P2", "VOLUME", "UNUSED", "DSW" }; /* apply shuffling */ offset = control_map[offset / 2]; result = kinst_control[offset]; switch (offset) { case 2: /* $90 -- sound return */ result = input_port_read(space->machine, portnames[offset]); result &= ~0x0002; if (dcs_control_r() & 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->cpu) == 0x802d428) cpu_spinuntil_int(space->cpu); break; } return result; }