您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ BurnMalloc函数代码示例

51自学网 2021-06-01 19:56:08
  C++
这篇教程C++ BurnMalloc函数代码示例写得很实用,希望能帮到您。

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

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

示例1: K053936Init

void K053936Init(INT32 chip, UINT8 *ram, INT32 len, INT32 w, INT32 h, void (*pCallback)(INT32 offset, UINT16 *ram, INT32 *code, INT32 *color, INT32 *sx, INT32 *sy, INT32 *fx, INT32 *fy)){	ramptr[chip] = ram;	nRamLen[chip] = len;	if (rambuf[chip] == NULL) {		rambuf[chip] = (UINT8*)BurnMalloc(len);	}	nWidth[chip] = w;	nHeight[chip] = h;	if (tscreen[chip] == NULL) {		tscreen[chip] = (UINT16*)BurnMalloc(w * h * 2);	}	if (chip == 0) {		pTileCallback0 = pCallback;	}	if (chip == 1) {		pTileCallback1 = pCallback;	}	KonamiAllocateBitmaps();	KonamiIC_K053936InUse = 1;}
开发者ID:Cpasjuste,项目名称:libarcade,代码行数:28,


示例2: tms34061_init

void tms34061_init(UINT8 rowshift, UINT32 ram_size, void (*partial_update)(), void (*callback)(INT32 state)){	DebugDev_Tms34061Initted = 1;		m_partial_update = partial_update;	m_rowshift = rowshift;	m_vramsize = ram_size;	/* resolve callbak */	m_interrupt_cb = callback;	/* reset the data */	m_vrammask = m_vramsize - 1;	/* allocate memory for VRAM */	m_vram = (UINT8*)BurnMalloc(m_vramsize + 256 * 2);	/* allocate memory for latch RAM */	m_latchram = (UINT8*)BurnMalloc(m_vramsize + 256 * 2);	/* add some buffer space for VRAM and latch RAM */	m_vram += 256;	m_latchram += 256;	/* point the shift register to the base of VRAM for now */	m_shiftreg = m_vram;}
开发者ID:Cpasjuste,项目名称:libarcade,代码行数:27,


示例3: K053247Init

