示例#1
0
static int DrvInit()
{
	AllMem = NULL;
	MemIndex();
	int nLen = MemEnd - (unsigned char *)0;
	if ((AllMem = (unsigned char *)malloc(nLen)) == NULL) return 1;
	memset(AllMem, 0, nLen);
	MemIndex();

	{
		if (BurnLoadRom(DrvM6809ROM + 0x08000,  0, 1)) return 1;
		memcpy (DrvM6809ROM + 0x4000, DrvM6809ROM + 0xc000, 0x4000);
		if (BurnLoadRom(DrvM6809ROM + 0x0c000,  1, 1)) return 1;

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

		if (BurnLoadRom(DrvGfxROM0  + 0x00000,  3, 1)) return 1;

		if (BurnLoadRom(DrvGfxROM1  + 0x00000,  4, 1)) return 1;
		if (BurnLoadRom(DrvGfxROM1  + 0x08000,  5, 1)) return 1;

		if (BurnLoadRom(DrvColPROM  + 0x00000,  6, 1)) return 1;
		if (BurnLoadRom(DrvColPROM  + 0x00100,  7, 1)) return 1;
		if (BurnLoadRom(DrvColPROM  + 0x00200,  8, 1)) return 1;
		if (BurnLoadRom(DrvColPROM  + 0x00300,  9, 1)) return 1;
		if (BurnLoadRom(DrvColPROM  + 0x00400, 10, 1)) return 1;

		DrvPaletteInit();
		DrvGfxDecode();
	}

	M6809Init(1);
	M6809Open(0);
	M6809MapMemory(DrvColRAM,		0x0000, 0x07ff, M6809_RAM);
	M6809MapMemory(DrvVidRAM,		0x0800, 0x0fff, M6809_RAM);
	M6809MapMemory(DrvSprRAM,		0x1000, 0x1fff, M6809_RAM);
	M6809MapMemory(DrvM6809ROM + 0x04000,	0x4000, 0xffff, M6809_ROM);
	M6809SetWriteByteHandler(scotrsht_main_write);
	M6809SetReadByteHandler(scotrsht_main_read);
	M6809Close();

	ZetInit(1);
	ZetOpen(0);
	ZetMapArea(0x0000, 0x3fff, 0, DrvZ80ROM);
	ZetMapArea(0x0000, 0x3fff, 2, DrvZ80ROM);
	ZetMapArea(0x4000, 0x43ff, 0, DrvZ80RAM);
	ZetMapArea(0x4000, 0x43ff, 1, DrvZ80RAM);
	ZetMapArea(0x4000, 0x43ff, 2, DrvZ80RAM);
	ZetSetReadHandler(scotrsht_sound_read);
	ZetSetOutHandler(scotrsht_sound_out);
	ZetSetInHandler(scotrsht_sound_in);
	ZetMemEnd();
	ZetClose();

	BurnYM2203Init(1, 3072000, NULL, DrvSynchroniseStream, DrvGetTime, 0);
	BurnTimerAttachZet(3072000);

	DrvDoReset();

	GenericTilesInit();

	return 0;
}
示例#2
0
int QsndInit()
{
	int nVolumeShift;
	int nRate;

	// Init QSound z80
	if (QsndZInit()) {
		return 1;
	}
	BurnTimerInit(qsndTimerOver, NULL);

	if (Cps1Qs == 1) {
		nCpsZ80Cycles = 6000000 * 100 / nBurnFPS;
		BurnTimerAttachZet(6000000);
	} else {
		nCpsZ80Cycles = 8000000 * 100 / nBurnFPS;
		BurnTimerAttachZet(8000000);
	}

	if (nBurnSoundRate >= 0) {
		nRate = nBurnSoundRate;
	} else {
		nRate = 11025;
	}

	nVolumeShift = 0;

	// These games are too soft at normal volumes
	if (strncmp(BurnDrvGetTextA(DRV_NAME), "csclub", 6) == 0) {
		nVolumeShift = -1;
	}
#if 0
	// These games are loud at normal volumes (no clipping)
	if (strncmp(BurnDrvGetTextA(DRV_NAME), "1944",	  4) == 0 ||
		strcmp( BurnDrvGetTextA(DRV_NAME), "dimahoo"  ) == 0 ||
		strcmp( BurnDrvGetTextA(DRV_NAME), "gmahoo"   ) == 0)
	{
		nVolumeShift = 1;
	}
#endif
	// These games are too loud at normal volumes (no clipping)
	if (strncmp(BurnDrvGetTextA(DRV_NAME), "sgemf",  5) == 0 ||
		strncmp(BurnDrvGetTextA(DRV_NAME), "pfght",  5) == 0 ||
		strncmp(BurnDrvGetTextA(DRV_NAME), "mpang",  5) == 0 ||
		strncmp(BurnDrvGetTextA(DRV_NAME), "spf2",   4) == 0 ||
		strncmp(BurnDrvGetTextA(DRV_NAME), "sfa2",   4) == 0 ||
		strncmp(BurnDrvGetTextA(DRV_NAME), "sfa2",   4) == 0)
	{
		nVolumeShift = 1;
	}
	// These games are too loud at normal volumes (clipping)
	if (strncmp(BurnDrvGetTextA(DRV_NAME), "19xx",   4) == 0 ||
		strncmp(BurnDrvGetTextA(DRV_NAME), "ddtod",  5) == 0)
	{
		nVolumeShift = 2;
	}

	QscInit(nRate, nVolumeShift);		// Init QSound chip

	return 0;
}
示例#3
0
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;
}
示例#4
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;
}