• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ BURN_ENDIAN_SWAP_INT16函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: DrvReset

static INT32 DrvReset()
{
	// Reset machine
	if (Cps == 2 || PangEEP || Cps1Qs == 1 || CpsBootlegEEPROM) EEPROMReset();
    
    //HACK
    if (glob_ffingeron&&virtual_stick_on) {
        wait_control=60;
        glob_framecpt=0;
        glob_replay_last_dx16=glob_replay_last_dy16=0;
        glob_delta_dy16=0;
        glob_replay_last_fingerOn=0;
    }
    //

	SekOpen(0);
	SekReset();
	SekClose();

	if (((Cps & 1) && !Cps1DisablePSnd) || ((Cps == 2) && !Cps2DisableQSnd)) {
		ZetOpen(0);
		ZetReset();
		ZetClose();
	}

	if (Cps == 2) {
		// Disable beam-synchronized interrupts
		*((UINT16*)(CpsReg + 0x4E)) = BURN_ENDIAN_SWAP_INT16(0x0200);
		*((UINT16*)(CpsReg + 0x50)) = BURN_ENDIAN_SWAP_INT16(nCpsNumScanlines);
		*((UINT16*)(CpsReg + 0x52)) = BURN_ENDIAN_SWAP_INT16(nCpsNumScanlines);
	}

	SekOpen(0);
	CpsMapObjectBanks(0);
	SekClose();

	nCpsCyclesExtra = 0;

	if (((Cps == 2) && !Cps2DisableQSnd) || Cps1Qs == 1) {			// Sound init (QSound)
		QsndReset();
	}
	
	if (CpsRunResetCallbackFunction) {
		CpsRunResetCallbackFunction();
	}
	
	HiscoreReset();

	return 0;
}
开发者ID:coca8cola,项目名称:iFBA,代码行数:50,代码来源:cps_run.cpp


示例2: CavePalUpdate4Bit

INT32 CavePalUpdate4Bit(INT32 nOffset, INT32 nNumPalettes)
{
	INT32 i, j;

	UINT16* ps = (UINT16*)CavePalSrc + nOffset;
	UINT16* pc;
	UINT32* pd;

	UINT16 c;

	if (CaveRecalcPalette) {

		for (i = 0; i < 0 + nNumPalettes; i++) {

			pc = CavePalCopy + (i << 8);
			pd = CavePalette + (i << 8);

			for (j = 0; j < 16; j++, ps++, pc++, pd++) {

				c = *ps;
				*pc = c;
				*pd = CalcCol(BURN_ENDIAN_SWAP_INT16(c));

			}
		}

		CaveRecalcPalette = 0;
		return 0;
	}


	for (i = 0; i < 0 + nNumPalettes; i++) {

		pc = CavePalCopy + (i << 8);
		pd = CavePalette + (i << 8);

		for (j = 0; j < 16; j++, ps++, pc++, pd++) {

			c = *ps;
			if (*pc != c) {
				*pc = c;
				*pd = CalcCol(BURN_ENDIAN_SWAP_INT16(c));
			}

		}
	}

	return 0;
}
开发者ID:CaptainCPS,项目名称:FBAlphaRL,代码行数:49,代码来源:cave_palette.cpp


示例3: pgm_decrypt_dw2

void pgm_decrypt_dw2()
{
	UINT16 *src = (UINT16 *)PGM68KROM;

	for (INT32 i = 0; i<nPGM68KROMLen/2; i++) {
		UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]);

		if ((i & 0x020890) == 0x000000)				      x ^= 0x0002;
		if ((i & 0x020000) == 0x020000 && (i & 0x001500) != 0x001400) x ^= 0x0002;
		if ((i & 0x020400) == 0x000000 && (i & 0x002010) != 0x002010) x ^= 0x0400;
		if ((i & 0x020000) == 0x020000 && (i & 0x000148) != 0x000140) x ^= 0x0400;
	
		src[i] = BURN_ENDIAN_SWAP_INT16(x);
	}
}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:15,代码来源:pgm_crypt.cpp


示例4: pgm_decrypt_dw3

void pgm_decrypt_dw3()
{
	UINT16 *src = (UINT16 *)PGM68KROM;

	for (INT32 i = 0; i < nPGM68KROMLen/2; i++) {
		UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]);

		if ((i & 0x005460) == 0x001400) x ^= 0x0100;
		if ((i & 0x005450) == 0x001040) x ^= 0x0100;
		if ((i & 0x005e00) == 0x001c00) x ^= 0x0040;
		if ((i & 0x005580) == 0x001100) x ^= 0x0040;

		src[i] = BURN_ENDIAN_SWAP_INT16(x);
	}
}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:15,代码来源:pgm_crypt.cpp


