Beispiel #1
0
void pcm86_setnextintr(void) {
#if 0
	SINT32	cnt;
	SINT32	clk;

	if (pcm86.fifo & 0x80) {
		cnt = pcm86.virbuf - pcm86.fifosize;
		if (cnt > 0) {
			cnt += pcm86.stepmask;
			cnt >>= pcm86.stepbit;
//			cnt += 4;								// ちょっと延滞させる
			// ここで clk = pccore.realclock * cnt / 86pcm_rate
			// clk = ((pccore.baseclock / 86pcm_rate) * cnt) * pccore.multiple
			if (pccore.cpumode & CPUMODE_8MHZ) {
				clk = clk20_128[pcm86.fifo & 7];
			}
			else {
				clk = clk25_128[pcm86.fifo & 7];
			}
			// cntは最大 8000h で 32bitで収まるように…
			clk *= cnt;
			clk >>= 7;
//			clk++;						// roundup
			clk *= pccore.multiple;
			nevent_set(NEVENT_86PCM, clk, pcm86_cb, NEVENT_ABSOLUTE);
		}
Beispiel #2
0
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;
}
Beispiel #3
0
void calendar_reset(void) {

	SINT32	clock;

	timemng_gettime(&cal.dt);
#if defined(FIX_Z80A)
	clock = 2000000 * 2 / 5;
#else
	clock = pccore.realclock / 5;
#endif
	nevent_set(NEVENT_RTC, clock, neitem_rtc, NEVENT_RELATIVE);
}
Beispiel #4
0
static void set_fmtimerbevent(BOOL absolute) {

	SINT32	l;

	l = 288 * (256 - fmtimer.timerb);
	if (pccore.cpumode & CPUMODE_8MHZ) {		// 4MHz
		l = (l * 1248 / 625) * pccore.multiple;
	}
	else {										// 5MHz
		l = (l * 1536 / 625) * pccore.multiple;
	}
	nevent_set(NEVENT_FMTIMERB, l, fmport_b, absolute);
}
Beispiel #5
0
static void set_fmtimeraevent(BOOL absolute) {

	SINT32	l;

	l = 18 * (1024 - fmtimer.timera);
	if (pccore.cpumode & CPUMODE_8MHZ) {		// 4MHz
		l = (l * 1248 / 625) * pccore.multiple;
	}
	else {										// 5MHz
		l = (l * 1536 / 625) * pccore.multiple;
	}
//	TRACEOUT(("FMTIMER-A: %08x-%d", l, absolute));
	nevent_set(NEVENT_FMTIMERA, l, fmport_a, absolute);
}
Beispiel #6
0
void nevent_setbyms(UINT id, SINT32 ms, NEVENTCB proc, BOOL absolute) {

	nevent_set(id, (pccore.realclock / 1000) * ms, proc, absolute);
}
Beispiel #7
0
static void sets98event(BOOL absolute) {

	s98log.intcount++;
	nevent_set(NEVENT_S98TIMER, s98log.clock, s98timer, NEVENT_RELATIVE);
	(void)absolute;
}
Beispiel #8
0
void fdc_interrupt(void) {

	nevent_set(NEVENT_FDCINT, 512, fdc_intwait, NEVENT_ABSOLUTE);
}