当前位置: 首页>>代码示例>>C++>>正文


C++ DrvDoReset函数代码示例

本文整理汇总了C++中DrvDoReset函数的典型用法代码示例。如果您正苦于以下问题:C++ DrvDoReset函数的具体用法?C++ DrvDoReset怎么用?C++ DrvDoReset使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DrvDoReset函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DrvFrame

static int DrvFrame()
{
	int nInterleave = 10;
	int nSoundBufferPos = 0;

	if (DrvReset) DrvDoReset();

	DrvMakeInputs();

	nCyclesTotal[0] = 28638000 / 60;
	nCyclesDone[0] = 0;

	for (int i = 0; i < nInterleave; i++) {
		int nCurrentCPU, nNext;

		nCurrentCPU = 0;
		Sh2Open(0);
		nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave;
		nCyclesSegment = nNext - nCyclesDone[nCurrentCPU];
		nCyclesDone[nCurrentCPU] += Sh2Run(nCyclesSegment);
		if (i == 5) Sh2SetIRQLine(1, SH2_IRQSTATUS_AUTO);
		if (i == 9) Sh2SetIRQLine(5, SH2_IRQSTATUS_AUTO);
		Sh2Close();
	}
	
	if (pBurnDraw) DrvDraw();

	return 0;
}
开发者ID:ernestd,项目名称:fbarr,代码行数:29,代码来源:d_suprnova.cpp

示例2: crushermInit

static INT32 crushermInit()
{
	INT32 nLen;

	BurnSetRefreshRate(CAVE_REFRESHRATE);

	// 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 (crushermLoadRoms()) {
		return 1;
	}

	EEPROMInit(&eeprom_interface_93C46_8bit);

	{

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

		// Map 68000 memory:
		SekMapMemory(Rom01,		0x000000, 0x07FFFF, MAP_ROM);	// CPU 0 ROM
		SekMapMemory(CaveTileRAM[0],	0x100000, 0x107FFF, MAP_RAM);
		SekMapMemory(CaveSpriteRAM,	0x180000, 0x187FFF, MAP_RAM);
		SekMapMemory(CavePalSrc,	0x200000, 0x207FFF, MAP_RAM);
		SekMapMemory(Ram01,		0x340000, 0x34FFFF, MAP_RAM);

		SekSetReadWordHandler(0, 	korokoroReadWord);
		SekSetReadByteHandler(0, 	korokoroReadByte);
		SekSetWriteWordHandler(0, 	korokoroWriteWord);
		SekSetWriteByteHandler(0, 	korokoroWriteByte);

		SekClose();
	}

	nCaveRowModeOffset = 1;

	CavePalInit(0x8000);
	CaveTileInit();
	CaveSpriteInit(1, 0x400000);
	CaveTileInitLayer(0, 0x200000, 4, 0x4400);

	YMZ280BInit(16934400, &TriggerSoundIRQ, 0x200000);
	YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT);
	YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT);

	bDrawScreen = true;

	DrvDoReset(); // Reset machine

	return 0;
}
开发者ID:Cpasjuste,项目名称:libarcade,代码行数:60,代码来源:d_korokoro.cpp

示例3: DrvInit

