示例#1
0
文件: fdd_mtr.c 项目: aliaspider/np2
void fddmtr_seek(REG8 drv, REG8 c, UINT size) {

    int		regmove;
    SINT32	waitcnt;

    drv &= 3;
    regmove = c - fddmtr.head[drv];
    fddmtr.head[drv] = c;

    if (!np2cfg.MOTOR) {
        if (size) {
            fddmtr.busy = 1;
            nevent_set(NEVENT_FDBIOSBUSY, size * pccore.multiple,
                       fdbiosout, NEVENT_ABSOLUTE);
        }
        return;
    }

    waitcnt = (size * DISK1ROL_MS) / (1024 * 8);
    if (regmove < 0) {
        regmove = 0 - regmove;
    }
    if (regmove == 1) {
        if (fddmtr.curevent < 80) {
            fddmtr_event();
#if defined(SUPPORT_SWSEEKSND)
            fddmtrsnd_play(1, TRUE);
#else
            soundmng_pcmplay(SOUND_PCMSEEK1, FALSE);
#endif
            fddmtr.curevent = 80;
            fddmtr.nextevent = GETTICK() + MOVEMOTOR1_MS;
        }
    }
    else if (regmove) {
        if (fddmtr.curevent < 100) {
            fddmtr_event();
#if defined(SUPPORT_SWSEEKSND)
            fddmtrsnd_play(0, TRUE);
#else
            soundmng_pcmplay(SOUND_PCMSEEK, TRUE);
#endif
            fddmtr.curevent = 100;
            fddmtr.nextevent = GETTICK() + (regmove * MOVE1TCK_MS);
        }
        if (regmove >= 32) {
            waitcnt += DISK1ROL_MS;
        }
    }
    if (waitcnt) {
        fddmtr.busy = 1;
        nevent_setbyms(NEVENT_FDBIOSBUSY,
                       waitcnt, fdbiosout, NEVENT_ABSOLUTE);
    }
    (void)drv;
}
示例#2
0
文件: fdc.c 项目: FREEWING-JP/np2pi
static void fdc_timeoutset(void) {

	nevent_setbyms(NEVENT_FDCTIMEOUT, 166, fdctimeoutproc, NEVENT_ABSOLUTE);
}