Esempio n. 1
0
/* This is called at every vsync. */
void drive_vsync_hook(void)
{
    unsigned int dnr;

    drive_update_ui_status();

    for (dnr = 0; dnr < DRIVE_NUM; dnr++) {
        drive_t *drive = drive_context[dnr]->drive;
        if (drive->enable) {
            if (drive->idling_method != DRIVE_IDLE_SKIP_CYCLES) {
                if (drive->type == DRIVE_TYPE_2000 || drive->type == DRIVE_TYPE_4000) {
                    drivecpu65c02_execute(drive_context[dnr], maincpu_clk);
                } else {
                    drivecpu_execute(drive_context[dnr], maincpu_clk);
                }
            }
            if (drive->idling_method == DRIVE_IDLE_NO_IDLE) {
                /* if drive is never idle, also rotate the disk. this prevents
                 * huge peaks in cpu usage when the drive must catch up with
                 * a longer period of time.
                 */
                rotation_rotate_disk(drive);
            }
            /* printf("drive_vsync_hook drv %d @clk:%d\n", dnr, maincpu_clk); */
        }
    }
}
Esempio n. 2
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. 3
0
void drive_cpu_execute_one(drive_context_t *drv, CLOCK clk_value)
{
    drive_t *drive = drv->drive;

    if (drive->type == DRIVE_TYPE_2000 || drive->type == DRIVE_TYPE_4000) {
        drivecpu65c02_execute(drv, clk_value);
    } else {
        drivecpu_execute(drv, clk_value);
    }
}
Esempio n. 4
0
void parallel_cable_cpu_execute(void)
{
    unsigned int dnr;

    for (dnr = 0; dnr < DRIVE_NUM; dnr++) {
        if (drive_context[dnr]->drive->enable
            && drive_context[dnr]->drive->parallel_cable)
            drivecpu_execute(drive_context[dnr], maincpu_clk);
    }
}
Esempio n. 5
0
/* execute drive cpu for all drives that are connected to the respective port
   on the C64
 */
void parallel_cable_cpu_execute(int type)
{
    unsigned int dnr;
    int port;

    port = portmap[type];

    for (dnr = 0; dnr < DRIVE_NUM; dnr++) {
        if (drive_context[dnr]->drive->enable && drive_context[dnr]->drive->parallel_cable) {
            if (portmap[drive_context[dnr]->drive->parallel_cable] == port) {
                drivecpu_execute(drive_context[dnr], maincpu_clk);
            }
        }
    }
}
Esempio n. 6
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. 7
0
/* This is called at every vsync.  */
void drive_vsync_hook(void)
{
	unsigned int dnr;

	drive_update_ui_status();

	for (dnr = 0; dnr < DRIVE_NUM; dnr++)
	{
		drive_t *drive;

		drive = drive_context[dnr]->drive;
		if (drive->idling_method != DRIVE_IDLE_SKIP_CYCLES && drive->enable)
			drivecpu_execute(drive_context[dnr], maincpu_clk);
	}

	machine_drive_vsync_hook();
}