示例5: pgm_decrypt_killbld

void pgm_decrypt_killbld()
{
	UINT16 *src = (UINT16 *)PGM68KROM;

	for (INT32 i = 0; i < nPGM68KROMLen/2; i++) {
		UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]);

		if ((i & 0x006d00) == 0x000400) x ^= 0x0008;
		if ((i & 0x006c80) == 0x000880) x ^= 0x0008;
		if ((i & 0x007500) == 0x002400) x ^= 0x1000;
		if ((i & 0x007600) == 0x003200) x ^= 0x1000;

		src[i] = BURN_ENDIAN_SWAP_INT16(x);
	}
}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:15,代码来源:pgm_crypt.cpp


示例6: 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,代码来源:pgm_crypt.cpp


示例7: K053246Write

void K053246Write(INT32 offset, INT32 data)
{
	if (data & 0x10000) { // handle it as a word
		*((UINT16*)(K053246Regs + (offset & 6))) = BURN_ENDIAN_SWAP_INT16(data);
	} else {
		K053246Regs[offset & 7] = data;
	}
}
开发者ID:CaptainCPS,项目名称:FBAlphaRL,代码行数:8,代码来源:k053247.cpp


示例8: K053247Write

void K053247Write(INT32 offset, INT32 data)
{
	if (data & 0x10000) { // use word
		*((UINT16*)(K053247Ram + (offset & 0xffe))) = BURN_ENDIAN_SWAP_INT16(data);
	} else {
		K053247Ram[offset & 0xfff] = data;
	}
}
开发者ID:CaptainCPS,项目名称:FBAlphaRL,代码行数:8,代码来源:k053247.cpp


示例9: pgm_decode_kovqhsgs_program

static void pgm_decode_kovqhsgs_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, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 6, 7, 5, 4, 3, 2, 1, 0);

		dst[j] = BURN_ENDIAN_SWAP_INT16(BITSWAP16(BURN_ENDIAN_SWAP_INT16(src[i]), 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 4, 5, 3, 2, 1, 0));
	}

	memcpy (src, dst, 0x400000);

	BurnFree (dst);
}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:17,代码来源:pgm_crypt.cpp


示例10: pgm_decrypt_svg

void pgm_decrypt_svg()
{
	UINT16 *src = (UINT16 *)PGMUSER0;

	for (INT32 i = 0; i < nPGMExternalARMLen/2; i++) {
		UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]);

		if ((i & 0x040080) != 0x000080) x ^= 0x0001;
		if ((i & 0x004008) == 0x004008) x ^= 0x0002;
		if ((i & 0x080030) == 0x080010) x ^= 0x0004;
		if ((i & 0x000042) != 0x000042) x ^= 0x0008;
		if ((i & 0x048100) == 0x048000) x ^= 0x0010;
		if ((i & 0x002004) != 0x000004) x ^= 0x0020;
		if ((i & 0x011800) != 0x010000) x ^= 0x0040;
		if ((i & 0x000820) == 0x000820) x ^= 0x0080;

		src[i] = BURN_ENDIAN_SWAP_INT16(x);
	}
}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:19,代码来源:pgm_crypt.cpp


示例11: read_half

uint16_t read_half(addr_t address)
{
    address &= 0xFFFFFFFF;

    UINT8 *pr = g_mmap->MemMap[PFN(address)];
    if ((uintptr_t)pr >= MIPS_MAXHANDLER) {
        return BURN_ENDIAN_SWAP_INT16(fast_read<uint16_t>(pr, address));
    }
    return g_mmap->ReadHalf[(uintptr_t)pr](address);
}
开发者ID:spectrenoir06,项目名称:libretro-fba,代码行数:10,代码来源:mips3_intf.cpp


示例12: pgm_decrypt_ddp2

