예제 #1
0
static INT32 crushermInit()
{
	INT32 nLen;

	BurnSetRefreshRate(CAVE_REFRESHRATE);

	// Find out how much memory is needed
	Mem = NULL;
	MemIndex();
	nLen = MemEnd - (UINT8 *)0;
	if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) {
		return 1;
	}
	memset(Mem, 0, nLen);										// blank all memory
	MemIndex();													// Index the allocated memory

	// Load the roms into memory
	if (crushermLoadRoms()) {
		return 1;
	}

	EEPROMInit(&eeprom_interface_93C46_8bit);

	{

		SekInit(0, 0x68000);												// Allocate 68000
		SekOpen(0);

		// Map 68000 memory:
		SekMapMemory(Rom01,		0x000000, 0x07FFFF, MAP_ROM);	// CPU 0 ROM
		SekMapMemory(CaveTileRAM[0],	0x100000, 0x107FFF, MAP_RAM);
		SekMapMemory(CaveSpriteRAM,	0x180000, 0x187FFF, MAP_RAM);
		SekMapMemory(CavePalSrc,	0x200000, 0x207FFF, MAP_RAM);
		SekMapMemory(Ram01,		0x340000, 0x34FFFF, MAP_RAM);

		SekSetReadWordHandler(0, 	korokoroReadWord);
		SekSetReadByteHandler(0, 	korokoroReadByte);
		SekSetWriteWordHandler(0, 	korokoroWriteWord);
		SekSetWriteByteHandler(0, 	korokoroWriteByte);

		SekClose();
	}

	nCaveRowModeOffset = 1;

	CavePalInit(0x8000);
	CaveTileInit();
	CaveSpriteInit(1, 0x400000);
	CaveTileInitLayer(0, 0x200000, 4, 0x4400);

	YMZ280BInit(16934400, &TriggerSoundIRQ, 0x200000);
	YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT);
	YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT);

	bDrawScreen = true;

	DrvDoReset(); // Reset machine

	return 0;
}
예제 #2
0
static int DrvInit()
{
	int nLen;

	BurnSetRefreshRate(CAVE_REFRESHRATE);

	// Find out how much memory is needed
	Mem = NULL;
	MemIndex();
	nLen = MemEnd - (unsigned char *)0;
	if ((Mem = (unsigned char *)BurnMalloc(nLen)) == NULL) {
		return 1;
	}
	memset(Mem, 0, nLen);										// blank all memory
	MemIndex();													// Index the allocated memory

	EEPROMInit(&eeprom_interface_93C46_8bit);
	
	// Load the roms into memory
	if (LoadRoms()) {
		return 1;
	}

	{

		SekInit(0, 0x68000);												// Allocate 68000
		SekOpen(0);

		// Map 68000 memory:
		SekMapMemory(Rom01,		0x000000, 0x07FFFF, SM_ROM);	// CPU 0 ROM
		SekMapMemory(CaveTileRAM[0],	0x100000, 0x107FFF, SM_RAM);
		SekMapMemory(CaveSpriteRAM,	0x180000, 0x187FFF, SM_RAM);
		SekMapMemory(CavePalSrc,	0x200000, 0x207FFF, SM_RAM);
		SekMapMemory(Ram01,		0x300000, 0x30FFFF, SM_RAM);

		SekSetReadWordHandler(0, 	korokoroReadWord);
		SekSetReadByteHandler(0, 	korokoroReadByte);
		SekSetWriteWordHandler(0, 	korokoroWriteWord);
		SekSetWriteByteHandler(0, 	korokoroWriteByte);

		SekClose();
	}

	nCaveRowModeOffset = 1;

	CavePalInit(0x8000);
	CaveTileInit();
	CaveSpriteInit(1, 0x300000);
	CaveTileInitLayer(0, 0x200000, 4, 0x4400);

	YMZ280BInit(16934400, &TriggerSoundIRQ, 3);

	bDrawScreen = true;

	DrvDoReset(); // Reset machine

	return 0;
}
예제 #3
0
static int DrvInit()
{
	int nLen;

//	bToaRotateScreen = true;

	BurnSetRefreshRate(REFRESHRATE);

	nBCU2ROMSize = 0x080000;
	nFCU2ROMSize = 0x080000;

	// Find out how much memory is needed
	AllMem = NULL;
	MemIndex();
	nLen = MemEnd - (unsigned char *)0;
	if ((AllMem = (unsigned char *)malloc(nLen)) == NULL) {
		return 1;
	}
	memset(AllMem, 0, nLen);
	MemIndex();

	if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1;
	if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1;
	if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1;
	if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1;

	ToaLoadTiles(BCU2ROM, 4, nBCU2ROMSize);
	ToaLoadTiles(FCU2ROM, 8, nFCU2ROMSize);

	{
		SekInit(0, 0x68000);
		SekOpen(0);
		SekMapMemory(Drv68KROM,			0x000000, 0x07FFFF, SM_ROM);
		SekMapMemory(Drv68KRAM,			0x0c0000, 0x0c3FFF, SM_RAM);
		SekMapMemory(DrvPalRAM,			0x104000, 0x1047FF, SM_RAM);
		SekMapMemory(DrvPalRAM2,		0x106000, 0x1067FF, SM_RAM);
		SekSetReadWordHandler(0, 		samesameReadWord);
		SekSetReadByteHandler(0, 		samesameReadByte);
		SekSetWriteWordHandler(0, 		samesameWriteWord);
		SekSetWriteByteHandler(0, 		samesameWriteByte);
		SekClose();
	}

	ToaInitBCU2();

	nToaPalLen = nColCount;
	ToaPalSrc = DrvPalRAM;
	ToaPalSrc2 = DrvPalRAM2;
	ToaPalInit();

//	BurnYM3812Init(28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0);

	bDrawScreen = true;

	DrvDoReset();
	return 0;
}
예제 #4
0
INT32 CpsInit()
{
	INT32 nMemLen, i;
	
   if (Cps == 2)
      BurnSetRefreshRate(59.629403);

	if (!nCPS68KClockspeed) {
			nCPS68KClockspeed = 11800000;
	}
	nCPS68KClockspeed = nCPS68KClockspeed * 100 / nBurnFPS;

	nMemLen = nCpsGfxLen + nCpsRomLen + nCpsCodeLen + nCpsZRomLen + nCpsQSamLen + nCpsAdLen;

	// Allocate Gfx, Rom and Z80 Roms
	CpsGfx = (UINT8*)BurnMalloc(nMemLen);
	if (CpsGfx == NULL) {
		return 1;
	}
	memset(CpsGfx, 0, nMemLen);

	CpsRom  = CpsGfx + nCpsGfxLen;
	CpsCode = CpsRom + nCpsRomLen;
   CpsZRom = CpsCode + nCpsCodeLen;
	CpsQSam =(INT8*)(CpsZRom + nCpsZRomLen);
	CpsAd   =(UINT8*)(CpsQSam + nCpsQSamLen);

	// Create Gfx addr mask
	for (i = 0; i < 31; i++) {
		if ((1 << i) >= (INT32)nCpsGfxLen) {
			break;
		}
	}
	nCpsGfxMask = (1 << i) - 1;

	// Offset to Scroll tiles
   nCpsGfxScroll[1] = nCpsGfxScroll[2] = nCpsGfxScroll[3] = 0x800000;

#if 0
	if (nCpsZRomLen>=5) {
		// 77->cfff and rst 00 in case driver doesn't load
		CpsZRom[0] = 0x3E; CpsZRom[1] = 0x77;
		CpsZRom[2] = 0x32; CpsZRom[3] = 0xFF; CpsZRom[4] = 0xCF;
		CpsZRom[5] = 0xc7;
	}
#endif

	SepTableCalc();									  // Precalc the separate table

	CpsReset = 0; Cpi01A = Cpi01C = Cpi01E = 0;		  // blank other inputs

	// Use this as default - all CPS-2 games use it
	SetCpsBId(CPS_B_21_DEF, 0);

	return 0;
}
예제 #5
0
static INT32 DrvInit()
{
	INT32 nLen;

//	bToaRotateScreen = true;

	BurnSetRefreshRate(REFRESHRATE);

	nBCU2ROMSize = 0x080000;
	nFCU2ROMSize = 0x100000;

	// Find out how much memory is needed
	AllMem = NULL;
	MemIndex();
	nLen = MemEnd - (UINT8 *)0;
	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) {
		return 1;
	}
	memset(AllMem, 0, nLen);
	MemIndex();

	ToaLoadCode(Drv68KROM, 0, 2);
	ToaLoadTiles(BCU2ROM, 2, nBCU2ROMSize);
	ToaLoadGP9001Tiles(FCU2ROM, 6, 3, nFCU2ROMSize);

	{
		SekInit(0, 0x68000);
		SekOpen(0);
		SekMapMemory(Drv68KROM,		0x000000, 0x03FFFF, SM_ROM);
		SekMapMemory(DrvPalRAM,		0x404000, 0x4047FF, SM_RAM);
		SekMapMemory(DrvPalRAM2,	0x406000, 0x4067FF, SM_RAM);
		SekMapMemory(Drv68KRAM,		0x480000, 0x487FFF, SM_RAM);
		SekSetReadWordHandler(0, 	vimanaReadWord);
		SekSetReadByteHandler(0, 	vimanaReadByte);
		SekSetWriteWordHandler(0, 	vimanaWriteWord);
		SekSetWriteByteHandler(0, 	vimanaWriteByte);
		SekClose();
	}

	ToaInitBCU2();

	nToaPalLen = nColCount;
	ToaPalSrc = DrvPalRAM;
	ToaPalSrc2 = DrvPalRAM2;
	ToaPalInit();