static INT32 DrvInit()
{
	GenericTilesInit();

	AllMem = NULL;
	MemIndex();
	INT32 nLen = MemEnd - (UINT8 *)0;
	if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1;
	memset(AllMem, 0, nLen);
	MemIndex();

	{
		if (BurnLoadRom(Drv68KROM  + 0x000000,  0, 1)) return 1;
		if (BurnLoadRom(Drv68KROM  + 0x080000,  1, 1)) return 1;

		if (BurnLoadRom(DrvGfxROM  + 0x000000,  2, 2)) return 1;
		if (BurnLoadRom(DrvGfxROM  + 0x000001,  3, 2)) return 1;
		if (BurnLoadRom(DrvGfxROM  + 0x100000,  4, 2)) return 1;
		if (BurnLoadRom(DrvGfxROM  + 0x100001,  5, 2)) return 1;

		if (BurnLoadRom(YMZ280BROM + 0x000000,  6, 1)) return 1;
		if (BurnLoadRom(YMZ280BROM + 0x080000,  7, 1)) return 1;
		if (BurnLoadRom(YMZ280BROM + 0x100000,  8, 1)) return 1;
		if (BurnLoadRom(YMZ280BROM + 0x180000,  9, 1)) return 1;

		DrvGfxDecode();
	}

	SekInit(0, 0x68000);
	SekOpen(0);
	SekMapMemory(Drv68KROM,		0x000000, 0x0fffff, MAP_ROM);
	SekMapMemory(Drv68KRAM,		0x400000, 0x407fff, MAP_RAM);
	SekMapMemory(DrvPalRAM,		0xb00000, 0xb03fff, MAP_RAM);
	SekMapMemory(DrvPalRAM,		0xb04000, 0xb047ff, MAP_ROM);
	SekSetWriteWordHandler(0,	bishi_write_word);
	SekSetWriteByteHandler(0,	bishi_write_byte);
	SekSetReadWordHandler(0,	bishi_read_word);
	SekSetReadByteHandler(0,	bishi_read_byte);
	SekClose();

	K055555Init();
	K054338Init();

	K056832Init(DrvGfxROM, DrvGfxROMExp, 0x200000, bishi_tile_callback);
	K056832SetGlobalOffsets(29, 16);
	K056832SetLayerOffsets(0, -2, 0);
	K056832SetLayerOffsets(1,  2, 0);
	K056832SetLayerOffsets(2,  4, 0);
	K056832SetLayerOffsets(3,  6, 0);
	K056832SetLayerAssociation(0);

	YMZ280BInit(16934400, bishi_sound_irq);
	YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_1, 1.00, BURN_SND_ROUTE_LEFT);
	YMZ280BSetRoute(BURN_SND_YMZ280B_YMZ280B_ROUTE_2, 1.00, BURN_SND_ROUTE_RIGHT);

	DrvDoReset();

	return 0;
}
开发者ID:Cpasjuste,项目名称:libarcade,代码行数:59,代码来源:d_bishi.cpp

示例4: DrvInit

static int DrvInit()
{
	int nLen;

#ifdef DRIVER_ROTATION
	bToaRotateScreen = false;
#endif

	nGP9001ROMSize[0] = 0x800000;

	// 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, 0x103FFF, SM_RAM);
		SekMapMemory(RamPal,	0x400000, 0x400FFF, SM_RAM);	// Palette RAM

		SekSetReadWordHandler(0, kbashReadWord);
		SekSetReadByteHandler(0, kbashReadByte);
		SekSetWriteWordHandler(0, kbashWriteWord);
		SekSetWriteByteHandler(0, kbashWriteByte);

		SekClose();
	}

	nSpriteYOffset = 0x0011;

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

	ToaInitGP9001();

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

	bDrawScreen = true;

	DrvDoReset();			// Reset machine
	return 0;
}
开发者ID:alfredox123,项目名称:pifba,代码行数:59,代码来源:d_kbash.cpp

示例5: DrvInit

