Esempio n. 1
0
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;
            }
        }
    }
}
Esempio n. 2
0
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();
}
Esempio n. 3
0
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();
}
Esempio n. 4
0
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);
        }
    }
}
Esempio n. 5
0
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();
}
Esempio n. 6
0
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();
}
Esempio n. 7
0
void via1d2031_set_atn(via_context_t *via_context, int state)
{
    drivevia1_context_t *via1p;

    via1p = (drivevia1_context_t *)(via_context->prv);

    if (via1p->drive->type == DRIVE_TYPE_2031) {
        viacore_signal(via_context, VIA_SIG_CA1, state ? VIA_SIG_RISE : 0);
        parallel_drivex_set_nrfd((BYTE)(((!parieee_is_out)
                                         && (!(via_context->oldpb & 0x02)))
                                        || (parallel_atn
                                            && (!(via_context->oldpb & 0x01)))
                                        || ((!parallel_atn)
                                            && (via_context->oldpb & 0x01))));
        parallel_drivex_set_ndac((BYTE)(((!parieee_is_out)
                                         && (!(via_context->oldpb & 0x04)))
                                        || (parallel_atn
                                            && (!(via_context->oldpb & 0x01)))
                                        || ((!parallel_atn)
                                            && (via_context->oldpb & 0x01))));
    }
}
Esempio n. 8
0
static void pet_userport_set_flag(BYTE b)
{
    viacore_signal(machine_context.via, VIA_SIG_CA1, b ? VIA_SIG_RISE : VIA_SIG_FALL);
}
Esempio n. 9
0
static void vic20printer_userport_set_busy(unsigned int b)
{
    viacore_signal(machine_context.via2,
                   VIA_SIG_CB1, b ? VIA_SIG_RISE : VIA_SIG_FALL);
}
Esempio n. 10
0
void machine_set_restore_key(int v)
{
    viacore_signal(machine_context.via2,
                   VIA_SIG_CA1, v ? VIA_SIG_FALL : VIA_SIG_RISE);
}