static READ8_HANDLER( audio_io_r ) { badlands_state *state = space->machine->driver_data<badlands_state>(); int result = 0xff; switch (offset & 0x206) { case 0x000: /* n/c */ logerror("audio_io_r: Unknown read at %04X\n", offset & 0x206); break; case 0x002: /* /RDP */ result = atarigen_6502_sound_r(space, offset); break; case 0x004: /* /RDIO */ /* 0x80 = self test 0x40 = NMI line state (active low) 0x20 = sound output full 0x10 = self test 0x08 = +5V 0x04 = +5V 0x02 = coin 2 0x01 = coin 1 */ result = input_port_read(space->machine, "AUDIO"); if (!(input_port_read(space->machine, "FE4000") & 0x0080)) result ^= 0x90; if (state->cpu_to_sound_ready) result ^= 0x40; if (state->sound_to_cpu_ready) result ^= 0x20; result ^= 0x10; break; case 0x006: /* /IRQACK */ atarigen_6502_irq_ack_r(space, 0); break; case 0x200: /* /VOICE */ case 0x202: /* /WRP */ case 0x204: /* /WRIO */ case 0x206: /* /MIX */ logerror("audio_io_r: Unknown read at %04X\n", offset & 0x206); break; } return result; }
static READ_HANDLER( audio_io_r ) { int result = 0xff; switch (offset & 0x206) { case 0x000: /* n/c */ //logerror("audio_io_r: Unknown read at %04X\n", offset & 0x206); break; case 0x002: /* /RDP */ result = atarigen_6502_sound_r(offset); break; case 0x004: /* /RDIO */ /* 0x80 = self test 0x40 = NMI line state (active low) 0x20 = sound output full 0x10 = self test 0x08 = +5V 0x04 = +5V 0x02 = coin 2 0x01 = coin 1 */ result = readinputport(3); if (!(readinputport(0) & 0x0080)) result ^= 0x90; if (atarigen_cpu_to_sound_ready) result ^= 0x40; if (atarigen_sound_to_cpu_ready) result ^= 0x20; result ^= 0x10; break; case 0x006: /* /IRQACK */ atarigen_6502_irq_ack_r(0); break; case 0x200: /* /VOICE */ case 0x202: /* /WRP */ case 0x204: /* /WRIO */ case 0x206: /* /MIX */ //logerror("audio_io_r: Unknown read at %04X\n", offset & 0x206); break; } return result; }