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


C++ BurnLoadRom函数代码示例

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


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

示例1: LoadRoms

static int LoadRoms()
{
	int nRet=0;
	// Load program roms and byteswap
	nRet = BurnLoadRom(Rom + 0x00001, 0, 2); if (nRet != 0) return 1;
	nRet = BurnLoadRom(Rom + 0x00000, 1, 2); if (nRet != 0) return 1;
	nRet = BurnLoadRom(Rom + 0x40001, 2, 2); if (nRet != 0) return 1;
	nRet = BurnLoadRom(Rom + 0x40000, 3, 2); if (nRet != 0) return 1;

	nRet = BurnLoadRom(z80_rom, 4, 1); // load z80 code rom

	ttiles = (unsigned char *)malloc(0x400000);
	memset(ttiles, 0, 16384 * 256);

	SysxTempGfx = (unsigned char *)malloc(0x200000);

	nRet = BurnLoadRom(SysxTempGfx + 0x000000, 5, 1);
	nRet = BurnLoadRom(SysxTempGfx + 0x080000, 6, 1);
	nRet = BurnLoadRom(SysxTempGfx + 0x100000, 7, 1);
	nRet = BurnLoadRom(SysxTempGfx + 0x180000, 8, 1);

	nRet = BurnLoadRom(SupermanYM2610Rom, 9, 1);

	return nRet;
}
开发者ID:0nem4n,项目名称:ggpofba,代码行数:25,代码来源:d_superman.cpp

示例2: ToaLoadTiles

// This function decodes the tile data for the GP9001 chip in place.
int ToaLoadTiles(unsigned char* pDest, int nStart, int nROMSize)
{
	unsigned char* pTile;
	int nSwap = 3;

	BurnLoadRom(pDest + 3, nStart + 0, 4);
	BurnLoadRom(pDest + 1, nStart + 1, 4);
	BurnLoadRom(pDest + 2, nStart + 2, 4);
	BurnLoadRom(pDest + 0, nStart + 3, 4);

	for (pTile = pDest; pTile < (pDest + nROMSize); pTile += 4) {
		unsigned char data[4];
		for (int n = 0; n < 4; n++) {
			int m = 7 - (n << 1);
			unsigned char nPixels = ((pTile[0 ^ nSwap] >> m) & 1) << 0;
			nPixels |= ((pTile[2 ^ nSwap] >> m) & 1) << 1;
			nPixels |= ((pTile[1 ^ nSwap] >> m) & 1) << 2;
			nPixels |= ((pTile[3 ^ nSwap] >> m) & 1) << 3;
			nPixels |= ((pTile[0 ^ nSwap] >> (m - 1)) & 1) << 4;
			nPixels |= ((pTile[2 ^ nSwap] >> (m - 1)) & 1) << 5;
			nPixels |= ((pTile[1 ^ nSwap] >> (m - 1)) & 1) << 6;
			nPixels |= ((pTile[3 ^ nSwap] >> (m - 1)) & 1) << 7;

			data[n] = nPixels;
		}

		for (int n = 0; n < 4; n++) {
			pTile[n] = data[n];
		}
	}
	return 0;
}
开发者ID:alfredox123,项目名称:pifba,代码行数:33,代码来源:toaplan1.cpp

示例3: init_dec0_aud

void init_dec0_aud(int romNumPrg, int romNumSamples)
{
	Ram = (unsigned char*) malloc(0x0600);
	Rom = (unsigned char*) malloc(0x8000);
	
	memset(Ram,0x00, sizeof(Ram));

	MSM6295ROM = (unsigned char*) malloc(0x10000);

	BurnLoadRom(Rom, romNumPrg,1 );
	BurnLoadRom(MSM6295ROM,romNumSamples,1);

	m6502Init(1);
	m6502Open(0);

	m6502MapMemory(Ram, 0x0000, 0x05ff, M6502_RAM); // Ram

	m6502MapMemory(Rom, 0x8000, 0xffff, M6502_ROM); // Rom


	m6502SetReadHandler(dec0_aud_read_byte);
	m6502SetWriteHandler(dec0_aud_write_byte);
	m6502Close();

	BurnYM3812Init(3000000, &dec0YMxxxxIrqHandler, &dec0SynchroniseStream, 1);

	BurnYM2203Init(1, 1500000, &dec0YMxxxxIrqHandler, dec0SynchroniseStream, DrvGetTime, 0);

	// Setup the OKIM6295 emulation
	MSM6295Init(0, 1023924/132, 30.0, 1);
	BurnTimerAttachSek(10000000);
}
开发者ID:carstene1ns,项目名称:fbagx,代码行数:32,代码来源:dec_aud.cpp

示例4: 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

示例5: DrvInit

