src/mess/machine/mbee.c
| r1806 | r1807 | |
| 123 | 123 | */ |
| 124 | 124 | READ8_HANDLER ( mbee_pio_r ) |
| 125 | 125 | { |
| 126 | | UINT8 data = (offset & 2) ? z80pio_c_r(0, offset & 1) : z80pio_d_r(0, offset & 1); |
| 127 | | if( offset != 2 ) |
| 128 | | return data; |
| 129 | | |
| 130 | | data |= 0x01; |
| 126 | UINT8 data=0; |
| 127 | if (offset == 0) return z80pio_d_r(0,0); |
| 128 | if (offset == 1) return z80pio_c_r(0,0); |
| 129 | if (offset == 3) return z80pio_c_r(0,1); |
| 130 | data = z80pio_d_r(0,1) | 1; |
| 131 | 131 | if (cassette_input(cassette_device_image()) > 0.03) |
| 132 | | data &= ~0x01; |
| 133 | | |
| 134 | | return data; |
| 132 | data &= ~1; |
| 133 | return data; |
| 135 | 134 | } |
| 136 | 135 | |
| 137 | 136 | WRITE8_HANDLER ( mbee_pio_w ) |
| 138 | 137 | { |
| 139 | | if (offset & 2) |
| 140 | | z80pio_c_w(0, offset & 1, data); |
| 141 | | else |
| 142 | | z80pio_d_w(0, offset & 1, data); |
| 138 | if (offset == 0) z80pio_d_w(0,0,data); |
| 139 | if (offset == 1) z80pio_c_w(0,0,data); |
| 140 | if (offset == 3) z80pio_c_w(0,1,data); |
| 143 | 141 | |
| 144 | 142 | if( offset == 2 ) |
| 145 | 143 | { |
| 144 | z80pio_d_w(0,1,data); |
| 145 | data = z80pio_p_r(0,1); |
| 146 | 146 | cassette_output(cassette_device_image(), (data & 0x02) ? -1.0 : +1.0); |
| 147 | | speaker_level_w(0, (data >> 6) & 1); |
| 147 | speaker_level_w(0, (data & 0x40) ? 1 : 0); |
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
| r1806 | r1807 | |
| 202 | 202 | |
| 203 | 203 | INTERRUPT_GEN( mbee_interrupt ) |
| 204 | 204 | { |
| 205 | | /* once per frame, pulse the PIO B bit 7 */ |
| 206 | | logerror("mbee interrupt\n"); |
| 205 | /* once per frame, pulse the PIO B bit 7 */ |
| 207 | 206 | z80pio_p_w(0, 1, 0x80); |
| 208 | | z80pio_p_w(0, 1, 0x00); |
| 207 | z80pio_p_w(0, 1, 0x00); |
| 209 | 208 | } |
| 210 | 209 | |
| 211 | 210 | DEVICE_LOAD( mbee_cart ) |