當前位置: 首頁>>代碼示例>>C++>>正文


C++ BURN_ENDIAN_SWAP_INT16函數代碼示例

本文整理匯總了C++中BURN_ENDIAN_SWAP_INT16函數的典型用法代碼示例。如果您正苦於以下問題:C++ BURN_ENDIAN_SWAP_INT16函數的具體用法?C++ BURN_ENDIAN_SWAP_INT16怎麽用?C++ BURN_ENDIAN_SWAP_INT16使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了BURN_ENDIAN_SWAP_INT16函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的BURN_ENDIAN_SWAP_INT16函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。