Example #1
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;
}
Example #2
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;
	}