void pgm_decrypt_ddp2()
{
	UINT16 *src = (UINT16 *)PGMUSER0;

	for (INT32 i = 0; i < nPGMExternalARMLen/2; i++) {
    		UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]);

		if ((i & 0x0480) != 0x0080) x ^= 0x0001;
		if ((i & 0x0042) != 0x0042) x ^= 0x0008;
		if ((i & 0x8100) == 0x8000) x ^= 0x0010;
		if ((i & 0x2004) != 0x0004) x ^= 0x0020;
		if ((i & 0x1800) != 0x0000) x ^= 0x0040;
		if ((i & 0x0820) == 0x0820) x ^= 0x0080;

		x ^= ddp2_tab[(i >> 1) & 0xff] << 8;

		src[i] = BURN_ENDIAN_SWAP_INT16(x);
	}
}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:19,代码来源:pgm_crypt.cpp


示例13: write_half

void write_half(addr_t address, uint16_t value)
{
    address &= 0xFFFFFFFF;

    UINT8 *pr = g_mmap->MemMap[PAGE_WADD + PFN(address)];
    if ((uintptr_t)pr >= MIPS_MAXHANDLER) {
        fast_write<uint16_t>(pr, address, BURN_ENDIAN_SWAP_INT16(value));
        return;
    }
    g_mmap->WriteHalf[(uintptr_t)pr](address, value);
}
开发者ID:spectrenoir06,项目名称:libretro-fba,代码行数:11,代码来源:mips3_intf.cpp


示例14: pgm_decrypt_puzlstar

void pgm_decrypt_puzlstar()
{
	UINT16 *src = (UINT16 *)PGM68KROM;

	for (INT32 i = 0; i < nPGM68KROMLen/2; i++) {
		UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]);

		if ((i & 0x40480) != 0x00080) x ^= 0x0001;
		if ((i & 0x00030) == 0x00010) x ^= 0x0004;
		if ((i & 0x00242) != 0x00042) x ^= 0x0008;
		if ((i & 0x08100) == 0x08000) x ^= 0x0010;
		if ((i & 0x22004) != 0x00004) x ^= 0x0020;
		if ((i & 0x11800) != 0x10000) x ^= 0x0040;
		if ((i & 0x04820) == 0x04820) x ^= 0x0080;

		x ^= puzlstar_tab[i & 0xff] << 8;

		src[i] = BURN_ENDIAN_SWAP_INT16(x);
	}
}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:20,代码来源:pgm_crypt.cpp


示例15: pgm_decrypt_happy6in1

void pgm_decrypt_happy6in1()
{
	UINT16 *src = (UINT16*)PGMUSER0;

	for (INT32 i = 0; i < nPGMExternalARMLen/2; i++) {
		UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]);

		if ((i & 0x040480) != 0x000080) x ^= 0x0001;
		if ((i & 0x104008) == 0x104008) x ^= 0x0002;
		if ((i & 0x080030) == 0x080010) x ^= 0x0004;
		if ((i & 0x000242) != 0x000042) x ^= 0x0008;
		if ((i & 0x048100) == 0x048000) x ^= 0x0010;
		if ((i & 0x002004) != 0x000004) x ^= 0x0020;
		if ((i & 0x011800) != 0x010000) x ^= 0x0040;
		if ((i & 0x000820) == 0x000820) x ^= 0x0080;

		x ^= happy6in1_tab[(i >> 1) & 0xff] << 8;

		src[i] = BURN_ENDIAN_SWAP_INT16(x);
	}
}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:21,代码来源:pgm_crypt.cpp


示例16: pgm_decrypt_espgaluda

void pgm_decrypt_espgaluda()
{
	UINT16 *src = (UINT16 *)PGM68KROM;

	for (INT32 i = 0; i < nPGM68KROMLen/2; i++) {
		UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]);

		if ((i & 0x040480) != 0x000080) x ^= 0x0001;
		if ((i & 0x084008) == 0x084008) x ^= 0x0002;
		if ((i & 0x000030) == 0x000010) x ^= 0x0004;
		if ((i & 0x000042) != 0x000042) x ^= 0x0008;
		if ((i & 0x048100) == 0x048000) x ^= 0x0010;
		if ((i & 0x022004) != 0x000004) x ^= 0x0020;
		if ((i & 0x011800) != 0x010000) x ^= 0x0040;
		if ((i & 0x000820) == 0x000820) x ^= 0x0080;

		x ^= espgal_tab[i & 0xff] << 8;

		src[i] = BURN_ENDIAN_SWAP_INT16(x);
	}
}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:21,代码来源:pgm_crypt.cpp


示例17: pgm_decrypt_ketsui