static int DrvInit()
{
	int nRet=0;
	int i=0;
	unsigned char *pqs=NULL;

	Cps=2;
	nCpsRomLen=  4*0x080000;
	nCpsCodeLen= 2*0x080000;
	nCpsGfxLen=   0x1000000;
	nCpsZRomLen= 1*0x020000;
	nCpsQSamLen= 2*0x200000;
	nRet=CpsInit();
	if (nRet!=0)
	{
		return 1;
	}

	for (i=0; i<4; i++)
	{
		nRet=BurnLoadRom(CpsRom+0x080000*i,2+i,1);
		if (nRet!=0)
		{
			return 1;
		}
	}

	memcpy(CpsCode,CpsRom,nCpsCodeLen);
	for (i=0; i<2; i++)
	{
		nRet=BurnXorRom(CpsCode+0x080000*i,0+i,1);
		if (nRet!=0)
		{
			return 1;
		}
	}

	nRet=Cps2LoadTiles(CpsGfx          ,6);
	nRet=Cps2LoadTiles(CpsGfx+0x0800000,10);

	nRet=BurnLoadRom(CpsZRom,14,1);

	pqs=(unsigned char *)CpsQSam;
	nRet=BurnLoadRom(pqs         ,15,1);
	nRet=BurnLoadRom(pqs+0x200000,16,1);
	BurnByteswap(pqs,nCpsQSamLen);
	





	nRet=CpsRunInit();
	if (nRet!=0)
	{
		return 1;
	}
	return 0;
}
开发者ID:tmaul,项目名称:finalburnalpha_2001,代码行数:59,代码来源:dc_avsp.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: DinohInit

static int DinohInit()
{
  int nRet=0; unsigned char *pqs=NULL;
  Cps=1; Cps1Qs=1; Cps1QsHack=1;
  nCpsRomLen= 4*0x080000;
  nCpsCodeLen=0; // not encrypted
  nCpsGfxLen= 8*0x080000;
  nCpsZRomLen= 2*0x020000;
  nCpsQSamLen= 4*0x080000;
  nRet=CpsInit(); if (nRet!=0) return 1;

  // Load program roms
  nRet=BurnLoadRom(CpsRom+0x000000,0,1); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x080000,1,1); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x100000,2,1); if (nRet!=0) return 1;
  nRet=BurnLoadRom(CpsRom+0x180000,3,1); if (nRet!=0) return 1;

  // Patch Q-Sound Test
  CpsRom[0xaacf5]=0x4e;
  CpsRom[0xaacf4]=0x71;

  // Load graphics roms
  CpsLoadTiles(CpsGfx         , 4);
  CpsLoadTiles(CpsGfx+0x200000, 8);

  nCpsLcReg=0x66;
  CpsLayEn[1]=0x02;
  CpsLayEn[2]=0x04;
  CpsLayEn[3]=0x08;

  // Protection enable code by KEV
  CpsMProt[0]=0x00;
  CpsMProt[1]=0x00;
  CpsMProt[2]=0x00;
  CpsMProt[3]=0x00;

  // Board ID improvments by KEV. 0x00,0x0000
  CpsBID[0]=0x00;
  CpsBID[1]=0x00;
  CpsBID[2]=0x00;

  MaskAddr[0]=0x68;
  MaskAddr[1]=0x6a;
  MaskAddr[2]=0x6c;
  MaskAddr[3]=0x6e;

  nRet=BurnLoadRom(CpsZRom,12,1);
  dino_decode();

  pqs=(unsigned char *)CpsQSam;
  nRet=BurnLoadRom(pqs         ,13,1);
  nRet=BurnLoadRom(pqs+0x080000,14,1);
  nRet=BurnLoadRom(pqs+0x100000,15,1);
  nRet=BurnLoadRom(pqs+0x180000,16,1);


  nRet=CpsRunInit(); if (nRet!=0) return 1;
  // Ready to go
  return 0;
}
开发者ID:0nem4n,项目名称:ggpofba,代码行数:60,代码来源:dc_dino.cpp

示例8: LoadRoms

static INT32 LoadRoms()
{
	// Load 68000 ROM
	BurnLoadRom(Rom01, 0, 1);

	// Load GP9001 tile data
	ToaLoadGP9001Tiles(GP9001ROM[0], 1, 2, nGP9001ROMSize[0]);

	if (BurnLoadRom(RomSnd + 0x040000, 3, 1)) return 1;
	if (BurnLoadRom(RomSnd + 0x100000, 4, 1)) return 1;

	return 0;
}
开发者ID:vanfanel,项目名称:libretro-fba,代码行数:13,代码来源:d_kbash2.cpp

示例9: LoadRoms

static INT32 LoadRoms()
{
	// Load 68000 ROM
	BurnLoadRom(Rom01, 0, 1);

	// Load GP9001 tile data
	ToaLoadGP9001Tiles(GP9001ROM[0], 1, 4, nGP9001ROMSize[0]);

	BurnLoadRom(Rom02, 5, 1);
	BurnLoadRom(MSM6295ROM, 6, 1);

	return 0;
}
开发者ID:meesokim,项目名称:fba,代码行数:13,代码来源:d_kbash.cpp

示例10: 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

示例11: LoadUp

