src/mess/includes/c16.h
| r3900 | r3901 | |
| 10 | 10 | |
| 11 | 11 | /*----------- defined in machine/c16.c -----------*/ |
| 12 | 12 | |
| 13 | | UINT8 c16_m7501_port_read(void); |
| 14 | | void c16_m7501_port_write(UINT8 data); |
| 13 | UINT8 c16_m7501_port_read(const device_config *device, UINT8 direction); |
| 14 | void c16_m7501_port_write(const device_config *device, UINT8 direction, UINT8 data); |
| 15 | 15 | |
| 16 | 16 | extern WRITE8_HANDLER(c16_6551_port_w); |
| 17 | 17 | extern READ8_HANDLER(c16_6551_port_r); |
src/mess/machine/c16.c
| r3900 | r3901 | |
| 24 | 24 | #include "devices/cassette.h" |
| 25 | 25 | #include "devices/cartslot.h" |
| 26 | 26 | |
| 27 | | #include "deprecat.h" |
| 28 | 27 | |
| 29 | | |
| 30 | 28 | #define VERBOSE_LEVEL 0 |
| 31 | 29 | #define DBG_LOG(N,M,A) \ |
| 32 | 30 | do { \ |
| r3900 | r3901 | |
| 112 | 110 | p7 serial data in, serial bus 5 |
| 113 | 111 | */ |
| 114 | 112 | |
| 115 | | void c16_m7501_port_write(UINT8 data) |
| 113 | void c16_m7501_port_write(const device_config *device, UINT8 direction, UINT8 data) |
| 116 | 114 | { |
| 117 | 115 | int dat, atn, clk; |
| 118 | 116 | |
| 119 | 117 | /* bit zero then output 0 */ |
| 120 | | cbm_serial_atn_write (Machine, atn = !(data & 0x04)); |
| 121 | | cbm_serial_clock_write (Machine, clk = !(data & 0x02)); |
| 122 | | cbm_serial_data_write (Machine, dat = !(data & 0x01)); |
| 118 | cbm_serial_atn_write (device->machine, atn = !(data & 0x04)); |
| 119 | cbm_serial_clock_write (device->machine, clk = !(data & 0x02)); |
| 120 | cbm_serial_data_write (device->machine, dat = !(data & 0x01)); |
| 123 | 121 | |
| 124 | 122 | // vc20_tape_write (!(data & 0x02)); // CASSETTE_RECORD not implemented yet |
| 125 | 123 | } |
| 126 | 124 | |
| 127 | | UINT8 c16_m7501_port_read(void) |
| 125 | UINT8 c16_m7501_port_read(const device_config *device, UINT8 direction) |
| 128 | 126 | { |
| 129 | | running_machine *machine = Machine; |
| 130 | 127 | UINT8 data = 0xff; |
| 131 | | UINT8 c16_port7501 = (UINT8) cpu_get_info_int(machine->cpu[0], CPUINFO_INT_M6510_PORT); |
| 128 | UINT8 c16_port7501 = (UINT8) cpu_get_info_int(device->machine->cpu[0], CPUINFO_INT_M6510_PORT); |
| 132 | 129 | |
| 133 | | if ((c16_port7501 & 0x01) || !cbm_serial_data_read(Machine)) |
| 130 | if ((c16_port7501 & 0x01) || !cbm_serial_data_read(device->machine)) |
| 134 | 131 | data &= ~0x80; |
| 135 | 132 | |
| 136 | | if ((c16_port7501 & 0x02) || !cbm_serial_clock_read(Machine)) |
| 133 | if ((c16_port7501 & 0x02) || !cbm_serial_clock_read(device->machine)) |
| 137 | 134 | data &= ~0x40; |
| 138 | 135 | |
| 139 | 136 | // data &= ~0x20; // port bit not in pinout |
| 140 | 137 | |
| 141 | | if (cassette_input(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" )) > +0.0) |
| 138 | if (cassette_input(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" )) > +0.0) |
| 142 | 139 | data |= 0x10; |
| 143 | 140 | else |
| 144 | 141 | data &= ~0x10; |
| 145 | 142 | |
| 146 | | cassette_change_state(device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" ), (c16_port7501 & 0x08) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); |
| 143 | cassette_change_state(device_list_find_by_tag( device->machine->config->devicelist, CASSETTE, "cassette" ), (c16_port7501 & 0x08) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); |
| 147 | 144 | |
| 148 | 145 | return data; |
| 149 | 146 | } |