Beispiel #1
0
static int pp_read(CBM_FILE fd, unsigned char *c1, unsigned char *c2)
{
                                                                        SETSTATEDEBUG((void)0);
    pp_check_direction(PP_READ);
                                                                        SETSTATEDEBUG((void)0);
#ifndef USE_CBM_IEC_WAIT
    while(!cbm_iec_get(fd, IEC_DATA));
#else
    cbm_iec_wait(fd, IEC_DATA, 1);
#endif
                                                                        SETSTATEDEBUG((void)0);
    *c1 = cbm_pp_read(fd);
                                                                        SETSTATEDEBUG((void)0);
    cbm_iec_release(fd, IEC_CLOCK);

                                                                        SETSTATEDEBUG((void)0);
#ifndef USE_CBM_IEC_WAIT
    while(cbm_iec_get(fd, IEC_DATA));
#else
    cbm_iec_wait(fd, IEC_DATA, 0);
#endif
                                                                        SETSTATEDEBUG((void)0);
    *c2 = cbm_pp_read(fd);
                                                                        SETSTATEDEBUG((void)0);
    cbm_iec_set(fd, IEC_CLOCK);

                                                                        SETSTATEDEBUG((void)0);
    return 0;
}
Beispiel #2
0
static int open_disk(CBM_FILE fd, d64copy_settings *settings,
                     const void *arg, int for_writing,
                     turbo_start start, d64copy_message_cb message_cb)
{
    unsigned char d = (unsigned char)(ULONG_PTR)arg;
    const unsigned char *drive_prog;
    int prog_size;

    fd_cbm    = fd;
    two_sided = settings->two_sided;

    if(settings->drive_type != cbm_dt_cbm1541)
    {
        drive_prog = pp1571_drive_prog;
        prog_size  = sizeof(pp1571_drive_prog);
    }
    else
    {
        drive_prog = pp1541_drive_prog;
        prog_size  = sizeof(pp1541_drive_prog);
    }

    /* make sure the XP1541 portion of the cable is in input mode */
    cbm_pp_read(fd_cbm);

    cbm_upload(fd_cbm, d, 0x700, drive_prog, prog_size);
    start(fd, d);
    pp_check_direction(PP_READ);
    cbm_iec_set(fd_cbm, IEC_CLOCK);
    cbm_iec_wait(fd_cbm, IEC_DATA, 1);
    return 0;
}
Beispiel #3
0
static int pp_write(CBM_FILE fd, char c1, char c2)
{
                                                                        SETSTATEDEBUG((void)0);
    pp_check_direction(PP_WRITE);
                                                                        SETSTATEDEBUG((void)0);
#ifndef USE_CBM_IEC_WAIT
    while(!cbm_iec_get(fd, IEC_DATA));
#else
    cbm_iec_wait(fd, IEC_DATA, 1);
#endif
                                                                        SETSTATEDEBUG((void)0);
    cbm_pp_write(fd, c1);
                                                                        SETSTATEDEBUG((void)0);
    cbm_iec_release(fd, IEC_CLOCK);

                                                                        SETSTATEDEBUG((void)0);
#ifndef USE_CBM_IEC_WAIT
    while(cbm_iec_get(fd, IEC_DATA));
#else
    cbm_iec_wait(fd, IEC_DATA, 0);
#endif
                                                                        SETSTATEDEBUG((void)0);
    cbm_pp_write(fd, c2);
                                                                        SETSTATEDEBUG((void)0);
    cbm_iec_set(fd, IEC_CLOCK);

                                                                        SETSTATEDEBUG((void)0);
    return 0;
}