Beispiel #1
0
static void ESEFadeout2()
{
	if (FadeoutStop == 1) {
		Playing2 = 0xff;
		FadeoutReady = 0;
		FadeoutStop = 0;
		Vol1 = 1.00;
		SetVolumeSamplesChannel0(1.00);
	}
	
	if (Counter1 >= 10) {
		Counter1 = 0;
		if (FadeoutReady == 1) {
			Vol1 = Vol1 - 0.10;
			if (Vol1 <= 0) Vol1 = 0;
			SetVolumeSamplesChannel0(Vol1);
		}
		if (Vol1 == 0) {
			StopSamplesChannel0();
			FadeoutReady = 0;
			FadeoutStop = 0;
			Vol1 = 1.00;
			SetVolumeSamplesChannel0(1.00);
		}
	}	
	Counter1++;
}
Beispiel #2
0
static void tekipakiHD647180Write(UINT16 d)
{
	if (d == 0xfe) {
		StopAllSamples();
	}

	if (d >= 0x01 && d <= 0x03) {
		StopSamplesChannel0();
		BurnSampleSetLoop(d, 1);
		BurnSamplePlay(d);
	}
	
	if (d >= 0x04 && d <= 0x05) {
		StopSamplesChannel0();
		BurnSamplePlay(d);
	}

	if (d >= 0x06 && d <= 0x07) {
		StopSamplesChannel1();
		BurnSamplePlay(d);
	}

	if (d == 0x08 || d == 0x09) {
		StopSamplesChannel2();
		BurnSamplePlay(d);
	}

	if (d >= 0x0a && d <= 0x0d) {
		StopSamplesChannel3();
		BurnSamplePlay(d);
	}

	if (d == 0x0e || d == 0x12) {
		StopSamplesChannel4();
		BurnSamplePlay(d);
	}

	if (d >= 0x13 && d <= 0x14) {
		StopSamplesChannel5();
		BurnSamplePlay(d);
	}

	if (d == 0x15) {
		BurnSampleStop(d);
		BurnSamplePlay(d);
	}
}
Beispiel #3
0
static INT32 DrvFrame()
{
	INT32 nInterleave = 4;

	if (DrvReset) {
		DrvDoReset();
	}

	memset (DrvInputs, 0, 3);
	for (INT32 i = 0; i < 8; i++) {
		DrvInputs[0] |= (DrvJoy1[i] & 1) << i;
		DrvInputs[1] |= (DrvJoy2[i] & 1) << i;
		DrvInputs[2] |= (DrvJoy3[i] & 1) << i;
	}
	ToaClearOpposites(&DrvInputs[0]);
	ToaClearOpposites(&DrvInputs[1]);

	SekNewFrame();
	
	SekOpen(0);

	SekIdle(nCyclesDone[0]);

	nCyclesTotal[0] = (INT32)((INT64)10000000 * nBurnCPUSpeedAdjust / (0x0100 * REFRESHRATE));

	SekSetCyclesScanline(nCyclesTotal[0] / 262);
	nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262);
	nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262);
	bVBlank = false;

	for (INT32 i = 0; i < nInterleave; i++) {
		INT32 nNext;

		// Run 68000

		nNext = (i + 1) * nCyclesTotal[0] / nInterleave;

		// Trigger VBlank interrupt
		if (nNext > nToaCyclesVBlankStart) {
			if (SekTotalCycles() < nToaCyclesVBlankStart) {
				nCyclesSegment = nToaCyclesVBlankStart - SekTotalCycles();
				SekRun(nCyclesSegment);
			}

			if (pBurnDraw) {
				DrvDraw();
			}

			ToaBufferFCU2Sprites();

			bVBlank = true;
			if (bEnableInterrupts) {
				SekSetIRQLine(4, CPU_IRQSTATUS_AUTO);
			}
		}

		nCyclesSegment = nNext - SekTotalCycles();
		if (bVBlank || (!CheckSleep(0))) {
			SekRun(nCyclesSegment);
		} else {
			SekIdle(nCyclesSegment);
		}
	}

	nToa1Cycles68KSync = SekTotalCycles();
//	BurnTimerEndFrameYM3812(nCyclesTotal[1]);
//	BurnYM3812Update(pBurnSoundOut, nBurnSoundLen);

	if (pBurnSoundOut) {
		BurnSampleRender(pBurnSoundOut, nBurnSoundLen);
#ifdef TOAPLAN_SOUND_SAMPLES_HACK
		if (Start > 0) Wait++;
	
		if (Wait >= (108 + Start2)) {
			StopSamplesChannel0();
			SetVolumeSamplesChannel0(1.00);
			BurnSamplePlay(0x07);
			Start = 0;
			Start2 = 1;
			Wait = 0;
		}
	
		if (Start2 == 0) ESEFadeout2();
#endif
	}
	nCyclesDone[0] = SekTotalCycles() - nCyclesTotal[0];