void pgm_decrypt_ketsui()
{
	UINT16 *src = (UINT16 *)PGM68KROM;

	for (INT32 i = 0; i < nPGM68KROMLen/2; i++) {
		UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]);

		if ((i & 0x040480) != 0x000080) x ^= 0x0001;
		if ((i & 0x004008) == 0x004008) x ^= 0x0002;
		if ((i & 0x080030) == 0x000010) x ^= 0x0004; // due to address starting at 0 and not 100000/2!
		if ((i & 0x000042) != 0x000042) x ^= 0x0008;
		if ((i & 0x008100) == 0x008000) x ^= 0x0010;
		if ((i & 0x002004) != 0x000004) x ^= 0x0020;
		if ((i & 0x011800) != 0x010000) x ^= 0x0040;
		if ((i & 0x000820) == 0x000820) x ^= 0x0080;

		x ^= ketsui_tab[i & 0xff] << 8;

		src[i] = BURN_ENDIAN_SWAP_INT16(x);
	}
}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:21,代码来源:pgm_crypt.cpp


示例18: DrvReset

static INT32 DrvReset()
{
	// Reset machine
	if (Cps == 2 || PangEEP || Cps1Qs == 1 || CpsBootlegEEPROM) EEPROMReset();

	SekOpen(0);
	SekReset();
	SekClose();

	if (((Cps & 1) && !Cps1DisablePSnd) || ((Cps == 2) && !Cps2DisableQSnd)) {
		ZetOpen(0);
		ZetReset();
		ZetClose();
	}

	if (Cps == 2) {
		// Disable beam-synchronized interrupts
		*((UINT16*)(CpsReg + 0x4E)) = BURN_ENDIAN_SWAP_INT16(0x0200);
		*((UINT16*)(CpsReg + 0x50)) = BURN_ENDIAN_SWAP_INT16(nCpsNumScanlines);
		*((UINT16*)(CpsReg + 0x52)) = BURN_ENDIAN_SWAP_INT16(nCpsNumScanlines);
	}

	SekOpen(0);
	CpsMapObjectBanks(0);
	SekClose();

	nCpsCyclesExtra = 0;

	if (((Cps == 2) && !Cps2DisableQSnd) || Cps1Qs == 1) {			// Sound init (QSound)
		QsndReset();
	}
	
	if (CpsRunResetCallbackFunction) {
		CpsRunResetCallbackFunction();
	}
	
	HiscoreReset();

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


示例19: pgm_decrypt_svgpcb

void pgm_decrypt_svgpcb()
{
	UINT16 *src = (UINT16 *)PGMUSER0;

	for (INT32 i = 0; i < nPGMExternalARMLen/2; i++) {
		UINT16 x = BURN_ENDIAN_SWAP_INT16(src[i]);

		// preliminary!
		if ((i & 0x040080) != 0x000080) x ^= 0x0001; // ok?
		if ((i & 0x084008) == 0x084008) x ^= 0x0002;
		if ((i & 0x080030) == 0x080010) x ^= 0x0004;
		if ((i & 0x000242) != 0x000042) x ^= 0x0008; // ok?
		if ((i & 0x048100) == 0x048000) x ^= 0x0010; //
		if ((i & 0x022004) != 0x000004) x ^= 0x0020; // ok?
		if ((i & 0x011800) != 0x010000) x ^= 0x0040;
		if ((i & 0x000820) == 0x000820) x ^= 0x0080;

		x ^= svgpcb_tab[(i >> 1) & 0xff] << 8;

		src[i] = BURN_ENDIAN_SWAP_INT16(x);
	}
}
开发者ID:aquasnake,项目名称:fba-sdl,代码行数:22,代码来源:pgm_crypt.cpp


示例20: fuuki32_write_word

void __fastcall fuuki32_write_word(UINT32 address, UINT16 data)
{
	if ((address & 0xffffe0) == 0x8c0000) {

		if (address == 0x8c001c) {
			DrvRasterPos[0] = data & 0xff;
		}

		*((UINT16*)(DrvVidRegs + (address & 0x1e))) = BURN_ENDIAN_SWAP_INT16(data);

		return;
	}

	if ((address & 0xffffe0) == 0x903fe0) {
		cpu_sync();

		DrvShareRAM[(address & 0x1f) >> 1] = data & 0xff;
		return;
	}
开发者ID:Cpasjuste,项目名称:libarcade,代码行数:19,代码来源:d_fuukifg3.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ BUSNAME函数代码示例发布时间:2022-05-30
下一篇:
C++ BUILTIN_TYPE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap