src/mess/machine/ibmpc.c
| r2145 | r2146 | |
| 2 | 2 | #include "memconv.h" |
| 3 | 3 | #include "includes/ibmpc.h" |
| 4 | 4 | #include "devices/cassette.h" |
| 5 | #include "machine/pit8253.h" |
| 5 | 6 | |
| 6 | 7 | #include "machine/pcshare.h" |
| 7 | 8 | #include "audio/pc.h" |
| r2145 | r2146 | |
| 102 | 103 | int portc_switch_high; |
| 103 | 104 | int speaker; |
| 104 | 105 | int keyboard_disabled; |
| 106 | UINT8 portb; |
| 105 | 107 | } pc_ppi={ 0 }; |
| 106 | 108 | |
| 107 | 109 | READ8_HANDLER (pc_ppi_porta_r) |
| r2145 | r2146 | |
| 160 | 162 | PIO_LOG(1,"PIO_C_r (lo)",("$%02x\n", data)); |
| 161 | 163 | } |
| 162 | 164 | |
| 163 | | { |
| 165 | if ( ! ( pc_ppi.portb & 0x08 ) ) { |
| 164 | 166 | double tap_val = cassette_input( image_from_devtype_and_index( IO_CASSETTE, 0 ) ); |
| 165 | 167 | |
| 166 | 168 | if ( tap_val < 0 ) { |
| r2145 | r2146 | |
| 168 | 170 | } else { |
| 169 | 171 | data |= 0x10; |
| 170 | 172 | } |
| 173 | } else { |
| 174 | if ( pc_ppi.portb & 0x01 ) { |
| 175 | data = ( data & 0x10 ) | ( pit8253_get_output( 0, 2 ) ? 0x10 : 0x00 ); |
| 176 | } |
| 171 | 177 | } |
| 172 | 178 | return data; |
| 173 | 179 | } |
| r2145 | r2146 | |
| 181 | 187 | WRITE8_HANDLER ( pc_ppi_portb_w ) |
| 182 | 188 | { |
| 183 | 189 | /* KB controller port B */ |
| 190 | pc_ppi.portb = data; |
| 184 | 191 | pc_ppi.portc_switch_high = data & 0x08; |
| 185 | 192 | pc_ppi.keyboard_disabled = data & 0x80; |
| 186 | 193 | pc_sh_speaker(machine, data & 0x03); |
| 187 | 194 | pc_keyb_set_clock(data & 0x40); |
| 188 | 195 | |
| 196 | cassette_change_state( image_from_devtype_and_index( IO_CASSETTE, 0 ), ( data & 0x08 ) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); |
| 197 | |
| 189 | 198 | if (data & 0x80) |
| 190 | 199 | pc_keyb_clear(); |
| 191 | 200 | } |
src/mess/drivers/pc.c
| r2145 | r2146 | |
| 1499 | 1499 | |
| 1500 | 1500 | /* IBM PC 5150 (rev 0: 04/24/81) 2-screw case w/MDA Card, ROM Basic 1.0 */ |
| 1501 | 1501 | /* ROM Basic 1.0 had a bug: Doing ".1 / 10" would result in the wrong answer. May have been fixed in 1.1 */ |
| 1502 | | ROM_SYSTEM_BIOS( 1, "rev0", "IBM PC 5150 ??????? 02/24/81" ) |
| 1502 | ROM_SYSTEM_BIOS( 1, "rev1", "IBM PC 5150 ??????? 02/24/81" ) |
| 1503 | 1503 | ROMX_LOAD("basicc10.f6", 0xf6000, 0x2000, NO_DUMP, ROM_BIOS(2)) |
| 1504 | 1504 | ROMX_LOAD("basicc10.f8", 0xf8000, 0x2000, NO_DUMP, ROM_BIOS(2)) |
| 1505 | 1505 | ROMX_LOAD("basicc10.fa", 0xfa000, 0x2000, NO_DUMP, ROM_BIOS(2)) |
| r2145 | r2146 | |
| 1807 | 1807 | static void ibmpc_cassette_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info) { |
| 1808 | 1808 | switch( state ) { |
| 1809 | 1809 | case MESS_DEVINFO_INT_COUNT: info->i = 1; break; |
| 1810 | | case MESS_DEVINFO_INT_CASSETTE_DEFAULT_STATE: info->i = CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED; break; |
| 1810 | case MESS_DEVINFO_INT_CASSETTE_DEFAULT_STATE: info->i = CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED; break; |
| 1811 | 1811 | |
| 1812 | 1812 | default: cassette_device_getinfo(devclass, state, info); break; |
| 1813 | 1813 | } |