//	BurnYM3812Init(28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0);

	bDrawScreen = true;

	DrvDoReset();
	return 0;
}
예제 #6
0
static INT32 DrvInit()
{
	INT32 nLen;

	Rallybik = 1;

//	bToaRotateScreen = true;

	BurnSetRefreshRate(REFRESHRATE);

	nBCU2ROMSize = 0x080000;
	nFCU2ROMSize = 0x080000;

	// Find out how much memory is needed
	AllMem = NULL;
	MemIndex();
	nLen = MemEnd - (UINT8 *)0;
	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) {
		return 1;
	}
	memset(AllMem, 0, nLen);
	MemIndex();

	if (BurnLoadRom(Drv68KROM + 0x000001,  0, 2)) return 1;
	if (BurnLoadRom(Drv68KROM + 0x000000,  1, 2)) return 1;
	if (BurnLoadRom(Drv68KROM + 0x040001,  2, 2)) return 1;
	if (BurnLoadRom(Drv68KROM + 0x040000,  3, 2)) return 1;

	if (BurnLoadRom(DrvZ80ROM,             4, 1)) return 1;

	ToaLoadTiles(BCU2ROM, 5, nBCU2ROMSize);
//	ToaLoadTiles(FCU2ROM, 9, nFCU2ROMSize);

	if (BurnLoadRom(FCU2ROM + 0x000000,    9, 1)) return 1;
	if (BurnLoadRom(FCU2ROM + 0x010000,   10, 1)) return 1;
	if (BurnLoadRom(FCU2ROM + 0x020000,   11, 1)) return 1;
	if (BurnLoadRom(FCU2ROM + 0x030000,   12, 1)) return 1;

	DrvSpriteDecode();

	{
		SekInit(0, 0x68000);
		SekOpen(0);
		SekMapMemory(Drv68KROM,			0x000000, 0x00FFFF, SM_ROM);
		SekMapMemory(Drv68KROM + 0x40000,	0x040000, 0x07FFFF, SM_ROM);
		SekMapMemory(Drv68KRAM,			0x080000, 0x083FFF, SM_RAM);
		SekMapMemory(DrvSprRAM,			0x0c0000, 0x0C0FFF, SM_RAM);
		SekMapMemory(DrvPalRAM,			0x144000, 0x1447FF, SM_RAM);
		SekMapMemory(DrvPalRAM2,		0x146000, 0x1467FF, SM_RAM);
		SekSetReadWordHandler(0, 		rallybikReadWord);
		SekSetReadByteHandler(0, 		rallybikReadByte);
		SekSetWriteWordHandler(0, 		rallybikWriteWord);
		SekSetWriteByteHandler(0, 		rallybikWriteByte);

		SekMapHandler(1,			0x180000, 0x180FFF, SM_RAM);
		SekSetReadByteHandler(1, 		toaplan1ReadByteZ80RAM);
		SekSetReadWordHandler(1, 		toaplan1ReadWordZ80RAM);
		SekSetWriteByteHandler(1, 		toaplan1WriteByteZ80RAM);
		SekSetWriteWordHandler(1, 		toaplan1WriteWordZ80RAM);
		SekClose();

		ZetInit(0);
		ZetOpen(0);
		ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM);
		ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM);
		ZetMapArea(0x8000, 0xffff, 0, DrvShareRAM);
		ZetMapArea(0x8000, 0xffff, 1, DrvShareRAM);
		ZetMapArea(0x8000, 0xffff, 2, DrvShareRAM);
		ZetSetOutHandler(rallybik_sound_write_port);
		ZetSetInHandler(rallybik_sound_read_port);
		ZetMemEnd();
		ZetClose();
	}

	nLayer0XOffset = 0x0d + 6;
	nLayer1XOffset = 0x0d + 4;
	nLayer2XOffset = 0x0d + 2;
	nLayer3XOffset = 0x0d + 0;
	nLayer0YOffset = nLayer1YOffset = nLayer2YOffset = nLayer3YOffset  = 0x111;

	ToaInitBCU2();

	ToaOpaquePriority = 0;

	nToaPalLen = nColCount;
	ToaPalSrc = DrvPalRAM;
	ToaPalSrc2 = DrvPalRAM2;
	ToaPalInit();

	BurnYM3812Init(28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0);
	BurnTimerAttachZetYM3812(28000000 / 8);

	bDrawScreen = true;

	DrvDoReset();

	return 0;
}
예제 #7
0
파일: d_darkmist.cpp 프로젝트: meesokim/fba
static INT32 DrvInit()
{
	BurnSetRefreshRate(60.00);

	AllMem = NULL;
	MemIndex();
	INT32 nLen = MemEnd - (UINT8 *)0;
	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
	memset(AllMem, 0, nLen);
	MemIndex();

	{
		if (BurnLoadRom(DrvZ80ROM  + 0x00000,  0, 1)) return 1;
		if (BurnLoadRom(DrvZ80ROM  + 0x10000,  1, 1)) return 1;

		if (BurnLoadRom(t5182ROM   + 0x00000,  2, 1)) return 1;
		if (BurnLoadRom(t5182ROM   + 0x08000,  3, 1)) return 1;

		if (BurnLoadRom(DrvGfxROM0 + 0x00000,  4, 1)) return 1;
		if (BurnLoadRom(DrvGfxROM0 + 0x02000,  5, 1)) return 1;

		if (BurnLoadRom(DrvGfxROM1 + 0x10000,  6, 1)) return 1;
		if (BurnLoadRom(DrvGfxROM1 + 0x00000,  7, 1)) return 1;
		if (BurnLoadRom(DrvGfxROM1 + 0x30000,  8, 1)) return 1;
		if (BurnLoadRom(DrvGfxROM1 + 0x20000,  9, 1)) return 1;

		if (BurnLoadRom(DrvGfxROM2 + 0x00000, 10, 1)) return 1;
		if (BurnLoadRom(DrvGfxROM2 + 0x10000, 11, 1)) return 1;
		if (BurnLoadRom(DrvGfxROM2 + 0x20000, 12, 1)) return 1;
		if (BurnLoadRom(DrvGfxROM2 + 0x30000, 13, 1)) return 1;

		if (BurnLoadRom(DrvGfxROM3 + 0x00000, 14, 1)) return 1;
		if (BurnLoadRom(DrvGfxROM3 + 0x08000, 15, 1)) return 1;

		if (BurnLoadRom(DrvGfxROM4 + 0x00000, 16, 1)) return 1;
		if (BurnLoadRom(DrvGfxROM4 + 0x04000, 17, 1)) return 1;

		if (BurnLoadRom(DrvColPROM + 0x00000, 18, 1)) return 1;
		if (BurnLoadRom(DrvColPROM + 0x00100, 19, 1)) return 1;
		if (BurnLoadRom(DrvColPROM + 0x00200, 20, 1)) return 1;
		if (BurnLoadRom(DrvColPROM + 0x00300, 21, 1)) return 1;

		decrypt_prg();
		decrypt_gfx();
		decrypt_snd();

		DrvGfxDecode();
		DrvPaletteInit();
	}

	ZetInit(0);
	ZetOpen(0);
	ZetMapMemory(DrvZ80ROM,		0x0000, 0x7fff, MAP_ROM);
	ZetMapMemory(DrvZ80ROMDec,	0x0000, 0x7fff, MAP_FETCHOP);
	ZetMapMemory(DrvPalRAM,		0xd000, 0xd3ff, MAP_ROM);
	ZetMapMemory(DrvScrollRAM,	0xd400, 0xd4ff, MAP_RAM);
	ZetMapMemory(DrvVidRAM,		0xd800, 0xdfff, MAP_RAM);
	ZetMapMemory(DrvZ80RAM,		0xe000, 0xefff, MAP_RAM);
	ZetMapMemory(DrvSprRAM,		0xf000, 0xffff, MAP_RAM);
	ZetSetWriteHandler(darkmist_main_write);
	ZetSetReadHandler(darkmist_main_read);
	ZetClose();

	t5182Init(1, 14318180/4);

	GenericTilesInit();

	DrvDoReset();

	return 0;
}
예제 #8
0
static INT32 DrvInit()
{
	if (bBurnUseASMCPUEmulation) {
		bUseAsm68KCoreOldValue = bBurnUseASMCPUEmulation;
		bBurnUseASMCPUEmulation = false;
	}

	INT32 nLen;

//	bToaRotateScreen = true;

	BurnSetRefreshRate(REFRESHRATE);

	nBCU2ROMSize = 0x080000;
	nFCU2ROMSize = 0x080000;

	// Find out how much memory is needed
	AllMem = NULL;
	MemIndex();
	nLen = MemEnd - (UINT8 *)0;
	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) {
		return 1;
	}
	memset(AllMem, 0, nLen);
	MemIndex();

	if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1;
	if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1;

	if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1;

	ToaLoadTiles(BCU2ROM, 5, nBCU2ROMSize);
	ToaLoadTiles(FCU2ROM, 9, nFCU2ROMSize);

	{
		SekInit(0, 0x68000);
		SekOpen(0);
		SekMapMemory(Drv68KROM,			0x000000, 0x03FFFF, SM_ROM);
		SekMapMemory(DrvPalRAM,			0x404000, 0x4047FF, SM_RAM);
		SekMapMemory(DrvPalRAM2,		0x406000, 0x4067FF, SM_RAM);
		SekMapMemory(Drv68KRAM,			0xc00000, 0xc03FFF, SM_RAM);
		SekSetReadWordHandler(0, 		demonwldReadWord);
		SekSetReadByteHandler(0, 		demonwldReadByte);
		SekSetWriteWordHandler(0, 		demonwldWriteWord);
		SekSetWriteByteHandler(0, 		demonwldWriteByte);

		SekMapHandler(1,			0x600000, 0x600FFF, SM_RAM);
		SekSetReadByteHandler(1, 		toaplan1ReadByteZ80RAM);
		SekSetReadWordHandler(1, 		toaplan1ReadWordZ80RAM);
		SekSetWriteByteHandler(1, 		toaplan1WriteByteZ80RAM);
		SekSetWriteWordHandler(1, 		toaplan1WriteWordZ80RAM);
		SekClose();

		ZetInit(0);
		ZetOpen(0);
		ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM);
		ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM);
		ZetMapArea(0x8000, 0xffff, 0, DrvShareRAM);
		ZetMapArea(0x8000, 0xffff, 1, DrvShareRAM);
		ZetMapArea(0x8000, 0xffff, 2, DrvShareRAM);
		ZetSetOutHandler(demonwld_sound_write_port);
		ZetSetInHandler(demonwld_sound_read_port);
		ZetMemEnd();
		ZetClose();
	}

	ToaInitBCU2();

	nToaPalLen = nColCount;
	ToaPalSrc = DrvPalRAM;
	ToaPalSrc2 = DrvPalRAM2;
	ToaPalInit();

	ToaOpaquePriority = 2;

	BurnYM3812Init(28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0);
	BurnTimerAttachZetYM3812(28000000 / 8);
	BurnYM3812SetRoute(BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH);

	bDrawScreen = true;

	DrvDoReset();
	return 0;
}
예제 #9
0
static int DrvInit()
{
	int nLen;

	BurnSetRefreshRate(CAVE_REFRESHRATE);

	// Find out how much memory is needed
	Mem = NULL;
	MemIndex();
	nLen = MemEnd - (unsigned char *)0;
	if ((Mem = (unsigned char *)malloc(nLen)) == NULL) {
		return 1;
	}
	memset(Mem, 0, nLen);										// blank all memory
	MemIndex();													// Index the allocated memory

	EEPROMInit(1024, 16);										// EEPROM has 1024 bits, uses 16-bit words

	// Load the roms into memory
	if (LoadRoms()) {
		return 1;
	}

	{
		SekInit(0, 0x68000);													// Allocate 68000
	    SekOpen(0);

		// Map 68000 memory:
		SekMapMemory(Rom01,						0x000000, 0x07FFFF, SM_ROM);	// CPU 0 ROM
		SekMapMemory(Ram01,						0x100000, 0x10FFFF, SM_RAM);
		SekMapMemory(CaveTileRAM[1],			0x200000, 0x207FFF, SM_RAM);
		SekMapMemory(CaveTileRAM[0],			0x300000, 0x307FFF, SM_RAM);
		SekMapMemory(CaveTileRAM[2] + 0x4000,	0x400000, 0x403FFF, SM_RAM);
		SekMapMemory(CaveTileRAM[2] + 0x4000,	0x404000, 0x407FFF, SM_RAM);
		SekMapMemory(CaveSpriteRAM,				0x500000, 0x50FFFF, SM_RAM);
		SekMapMemory(CavePalSrc,				0xA08000, 0xA08FFF, SM_RAM);	// Palette RAM

		SekSetReadWordHandler(0, donpachiReadWord);
		SekSetReadByteHandler(0, donpachiReadByte);
		SekSetWriteWordHandler(0, donpachiWriteWord);
		SekSetWriteByteHandler(0, donpachiWriteByte);

		SekClose();
	}

	CavePalInit();
	CaveTileInit();
	CaveSpriteInit(0, 0x0800000);
	CaveTileInitLayer(0, 0x200000, 8, 0x4000);
	CaveTileInitLayer(1, 0x200000, 8, 0x4000);
	CaveTileInitLayer(2, 0x080000, 8, 0x4000);

	MSM6295Init(0, 8000, 50.0, 0);
	MSM6295Init(1, 16000, 50.0, 0);

	MSM6295SampleData[0][0] = MSM6295ROM + 0x100000;
	MSM6295SampleInfo[0][0] = MSM6295ROM + 0x100000 + 0x0000;
	MSM6295SampleData[0][1] = MSM6295ROM + 0x100000;
	MSM6295SampleInfo[0][1] = MSM6295ROM + 0x100000 + 0x0100;
	MSM6295SampleData[0][2] = MSM6295ROM + 0x100000;
	MSM6295SampleInfo[0][2] = MSM6295ROM + 0x100000 + 0x0200;
	MSM6295SampleData[0][3] = MSM6295ROM + 0x100000;
	MSM6295SampleInfo[0][3] = MSM6295ROM + 0x100000 + 0x0300;

	bDrawScreen = true;

#if defined FBA_DEBUG && defined USE_SPEEDHACKS
	bprintf(PRINT_IMPORTANT, _T("  * Using speed-hacks (detecting idle loops).\n"));
#endif

	DrvDoReset(); // Reset machine

	return 0;
}
예제 #10
0
static INT32 DrvInit()
{
	INT32 nLen;

//	bToaRotateScreen = true;

	BurnSetRefreshRate(REFRESHRATE);

	nBCU2ROMSize = 0x080000;
	nFCU2ROMSize = 0x080000;

	// Find out how much memory is needed
	AllMem = NULL;
	MemIndex();
	nLen = MemEnd - (UINT8 *)0;
	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) {
		return 1;
	}
	memset(AllMem, 0, nLen);
	MemIndex();

	if (BurnLoadRom(Drv68KROM + 0x000001, 0, 2)) return 1;
	if (BurnLoadRom(Drv68KROM + 0x000000, 1, 2)) return 1;
	if (BurnLoadRom(Drv68KROM + 0x040001, 2, 2)) return 1;
	if (BurnLoadRom(Drv68KROM + 0x040000, 3, 2)) return 1;

	ToaLoadTiles(BCU2ROM, 4, nBCU2ROMSize);
	ToaLoadTiles(FCU2ROM, 8, nFCU2ROMSize);

	{
		SekInit(0, 0x68000);
		SekOpen(0);
		SekMapMemory(Drv68KROM,			0x000000, 0x07FFFF, MAP_ROM);
		SekMapMemory(Drv68KRAM,			0x0c0000, 0x0c3FFF, MAP_RAM);
		SekMapMemory(DrvPalRAM,			0x104000, 0x1047FF, MAP_RAM);
		SekMapMemory(DrvPalRAM2,		0x106000, 0x1067FF, MAP_RAM);
		SekSetReadWordHandler(0, 		samesameReadWord);
		SekSetReadByteHandler(0, 		samesameReadByte);
		SekSetWriteWordHandler(0, 		samesameWriteWord);
		SekSetWriteByteHandler(0, 		samesameWriteByte);
		SekClose();
	}

	ToaInitBCU2();

	nToaPalLen = nColCount;
	ToaPalSrc = DrvPalRAM;
	ToaPalSrc2 = DrvPalRAM2;
	ToaPalInit();