static int DrvInit()
{
	int nLen;

	BurnSetRefreshRate(CAVE_REFRESHRATE);

	// Find out how much memory is needed
	Mem = NULL;
	MemIndex();
	nLen = MemEnd - (unsigned char *)0;
	if ((Mem = (unsigned char *)BurnMalloc(nLen)) == NULL) {
		return 1;
	}
	memset(Mem, 0, nLen);										// blank all memory
	MemIndex();													// Index the allocated memory

	EEPROMInit(&eeprom_interface_93C46_8bit);
	
	// 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(CaveTileRAM[0],	0x100000, 0x107FFF, SM_RAM);
		SekMapMemory(CaveSpriteRAM,	0x180000, 0x187FFF, SM_RAM);
		SekMapMemory(CavePalSrc,	0x200000, 0x207FFF, SM_RAM);
		SekMapMemory(Ram01,		0x300000, 0x30FFFF, SM_RAM);

		SekSetReadWordHandler(0, 	korokoroReadWord);
		SekSetReadByteHandler(0, 	korokoroReadByte);
		SekSetWriteWordHandler(0, 	korokoroWriteWord);
		SekSetWriteByteHandler(0, 	korokoroWriteByte);

		SekClose();
	}

	nCaveRowModeOffset = 1;

	CavePalInit(0x8000);
	CaveTileInit();
	CaveSpriteInit(1, 0x300000);
	CaveTileInitLayer(0, 0x200000, 4, 0x4400);

	YMZ280BInit(16934400, &TriggerSoundIRQ, 3);

	bDrawScreen = true;

	DrvDoReset(); // Reset machine

	return 0;
}
开发者ID:PS3emulators,项目名称:fba-next-slim,代码行数:58,代码来源:d_korokoro.cpp

示例6: DrvInit