void K053247Init(UINT8 *gfxrom, INT32 gfxlen, void (*Callback)(INT32 *code, INT32 *color, INT32 *priority), INT32 flags){	K053247Ram = (UINT8*)BurnMalloc(0x1000);	K053246Gfx = gfxrom;	K053246Mask = gfxlen;	K053247Callback = Callback;	K053247_dx = 0;	K053247_dy = 0;	K053247_wraparound = 1;	if (konami_temp_screen == NULL) {		INT32 width, height;		BurnDrvGetVisibleSize(&width, &height);		konami_temp_screen = (UINT16*)BurnMalloc(width * height * 2);	}	K053247Temp = konami_temp_screen;	K053247Flags = flags; // 0x02 highlight, 0x01 shadow	KonamiIC_K053247InUse = 1;}
开发者ID:CaptainCPS,项目名称:FBAlphaRL,代码行数:25,


示例4: CavePalInit

INT32 CavePalInit(INT32 nPalSize){	CavePalette = (UINT32*)BurnMalloc(nPalSize * sizeof(UINT32));	memset(CavePalette, 0, nPalSize * sizeof(UINT32));	CavePalCopy = (UINT16*)BurnMalloc(nPalSize * sizeof(UINT16));	memset(CavePalCopy, 0, nPalSize * sizeof(UINT16));		pBurnDrvPalette = CavePalette;	return 0;}
开发者ID:CaptainCPS,项目名称:FBAlphaRL,代码行数:12,


示例5: 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,


示例6: LoadUp

// Allocate space and load up a romstatic 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,


示例7: DrvGfxDecode

static INT32 DrvGfxDecode(){	INT32 Plane0[4]  = { 0, 4, RGN_FRAC(0x04000, 1,2), RGN_FRAC(0x04000, 1,2)+4 };	INT32 Plane1[4]  = { 0, 4, RGN_FRAC(0x40000, 1,2), RGN_FRAC(0x40000, 1,2)+4 };	INT32 Plane2[4]  = { 0, 4, RGN_FRAC(0x40000, 1,2), RGN_FRAC(0x40000, 1,2)+4 };	INT32 XOffs[16]  = { STEP4(0,1), STEP4(8,1), STEP4(16,1), STEP4(24,1) };	INT32 YOffs0[8]  = { STEP8(0,16) };	INT32 YOffs1[16] = { STEP16(0,32) };	UINT8 *tmp = (UINT8*)BurnMalloc(0x40000);	if (tmp == NULL) {		return 1;	}	memcpy (tmp, DrvGfxROM0, 0x04000);	GfxDecode(0x0200, 4,  8,  8, Plane0, XOffs, YOffs0, 0x080, tmp, DrvGfxROM0);	memcpy (tmp, DrvGfxROM1, 0x40000);	GfxDecode(0x0800, 4, 16, 16, Plane1, XOffs, YOffs1, 0x200, tmp, DrvGfxROM1);	memcpy (tmp, DrvGfxROM2, 0x40000);	GfxDecode(0x0800, 4, 16, 16, Plane2, XOffs, YOffs1, 0x200, tmp, DrvGfxROM2);	BurnFree (tmp);	return 0;}
开发者ID:meesokim,项目名称:fba,代码行数:30,


示例8: 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,


示例9: DrvGfxDecode

static INT32 DrvGfxDecode(){	INT32 Plane0[4]  = { 0x200000, 0x300000, 0x000000, 0x100000 };	INT32 XOffs0[8]  = { 0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007 };	INT32 YOffs0[8]  = { 0x038, 0x030, 0x028, 0x020, 0x018, 0x010, 0x008, 0x000 };	INT32 Plane1[4]  = { 0x000004, 0x000000, 0x100004, 0x100000 };	INT32 XOffs1[16] = { 0x10b, 0x10a, 0x109, 0x108, 0x103, 0x102, 0x101, 0x100,			   0x00b, 0x00a, 0x009, 0x008, 0x003, 0x002, 0x001, 0x000 };	INT32 YOffs1[16] = { 0x0f0, 0x0e0, 0x0d0, 0x0c0, 0x0b0, 0x0a0, 0x090, 0x080,			   0x070, 0x060, 0x050, 0x040, 0x030, 0x020, 0x010, 0x000 };	UINT8 *tmp = (UINT8*)BurnMalloc(0x80000);	if (tmp == NULL) {		return 1;	}	for (INT32 i = 0; i < 0x80000; i++) tmp[i] = DrvGfxROM0[i] ^ 0xff;	GfxDecode(0x4000, 4,  8,  8, Plane0, XOffs0, YOffs0, 0x040, tmp, DrvGfxROM0);	for (INT32 i = 0; i < 0x40000; i++) tmp[i] = DrvGfxROM1[i] ^ 0xff;	GfxDecode(0x0800, 4, 16, 16, Plane1, XOffs1, YOffs1, 0x200, tmp, DrvGfxROM1);	BurnFree (tmp);	return 0;}
开发者ID:Cpasjuste,项目名称:libarcade,代码行数:29,


示例10: Sf2mdtSoundInit

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;}
开发者ID:CaptainCPS,项目名称:FBAlphaRL,代码行数:31,


示例11: 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,


示例12: DrvInit

