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; }
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; }
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; }
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; }