static int DrvInit()
{
	int nLen;

//	bToaRotateScreen = true;

	BurnSetRefreshRate(REFRESHRATE);

	nBCU2ROMSize = 0x080000;
	nFCU2ROMSize = 0x080000;

	// Find out how much memory is needed
	AllMem = NULL;
	MemIndex();
	nLen = MemEnd - (unsigned char *)0;
	if ((AllMem = (unsigned char *)malloc(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;

	ToaLoadTiles(BCU2ROM, 4, nBCU2ROMSize);
	ToaLoadTiles(FCU2ROM, 8, nFCU2ROMSize);

	{
		SekInit(0, 0x68000);
		SekOpen(0);
		SekMapMemory(Drv68KROM,			0x000000, 0x07FFFF, SM_ROM);
		SekMapMemory(Drv68KRAM,			0x0c0000, 0x0c3FFF, SM_RAM);
		SekMapMemory(DrvPalRAM,			0x104000, 0x1047FF, SM_RAM);
		SekMapMemory(DrvPalRAM2,		0x106000, 0x1067FF, SM_RAM);
		SekSetReadWordHandler(0, 		samesameReadWord);
		SekSetReadByteHandler(0, 		samesameReadByte);
		SekSetWriteWordHandler(0, 		samesameWriteWord);
		SekSetWriteByteHandler(0, 		samesameWriteByte);
		SekClose();
	}

	ToaInitBCU2();

	nToaPalLen = nColCount;
	ToaPalSrc = DrvPalRAM;
	ToaPalSrc2 = DrvPalRAM2;
	ToaPalInit();

//	BurnYM3812Init(28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0);

	bDrawScreen = true;

	DrvDoReset();
	return 0;
}
开发者ID:ernestd,项目名称:fbarr,代码行数:57,代码来源:d_samesame.cpp

示例7: DrvInit

static INT32 DrvInit()
{
	INT32 nLen;

//	bToaRotateScreen = true;

	BurnSetRefreshRate(REFRESHRATE);

	nBCU2ROMSize = 0x080000;
	nFCU2ROMSize = 0x100000;

	// 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();

	ToaLoadCode(Drv68KROM, 0, 2);
	ToaLoadTiles(BCU2ROM, 2, nBCU2ROMSize);
	ToaLoadGP9001Tiles(FCU2ROM, 6, 3, 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,		0x480000, 0x487FFF, SM_RAM);
		SekSetReadWordHandler(0, 	vimanaReadWord);
		SekSetReadByteHandler(0, 	vimanaReadByte);
		SekSetWriteWordHandler(0, 	vimanaWriteWord);
		SekSetWriteByteHandler(0, 	vimanaWriteByte);
		SekClose();
	}

	ToaInitBCU2();

	nToaPalLen = nColCount;
	ToaPalSrc = DrvPalRAM;
	ToaPalSrc2 = DrvPalRAM2;
	ToaPalInit();

//	BurnYM3812Init(28000000 / 8, &toaplan1FMIRQHandler, &toaplan1SynchroniseStream, 0);

	bDrawScreen = true;

	DrvDoReset();
	return 0;
}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:53,代码来源:d_vimana.cpp

示例8: DrvFrame

static int DrvFrame()
{
	if (DrvReset) DrvDoReset();
	
	if (bRecalcPalette) {
		for (int i=0;i<(0x1000/2); i++)
			RamCurPal[i] = CalcCol( RamPal[i] );
		bRecalcPalette = 0;	
	}
	
	DrvInput[0] = 0x00;													// Joy1
	DrvInput[1] = 0x00;													// Joy2
	DrvInput[2] = 0x00;													// Buttons
	for (int i = 0; i < 8; i++) {
		DrvInput[0] |= (DrvJoy1[i] & 1) << i;
		DrvInput[1] |= (DrvJoy2[i] & 1) << i;
		DrvInput[2] |= (DrvButton[i] & 1) << i;
	}

	
	SekNewFrame();
	SekOpen(0);

#if 0	
	int nCyclesDone = 0;
	int nCyclesNext = 0;
	for(int i=0; i<10; i++) {
		nCyclesNext += (16000000 / 60 / 10);
		nCyclesDone += SekRun( nCyclesNext - nCyclesDone );
	}
#else

	SekRun(16000000 / 60);
	
#endif
	
	SekSetIRQLine(4, SEK_IRQSTATUS_AUTO);
	
	SekClose();
	
	if (pBurnDraw) DrvDraw();
	
	if (pBurnSoundOut) {
		memset(pBurnSoundOut, 0, nBurnSoundLen * 4);
		MSM6295Render(0, pBurnSoundOut, nBurnSoundLen);
		MSM6295Render(1, pBurnSoundOut, nBurnSoundLen);
	}
	return 0;
}
开发者ID:iq132,项目名称:FB-Alpha,代码行数:49,代码来源:d_1945kiii.cpp

示例9: s1945iiInit

static int s1945iiInit()
{
	int nRet;
	
	Mem = NULL;
	MemIndex();
	int nLen = MemEnd - (unsigned char *)0;
	if ((Mem = (unsigned char *)malloc(nLen)) == NULL) return 1;
	memset(Mem, 0, nLen);										// blank all memory
	MemIndex();	
	
	nRet = BurnLoadRom(RomSH2 + 0x000000, 0, 2); if (nRet != 0) return 1;
	nRet = BurnLoadRom(RomSH2 + 0x000001, 1, 2); if (nRet != 0) return 1;
	be_to_le( RomSH2, 0x100000 );

#if 0
FILE * f = fopen("d.bin", "wb+");	
fwrite(RomSH2, 1, 0x100000, f);
fclose(f);
#endif
	

	{
		Sh2Init(1);
	    Sh2Open(0);

		// Map 68000 memory:
		Sh2MapMemory(RomSH2,		0x00000000, 0x000fffff, SM_ROM);
		Sh2MapMemory(RamSpr,		0x03000000, 0x0300ffff, SM_RAM);
		Sh2MapMemory((unsigned char *) RamPal,		
									0x03040000, 0x03044fff, SM_RAM);
		Sh2MapMemory(RamVReg,		0x03050000, 0x0305ffff, SM_WRITE);
		Sh2MapMemory(RamSH2,		0x06000000, 0x060fffff, SM_RAM);
	

		Sh2SetReadByteHandler (0, ps3v1ReadByte);
		Sh2SetReadWordHandler (0, ps3v1ReadWord);
		Sh2SetReadLongHandler (0, ps3v1ReadLong);
		Sh2SetWriteByteHandler(0, ps3v1WriteByte);
		Sh2SetWriteWordHandler(0, ps3v1WriteWord);
		Sh2SetWriteLongHandler(0, ps3v1WriteLong);

	}


	DrvDoReset();
	
	return 0;
}
开发者ID:SiN13,项目名称:pifba,代码行数:49,代码来源:d_psikyosh.cpp

示例10: DrvFrame

static int DrvFrame()
{
	if (DrvReset) {
		DrvDoReset();
	}

	ZetOpen(0);
	ZetRun(4000000 / 60);
	ZetRaiseIrq(0);
	ZetClose();

	if (pBurnDraw) {
		DrvDraw();
	}

	return 0;
}
开发者ID:mrcaytao000,项目名称:FBA4PSP,代码行数:17,代码来源:d_dotrikun.cpp

示例11: DrvFrame

static INT32 DrvFrame()
{
	if (DrvReset) {
		DrvDoReset();
	}

	{
		memset (DrvInputs, 0xff, 2 * sizeof(INT16));
		for (INT32 i = 0; i < 16; i++) {
			DrvInputs[0] ^= (DrvJoy1[i] & 1) << i;
			DrvInputs[1] ^= (DrvJoy2[i] & 1) << i;
		}
	}

	INT32 nInterleave = 256;
	INT32 nCyclesTotal[1] = { 12000000 / 60 };
	INT32 nCyclesDone[1] = { 0 };

	SekOpen(0);

	for (INT32 i = 0; i < nInterleave; i++)
	{
		nCyclesDone[0] += SekRun(nCyclesTotal[0] / nInterleave);

		if (control_data & 0x800) {
			if (i == 0) SekSetIRQLine(4, CPU_IRQSTATUS_AUTO);
			if (i == 240) SekSetIRQLine(3, CPU_IRQSTATUS_AUTO);

		}
	}

	if (pBurnSoundOut) {
		YMZ280BRender(pBurnSoundOut, nBurnSoundLen);
	}

	SekClose();

	if (pBurnDraw) {
		DrvDraw();
	}

	return 0;
}
开发者ID:Cpasjuste,项目名称:libarcade,代码行数:43,代码来源:d_bishi.cpp

示例12: DrvFrame

static INT32 DrvFrame()
{
	if (DrvReset) {
		DrvDoReset();
	}

	{
		memset (DrvInputs, 0xff, 3);
		for (INT32 i = 0; i < 8; i++) {
			DrvInputs[0] ^= DrvJoy1[i] << i;
			DrvInputs[1] ^= DrvJoy2[i] << i;
			DrvInputs[2] ^= DrvJoy3[i] << i;
		}
	}

	INT32 nInterleave = 10;
	INT32 nCyclesTotal[2] = { 6000000 / 60, 6000000 / 60 };
	INT32 nCyclesDone[2] = { 0, 0 };

	for (INT32 i = 0; i < nInterleave; i++) {
		INT32 nSegment;

		ZetOpen(0);
		nSegment = nCyclesTotal[0] / nInterleave;
		nCyclesDone[0] += ZetRun(nSegment);
		if (i == (nInterleave - 1)) ZetSetIRQLine(0, CPU_IRQSTATUS_AUTO);
		ZetClose();

		ZetOpen(1);
		nCyclesDone[1] += ZetRun(nSegment);
		ZetClose();
	}

	if (pBurnSoundOut) {
		MSM6295Render(0,pBurnSoundOut, nBurnSoundLen);
	}

	if (pBurnDraw) {
		DrvDraw();
	}

	return 0;
}
开发者ID:Cpasjuste,项目名称:libarcade,代码行数:43,代码来源:d_speedspn.cpp

示例13: DrvInit

static int DrvInit()
{
	Mem = (unsigned char*)malloc ( 0x4800 );
	if (Mem == NULL) {
		return 1;
	}

	if (BurnLoadRom(Mem, 0, 1)) return 1;

	ZetInit(1);
	ZetOpen(0);
	ZetMapArea (0x0000, 0x3fff, 0, Mem + 0x0000); // Read ROM
	ZetMapArea (0x0000, 0x3fff, 2, Mem + 0x0000); // Fetch ROM
	ZetMapArea (0x8000, 0x87ff, 0, Mem + 0x4000); // Read RAM
	ZetMapArea (0x8000, 0x87ff, 1, Mem + 0x4000); // Write RAM
	ZetMemEnd();
	ZetSetInHandler(dotrikun_in_port);
	ZetSetOutHandler(dotrikun_out_port);
	ZetClose();

	DrvDoReset();
	return 0;
}
开发者ID:mrcaytao000,项目名称:FBA4PSP,代码行数:23,代码来源:d_dotrikun.cpp

示例14: s1945iiFrame

static int s1945iiFrame()
{
	if (DrvReset)														// Reset machine
		DrvDoReset();
		
	if (bRecalcPalette) {
		// for(int i=0;i<0x4000;i++) CalcCol(i);
		bRecalcPalette = 0;
	}
	
	Sh2Run(28636350 / 60);

//	Sh2SetIRQLine(4, SH2_IRQSTATUS_AUTO);
	
//	Sh2SetIRQLine(12, SH2_IRQSTATUS_AUTO);
		
//	bprintf(0, _T("PC: %08x\n"), Sh2GetPC(0));
	
	//Sh2Run(1000);
	
	if (pBurnDraw) DrvDraw();

	return 0;
}
开发者ID:SiN13,项目名称:pifba,代码行数:24,代码来源:d_psikyosh.cpp

示例15: DrvFrame

static int DrvFrame()
{
	int nInterleave = 4;

	if (DrvReset) {														// Reset machine
		DrvDoReset();
	}

	// Compile digital inputs
	DrvInput[0] = 0x00;													// Buttons
	DrvInput[1] = 0x00;													// Player 1
	DrvInput[2] = 0x00;													// Player 2
	for (int i = 0; i < 8; i++) {
		DrvInput[0] |= (DrvJoy1[i] & 1) << i;
		DrvInput[1] |= (DrvJoy2[i] & 1) << i;
		DrvInput[2] |= (DrvButton[i] & 1) << i;
	}
	ToaClearOpposites(&DrvInput[0]);
	ToaClearOpposites(&DrvInput[1]);

	SekNewFrame();

	nCyclesTotal[0] = (int)((long long)16000000 * nBurnCPUSpeedAdjust / (0x0100 * 60));
	nCyclesDone[0] = 0;

	SekSetCyclesScanline(nCyclesTotal[0] / 262);
	nToaCyclesDisplayStart = nCyclesTotal[0] - ((nCyclesTotal[0] * (TOA_VBLANK_LINES + 240)) / 262);
	nToaCyclesVBlankStart = nCyclesTotal[0] - ((nCyclesTotal[0] * TOA_VBLANK_LINES) / 262);
	bVBlank = false;

	SekOpen(0);

	for (int i = 0; i < nInterleave; i++) {
    	int nCurrentCPU;
		int nNext;

		// Run 68000
		nCurrentCPU = 0;
		nNext = (i + 1) * nCyclesTotal[nCurrentCPU] / nInterleave;


		// Trigger VBlank interrupt
		if (!bVBlank && nNext > nToaCyclesVBlankStart) {
			if (nCyclesDone[nCurrentCPU] < nToaCyclesVBlankStart) {
				nCyclesSegment = nToaCyclesVBlankStart - nCyclesDone[nCurrentCPU];
				nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment);
			}

			bVBlank = true;

			ToaBufferGP9001Sprites();

			// Trigger VBlank interrupt
			SekSetIRQLine(4, SEK_IRQSTATUS_AUTO);
		}

		nCyclesSegment = nNext - nCyclesDone[nCurrentCPU];
		if (bVBlank || (!CheckSleep(nCurrentCPU))) {					// See if this CPU is busywaiting
			nCyclesDone[nCurrentCPU] += SekRun(nCyclesSegment);
		} else {
			nCyclesDone[nCurrentCPU] += SekIdle(nCyclesSegment);
		}

	}

	SekClose();

	if (pBurnDraw) {
		DrvDraw();												// Draw screen if needed
	}

	return 0;
}
开发者ID:alfredox123,项目名称:pifba,代码行数:73,代码来源:d_kbash.cpp


注:本文中的DrvDoReset函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。