Example #1
0
static INT32 DrvInit()
{
	INT32 nLen;
    
#ifdef DRIVER_ROTATION
	bToaRotateScreen = true;
#endif
    
	nGP9001ROMSize[0] = 0x400000;
	nGP9001ROMSize[1] = 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, 0x07FFFF, SM_ROM);	// CPU 0 ROM
		SekMapMemory(Ram01,		0x100000, 0x10FFFF, SM_RAM);
		SekMapMemory(RamPal,	0x400000, 0x400FFF, SM_RAM);	// Palette RAM
		SekSetReadWordHandler(0, batsugunReadWord);
		SekSetReadByteHandler(0, batsugunReadByte);
		SekSetWriteWordHandler(0, batsugunWriteWord);
		SekSetWriteByteHandler(0, batsugunWriteByte);
		SekClose();
        
		VezInit(0, V25_TYPE, 16000000 /*before divider*/);
		VezOpen(0);
		for (INT32 i = 0x80000; i < 0x100000; i += 0x8000) {
			VezMapArea(i, i + 0x7fff, 0, ShareRAM);
			VezMapArea(i, i + 0x7fff, 1, ShareRAM);
			VezMapArea(i, i + 0x7fff, 2, ShareRAM);
		}
		VezSetReadHandler(batsugun_v25_read);
		VezSetWriteHandler(batsugun_v25_write);
		VezSetReadPort(batsugun_v25_read_port);
		VezClose();
	}
    
	BurnYM2151Init(3375000);
	BurnYM2151SetAllRoutes(0.50, BURN_SND_ROUTE_BOTH);
	MSM6295Init(0, 4000000 / 132, 1);
	MSM6295SetRoute(0, 0.50, BURN_SND_ROUTE_BOTH);
    
	nSpriteYOffset = 0x0001;
    
	nLayer0XOffset = -0x01D6;
	nLayer1XOffset = -0x01D8;
	nLayer2XOffset = -0x01DA;
    
	ToaInitGP9001(3);
    
	nToaPalLen = nColCount;
	ToaPalSrc = RamPal;
	ToaPalInit();
    
	bDrawScreen = true;
    
	DrvDoReset(); // Reset machine
    
	return 0;
}
Example #2
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, 0);
	BurnTimerAttachZetYM3812(28000000 / 8);

	bDrawScreen = true;

	DrvDoReset();												// Reset machine
	return 0;
}
Example #3
0
static int DrvInit()
{
	int nLen;

#ifdef DRIVER_ROTATION
	bToaRotateScreen = true;
#endif

	nGP9001ROMSize[0] = 0x400000;
	nGP9001ROMSize[1] = 0x200000;

	// 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, 0x07FFFF, SM_ROM);	// CPU 0 ROM
		SekMapMemory(Ram01,		0x100000, 0x10FFFF, SM_RAM);
		SekMapMemory(Ram02,		0x210000, 0x21EFFF, SM_RAM);	//
		SekMapMemory(Ram03,		0x21FC00, 0x21FFFF, SM_RAM);	//
		SekMapMemory(RamPal,	0x400000, 0x400FFF, SM_RAM);	// Palette RAM

		SekSetReadWordHandler(0, batsugunReadWord);
		SekSetReadByteHandler(0, batsugunReadByte);
		SekSetWriteWordHandler(0, batsugunWriteWord);
		SekSetWriteByteHandler(0, batsugunWriteByte);

		SekClose();
	}

	nSpriteYOffset = 0x0001;

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

	ToaInitGP9001(3);

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

	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;
}
Example #4
0
static int DrvInit()
{
	int nLen;

#ifdef DRIVER_ROTATION
	bToaRotateScreen = true;
#endif

	nGP9001ROMSize[0] = 0x400000;
	nGP9001ROMSize[1] = 0x200000;

	// 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);
		SekMapMemory(Rom01,		0x000000, 0x07FFFF, SM_ROM);	// CPU 0 ROM
		SekMapMemory(Ram01,		0x100000, 0x10FFFF, SM_RAM);
		SekMapMemory(RamPal,	0x400000, 0x400FFF, SM_RAM);	// Palette RAM
		SekSetReadWordHandler(0, batsugunReadWord);
		SekSetReadByteHandler(0, batsugunReadByte);
		SekSetWriteWordHandler(0, batsugunWriteWord);
		SekSetWriteByteHandler(0, batsugunWriteByte);
		SekClose();

		VezInit(0, V25_TYPE, 16000000 /*before divider*/);
		VezOpen(0);
		for (int i = 0x80000; i < 0x100000; i += 0x8000) {
			VezMapArea(i, i + 0x7fff, 0, ShareRAM);
			VezMapArea(i, i + 0x7fff, 1, ShareRAM);
			VezMapArea(i, i + 0x7fff, 2, ShareRAM);
		}
		VezSetReadHandler(batsugun_v25_read);
		VezSetWriteHandler(batsugun_v25_write);
		VezSetReadPort(batsugun_v25_read_port);
		VezClose();
	}

	BurnYM2151Init(3375000, 50.0);
	MSM6295Init(0, 4000000 / 132, 50.0, 1);

	nSpriteYOffset = 0x0001;

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

	ToaInitGP9001(3);

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

	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;
}
Example #5
0
static INT32 drvInit()
{
    INT32 nLen;

#ifdef DRIVER_ROTATION
    bToaRotateScreen = true;
#endif

    nGP9001ROMSize[0] = 0x01000000;

    // 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);										// Zero memory
    MemIndex();													// Index the allocated memory

    if (LoadRoms()) {
        return 1;
    }

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

        // Map 68000 memory:
        SekMapMemory(Rom01, 0x000000, 0x1FFFFF, SM_ROM);		// CPU 0 ROM
        SekMapMemory(Ram02, 0x208000, 0x20FFFF, SM_RAM);

        Map68KTextROM(true);

        SekSetReadWordHandler(0, batriderReadWord);
        SekSetReadByteHandler(0, batriderReadByte);
        SekSetWriteWordHandler(0, batriderWriteWord);
        SekSetWriteByteHandler(0, batriderWriteByte);

        SekMapHandler(1,	0x400000, 0x400400, SM_RAM);		// GP9001 addresses

        SekSetReadWordHandler(1, batriderReadWordGP9001);
        SekSetWriteWordHandler(1, batriderWriteWordGP9001);

        SekMapHandler(2,	0x300000, 0x37FFFF, SM_ROM);		// Z80 ROM

        SekSetReadByteHandler(2, batriderReadByteZ80ROM);
        SekSetReadWordHandler(2, batriderReadWordZ80ROM);

        SekClose();
    }

    nSpriteYOffset = 0x0001;

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

    ToaInitGP9001();

    nExtraTXOffset = 0x2C;
    ToaExtraTextInit();

    drvZInit();				// Initialize Z80

    BurnYM2151Init(32000000 / 8);
    BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH);

    MSM6295Init(0, 32000000 / 10 / 132, 1);
    MSM6295Init(1, 32000000 / 10 / 165, 1);
    MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH);
    MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH);

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

    nTextROMStatus = -1;
    bDrawScreen = true;

    drvDoReset(); // Reset machine
    return 0;
}
Example #6
0
static INT32 DrvInit()
{
	INT32 nLen;

#ifdef DRIVER_ROTATION
	bToaRotateScreen = true;
#endif

	nGP9001ROMSize[0] = 0x200000;

	// Find out how much memory is needed
	Mem = NULL;
	MemIndex();
	nLen = MemEnd - (UINT8 *)0;
	if ((Mem = (UINT8 *)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);
		SekMapMemory(Rom01,		0x000000, 0x07FFFF, SM_ROM);	// CPU 0 ROM
		SekMapMemory(Ram01,		0x100000, 0x103FFF, SM_RAM);
	//	SekMapMemory(ShareRAM,		0x210000, 0x21ffff, SM_RAM);
		SekMapMemory(RamPal,		0x400000, 0x400FFF, SM_RAM);	// Palette RAM
		SekSetReadWordHandler(0, vfiveReadWord);
		SekSetReadByteHandler(0, vfiveReadByte);
		SekSetWriteWordHandler(0, vfiveWriteWord);
		SekSetWriteByteHandler(0, vfiveWriteByte);
		SekClose();

		VezInit(0, V25_TYPE, 10000000 /*before divider*/);
		VezOpen(0);
		for (INT32 i = 0x80000; i < 0x100000; i += 0x8000) {
			VezMapArea(i, i + 0x7fff, 0, ShareRAM);
			VezMapArea(i, i + 0x7fff, 1, ShareRAM);
			VezMapArea(i, i + 0x7fff, 2, ShareRAM);
		}
		VezSetReadHandler(vfive_v25_read);
		VezSetWriteHandler(vfive_v25_write);
		VezSetReadPort(vfive_v25_read_port);
		VezSetDecode(nitro_decryption_table);
		VezClose();
	}

	BurnYM2151Init(3375000, 100.0);

	nSpriteYOffset = 0x0001;

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

	ToaInitGP9001();

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

	bDrawScreen = true;

	DrvDoReset();							// Reset machine
	return 0;
}
Example #7
0
static int DrvInit()
{
	int nLen;

#ifdef DRIVER_ROTATION
	bToaRotateScreen = false;
#endif

	nGP9001ROMSize[0] = 0x400000;

	// 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, 0x07FFFF, SM_ROM);	// CPU 0 ROM
		SekMapMemory(Ram01,		0x100000, 0x10FFFF, SM_RAM);
		SekMapMemory(RamPal,	0x400000, 0x400FFF, SM_RAM);	// Palette RAM

		SekSetReadWordHandler(0, snowbro2ReadWord);
		SekSetReadByteHandler(0, snowbro2ReadByte);
		SekSetWriteWordHandler(0, snowbro2WriteWord);
		SekSetWriteByteHandler(0, snowbro2WriteByte);

		SekClose();
	}

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

	nSpriteYOffset = 0x0011;
	ToaInitGP9001();

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

	BurnYM2151Init(27000000 / 8, 50.0);
	MSM6295Init(0, 27000000 / 10 / 132, 50.0, 1);

	bDrawScreen = true;

	DrvDoReset(); // Reset machine
	return 0;
}
Example #8
0
static INT32 DrvInit()
{
	INT32 nLen;

#ifdef DRIVER_ROTATION
	bToaRotateScreen = false;
#endif

	nGP9001ROMSize[0] = 0x800000;

	// 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);	// CPU 0 ROM
		SekMapMemory(Ram01,		0x080000, 0x082FFF, SM_RAM);
		SekMapMemory(RamPal,	0x0c0000, 0x0c0FFF, SM_RAM);	// Palette RAM

		SekSetReadWordHandler(0, tekipakiReadWord);
		SekSetReadByteHandler(0, tekipakiReadByte);
		SekSetWriteWordHandler(0, tekipakiWriteWord);
		SekSetWriteByteHandler(0, tekipakiWriteByte);

		SekClose();
	}

	nSpriteYOffset = 0x0011;

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

	ToaInitGP9001();

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

	BurnSampleInit(0);
	BurnSampleSetAllRoutesAllSamples(1.00, BURN_SND_ROUTE_BOTH);

	bDrawScreen = true;

	DrvDoReset();			// Reset machine
	return 0;
}