static READ16_HANDLER( pkgnshdx_input_r ) { UINT16 sel = ~realbrk_dsw_select[0]; switch(offset) { case 0x00/2: return 0xffff; case 0x02/2: return input_port_0_word_r(0,0);/*Service buttons*/ /*DSW,same handling as realbrk*/ case 0x04/2: if (sel & 0x01) return (input_port_1_word_r(0,0) & 0x00ff) << 8; // DSW1 low bits if (sel & 0x02) return (input_port_2_word_r(0,0) & 0x00ff) << 8; // DSW2 low bits if (sel & 0x04) return (input_port_3_word_r(0,0) & 0x00ff) << 8; // DSW3 low bits if (sel & 0x08) return (input_port_4_word_r(0,0) & 0x00ff) << 8; // DSW4 low bits if (sel & 0x10) return ((input_port_1_word_r(0,0) & 0x0300) << 0) | // DSWs high 2 bits ((input_port_2_word_r(0,0) & 0x0300) << 2) | ((input_port_3_word_r(0,0) & 0x0300) << 4) | ((input_port_4_word_r(0,0) & 0x0300) << 6) ; return 0xffff; case 0x06/2: return input_port_6_word_r(0,0);/*Buttons+Handle 2p*/ case 0x08/2: return input_port_5_word_r(0,0);/*Buttons+Handle 1p*/ case 0x0a/2: return 0xffff; case 0x0c/2: return 0xffff; case 0x0e/2: return 0xffff; case 0x10/2: return 0xffff; case 0x12/2: return 0xffff; } return 0xffff; }
static READ16_HANDLER( ioc_r ) { /* 20 (only once), 76, a0 are read in log */ switch (offset) { case 0x80/2: return input_port_0_word_r(0,mem_mask); /* DSW */ case 0x84/2: return input_port_1_word_r(0,mem_mask); /* IN0 */ case 0x86/2: return input_port_2_word_r(0,mem_mask); /* IN1 */ case 0x50: case 0x51: return OKIM6295_status_0_r(0)<<8; break; } /*logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",activecpu_get_pc(),offset); */ return gcpinbal_ioc_ram[offset]; }
static READ16_HANDLER( i_port1_r ) { if (control & 0x0080) return input_port_0_word_r(0,0); else return input_port_1_word_r(0,0); }
static UINT16 exterm_trackball_port_r(int which, UINT16 mem_mask) { UINT16 port; /* Read the fake input port */ UINT8 trackball_pos = readinputport(3 + which); /* Calculate the change from the last position. */ UINT8 trackball_diff = trackball_old[which] - trackball_pos; /* Store the new position for the next comparision. */ trackball_old[which] = trackball_pos; /* Move the sign bit to the high bit of the 6-bit trackball count. */ if (trackball_diff & 0x80) trackball_diff |= 0x20; /* Keep adding the changes. The counters will be reset later by a hardware write. */ aimpos[which] = (aimpos[which] + trackball_diff) & 0x3f; /* Combine it with the standard input bits */ port = which ? input_port_1_word_r(0, mem_mask) : input_port_0_word_r(0, mem_mask); return (port & 0xc0ff) | (aimpos[which] << 8); }
static READ16_HANDLER( darius_ioc_r ) { switch (offset) { case 0x01: return (taitosound_comm_r(0) & 0xff); /* sound interface read */ case 0x04: return input_port_0_word_r(0,mem_mask); /* IN0 */ case 0x05: return input_port_1_word_r(0,mem_mask); /* IN1 */ case 0x06: return input_port_2_word_r(0,mem_mask); /* IN2 */ case 0x07: return coin_word; /* bits 3&4 coin lockouts, must return zero */ case 0x08: return input_port_3_word_r(0,mem_mask); /* DSW */ } logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",activecpu_get_pc(),offset); return 0xff; }
static READ32_HANDLER( superchs_input_r ) { switch (offset) { case 0x00: return (input_port_0_word_r(0,0) << 16) | input_port_1_word_r(0,0) | (EEPROM_read_bit() << 7); case 0x01: return coin_word<<16; } return 0xffffffff; }
static READ16_HANDLER( pkgnsh_input_r ) { switch(offset) { case 0x00/2: return 0xffff; case 0x02/2: return 0xffff; case 0x04/2: return input_port_0_word_r(0,0);/*Service buttons*/ case 0x06/2: return input_port_1_word_r(0,0);/*DIP 2*/ case 0x08/2: return input_port_2_word_r(0,0);/*DIP 1*/ case 0x0a/2: return input_port_3_word_r(0,0);/*DIP 1+2 Hi-Bits*/ case 0x0c/2: return input_port_4_word_r(0,0);/*Handle 1p*/ case 0x0e/2: return input_port_5_word_r(0,0);/*Buttons 1p*/ case 0x10/2: return input_port_6_word_r(0,0);/*Handle 2p*/ case 0x12/2: return input_port_7_word_r(0,0);/*Buttons 2p*/ } return 0xffff; }
static READ16_HANDLER( control1_r ) { int res; /* bit 8 is EEPROM data */ /* bit 9 is EEPROM ready */ /* bit 10 is service button */ res = (EEPROM_read_bit()<<8) | input_port_1_word_r(0,0); if (init_eeprom_count) { init_eeprom_count--; res &= 0xfbff; } return res; }