static INT32 DrvZ80Init() { // Init the Z80 ZetInit(0); ZetOpen(0); ZetSetReadHandler(mahoudaiZ80Read); ZetSetWriteHandler(mahoudaiZ80Write); // ROM ZetMapArea (0x0000, 0xBFFF, 0, RomZ80); // Direct Read from ROM ZetMapArea (0x0000, 0xBFFF, 2, RomZ80); // Direct Fetch from ROM // RAM ZetMapArea (0xC000, 0xDFFF, 0, RamZ80); // Direct Read from RAM ZetMapArea (0xC000, 0xDFFF, 1, RamZ80); // Direct Write to RAM ZetMapArea (0xC000, 0xDFFF, 2, RamZ80); // // Callbacks ZetMemCallback(0xE000, 0xE0FF, 0); // Read ZetMemCallback(0xE000, 0xE0FF, 1); // Write ZetMemEnd(); ZetClose(); return 0; }
INT32 Sf2mdtSoundInit() { Sf2mdtZ80Ram = (UINT8*)BurnMalloc(0x800); ZetInit(0); ZetOpen(0); ZetSetReadHandler(Sf2mdtZ80Read); ZetSetWriteHandler(Sf2mdtZ80Write); ZetMapArea(0x0000, 0x7fff, 0, CpsZRom + 0x00000); ZetMapArea(0x0000, 0x7fff, 2, CpsZRom + 0x00000); ZetMapArea(0x8000, 0xbfff, 0, CpsZRom + 0x08000); ZetMapArea(0x8000, 0xbfff, 2, CpsZRom + 0x08000); ZetMapArea(0xd000, 0xd7ff, 0, Sf2mdtZ80Ram ); ZetMapArea(0xd000, 0xd7ff, 1, Sf2mdtZ80Ram ); ZetMapArea(0xd000, 0xd7ff, 2, Sf2mdtZ80Ram ); ZetClose(); BurnYM2151Init(3579540); BurnYM2151SetAllRoutes(0.35, BURN_SND_ROUTE_BOTH); MSM5205Init(0, Sf2mdtSynchroniseStream, 24000000 / 64, Sf2mdtMSM5205Vck0, MSM5205_S96_4B, 1); MSM5205Init(1, Sf2mdtSynchroniseStream, 24000000 / 64, Sf2mdtMSM5205Vck1, MSM5205_S96_4B, 1); MSM5205SetRoute(0, 0.25, BURN_SND_ROUTE_BOTH); MSM5205SetRoute(1, 0.25, BURN_SND_ROUTE_BOTH); nCpsZ80Cycles = 3579540 * 100 / nBurnFPS; Sf2mdtNumZ80Banks = (nCpsZRomLen / 0x4000) - 1; return 0; }
static INT32 DrvZ80Init() { ZetInit(0); ZetOpen(0); ZetSetReadHandler(battlegZ80Read); ZetSetWriteHandler(battlegZ80Write); // ROM bank 1 ZetMapArea (0x0000, 0x7FFF, 0, RomZ80 + 0x0000); // Direct Read from ROM ZetMapArea (0x0000, 0x7FFF, 2, RomZ80 + 0x0000); // Direct Fetch from ROM // ROM bank 2 ZetMapArea (0x8000, 0xBFFF, 0, RomZ80 + 0x8000); // Direct Read from ROM ZetMapArea (0x8000, 0xBFFF, 2, RomZ80 + 0x8000); // Direct Fetch from ROM // RAM ZetMapArea (0xC000, 0xDFFF, 0, RamZ80); // Direct Read from RAM ZetMapArea (0xC000, 0xDFFF, 1, RamZ80); // Direct Write to RAM ZetMapArea (0xC000, 0xDFFF, 2, RamZ80); // // Ports ZetMemCallback(0xE000, 0xE0FF, 0); // Read ZetMemCallback(0xE000, 0xE0FF, 1); // Write ZetClose(); nCurrentBank = 2; return 0; }
INT32 QsndZInit() { if (nCpsZRomLen < 0x8000) { // Not enough Z80 Data return 1; } if (CpsZRom == NULL) { return 1; } ZetInit(0); ZetOpen(0); ZetSetReadHandler(QsndZRead); ZetSetWriteHandler(QsndZWrite); // Read and fetch first 0x8000 of Rom if (Cps1Qs) { ZetMapArea(0x0000, 0x7FFF, 0, CpsZRom - (nCpsZRomLen / 2)); ZetMapArea(0x0000, 0x7FFF, 2, CpsZRom, CpsZRom - (nCpsZRomLen / 2)); // If it tries to fetch this area } else { ZetMapArea(0x0000, 0x7FFF, 0 ,CpsZRom); ZetMapArea(0x0000, 0x7FFF, 2, CpsZRom); } // Map first Bank of Rom nQsndZBank = 0; QsndZBankMap(); ZetMapArea(0xC000, 0xCFFF, 0, CpsZRamC0); ZetMapArea(0xC000, 0xCFFF, 1, CpsZRamC0); ZetMapArea(0xC000, 0xCFFF, 2, CpsZRamC0); ZetMemCallback(0xD000, 0xEFFF, 0); ZetMemCallback(0xD000, 0xEFFF, 1); if (Cps1Qs) { ZetMapArea(0xD000, 0xEFFF, 2, CpsZRom, CpsZRom - (nCpsZRomLen / 2)); // If it tries to fetch this area } else { ZetMapArea(0xD000, 0xEFFF, 2, CpsZRom); } ZetMapArea(0xF000, 0xFFFF, 0, CpsZRamF0); ZetMapArea(0xF000, 0xFFFF, 1, CpsZRamF0); ZetMapArea(0xF000, 0xFFFF, 2, CpsZRamF0); ZetMemEnd(); ZetClose(); return 0; }
int PsndZInit() { if (nCpsZRomLen<0x8000) { return 1; // Not enough Z80 Data } if (CpsZRom==NULL) { return 1; } PsndZRam=(unsigned char *)malloc(0x800); if (PsndZRam==NULL) { return 1; } ZetInit(1); ZetSetReadHandler(PsndZRead); ZetSetWriteHandler(PsndZWrite); ZetSetInHandler(PsndZIn); ZetSetOutHandler(PsndZOut); // Read and fetch first 0x8000 of Rom ZetMapArea(0x0000,0x7fff,0,CpsZRom); ZetMapArea(0x0000,0x7fff,2,CpsZRom); // Map first Bank of Rom to 0x8000-0xc000 nPsndZBank=0; PsndZBankMap(); // Ram ZetMapArea(0xd000,0xd7ff,0,PsndZRam); ZetMapArea(0xd000,0xd7ff,1,PsndZRam); ZetMapArea(0xd000,0xd7ff,2,PsndZRam); // Sound chip interfaces ZetMemCallback(0xf000,0xffff,0); ZetMemCallback(0xf000,0xffff,1); // In case it tries to fetch other areas ZetMapArea(0xc000,0xcfff,2,CpsZRom); ZetMapArea(0xd800,0xffff,2,CpsZRom); ZetMemEnd(); ZetClose(); return 0; }
static int DrvZ80Init() { // Init the Z80 ZetInit(1); ZetSetReadHandler(shippumdZ80Read); ZetSetWriteHandler(shippumdZ80Write); // ROM ZetMapArea (0x0000, 0xFFFF, 0, RomZ80); // Direct Read from ROM ZetMapArea (0x0000, 0xFFFF, 2, RomZ80); // Direct Fetch from ROM // RAM ZetMapArea (0xC000, 0xDFFF, 0, RamZ80); // Direct Read from RAM ZetMapArea (0xC000, 0xDFFF, 1, RamZ80); // Direct Write to RAM ZetMapArea (0xC000, 0xDFFF, 2, RamZ80); // // Callbacks ZetMemCallback(0xE000, 0xE0FF, 0); // Read ZetMemCallback(0xE000, 0xE0FF, 1); // Write ZetMemEnd(); return 0; }
static INT32 DrvInit() { AllMem = NULL; MemIndex(); INT32 nLen = MemEnd - (UINT8 *)0; if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; memset(AllMem, 0, nLen); MemIndex(); { if (BurnLoadRom(DrvZ80ROM0 + 0x000000, 0, 1)) return 1; memmove (DrvZ80ROM0 + 0x10000, DrvZ80ROM0 + 0x08000, 0x78000); if (BurnLoadRom(DrvZ80ROM1 + 0x000000, 1, 1)) return 1; if (BurnLoadRom(DrvGfxROM0 + 0x000000, 2, 1)) return 1; memcpy (DrvSndROM + 0x000000, DrvGfxROM0 + 0x000000, 0x020000); memcpy (DrvSndROM + 0x040000, DrvGfxROM0 + 0x000000, 0x020000); memcpy (DrvSndROM + 0x080000, DrvGfxROM0 + 0x000000, 0x020000); memcpy (DrvSndROM + 0x0c0000, DrvGfxROM0 + 0x000000, 0x020000); memcpy (DrvSndROM + 0x020000, DrvGfxROM0 + 0x000000, 0x020000); memcpy (DrvSndROM + 0x060000, DrvGfxROM0 + 0x020000, 0x020000); memcpy (DrvSndROM + 0x0a0000, DrvGfxROM0 + 0x040000, 0x020000); memcpy (DrvSndROM + 0x0e0000, DrvGfxROM0 + 0x060000, 0x020000); if (BurnLoadRom(DrvGfxROM0 + 0x000000, 3, 1)) return 1; if (BurnLoadRom(DrvGfxROM0 + 0x020000, 4, 1)) return 1; if (BurnLoadRom(DrvGfxROM0 + 0x040000, 5, 1)) return 1; if (BurnLoadRom(DrvGfxROM0 + 0x060000, 6, 1)) return 1; if (BurnLoadRom(DrvGfxROM1 + 0x000000, 7, 1)) return 1; if (BurnLoadRom(DrvGfxROM1 + 0x020000, 8, 1)) return 1; DrvGfxDecode(); } ZetInit(0); ZetOpen(0); ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM0); ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM0); ZetMapArea(0x8000, 0x87ff, 0, DrvPalRAM); // ZetMapArea(0x8000, 0x87ff, 1, DrvPalRAM); ZetMapArea(0x8000, 0x87ff, 2, DrvPalRAM); ZetMapArea(0x8800, 0x8fff, 0, DrvAttrRAM); ZetMapArea(0x8800, 0x8fff, 1, DrvAttrRAM); ZetMapArea(0x8800, 0x8fff, 2, DrvAttrRAM); ZetMapArea(0xa000, 0xbfff, 0, DrvZ80RAM0); ZetMapArea(0xa000, 0xbfff, 1, DrvZ80RAM0); ZetMapArea(0xa000, 0xbfff, 2, DrvZ80RAM0); ZetSetWriteHandler(speedspn_main_write); ZetSetOutHandler(speedspn_main_write_port); ZetSetInHandler(speedspn_main_read_port); ZetClose(); ZetInit(1); ZetOpen(1); ZetMapArea(0x0000, 0x7fff, 0, DrvZ80ROM1); ZetMapArea(0x0000, 0x7fff, 2, DrvZ80ROM1); ZetMapArea(0x8000, 0x87ff, 0, DrvZ80RAM1); ZetMapArea(0x8000, 0x87ff, 1, DrvZ80RAM1); ZetMapArea(0x8000, 0x87ff, 2, DrvZ80RAM1); ZetSetWriteHandler(speedspn_sound_write); ZetSetReadHandler(speedspn_sound_read); ZetClose(); MSM6295Init(0, 1122000 / 132, 0); MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH); DrvDoReset(); GenericTilesInit(); return 0; }
int TmntInit() { int nRet=0; int nLen=0; // Find out how much memory is needed Mem=NULL; MemIndex(); nLen=MemEnd-(unsigned char *)0; Mem=(unsigned char *)malloc(nLen); if (Mem==NULL) return 1; memset(Mem,0,nLen); // blank all memory MemIndex(); // Index the allocated memory TmntZ80Rom=(unsigned char *)malloc(0x08000); if (TmntZ80Rom==NULL) return 1; memset(TmntZ80Rom,0x11,0x08000); TmntZ80Ram=(unsigned char *)malloc(0x0800); if (TmntZ80Ram==NULL) return 1; memset(TmntZ80Ram,0x00,0x0800); nRet=LoadRoms(); if (nRet!=0) return 1; // Load the roms into memory SekInit(0,0x68000); // Allocate 68000 SekOpen(0); // Map in memory: // ----------------- Cpu 1 ------------------------ SekMapMemory(Tmnt68KROM01, 0x000000,0x05FFFF, SM_ROM); // 68000 Rom SekMapMemory(TmntRam06, 0x060000,0x063FFF, SM_RAM); SekMapMemory(TmntRam08, 0x080000,0x080FFF, SM_ROM); // Write goes through handler SekMapMemory(PriRam, 0x0c0000,0x0c00FF, SM_RAM); SekMapMemory(TmntRam10, 0x100000,0x107FFF, SM_RAM); SekMapMemory(K051960Ram, 0x140400,0x1407FF, SM_RAM); SekSetReadWordHandler(0,TmntReadWord); SekSetWriteWordHandler(0,TmntWriteWord); SekSetReadByteHandler(0,TmntReadByte); SekSetWriteByteHandler(0,TmntWriteByte); // ------------------------------------------------ // SekReset(); SekClose(); // Setup the Z80 emulation ZetInit(1); ZetOpen(0); ZetMapArea(0x0000, 0x7fff, 0, TmntZ80Rom); ZetMapArea(0x0000, 0x7fff, 2, TmntZ80Rom); ZetMapArea(0x8000, 0x87FF, 0, TmntZ80Ram); ZetMapArea(0x8000, 0x87FF,1, TmntZ80Ram); ZetMapArea(0x8000, 0x87FF, 2, TmntZ80Ram); ZetMemEnd(); ZetSetInHandler(tmntZ80In); ZetSetOutHandler(tmntZ80Out); ZetSetReadHandler(tmntZ80Read); ZetSetWriteHandler(tmntZ80Write); // ZetReset(); ZetClose(); // sound stuff // ym2151 BurnYM2151Init(3579545, 50.0); BurnYM2151SetIrqHandler(&tmntYM2151IRQHandler); // BurnYM2151Reset(); UPD7759Init(UPD7759_STANDARD_CLOCK, TmntSampleROM02); bInt5=0; GenericTilesInit(); TmntPalInit(); TmntReset(); return 0; }
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; }
void sms_init(void) { ZetInit(0); ZetOpen(0); /* Default: open bus */ data_bus_pullup = 0x00; data_bus_pulldown = 0x00; // bprintf(0, _T("Cart mapper: ")); /* Assign mapper */ if(cart.mapper == MAPPER_CODIES) { // bprintf(0, _T("codemasters\n")); ZetSetWriteHandler(writemem_mapper_codies); } else if (cart.mapper == MAPPER_MSX || cart.mapper == MAPPER_MSX_NEMESIS) { // bprintf(0, _T("msx\n")); ZetSetWriteHandler(writemem_mapper_msx); } else { // bprintf(0, _T("sega\n")); ZetSetWriteHandler(writemem_mapper_sega); } /* Force SMS (J) console type if FM sound enabled */ if(sms.use_fm) { sms.console = CONSOLE_SMSJ; sms.territory = TERRITORY_DOMESTIC; sms.display = DISPLAY_NTSC; } /* Initialize selected console emulation */ switch(sms.console) { case CONSOLE_SMS: ZetSetOutHandler(sms_port_w); ZetSetInHandler(sms_port_r); break; case CONSOLE_SMSJ: ZetSetOutHandler(smsj_port_w); ZetSetInHandler(smsj_port_r); break; case CONSOLE_SMS2: ZetSetOutHandler(sms_port_w); ZetSetInHandler(sms_port_r); data_bus_pullup = 0xFF; break; case CONSOLE_GG: ZetSetOutHandler(gg_port_w); ZetSetInHandler(gg_port_r); data_bus_pullup = 0xFF; break; case CONSOLE_GGMS: ZetSetOutHandler(ggms_port_w); ZetSetInHandler(ggms_port_r); data_bus_pullup = 0xFF; break; case CONSOLE_GEN: case CONSOLE_MD: ZetSetOutHandler(md_port_w); ZetSetInHandler(md_port_r); break; case CONSOLE_GENPBC: case CONSOLE_MDPBC: ZetSetOutHandler(md_port_w); ZetSetInHandler(md_port_r); data_bus_pullup = 0xFF; break; } ZetClose(); sms_reset(); }
int SupermanInit() { int nRet= 0; int nLen = 0; //--------------Allocate Memory----------------- Mem = NULL; MemIndex(); nLen = MemEnd - (unsigned char *)0; Mem = (unsigned char *)malloc(nLen); if (Mem == NULL) return 1; memset(Mem, 0, nLen); // blank all memory MemIndex(); // Index the allocated memory //--------------- Load Roms ------------------- nRet = LoadRoms(); if (nRet != 0) return 1; // Load the roms into memory // Map in memory: // ----------------- Cpu 1 68k ------------------------ SekInit(0, 0x68000); // Allocate 1 68000 SekOpen(0); SekMapMemory(Rom , 0x000000, 0x07ffff ,SM_ROM); SekMapMemory(Superman_src_pal, 0xb00000, 0xb00fff, SM_RAM); SekMapMemory(sysbvidattr , 0xd00000, 0xd00fff, SM_RAM); SekMapMemory(sysbvidram , 0xe00000, 0xe03fff, SM_RAM); SekMapMemory(Superman_ram , 0xf00000, 0xf03fff ,SM_RAM); SekSetWriteWordHandler(0, SupermanWriteWord); SekSetReadWordHandler(0, SupermanReadWord); SekSetReadByteHandler(0, SupermanReadByte); SekSetWriteByteHandler(0, SupermanWriteByte); SekClose(); // ----------------- Cpu 2 Z80 ------------------------ ZetInit(1); ZetSetReadHandler(SupermanZ80Read); ZetSetWriteHandler(SupermanZ80Write); ZetMapArea(0x0000, 0x3fff, 0, z80_rom); ZetMapArea(0x0000, 0x3fff, 2, z80_rom); ZetMapArea(0xc000, 0xdfff, 0, z80_ram); ZetMapArea(0xc000, 0xdfff, 2, z80_ram); ZetMapArea(0xc000, 0xdfff, 1, z80_ram); ZetMemCallback(0xe000, 0xffff, 0); ZetMemCallback(0xe000, 0xffff, 1); ZetMemEnd(); ZetClose(); //------------------------------------------------- //-------- sound stuff ---------------------------- nCurrentBank = -1; int SupermanYM2610RomSize = 0x80000; BurnYM2610Init(8000000, SupermanYM2610Rom, &SupermanYM2610RomSize, SupermanYM2610Rom, &SupermanYM2610RomSize, &SupermanFMIRQHandler, SupermanSynchroniseStream, SupermanGetTime); BurnTimerAttachZet(4000000); // ------- GFX Init ------------------- taito_pal=Superman_pal; SysXInit(1); SupermanDoReset(); return 0; }
int twinhawkInit() { int nRet=0; int nLen=0; //--------------Allocate Memory----------------- Mem=NULL; MemIndex(); nLen=MemEnd-(unsigned char *)0; Mem=(unsigned char *)malloc(nLen); if (Mem==NULL) return 1; memset(Mem,0,nLen); // blank all memory MemIndex(); // Index the allocated memory //--------------- Load Roms ------------------- nRet=LoadRoms(); if (nRet!=0) return 1; // Load the roms into memory // Map in memory: // ----------------- Cpu 1 68k ------------------------ SekInit(0, 0x68000); // Allocate 1 68000 SekOpen(0); SekMapMemory( Rom ,0x000000,0x3ffff,SM_ROM); // 68000 Rom SekMapMemory(twinhawk_src_pal,0xb00000,0xb00FFF,SM_RAM); SekMapMemory(sysbvidattr,0xd00000,0xd00fff,SM_RAM); SekMapMemory(sysbvidram,0xe00000,0xe03fff,SM_RAM); SekMapMemory(twinhawk_ram,0xf00000,0xf03fff,SM_RAM); SekSetReadWordHandler(0, twinhawkReadWord); SekSetWriteWordHandler(0, twinhawkWriteWord); SekSetReadByteHandler(0, twinhawkReadByte); SekSetWriteByteHandler(0, twinhawkWriteByte); SekClose(); // ------------------------------------------------ // ----------------- Cpu 2 Z80 ------------------------ ZetInit(1); ZetOpen(0); ZetSetReadHandler(twinhawkZ80Read); ZetSetWriteHandler(twinhawkZ80Write); ZetMapArea (0x0000,0x3FFF,0,z80_rom); ZetMapArea (0x0000,0x3FFF,2,z80_rom); // ZetMapArea (0x4000,0x7FFF,0,z80_rom+0x4000); // ZetMapArea (0x4000,0x7FFF,2,z80_rom+0x4000); ZetMapArea (0xc000,0xdfff,0,z80_ram); ZetMapArea (0xc000,0xdfff,2,z80_ram); ZetMapArea (0xc000,0xdfff,1,z80_ram); ZetMemEnd(); ZetMemCallback(0xe000, 0xFFFF, 0); // Read ZetMemCallback(0xe000, 0xFFFF, 1); // Write ZetReset(); ZetClose(); //------------------------------------------------- //-------- sound stuff ---------------------------- //---------- YM2151 Setup ---------------------- BurnYM2151Init(4000000, 50.0); BurnYM2151SetIrqHandler(&twinhawkYM2151IRQHandler); nCurrentBank=-1; //-------------------------------------------------- // ------- GFX Init ------------------- taito_pal=twinhawk_pal; SysXInit(0); drvDoReset(); return 0; }
int rastanInit() { int nRet=0; int nLen=0; //--------------Allocate Memory----------------- Mem=NULL; MemIndex(); nLen=MemEnd-(unsigned char *)0; Mem=(unsigned char *)malloc(nLen); if (Mem==NULL) return 1; memset(Mem,0,nLen); // blank all memory MemIndex(); // Index the allocated memory //--------------- Load Roms ------------------- nRet=LoadRoms(); if (nRet!=0) return 1; // Load the roms into memory taito_pal=rastan_pal; init_taito_gfx(); // Map in memory: // ----------------- Cpu 1 ------------------------ SekInit(0, 0x68000); // Allocate 1 68000 SekOpen(0); SekMapMemory( Rom ,0x000000,0x05ffff,SM_ROM); // 68000 Rom SekMapMemory(rastan_ram,0x10c000,0x10ffff,SM_RAM); //0x4000 SekMapMemory(rastan_src_pal,0x200000,0x200fff,SM_RAM); SekMapMemory(rastan_ram+0x4000,0x350008,0x350010,SM_RAM); SekMapMemory(PC090OJ_spritectrl,0x380000,0x380003,SM_RAM); SekMapMemory(rastan_ram+0x4012,0x3c0000,0x3c0003,SM_WRITE); SekMapMemory(PC080SN_word_0,0xc00000,0xc0ffff,SM_RAM); SekMapMemory(PC080SN_ctrl_word_0,0xc50000,0xc50003,SM_WRITE); SekMapMemory(PC090OJ_word_0,0xd00000,0xd03fff,SM_RAM); SekSetReadWordHandler(0, rastanReadWord); SekSetWriteWordHandler(0, rastanWriteWord); SekSetReadByteHandler(0, rastanReadByte); SekSetWriteByteHandler(0, rastanWriteByte); // ------------------------------------------------ SekClose(); ZetInit(1); ZetOpen(0); ZetSetReadHandler(RastanZ80Read); ZetSetWriteHandler(RastanZ80Write); ZetMapArea (0x0000,0x3FFF,0,z80_rom); ZetMapArea (0x0000,0x3FFF,2,z80_rom); ZetMapArea (0x4000,0x7FFF,0,z80_rom+0x4000); ZetMapArea (0x4000,0x7FFF,2,z80_rom+0x4000); ZetMapArea (0x8000,0x8FFF,0,z80_ram); ZetMapArea (0x8000,0x8FFF,1,z80_ram); ZetMemEnd(); ZetMemCallback(0x9000, 0xa001, 0); // Read ZetMemCallback(0x9000, 0xa001, 1); // Write ZetReset(); ZetClose(); //------------------------------------------------- BurnYM2151Init(4000000, 50.0); BurnYM2151SetIrqHandler(&RastanYM2151IRQHandler); BurnYM2151SetPortHandler(&rastanBankSwitch); nCurrentBank=0; // bank number 0 or 1 MSM5205Init(0,8000, 60,1); 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; }