// Allocate space and load up a rom
static int LoadUp(unsigned char** pRom, int* pnRomLen, int nNum)
{
	unsigned char *Rom;
	struct BurnRomInfo ri;

	ri.nLen = 0;
	BurnDrvGetRomInfo(&ri, nNum);	// Find out how big the rom is
	if (ri.nLen <= 0) {
		return 1;
	}

	// Load the rom
	Rom = (unsigned char*)malloc(ri.nLen);
	if (Rom == NULL) {
		return 1;
	}

	if (BurnLoadRom(Rom,nNum,1)) {
		free(Rom);
		return 1;
	}

	// Success
	*pRom = Rom; *pnRomLen = ri.nLen;
	return 0;
}
开发者ID:carstene1ns,项目名称:fbagx,代码行数:27,代码来源:cps.cpp

示例12: LoadUp

// Allocate space and load up a rom
static INT32 LoadUp(UINT8** pRom, INT32* pnRomLen, INT32 nNum)
{
	UINT8 *Rom;
	struct BurnRomInfo ri;

	ri.nLen = 0;
	BurnDrvGetRomInfo(&ri, nNum);	// Find out how big the rom is
	if (ri.nLen <= 0) {
		return 1;
	}

	// Load the rom
	Rom = (UINT8*)BurnMalloc(ri.nLen);
	if (Rom == NULL) {
		return 1;
	}

	if (BurnLoadRom(Rom,nNum,1)) {
		BurnFree(Rom);
		return 1;
	}

	// Success
	*pRom = Rom; *pnRomLen = ri.nLen;
	return 0;
}
开发者ID:demonccc,项目名称:fba-libretro,代码行数:27,代码来源:cps.cpp

示例13: LoadUpSplit

static int LoadUpSplit(unsigned char** pRom, int* pnRomLen, int nNum)
{
	unsigned char *Rom;
	struct BurnRomInfo ri;
	unsigned int nRomSize[4], nTotalRomSize;
	int i;

	ri.nLen = 0;
	for (i = 0; i < 4; i++) {
		BurnDrvGetRomInfo(&ri, nNum + i);
		nRomSize[i] = ri.nLen;
	}
	
	nTotalRomSize = nRomSize[0] + nRomSize[1] + nRomSize[2] + nRomSize[3];
	if (!nTotalRomSize) return 1;

	Rom = (unsigned char*)malloc(nTotalRomSize);
	if (Rom == NULL) return 1;
	
	int Offset = 0;
	for (i = 0; i < 4; i++) {
		if (i > 0) Offset += nRomSize[i - 1];
		if (BurnLoadRom(Rom + Offset, nNum + i, 1)) {
			free(Rom);
			return 1;
		}
	}

	*pRom = Rom;
	*pnRomLen = nTotalRomSize;
	
	return 0;
}
开发者ID:carstene1ns,项目名称:fbagx,代码行数:33,代码来源:cps.cpp

示例14: LoadUpSplit

static INT32 LoadUpSplit(UINT8** pRom, INT32* pnRomLen, INT32 nNum, INT32 nNumRomsGroup)
{
	UINT8 *Rom;
	struct BurnRomInfo ri;
	UINT32 nRomSize[8], nTotalRomSize = 0;
	INT32 i;

	ri.nLen = 0;
	for (i = 0; i < nNumRomsGroup; i++) {
		BurnDrvGetRomInfo(&ri, nNum + i);
		nRomSize[i] = ri.nLen;
	}
	
	for (i = 0; i < nNumRomsGroup; i++) {
		nTotalRomSize += nRomSize[i];
	}
	if (!nTotalRomSize) return 1;

	Rom = (UINT8*)BurnMalloc(nTotalRomSize);
	if (Rom == NULL) return 1;
	
	INT32 Offset = 0;
	for (i = 0; i < nNumRomsGroup; i++) {
		if (i > 0) Offset += nRomSize[i - 1];
		if (BurnLoadRom(Rom + Offset, nNum + i, 1)) {
			BurnFree(Rom);
			return 1;
		}
	}

	*pRom = Rom;
	*pnRomLen = nTotalRomSize;
	
	return 0;
}
开发者ID:demonccc,项目名称:fba-libretro,代码行数:35,代码来源:cps.cpp

示例15: LoadRoms

static INT32 LoadRoms()
{
	// Load 68000 ROM
	BurnLoadRom(Rom01 + 0, 0, 1);

	BurnLoadRom(CaveSpriteROM + 0x0000000, 1, 1);
	BurnLoadRom(CaveSpriteROM + 0x0100000, 2, 1);
	NibbleSwap1(CaveSpriteROM + 0x0000000, 0x180000);

	BurnLoadRom(CaveTileROM[0] + 0x000000, 3, 1);
	NibbleSwap2(CaveTileROM[0], 0x100000);

	// Load YMZ280B data
	BurnLoadRom(YMZ280BROM, 4, 1);

	return 0;
}
开发者ID:iq132,项目名称:FB-Alpha,代码行数:17,代码来源:d_korokoro.cpp


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