static INT32 DrvInit(){	INT32 nLen;#ifdef DRIVER_ROTATION	bToaRotateScreen = false;#endif	nGP9001ROMSize[0] = 0x800000;	// 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, 0x07FFFF, SM_ROM);		SekMapMemory(Ram01,		0x100000, 0x103FFF, SM_RAM);		SekMapMemory(RamPal,		0x400000, 0x400FFF, SM_RAM);		SekSetReadWordHandler(0, 	kbash2ReadWord);		SekSetReadByteHandler(0, 	kbash2ReadByte);		SekSetWriteWordHandler(0, 	kbash2WriteWord);		SekSetWriteByteHandler(0, 	kbash2WriteByte);		SekClose();	}	MSM6295Init(0, 1000000 / 132, 100.0, 1);	MSM6295Init(1, 1000000 / 132, 100.0, 1);	nSpriteYOffset = 0x0011;	nLayer0XOffset = -0x01D6;	nLayer1XOffset = -0x01D8;	nLayer2XOffset = -0x01DA;	ToaInitGP9001();	nToaPalLen = nColCount;	ToaPalSrc = RamPal;	ToaPalInit();	bDrawScreen = true;	DrvDoReset();			// Reset machine	return 0;}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:59,


示例13: 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,


示例14: CpsInit

INT32 CpsInit(){	INT32 nMemLen, i;	   if (Cps == 2)      BurnSetRefreshRate(59.629403);	if (!nCPS68KClockspeed) {			nCPS68KClockspeed = 11800000;	}	nCPS68KClockspeed = nCPS68KClockspeed * 100 / nBurnFPS;	nMemLen = nCpsGfxLen + nCpsRomLen + nCpsCodeLen + nCpsZRomLen + nCpsQSamLen + nCpsAdLen;	// Allocate Gfx, Rom and Z80 Roms	CpsGfx = (UINT8*)BurnMalloc(nMemLen);	if (CpsGfx == NULL) {		return 1;	}	memset(CpsGfx, 0, nMemLen);	CpsRom  = CpsGfx + nCpsGfxLen;	CpsCode = CpsRom + nCpsRomLen;   CpsZRom = CpsCode + nCpsCodeLen;	CpsQSam =(INT8*)(CpsZRom + nCpsZRomLen);	CpsAd   =(UINT8*)(CpsQSam + nCpsQSamLen);	// Create Gfx addr mask	for (i = 0; i < 31; i++) {		if ((1 << i) >= (INT32)nCpsGfxLen) {			break;		}	}	nCpsGfxMask = (1 << i) - 1;	// Offset to Scroll tiles   nCpsGfxScroll[1] = nCpsGfxScroll[2] = nCpsGfxScroll[3] = 0x800000;#if 0	if (nCpsZRomLen>=5) {		// 77->cfff and rst 00 in case driver doesn't load		CpsZRom[0] = 0x3E; CpsZRom[1] = 0x77;		CpsZRom[2] = 0x32; CpsZRom[3] = 0xFF; CpsZRom[4] = 0xCF;		CpsZRom[5] = 0xc7;	}#endif	SepTableCalc();									  // Precalc the separate table	CpsReset = 0; Cpi01A = Cpi01C = Cpi01E = 0;		  // blank other inputs	// Use this as default - all CPS-2 games use it	SetCpsBId(CPS_B_21_DEF, 0);	return 0;}
开发者ID:demonccc,项目名称:fba-libretro,代码行数:56,


示例15: pic16c5xInit

void pic16c5xInit(INT32 /*nCPU*/, INT32 type, UINT8 *mem){	DebugCPU_PIC16C5XInitted = 1;		nPic16c5xCpuType = type;	pic16c5xDoReset(type, &rom_address_mask, &ram_address_mask);	pic16c5x_rom = mem;		pic16c5x_ram = (UINT8*)BurnMalloc(ram_address_mask + 1);}
开发者ID:Cpasjuste,项目名称:libarcade,代码行数:12,


示例16: UpdateStream

static void UpdateStream(INT32 chip, INT32 length){	struct dac_info *ptr;	if (lBuffer == NULL) {	// delay buffer allocation for cases when fps is not 60		lBuffer = (INT16*)BurnMalloc(nBurnSoundLen * sizeof(INT16));		memset (lBuffer, 0, nBurnSoundLen * sizeof(INT16));	}	if (rBuffer == NULL) {	// delay buffer allocation for cases when fps is not 60		rBuffer = (INT16*)BurnMalloc(nBurnSoundLen * sizeof(INT16));		memset (rBuffer, 0, nBurnSoundLen * sizeof(INT16));	}        ptr = &dac_table[chip];        if (ptr->Initialized == 0) return;        if (length > nBurnSoundLen) length = nBurnSoundLen;        length -= ptr->nCurrentPosition;        if (length <= 0) return;        INT16 *lbuf = lBuffer + ptr->nCurrentPosition;	INT16 *rbuf = rBuffer + ptr->nCurrentPosition;	INT16 lOut = ((ptr->OutputDir & BURN_SND_ROUTE_LEFT ) == BURN_SND_ROUTE_LEFT ) ? ptr->Output : 0;        INT16 rOut = ((ptr->OutputDir & BURN_SND_ROUTE_RIGHT) == BURN_SND_ROUTE_RIGHT) ? ptr->Output : 0;        ptr->nCurrentPosition += length;        if (rOut && lOut) {                              while (length--) {                        *lbuf++ = *lbuf + lOut;			*rbuf++ = *rbuf + rOut;                }        } else if (lOut) {                              while (length--) *lbuf++ = *lbuf + lOut;        } else if (rOut) {                            while (length--) *rbuf++ = *rbuf + rOut;        }}
开发者ID:CaptainCPS,项目名称:FBAlphaRL,代码行数:39,


示例17: PC090OJInit

void PC090OJInit(INT32 nNumTiles, INT32 xOffset, INT32 yOffset, INT32 UseBuffer){	PC090OJRam = (UINT8*)BurnMalloc(0x4000);	memset(PC090OJRam, 0, 0x4000);		PC090OJNumTiles = nNumTiles;		PC090OJXOffset = xOffset;	PC090OJYOffset = yOffset;	PC090OJUseBuffer = UseBuffer;	PC090OJPaletteOffset = 0;		TaitoIC_PC090OJInUse = 1;}
开发者ID:CaptainCPS,项目名称:FBAlphaRL,代码行数:14,


示例18: K053250Init

void K053250Init(INT32 , UINT8 *rom, UINT8 *romexp, INT32 size){	KonamiAllocateBitmaps();	K053250Ram = (UINT16*)BurnMalloc(0x6000);	buffer[0] = K053250Ram + 0x2000;	buffer[1] = K053250Ram + 0x2800;	k053250Rom = rom;	k053250RomExp = romexp;	unpack_nibbles(0, rom, romexp, size);	KonamiIC_K053250InUse = 1;}
开发者ID:Cpasjuste,项目名称:libarcade,代码行数:15,


示例19: Cps2LoadOne

static INT32 Cps2LoadOne(UINT8* Tile, INT32 nNum, INT32 nWord, INT32 nShift){	UINT8 *Rom = NULL; INT32 nRomLen = 0;	UINT8 *pt, *pr;	LoadUp(&Rom, &nRomLen, nNum);	if (Rom == NULL) {		return 1;	}	if (nWord == 0) {		UINT8*Rom2 = NULL; INT32 nRomLen2 = 0;		UINT8*Rom3 = Rom;		LoadUp(&Rom2, &nRomLen2, nNum + 1);		if (Rom2 == NULL) {			return 1;		}		nRomLen <<= 1;		Rom = (UINT8*)BurnMalloc(nRomLen);		if (Rom == NULL) {			BurnFree(Rom2);			BurnFree(Rom3);			return 1;		}		for (INT32 i = 0; i < nRomLen2; i++) {			Rom[(i << 1) + 0] = Rom3[i];			Rom[(i << 1) + 1] = Rom2[i];		}		BurnFree(Rom2);		BurnFree(Rom3);	}	// Go through each section	pt = Tile; pr = Rom;	for (INT32 b = 0; b < nRomLen >> 19; b++) {		Cps2Load100000(pt, pr,     nShift); pt += 0x100000;		Cps2Load100000(pt, pr + 2, nShift); pt += 0x100000;		pr += 0x80000;	}	BurnFree(Rom);	return 0;}
开发者ID:demonccc,项目名称:fba-libretro,代码行数:48,


示例20: pgm_decode_kovqhsgs_gfx_block

void pgm_decode_kovqhsgs_gfx_block(UINT8 *src){	INT32 i, j;	UINT8 *dec = (UINT8*)BurnMalloc(0x800000);	for (i = 0; i < 0x800000; i++)	{		j = BITSWAP24(i, 23, 10, 9, 22, 19, 18, 20, 21, 17, 16, 15, 14, 13, 12, 11, 8, 7, 6, 5, 4, 3, 2, 1, 0);		dec[j] = src[i];	}	memcpy (src, dec, 0x800000);	BurnFree (dec);}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:16,


示例21: AllocateMemory

static INT32 AllocateMemory(){    INT32 nLen;    CpsMem = NULL;													// Find out how much memory is needed    CpsMemIndex();    nLen = CpsMemEnd - (UINT8*)0;    if ((CpsMem = (UINT8*)BurnMalloc(nLen)) == NULL) {        return 1;    }    memset(CpsMem, 0, nLen);										// blank all memory    CpsMemIndex();													// Index the allocated memory    return 0;}
开发者ID:frangarcj,项目名称:fba_cores_cps2,代码行数:17,


示例22: pgm_decode_kovassg_program

static void pgm_decode_kovassg_program(){	INT32 i, j;	UINT16 *src = (UINT16 *)PGM68KROM;	UINT16 *dst = (UINT16 *)BurnMalloc(0x400000);	for (i = 0; i < 0x400000/2; i++)	{		j = (i & ~0xffff) | (BITSWAP16(i, 15, 14, 13, 12,  11, 10, 7, 3,  1, 9, 4, 8,  6, 0, 2, 5) ^ 0x019c);		dst[i] = BITSWAP16(src[j], 13, 9, 10, 11, 2, 0, 12 ,5, 4, 1, 14, 8, 15, 6, 3, 7) ^ 0x9d05;	}	memcpy (src, dst, 0x400000);	BurnFree (dst);}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:17,


示例23: pgm_decode_kovlsqh2_program

static void pgm_decode_kovlsqh2_program(){	INT32 i, j;	UINT16 *src = (UINT16*)PGM68KROM;	UINT16 *dst = (UINT16*)BurnMalloc(0x400000);	for (i = 0; i < 0x400000 / 2; i++)	{		j = BITSWAP24(i, 23, 22, 21, 20, 19, 16, 15, 14, 13, 12, 11, 10, 9, 8, 0, 1, 2, 3, 4, 5, 6, 18, 17, 7);		dst[j] = BURN_ENDIAN_SWAP_INT16(src[i]);	}	memcpy (src, dst, 0x400000);	BurnFree (dst);}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:17,


示例24: pgm_decode_kovqhsgs_tile_data

void pgm_decode_kovqhsgs_tile_data(UINT8 *source){	INT32 i, j;	UINT16 *src = (UINT16*)source;	UINT16 *dst = (UINT16*)BurnMalloc(0x800000);	for (i = 0; i < 0x800000 / 2; i++)	{		j = BITSWAP24(i, 23, 22, 9, 8, 21, 18, 0, 1, 2, 3, 16, 15, 14, 13, 12, 11, 10, 19, 20, 17, 7, 6, 5, 4);		dst[j] = BURN_ENDIAN_SWAP_INT16(BITSWAP16(BURN_ENDIAN_SWAP_INT16(src[i]), 1, 14, 8, 7, 0, 15, 6, 9, 13, 2, 5, 10, 12, 3, 4, 11));	}	memcpy (src, dst, 0x800000);	BurnFree (dst);}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:17,


示例25: DrvSpriteDecode

static void DrvSpriteDecode(){	UINT8 *tmp = (UINT8*)BurnMalloc(0x40000);	if (tmp == NULL) {		return;	}	memcpy (tmp, FCU2ROM, 0x40000);	memset (FCU2ROM, 0, 0x80000);	for (INT32 i = 0; i < (0x40000 / 4) * 8; i++) {		for (INT32 j = 0; j < 4; j++) {			FCU2ROM[i] |= ((tmp[(j * 0x10000) + (i/8)] >> (~i & 7)) & 1) << (3 - j);		}	}	BurnFree (tmp);}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:18,


示例26: Adsp2100Init

int Adsp2100Init(){    pMemMap = new Adsp2100MemoryMap;    ResetMemoryMap();    pADSP = (adsp2100_state*) BurnMalloc(sizeof(adsp2100_state));    adsp2105_init(pADSP, nullptr);    pADSP->sport_rx_callback = RxCallback;    pADSP->sport_tx_callback = TxCallback;    pADSP->timer_fired = TimerCallback;    pTimerCallback = NULL;    pTxCallback = NULL;    pRxCallback = NULL;#if ENABLE_TRACE    pTrace = fopen("adsp21xx.txt", "w");#endif    return 0;}
开发者ID:meesokim,项目名称:fba,代码行数:19,


示例27: drvInit

static INT32 drvInit(){	INT32 nLen;    #ifdef DRIVER_ROTATION	bToaRotateScreen = true;#endif    	nGP9001ROMSize[0] = 0x01000000;    	// 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);										// Zero memory	MemIndex();													// Index the allocated memory    	if (LoadRoms()) {		return 1;	}    	{		SekInit(0, 0x68000);									// Allocate 68000	    SekOpen(0);        		// Map 68000 memory:		SekMapMemory(Rom01, 0x000000, 0x1FFFFF, SM_ROM);		// CPU 0 ROM		SekMapMemory(Ram02, 0x208000, 0x20FFFF, SM_RAM);        		Map68KTextROM(true);        		SekSetReadWordHandler(0, batriderReadWord);		SekSetReadByteHandler(0, batriderReadByte);		SekSetWriteWordHandler(0, batriderWriteWord);		SekSetWriteByteHandler(0, batriderWriteByte);        		SekMapHandler(1,	0x400000, 0x400400, SM_RAM);		// GP9001 addresses        		SekSetReadWordHandler(1, batriderReadWordGP9001);		SekSetWriteWordHandler(1, batriderWriteWordGP9001);        		SekMapHandler(2,	0x300000, 0x37FFFF, SM_ROM);		// Z80 ROM        		SekSetReadByteHandler(2, batriderReadByteZ80ROM);		SekSetReadWordHandler(2, batriderReadWordZ80ROM);        		SekClose();	}    	nSpriteYOffset = 0x0001;    	nLayer0XOffset = -0x01D6;	nLayer1XOffset = -0x01D8;	nLayer2XOffset = -0x01DA;    	ToaInitGP9001();    	nExtraTXOffset = 0x2C;	ToaExtraTextInit();    	drvZInit();				// Initialize Z80    	BurnYM2151Init(32000000 / 8);	BurnYM2151SetAllRoutes(1.00, BURN_SND_ROUTE_BOTH);		MSM6295Init(0, 32000000 / 10 / 132, 1);	MSM6295Init(1, 32000000 / 10 / 165, 1);	MSM6295SetRoute(0, 1.00, BURN_SND_ROUTE_BOTH);	MSM6295SetRoute(1, 1.00, BURN_SND_ROUTE_BOTH);    	nToaPalLen = nColCount;	ToaPalSrc = RamPal;	ToaPalInit();    	nTextROMStatus = -1;	bDrawScreen = true;    	drvDoReset(); // Reset machine	return 0;}
开发者ID:coca8cola,项目名称:iFBA,代码行数:83,


示例28: DrvInit

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;}
开发者ID:Cpasjuste,项目名称:libarcade,代码行数:74,


示例29: DrvInit

static INT32 DrvInit(){	INT32 nLen;#ifdef DRIVER_ROTATION	bToaRotateScreen = true;#endif	BurnSetRefreshRate(REFRESHRATE);	nBCU2ROMSize = 0x080000;	nFCU2ROMSize = 0x080000;	// 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);		// Map 68000 memory:		SekMapMemory(Rom01,			0x000000, 0x03FFFF, SM_ROM);	// 68K ROM		SekMapMemory(Ram01,			0x080000, 0x083FFF, SM_RAM);	// 68K RAM		SekMapMemory(RamPal,		0x144000, 0x1447FF, SM_RAM);	// BCU-2 palette RAM		SekMapMemory(RamPal2,		0x146000, 0x1467FF, SM_RAM);	// FCU-2 palette RAM		SekSetReadWordHandler(0, truxtonReadWord);		SekSetReadByteHandler(0, truxtonReadByte);		SekSetWriteWordHandler(0, truxtonWriteWord);		SekSetWriteByteHandler(0, truxtonWriteByte);		SekMapHandler(1,			0x180000, 0x180FFF, 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, 0);	BurnTimerAttachZetYM3812(28000000 / 8);	BurnYM3812SetRoute(BURN_SND_YM3812_ROUTE, 1.00, BURN_SND_ROUTE_BOTH);	bDrawScreen = true;	DrvDoReset();												// Reset machine	return 0;}
开发者ID:CaptainCPS,项目名称:FBAlphaRL,代码行数:71,



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


C++ Button函数代码示例
C++ BurnLoadRom函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。