void parallel_cable_cpu_pulse(void) { unsigned int dnr; parallel_cable_cpu_execute(); #if 0 log_debug("CP"); #endif for (dnr = 0; dnr < DRIVE_NUM; dnr++) { drive_t *drive; drive = drive_context[dnr]->drive; if (drive->enable && drive->parallel_cable) { if (drive->parallel_cable == DRIVE_PC_DD3) mc6821_set_signal(drive_context[dnr], MC6821_SIG_CA1); else if (drive->type == DRIVE_TYPE_1570 || drive->type == DRIVE_TYPE_1571 || drive->type == DRIVE_TYPE_1571CR) ciacore_set_flag(drive_context[dnr]->cia1571); else viacore_signal(drive_context[dnr]->via1d1541, VIA_SIG_CB1, VIA_SIG_FALL); } } }
void parallel_cable_cpu_pulse(int type) { unsigned int dnr; parallel_cable_cpu_execute(type); DBG(("PARCABLE (%d:%d) CPU Pulse", type, portmap[type])); for (dnr = 0; dnr < DRIVE_NUM; dnr++) { drive_t *drive; drive = drive_context[dnr]->drive; if (drive->enable && drive->parallel_cable) { switch (drive->parallel_cable) { case DRIVE_PC_DD3: dd3_set_signal(drive_context[dnr]); break; case DRIVE_PC_FORMEL64: viacore_signal(drive_context[dnr]->via1d1541, VIA_SIG_CB1, VIA_SIG_FALL); break; default: if (drive->type == DRIVE_TYPE_1570 || drive->type == DRIVE_TYPE_1571 || drive->type == DRIVE_TYPE_1571CR) { ciacore_set_flag(drive_context[dnr]->cia1571); } else { viacore_signal(drive_context[dnr]->via1d1541, VIA_SIG_CB1, VIA_SIG_FALL); } break; } } } }
static void iecbus_cpu_write_conf1(BYTE data, CLOCK clock) { drive_t *drive; drive = drive_context[0]->drive; drivecpu_execute(drive_context[0], clock); iec_update_cpu_bus(data); if (iec_old_atn != (iecbus.cpu_bus & 0x10)) { iec_old_atn = iecbus.cpu_bus & 0x10; if (drive->type != DRIVE_TYPE_1581) viacore_signal(drive_context[0]->via1d1541, VIA_SIG_CA1, iec_old_atn ? 0 : VIA_SIG_RISE); else if (!iec_old_atn) ciacore_set_flag(drive_context[0]->cia1581); } if (drive->type != DRIVE_TYPE_1581) iecbus.drv_bus[8] = (((iecbus.drv_data[8] << 3) & 0x40) | ((iecbus.drv_data[8] << 6) & ((~iecbus.drv_data[8] ^ iecbus.cpu_bus) << 3) & 0x80)); else iecbus.drv_bus[8] = (((iecbus.drv_data[8] << 3) & 0x40) | ((iecbus.drv_data[8] << 6) & ((iecbus.drv_data[8] | iecbus.cpu_bus) << 3) & 0x80)); iec_update_ports(); }
static void iecbus_cpu_write_conf3(BYTE data, CLOCK clock) { unsigned int dnr; drivecpu_execute_all(clock); serial_iec_device_exec(clock); DEBUG_IEC_CPU_WRITE(data); iec_update_cpu_bus(data); if (iec_old_atn != (iecbus.cpu_bus & 0x10)) { iec_old_atn = iecbus.cpu_bus & 0x10; for (dnr = 0; dnr < DRIVE_NUM; dnr++) { if (iecbus_device[8 + dnr] == IECBUS_DEVICE_TRUEDRIVE) { switch (drive_context[dnr]->drive->type) { case DRIVE_TYPE_1581: if (!iec_old_atn) { ciacore_set_flag(drive_context[dnr]->cia1581); } break; case DRIVE_TYPE_2000: case DRIVE_TYPE_4000: viacore_signal(drive_context[dnr]->via4000, VIA_SIG_CA2, iec_old_atn ? 0 : VIA_SIG_RISE); break; default: viacore_signal(drive_context[dnr]->via1d1541, VIA_SIG_CA1, iec_old_atn ? 0 : VIA_SIG_RISE); } } } } for (dnr = 0; dnr < DRIVE_NUM; dnr++) { if (iecbus_device[8 + dnr] == IECBUS_DEVICE_TRUEDRIVE) { unsigned int unit; unit = dnr + 8; switch (drive_context[dnr]->drive->type) { case DRIVE_TYPE_1581: case DRIVE_TYPE_2000: case DRIVE_TYPE_4000: iecbus.drv_bus[unit] = (((iecbus.drv_data[unit] << 3) & 0x40) | ((iecbus.drv_data[unit] << 6) & ((iecbus.drv_data[unit] | iecbus.cpu_bus) << 3) & 0x80)); break; default: iecbus.drv_bus[unit] = (((iecbus.drv_data[unit] << 3) & 0x40) | ((iecbus.drv_data[unit] << 6) & ((~iecbus.drv_data[unit] ^ iecbus.cpu_bus) << 3) & 0x80)); } } } iec_update_ports(); }
void parallel_cable_drive_write(BYTE data, int handshake, unsigned int dnr) { #if 0 log_debug("DW DATA %02x HS %02x", data, handshake); #endif if (handshake == PARALLEL_WRITE_HS || handshake == PARALLEL_HS) ciacore_set_flag(machine_context.cia2); if (handshake == PARALLEL_WRITE_HS || handshake == PARALLEL_WRITE) parallel_cable_drive_value[dnr] = data; }
BYTE parallel_cable_drive_read(int handshake) { BYTE rc; if (handshake) ciacore_set_flag(machine_context.cia2); rc = parallel_cable_value(); #if 0 log_debug("DR DATA %02x HS %02x", rc, handshake); #endif return rc; }
static void iecbus_cpu_write_conf2(BYTE data, CLOCK clock) { drive_t *drive; drive = drive_context[1]->drive; drivecpu_execute(drive_context[1], clock); DEBUG_IEC_CPU_WRITE(data); iec_update_cpu_bus(data); if (iec_old_atn != (iecbus.cpu_bus & 0x10)) { iec_old_atn = iecbus.cpu_bus & 0x10; switch (drive->type) { case DRIVE_TYPE_1581: if (!iec_old_atn) { ciacore_set_flag(drive_context[1]->cia1581); } break; case DRIVE_TYPE_2000: case DRIVE_TYPE_4000: viacore_signal(drive_context[1]->via4000, VIA_SIG_CA2, iec_old_atn ? 0 : VIA_SIG_RISE); break; default: viacore_signal(drive_context[1]->via1d1541, VIA_SIG_CA1, iec_old_atn ? 0 : VIA_SIG_RISE); } } switch (drive->type) { case DRIVE_TYPE_1581: case DRIVE_TYPE_2000: case DRIVE_TYPE_4000: iecbus.drv_bus[9] = (((iecbus.drv_data[9] << 3) & 0x40) | ((iecbus.drv_data[9] << 6) & ((iecbus.drv_data[9] | iecbus.cpu_bus) << 3) & 0x80)); break; default: iecbus.drv_bus[9] = (((iecbus.drv_data[9] << 3) & 0x40) | ((iecbus.drv_data[9] << 6) & ((~iecbus.drv_data[9] ^ iecbus.cpu_bus) << 3) & 0x80)); } iec_update_ports(); }
/* interface for the drive (read/write) */ void parallel_cable_drive_write(int type, BYTE data, int handshake, unsigned int dnr) { int port; DBG(("PARCABLE (%d:%d) DRV (%d) W DATA %02x HS %02x", type, portmap[type], dnr, data, handshake)); port = portmap[type]; if (handshake == PARALLEL_WRITE_HS || handshake == PARALLEL_HS) { if (port == PC_PORT_STANDARD) { ciacore_set_flag(machine_context.cia2); } } if (handshake == PARALLEL_WRITE_HS || handshake == PARALLEL_WRITE) { parallel_cable_drive_value[dnr] = data; } }
BYTE parallel_cable_drive_read(int type, int handshake) { int port; BYTE rc; port = portmap[type]; if (handshake) { if (port == PC_PORT_STANDARD) { ciacore_set_flag(machine_context.cia2); } } rc = parallel_cable_value(type); DBG(("PARCABLE (%d:%d) DRV R DATA %02x HS %02x", type, portmap[type], rc, handshake)); return rc; }
static void iecbus_cpu_write_conf3(BYTE data, CLOCK clock) { unsigned int dnr; drivecpu_execute_all(clock); serial_iec_device_exec(clock); iec_update_cpu_bus(data); if (iec_old_atn != (iecbus.cpu_bus & 0x10)) { iec_old_atn = iecbus.cpu_bus & 0x10; for (dnr = 0; dnr < DRIVE_NUM; dnr++) if( iecbus_device[8+dnr] == IECBUS_DEVICE_TRUEDRIVE ) { if (drive_context[dnr]->drive->type != DRIVE_TYPE_1581) viacore_signal(drive_context[dnr]->via1d1541, VIA_SIG_CA1, iec_old_atn ? 0 : VIA_SIG_RISE); else if (!iec_old_atn) ciacore_set_flag(drive_context[dnr]->cia1581); } } for (dnr = 0; dnr < DRIVE_NUM; dnr++) if( iecbus_device[8+dnr] == IECBUS_DEVICE_TRUEDRIVE ) { unsigned int unit; unit = dnr + 8; if (drive_context[dnr]->drive->type != DRIVE_TYPE_1581) iecbus.drv_bus[unit] = (((iecbus.drv_data[unit] << 3) & 0x40) | ((iecbus.drv_data[unit] << 6) & ((~iecbus.drv_data[unit] ^ iecbus.cpu_bus) << 3) & 0x80)); else iecbus.drv_bus[unit] = (((iecbus.drv_data[unit] << 3) & 0x40) | ((iecbus.drv_data[unit] << 6) & ((iecbus.drv_data[unit] | iecbus.cpu_bus) << 3) & 0x80)); } iec_update_ports(); }
/* Temporary! */ void cia2_set_flagx(void) { ciacore_set_flag(machine_context.cia2); }
static void scpu64_userport_set_flag(BYTE b) { if (b != 0) { ciacore_set_flag(machine_context.cia2); } }
static void cbm2_userport_set_flag(BYTE b) { if (b != 0) { ciacore_set_flag(machine_context.cia1); } }
void datasette_trigger_flux_change(unsigned int on) { ciacore_set_flag(machine_context.cia1); }