//	BurnYM3812Init(28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0);
//	BurnYM3812SetRoute(BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH);

#ifdef TOAPLAN_SOUND_SAMPLES_HACK
        BurnUpdateProgress(0.0, _T("Loading samples..."), 0);

	BurnSampleInit(0);
	BurnSampleSetAllRoutesAllSamples(0.60, BURN_SND_ROUTE_BOTH);
#endif

	bDrawScreen = true;

	DrvDoReset();
	return 0;
}
예제 #11
0
static int DrvInit()
{
    int nLen;

    Hellfire = 1;

#ifdef DRIVER_ROTATION
    bToaRotateScreen = true;
#endif

    BurnSetRefreshRate(REFRESHRATE);

    nBCU2ROMSize = 0x080000;
    nFCU2ROMSize = 0x080000;

    // Find out how much memory is needed
    Mem = NULL;
    MemIndex();
    nLen = MemEnd - (unsigned char *)0;
    if ((Mem = (unsigned char *)malloc(nLen)) == NULL) {
        return 1;
    }
    memset(Mem, 0, nLen);											// blank all memory
    MemIndex();														// Index the allocated memory

    // Load the roms into memory
    if (LoadRoms()) {
        return 1;
    }

    {
        SekInit(0, 0x68000);										// Allocate 68000
        SekOpen(0);

        // Map 68000 memory:
        SekMapMemory(Rom01,			0x000000, 0x03FFFF, SM_ROM);	// 68K ROM
        SekMapMemory(Ram01,			0x040000, 0x047FFF, SM_RAM);	// 68K RAM
        SekMapMemory(RamPal,		0x084000, 0x0847FF, SM_RAM);	// BCU-2 palette RAM
        SekMapMemory(RamPal2,		0x086000, 0x0867FF, SM_RAM);	// FCU-2 palette RAM

        SekSetReadWordHandler(0, hellfireReadWord);
        SekSetReadByteHandler(0, hellfireReadByte);
        SekSetWriteWordHandler(0, hellfireWriteWord);
        SekSetWriteByteHandler(0, hellfireWriteByte);

        SekMapHandler(1,			0x0c0000, 0x0c0FFF, SM_RAM);	// Z80 RAM

        SekSetReadByteHandler(1, toaplan1ReadByteZ80RAM);
        SekSetReadWordHandler(1, toaplan1ReadWordZ80RAM);
        SekSetWriteByteHandler(1, toaplan1WriteByteZ80RAM);
        SekSetWriteWordHandler(1, toaplan1WriteWordZ80RAM);

        SekClose();
    }

    ToaInitBCU2();

    DrvZ80Init();													// Initialize Z80

    nToaPalLen = nColCount;
    ToaPalSrc = RamPal;
    ToaPalSrc2 = RamPal2;
    ToaPalInit();

    BurnYM3812Init(28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream);
    BurnTimerAttachZet(28000000 / 8);

    bDrawScreen = true;

    DrvDoReset();												// Reset machine
    return 0;
}
예제 #12
0
static int CyvernInit()
{
	int nRet = 0, nLen;
	
	BurnSetRefreshRate(59.5971);

	// Allocate and Blank all required memory
	Mem = NULL;
	MemIndex();
	nLen = MemEnd - (unsigned char *)0;
	if ((Mem = (unsigned char *)malloc(nLen)) == NULL) return 1;
	memset(Mem, 0, nLen);
	MemIndex();

	DrvTempRom = (unsigned char *)malloc(0x800000);

	// Load BIOS Rom
	nRet = BurnLoadRom(DrvBiosRom + 0x000000, 0, 1); if (nRet != 0) return 1;
	be_to_le(DrvBiosRom, 0x00080000);
	
	// Load Program Rom
	nRet = BurnLoadRom(DrvPrgRom  + 0x000000, 1, 2); if (nRet != 0) return 1;
	nRet = BurnLoadRom(DrvPrgRom  + 0x000001, 2, 2); if (nRet != 0) return 1;
	be_to_le(DrvPrgRom, 0x00200000);
	
	free(DrvTempRom);
	
	// Setup the 68000 emulation
	Sh2Init(1);
	Sh2Open(0);
	Sh2MapMemory(DrvBiosRom           , 0x00000000, 0x0007ffff, SM_ROM);
	Sh2MapMemory(DrvSpriteRam         , 0x02000000, 0x02003fff, SM_RAM);
	Sh2MapMemory(DrvSpriteRegs        , 0x02100000, 0x0210003f, SM_RAM);
	Sh2MapMemory(DrvTileRegs          , 0x02400000, 0x0240007f, SM_RAM);
	Sh2MapMemory(DrvTileARam          , 0x02500000, 0x02503fff, SM_RAM);
	Sh2MapMemory(DrvTileBRam          , 0x02504000, 0x02507fff, SM_RAM);
	Sh2MapMemory(DrvTileLineRam       , 0x02600000, 0x02607fff, SM_RAM);
	Sh2MapMemory(DrvPaletteRegs       , 0x02a00000, 0x02a0001f, SM_RAM);
	Sh2MapMemory(DrvPaletteRam        , 0x02a40000, 0x02a5ffff, SM_RAM);
	Sh2MapMemory(DrvPrgRom            , 0x04000000, 0x041fffff, SM_ROM);
	Sh2MapMemory(DrvTileBTilesRam     , 0x04800000, 0x0483ffff, SM_RAM);
	Sh2MapMemory(DrvPrgRam            , 0x06000000, 0x06ffffff, SM_RAM);
//	Sh2MapMemory(DrvPrgRam            , 0x06000000, 0x06ffffff, SM_WRITE);
	Sh2MapMemory(DrvCacheRam          , 0xc0000000, 0xc0000fff, SM_RAM);
//	Sh2MapHandler(1                   , 0x06000028, 0x0600002b, SM_READ);
	Sh2SetReadByteHandler (0, CyvernReadByte);
	Sh2SetReadWordHandler (0, CyvernReadWord);
	Sh2SetReadLongHandler (0, CyvernReadLong);
	Sh2SetWriteByteHandler(0, CyvernWriteByte);
	Sh2SetWriteWordHandler(0, CyvernWriteWord);
	Sh2SetWriteLongHandler(0, CyvernWriteLong);
//	Sh2SetReadByteHandler (1, BiosSkipReadByte);
//	Sh2SetReadWordHandler (1, BiosSkipReadWord);
//	Sh2SetReadLongHandler (1, BiosSkipReadLong);
	Sh2Close();
	
	GenericTilesInit();

	// Reset the driver
	DrvDoReset();

	return 0;
}
예제 #13
0
파일: cps.cpp 프로젝트: 0nem4n/ggpofba
int CpsInit()
{
	int nMemLen, i;

	BurnSetRefreshRate(59.633333);

	if (!nCPS68KClockspeed) {
		if (!(Cps & 1)) {
			nCPS68KClockspeed = 11800000;
		} else {
			nCPS68KClockspeed = 10000000;
		}
	}
	nCPS68KClockspeed = nCPS68KClockspeed * 100 / nBurnFPS;

	nMemLen = nCpsGfxLen + nCpsRomLen + nCpsCodeLen + nCpsZRomLen + nCpsQSamLen + nCpsAdLen;

	if (Cps1Qs == 1) {
		nMemLen += nCpsZRomLen * 2;
	}

	// Allocate Gfx, Rom and Z80 Roms
	CpsGfx = (unsigned char*)malloc(nMemLen);
	if (CpsGfx == NULL) {
		return 1;
	}
	memset(CpsGfx, 0, nMemLen);

	CpsRom  = CpsGfx + nCpsGfxLen;
	CpsCode = CpsRom + nCpsRomLen;
	if (Cps1Qs == 1) {
		CpsEncZRom = CpsCode + nCpsCodeLen;
		CpsZRom = CpsEncZRom + nCpsZRomLen * 2;
	} else {
		CpsZRom = CpsCode + nCpsCodeLen;
	}
	CpsQSam =(char*)(CpsZRom + nCpsZRomLen);
	CpsAd   =(unsigned char*)(CpsQSam + nCpsQSamLen);

	// Create Gfx addr mask
	for (i = 0; i < 31; i++) {
		if ((1 << i) >= (int)nCpsGfxLen) {
			break;
		}
	}
	nCpsGfxMask = (1 << i) - 1;

	// Offset to Scroll tiles
	if (!(Cps & 1)) {
		nCpsGfxScroll[1] = nCpsGfxScroll[2] = nCpsGfxScroll[3] = 0x800000;
	} else {
		nCpsGfxScroll[1] = nCpsGfxScroll[2] = nCpsGfxScroll[3] = 0;
	}

	if (nCpsZRomLen>=5) {
		// 77->cfff and rst 00 in case driver doesn't load
		CpsZRom[0] = 0x3E; CpsZRom[1] = 0x77;
		CpsZRom[2] = 0x32; CpsZRom[3] = 0xFF; CpsZRom[4] = 0xCF;
		CpsZRom[5] = 0xc7;
	}

	// mprot
	CpsMProt[0] = 0x40;
	CpsMProt[1] = 0x42;
	CpsMProt[2] = 0x44;
	CpsMProt[3] = 0x46;

	// Board ID (ffight is the default)
	CpsBID[0] = 0x60;
	CpsBID[1] = 0x00;
	CpsBID[2] = 0x04;

	SepTableCalc();									  // Precalc the separate table

	CpsReset = 0; Cpi01A = Cpi01C = Cpi01E = 0;		  // blank other inputs

	nCpsLcReg = 0x66;								  // Layer controller usually at 0x66
	// Usual bits for layer enable
	CpsLayEn[1] = 2; CpsLayEn[2] = 4; CpsLayEn[3] = 8; CpsLayEn[4] = 0; CpsLayEn[5] = 0;

	return 0;
}
예제 #14
0
static INT32 DrvInit()
{
    INT32 nLen;

#ifdef DRIVER_ROTATION
    bToaRotateScreen = false;
#endif

    BurnSetRefreshRate(REFRESHRATE);

    nGP9001ROMSize[0] = 0x200000;

    // Find out how much memory is needed
    Mem = NULL;
    MemIndex();
    nLen = MemEnd - (UINT8 *)0;
    if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) {
        return 1;
    }
    memset(Mem, 0, nLen);										// blank all memory
    MemIndex();													// Index the allocated memory

    // Load the roms into memory
    if (LoadRoms()) {
        return 1;
    }

    {
        SekInit(0, 0x68000);										// Allocate 68000
        SekOpen(0);
        SekMapMemory(Rom01,		0x000000, 0x03FFFF, SM_ROM);	// CPU 0 ROM
        SekMapMemory(Ram01,		0x080000, 0x082FFF, SM_RAM);
        SekMapMemory(RamPal,		0x0c0000, 0x0c0FFF, SM_RAM);	// Palette RAM
        SekSetReadWordHandler(0, 	pipibibsReadWord);
        SekSetReadByteHandler(0, 	pipibibsReadByte);
        SekSetWriteWordHandler(0, 	pipibibsWriteWord);
        SekSetWriteByteHandler(0, 	pipibibsWriteByte);

        SekMapHandler(1,		0x190000, 0x190FFF, SM_RAM);
        SekSetReadByteHandler(1, 	toaplan1ReadByteZ80RAM);
        SekSetReadWordHandler(1, 	toaplan1ReadWordZ80RAM);
        SekSetWriteByteHandler(1, 	toaplan1WriteByteZ80RAM);
        SekSetWriteWordHandler(1, 	toaplan1WriteWordZ80RAM);
        SekClose();

        ZetInit(0);
        ZetOpen(0);
        ZetMapArea(0x0000, 0x7fff, 0, RomZ80);
        ZetMapArea(0x0000, 0x7fff, 2, RomZ80);
        ZetMapArea(0x8000, 0x87ff, 0, RamZ80);
        ZetMapArea(0x8000, 0x87ff, 1, RamZ80);
        ZetMapArea(0x8000, 0x87ff, 2, RamZ80);
        ZetSetWriteHandler(pipibibs_sound_write);
        ZetSetReadHandler(pipibibs_sound_read);
        ZetMemEnd();
        ZetClose();
    }

    nToa1Cycles68KSync = 0;
    BurnYM3812Init(3375000, &toaplan1FMIRQHandler, pipibibsSynchroniseStream, 0);
    BurnTimerAttachZetYM3812(3375000);
    BurnYM3812SetRoute(BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH);

    nSpriteYOffset =  0x0001;

    nLayer0XOffset = -0x01D6;
    nLayer1XOffset = -0x01D8;
    nLayer2XOffset = -0x01DA;

    ToaInitGP9001();

    nToaPalLen = nColCount;
    ToaPalSrc = RamPal;
    ToaPalInit();

    bDrawScreen = true;

    DrvDoReset();			// Reset machine
    return 0;
}
예제 #15
0
// Init game emulation (loading any needed roms)
extern "C" int BurnDrvInit()
{
	int nReturnValue;

	if (nBurnDrvSelect >= nBurnDrvCount)
		return 1;

#if defined (FBA_DEBUG)
	{
		char szText[1024] = "";
		char* pszPosition = szText;
		char* pszName = BurnDrvGetText(DRV_FULLNAME);
		int nName = 1;

		while ((pszName = BurnDrvGetText(DRV_NEXTNAME | DRV_FULLNAME)) != NULL)
			nName++;

		// Print the title

		bprintf(PRINT_IMPORTANT, _T("*** Starting emulation of %s") _T(SEPERATOR_1) _T("%s.\n"), BurnDrvGetText(DRV_NAME), BurnDrvGetText(DRV_FULLNAME));

		// Then print the alternative titles

		if (nName > 1)
		{
			bprintf(PRINT_IMPORTANT, "    Alternative %s ", (nName > 2) ? "titles are" : "title is");
			pszName = BurnDrvGetText(DRV_FULLNAME);
			nName = 1;
			while ((pszName = BurnDrvGetText(DRV_NEXTNAME | DRV_FULLNAME)) != NULL)
			{
				if (pszPosition + _tcslen(pszName) - 1022 > szText)
					break;
				if (nName > 1)
					bprintf(PRINT_IMPORTANT, _T(SEPERATOR_1));

				bprintf(PRINT_IMPORTANT, "%s", pszName);
				nName++;
			}
			bprintf(PRINT_IMPORTANT, ".\n");
		}
	}
#endif

	BurnSetRefreshRate(60.0);

#ifndef NO_CHEATS
	cheatInit();
#endif
	BurnStateInit();
#ifndef NO_COMBO
	if (BurnInitCombo)
		BurnInitCombo();
#endif
#ifndef NO_AUTOFIRE
	if (BurnInitAutofire)
		BurnInitAutofire();
#endif

	nReturnValue = pDriver[nBurnDrvSelect]->Init();	// Forward to drivers function

	nMaxPlayers = pDriver[nBurnDrvSelect]->players;

#if defined (FBA_DEBUG)
	if (!nReturnValue)
	{
		starttime = clock();
		nFramesEmulated = 0;
		nFramesRendered = 0;
		nCurrentFrame = 0;
	}
	else
		starttime = 0;
#endif

	return nReturnValue;
}
예제 #16
0
static INT32 DrvInit()
{
	INT32 nLen;

#ifdef DRIVER_ROTATION
	bToaRotateScreen = true;
#endif

	BurnSetRefreshRate(REFRESHRATE);

	nBCU2ROMSize = 0x080000;
	nFCU2ROMSize = 0x080000;

	// Find out how much memory is needed
	Mem = NULL;
	MemIndex();
	nLen = MemEnd - (UINT8 *)0;
	if ((Mem = (UINT8 *)BurnMalloc(nLen)) == NULL) {
		return 1;
	}
	memset(Mem, 0, nLen);											// blank all memory
	MemIndex();														// Index the allocated memory

	// Load the roms into memory
	if (LoadRoms()) {
		return 1;
	}

	{
		SekInit(0, 0x68000);										// Allocate 68000
	    SekOpen(0);

		// Map 68000 memory:
		SekMapMemory(Rom01,			0x000000, 0x03FFFF, SM_ROM);	// 68K ROM
		SekMapMemory(Ram01,			0x080000, 0x083FFF, SM_RAM);	// 68K RAM
		SekMapMemory(RamPal,		0x144000, 0x1447FF, SM_RAM);	// BCU-2 palette RAM
		SekMapMemory(RamPal2,		0x146000, 0x1467FF, SM_RAM);	// FCU-2 palette RAM

		SekSetReadWordHandler(0, truxtonReadWord);
		SekSetReadByteHandler(0, truxtonReadByte);
		SekSetWriteWordHandler(0, truxtonWriteWord);
		SekSetWriteByteHandler(0, truxtonWriteByte);

		SekMapHandler(1,			0x180000, 0x180FFF, SM_RAM);	// Z80 RAM

		SekSetReadByteHandler(1, toaplan1ReadByteZ80RAM);
		SekSetReadWordHandler(1, toaplan1ReadWordZ80RAM);
		SekSetWriteByteHandler(1, toaplan1WriteByteZ80RAM);
		SekSetWriteWordHandler(1, toaplan1WriteWordZ80RAM);

		SekClose();
	}
	
	ToaInitBCU2();
	
	DrvZ80Init();													// Initialize Z80

	nToaPalLen = nColCount;
	ToaPalSrc = RamPal;
	ToaPalSrc2 = RamPal2;
	ToaPalInit();

	BurnYM3812Init(28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0);
	BurnTimerAttachZetYM3812(28000000 / 8);
	BurnYM3812SetRoute(BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH);

	bDrawScreen = true;

	DrvDoReset();												// Reset machine
	return 0;
}
예제 #17
0
파일: burn.cpp 프로젝트: nworkers/fba-sdl
// Init game emulation (loading any needed roms)
extern "C" INT32 BurnDrvInit()
{
	INT32 nReturnValue;

	if (nBurnDrvActive >= nBurnDrvCount) {
		return 1;
	}

#if defined (FBA_DEBUG)
	{
		TCHAR szText[1024] = _T("");
		TCHAR* pszPosition = szText;
		TCHAR* pszName = BurnDrvGetText(DRV_FULLNAME);
		INT32 nName = 1;

		while ((pszName = BurnDrvGetText(DRV_NEXTNAME | DRV_FULLNAME)) != NULL) {
			nName++;
		}

		// Print the title

		bprintf(PRINT_IMPORTANT, _T("*** Starting emulation of %s - %s.\n"), BurnDrvGetText(DRV_NAME), BurnDrvGetText(DRV_FULLNAME));

		// Then print the alternative titles

		if (nName > 1) {
			bprintf(PRINT_IMPORTANT, _T("    Alternative %s "), (nName > 2) ? _T("titles are") : _T("title is"));
			pszName = BurnDrvGetText(DRV_FULLNAME);
			nName = 1;
			while ((pszName = BurnDrvGetText(DRV_NEXTNAME | DRV_FULLNAME)) != NULL) {
				if (pszPosition + _tcslen(pszName) - 1022 > szText) {
					break;
				}
				if (nName > 1) {
					bprintf(PRINT_IMPORTANT, _T(SEPERATOR_1));
				}
				bprintf(PRINT_IMPORTANT, _T("%s"), pszName);
				nName++;
			}
			bprintf(PRINT_IMPORTANT, _T(".\n"));
		}
	}
#endif

	BurnSetRefreshRate(60.0);

	CheatInit();
	HiscoreInit();
	BurnStateInit();	
	BurnInitMemoryManager();

	nReturnValue = pDriver[nBurnDrvActive]->Init();	// Forward to drivers function

	nMaxPlayers = pDriver[nBurnDrvActive]->Players;
	
#if defined (FBA_DEBUG)
	if (!nReturnValue) {
		starttime = clock();
		nFramesEmulated = 0;
		nFramesRendered = 0;
		nCurrentFrame = 0;
	} else {
		starttime = 0;
	}
#endif

	return nReturnValue;
}
예제 #18
0
extern "C" int BurnJukeboxInit()
{
	int nReturnValue;

	if (nBurnDrvSelect >= nBurnDrvCount) {
		return 1;
	}

#if defined (FBA_DEBUG)
	{
		TCHAR szText[1024] = _T("");
		TCHAR* pszPosition = szText;
		TCHAR* pszName = BurnDrvGetText(DRV_FULLNAME);
		int nName = 1;

		while ((pszName = BurnDrvGetText(DRV_NEXTNAME | DRV_FULLNAME)) != NULL) {
			nName++;
		}

		// Print the title

		bprintf(PRINT_IMPORTANT, _T("*** Starting jukebox emulation of %s") _T(SEPERATOR_1) _T("%s.\n"), BurnDrvGetText(DRV_NAME), BurnDrvGetText(DRV_FULLNAME));

		// Then print the alternative titles

		if (nName > 1) {
			bprintf(PRINT_IMPORTANT, _T("    Alternative %s "), (nName > 2) ? _T("titles are") : _T("title is"));
			pszName = BurnDrvGetText(DRV_FULLNAME);
			nName = 1;
			while ((pszName = BurnDrvGetText(DRV_NEXTNAME | DRV_FULLNAME)) != NULL) {
				if (pszPosition + _tcslen(pszName) - 1022 > szText) {
					break;
				}
				if (nName > 1) {
					bprintf(PRINT_IMPORTANT, _T(SEPERATOR_1));
				}
				bprintf(PRINT_IMPORTANT, _T("%s"), pszName);
				nName++;
			}
			bprintf(PRINT_IMPORTANT, _T(".\n"));
		}
	}
#endif

	BurnSetRefreshRate(60.0);

	nReturnValue = pDriver[nBurnDrvSelect]->JukeboxInit();	// Forward to drivers function

#if defined (FBA_DEBUG)
	if (!nReturnValue) {
		starttime = clock();
		nFramesEmulated = 0;
		nFramesRendered = 0;
		nCurrentFrame = 0;
	} else {
		starttime = 0;
	}
#endif

	return nReturnValue;
}