//	bprintf(PRINT_NORMAL, _T("    %i\n"), nCyclesDone[0]);

	ToaBufferFCU2Sprites();

	SekSetIRQLine(2, CPU_IRQSTATUS_AUTO); // sprite buffer finished...

	SekClose();

	return 0;
}
Beispiel #4
0
static void samesameSndCmd(UINT16 d)
{
	if (d == 0x00 || d == 0xdf) {
		StopAllSamples();
	}

	if (d >= 0x01 && d <= 0x05) {
		StopSamplesChannel0();
		SetVolumeSamplesChannel0(1.00);
		FadeoutStop = 1;
		Start2 = 0;
		BurnSampleSetLoop(d, 1);
		BurnSamplePlay(d);
	}

	if (d == 0x06) {
		StopSamplesChannel0();
		BurnSamplePlay(d);
		Start2 = 72;
	}

	if (d == 0x07) {
		FadeoutReady = 1;
		Start = 1;
	}

	if (d == 0x08 || d == 0x09) {
		StopSamplesChannel1();
		BurnSamplePlay(d);
	}

	if (d >= 0x0a && d <= 0x0f) {
		StopSamplesChannel2();
		BurnSamplePlay(d);
	}

	if (d == 0x10 || d == 0x11) {
		StopSamplesChannel3();
		BurnSamplePlay(d);
	}

	if (d >= 0x12 && d <= 0x16) {
		StopSamplesChannel4();
		BurnSamplePlay(d);
	}

	if (d >= 0x17 && d <= 0x1b) {
		StopSamplesChannel5();
		BurnSamplePlay(d);
	}

	if (d >= 0x1c && d <= 0x1f) {
		StopSamplesChannel0();
		BurnSamplePlay(d);
	}

	if (d == 0x20 || d == 0x21) {
		StopSamplesChannel6();
		BurnSamplePlay(d);
	}

	if (d == 0x22) {
		StopSamplesChannel0();
		BurnSamplePlay(d);
	}

	if (d == 0x23) {
		StopSamplesChannel7();
		BurnSamplePlay(d);
	}

	if (d == 0x24) {
		StopSamplesChannel7();
		BurnSamplePlay(d);
		FadeoutReady = 1;
	}

	if (d == 0x25) {
		StopSamplesChannel0();
		SetVolumeSamplesChannel0(1.00);
		BurnSamplePlay(d);
		FadeoutStop = 1;
	}

	if (d == 0x26) {
		StopSamplesChannel2();
		BurnSamplePlay(d);
	}

	if (d == 0x27) {
		StopSamplesChannel0();
		SetVolumeSamplesChannel0(1.00);
		BurnSamplePlay(d);
		FadeoutStop = 1;
	}

	if (d == 0x28) {
		BurnSamplePlay(d);
	}
}
Beispiel #5
0
static void ghoxSoundCmd(UINT16 d)
{
	if (d == 0xfe) {
		StopSamplesChannel0();
	}
	
	if (d == 0x42 || d == 0x44 || d == 0x45 || d == 0x47 || d == 0x48 || d == 0x4c || d == 0x4d || d == 0x4e) {
		StopSamplesChannel0();
		BurnSampleSetLoop(d, 1);
		BurnSamplePlay(d);
	}

	if (d == 0xd0) {
		StopSamplesChannel0();
		BurnSampleSetLoop(0, 1);
		BurnSamplePlay(0);
	}

	if (d == 0x49) {
		StopSamplesChannel0();
		BurnSamplePlay(d);
	}
	
	if (d >= 0x02 && d <= 0x0f) {
		StopSamplesChannel1();
		BurnSamplePlay(d);
	}
	
	if (d >= 0x10 && d <= 0x17) {
		StopSamplesChannel2();
		BurnSamplePlay(d);
	}
	
	if (d >= 0x18 && d <= 0x1f) {
		StopSamplesChannel3();
		BurnSamplePlay(d);
	}
	
	if (d >= 0x20 && d <= 0x27) {
		StopSamplesChannel4();
		BurnSamplePlay(d);
	}
	
	if (d >= 0x28 && d <= 0x2f) {
		StopSamplesChannel5();
		BurnSamplePlay(d);
	}
	
	if (d >= 0x30 && d <= 0x38) {
		StopSamplesChannel6();
		BurnSamplePlay(d);
	}
	
	if (d == 0x39) {
		StopSamplesChannel8();
		BurnSamplePlay(d);
	}
	
	if (d >= 0x3a && d <= 0x3f) {
		StopSamplesChannel7();
		BurnSamplePlay(d);
	}
	
	if (d == 0x01) {
		StopSamplesChannel8();
		BurnSamplePlay(d);
	}
	
	if (d == 0x4b) {
		StopSamplesChannel0();
		BurnSamplePlay(0x4f);
	}
}