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

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

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

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

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

示例1: DRIVER_INIT

ROM_ENDstatic DRIVER_INIT( wink ){	unsigned int i;	UINT8 *ROM = memory_region(REGION_CPU1);	UINT8 *buffer = malloc(0x8000);	// protection module reverse engineered by HIGHWAYMAN	if (buffer)	{		memcpy(buffer,ROM,0x8000);		for (i = 0x0000; i <= 0x1fff; i++)			ROM[i] = buffer[BITSWAP16(i,15,14,13, 11,12, 7, 9, 8,10, 6, 4, 5, 1, 2, 3, 0)];		for (i = 0x2000; i <= 0x3fff; i++)			ROM[i] = buffer[BITSWAP16(i,15,14,13, 10, 7,12, 9, 8,11, 6, 3, 1, 5, 2, 4, 0)];		for (i = 0x4000; i <= 0x5fff; i++)			ROM[i] = buffer[BITSWAP16(i,15,14,13,  7,10,11, 9, 8,12, 6, 1, 3, 4, 2, 5, 0)];		for (i = 0x6000; i <= 0x7fff; i++)			ROM[i] = buffer[BITSWAP16(i,15,14,13, 11,12, 7, 9, 8,10, 6, 4, 5, 1, 2, 3, 0)];		free(buffer);	}	for (i = 0; i < 0x8000; i++)		ROM[i] += BITSWAP8(i & 0xff, 7,5,3,1,6,4,2,0);}
开发者ID:joolswills,项目名称:advancemame,代码行数:32,


示例2: DRIVER_INIT

static DRIVER_INIT( togenkyo ){#if 0	UINT8 *prot = machine.region("protdata")->base();	int i;	/* this is one possible way to rearrange the protection ROM data to get the       expected 0x5ece checksum. It's probably completely wrong! But since the       game doesn't do anything else with that ROM, this is more than enough. I       could just fill this are with fake data, the only thing that matters is       the checksum. */	for (i = 0;i < 0x20000;i++)	{		prot[i] = BITSWAP8(prot[i],2,7,3,5,0,6,4,1);	}#else	unsigned char *ROM = machine.region("maincpu")->base();	// Protection ROM check skip	ROM[0x010b] = 0x00;	ROM[0x010c] = 0x00;	ROM[0x010d] = 0x00;	// Program ROM SUM check skip//  ROM[0x025c] = 0x00;//  ROM[0x025d] = 0x00;#endif	nb1413m3_type = NB1413M3_TOGENKYO;//S init_nb1413m3(machine);}
开发者ID:vikke,项目名称:mame_0145,代码行数:31,


示例3: DRIVER_INIT_MEMBER

MACHINE_CONFIG_ENDDRIVER_INIT_MEMBER(forte2_state,pesadelo){	int i;	UINT8 *mem = memregion("maincpu")->base();	int memsize = memregion("maincpu")->bytes();	UINT8 *buf;	// data swap	for ( i = 0; i < memsize; i++ )	{		mem[i] = BITSWAP8(mem[i],3,5,6,7,0,4,2,1);	}	// address line swap	buf = auto_alloc_array(machine(), UINT8, memsize);	memcpy(buf, mem, memsize);	for ( i = 0; i < memsize; i++ )	{		mem[BITSWAP16(i,11,9,8,13,14,15,12,7,6,5,4,3,2,1,0,10)] = buf[i];	}	auto_free(machine(), buf);}
开发者ID:cyberkni,项目名称:276in1JAMMA,代码行数:25,


示例4: BITSWAP8

UINT8 deco_cpu6_device::mi_decrypt::read_decrypted(UINT16 adr){	if (adr&1)		return BITSWAP8(direct->read_raw_byte(adr),6,4,7,5,3,2,1,0);	else		return direct->read_raw_byte(adr);}
开发者ID:CJBass,项目名称:mame2013-libretro,代码行数:7,


示例5: DRIVER_INIT_MEMBER

ROM_ENDDRIVER_INIT_MEMBER(wink_state,wink){	UINT32 i;	UINT8 *ROM = memregion("maincpu")->base();	dynamic_buffer buffer(0x8000);	// protection module reverse engineered by HIGHWAYMAN	memcpy(&buffer[0],ROM,0x8000);	for (i = 0x0000; i <= 0x1fff; i++)		ROM[i] = buffer[BITSWAP16(i,15,14,13, 11,12, 7, 9, 8,10, 6, 4, 5, 1, 2, 3, 0)];	for (i = 0x2000; i <= 0x3fff; i++)		ROM[i] = buffer[BITSWAP16(i,15,14,13, 10, 7,12, 9, 8,11, 6, 3, 1, 5, 2, 4, 0)];	for (i = 0x4000; i <= 0x5fff; i++)		ROM[i] = buffer[BITSWAP16(i,15,14,13,  7,10,11, 9, 8,12, 6, 1, 3, 4, 2, 5, 0)];	for (i = 0x6000; i <= 0x7fff; i++)		ROM[i] = buffer[BITSWAP16(i,15,14,13, 11,12, 7, 9, 8,10, 6, 4, 5, 1, 2, 3, 0)];	for (i = 0; i < 0x8000; i++)		ROM[i] += BITSWAP8(i & 0xff, 7,5,3,1,6,4,2,0);}
开发者ID:bradhugh,项目名称:mame,代码行数:27,


示例6: DRIVER_INIT

ROM_ENDstatic DRIVER_INIT( hnfubuki ){	UINT8 *rom = memory_region(REGION_GFX1);	int len = memory_region_length(REGION_GFX1);	int i,j;	/* interestingly, the blitter data has a slight encryption */	/* swap address bits 4 and 5 */	for (i = 0;i < len;i += 0x40)	{		for (j = 0;j < 0x10;j++)		{			UINT8 t = rom[i + j + 0x10];			rom[i + j + 0x10] = rom[i + j + 0x20];			rom[i + j + 0x20] = t;		}	}	/* swap data bits 0 and 1 */	for (i = 0;i < len;i++)	{		rom[i] = BITSWAP8(rom[i],7,6,5,4,3,2,0,1);	}}
开发者ID:shangma,项目名称:mame0112,代码行数:28,


示例7: DRIVER_INIT

ROM_ENDstatic DRIVER_INIT( wink ){	UINT32 i;	UINT8 *ROM = memory_region(machine, "maincpu");	UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x8000);	// protection module reverse engineered by HIGHWAYMAN	memcpy(buffer,ROM,0x8000);	for (i = 0x0000; i <= 0x1fff; i++)		ROM[i] = buffer[BITSWAP16(i,15,14,13, 11,12, 7, 9, 8,10, 6, 4, 5, 1, 2, 3, 0)];	for (i = 0x2000; i <= 0x3fff; i++)		ROM[i] = buffer[BITSWAP16(i,15,14,13, 10, 7,12, 9, 8,11, 6, 3, 1, 5, 2, 4, 0)];	for (i = 0x4000; i <= 0x5fff; i++)		ROM[i] = buffer[BITSWAP16(i,15,14,13,  7,10,11, 9, 8,12, 6, 1, 3, 4, 2, 5, 0)];	for (i = 0x6000; i <= 0x7fff; i++)		ROM[i] = buffer[BITSWAP16(i,15,14,13, 11,12, 7, 9, 8,10, 6, 4, 5, 1, 2, 3, 0)];	auto_free(machine, buffer);	for (i = 0; i < 0x8000; i++)		ROM[i] += BITSWAP8(i & 0xff, 7,5,3,1,6,4,2,0);}
开发者ID:DarrenBranford,项目名称:MAME4iOS,代码行数:29,


示例8: DRIVER_INIT_MEMBER

ROM_ENDDRIVER_INIT_MEMBER(hnayayoi_state,hnfubuki){	UINT8 *rom = machine().root_device().memregion("gfx1")->base();	int len = machine().root_device().memregion("gfx1")->bytes();	int i, j;	/* interestingly, the blitter data has a slight encryption */	/* swap address bits 4 and 5 */	for (i = 0; i < len; i += 0x40)	{		for (j = 0; j < 0x10; j++)		{			UINT8 t = rom[i + j + 0x10];			rom[i + j + 0x10] = rom[i + j + 0x20];			rom[i + j + 0x20] = t;		}	}	/* swap data bits 0 and 1 */	for (i = 0; i < len; i++)	{		rom[i] = BITSWAP8(rom[i],7,6,5,4,3,2,0,1);	}}
开发者ID:broftkd,项目名称:mess-svn,代码行数:28,


示例9: DRIVER_INIT_MEMBER

ROM_END/***************************************            Driver Init              ***************************************//* This reflect how was connected the bus to the EPROM   inside the epoxy CPU block. They used ultra-thin wires,   just to melt down with the epoxy in case someone try to   use a heat gun for epoxy removal purposes...   Bus / Eprom    D0-> D5    D1-> D6    D2-> D0    D3-> D7    D4-> D2    D5-> D4    D6-> D3    D7-> D1   A00-> A10   A01-> A08   A02-> A01   A03-> A11   A04-> A05   A05-> A13   A06-> A12   A07-> A04   A08-> A02   A09-> A07   A10-> A03   A11-> A00   A12-> A09   A13-> A06   A14-> A14*/DRIVER_INIT_MEMBER(kas89_state,kas89){	int i;	uint8_t *mem = memregion("maincpu")->base();	int memsize = memregion("maincpu")->bytes();	/* Unscrambling data lines */	for ( i = 0; i < memsize; i++ )	{		mem[i] = BITSWAP8(mem[i], 3, 1, 0, 5, 6, 4, 7, 2);	}	/* Unscrambling address lines */	std::vector<uint8_t> buf(memsize);	memcpy(&buf[0], mem, memsize);	for ( i = 0; i < memsize; i++ )	{		mem[BITSWAP16(i, 15, 14, 5, 6, 3, 0, 12, 1, 9, 13, 4, 7, 10, 8, 2, 11)] = buf[i];	}}
开发者ID:goofwear,项目名称:mame,代码行数:59,


示例10: decrypt_snd

static void decrypt_snd(running_machine *machine){	int i;	UINT8 *ROM = memory_region(machine, "t5182");	for(i=0x8000;i<0x10000;i++)		ROM[i] = BITSWAP8(ROM[i], 7,1,2,3,4,5,6,0);}
开发者ID:Paulodx,项目名称:sdl-mame-wii,代码行数:8,


示例11: decrypt_snd

static void decrypt_snd(running_machine &machine){	int i;	UINT8 *ROM = machine.region("t5182")->base();	for(i=0x8000;i<0x10000;i++)		ROM[i] = BITSWAP8(ROM[i], 7,1,2,3,4,5,6,0);}
开发者ID:vikke,项目名称:mame_0145,代码行数:8,


示例12: BITSWAP8

void fidel68k_state::eag_prepare_display(){	// Excel 68000: 4*7seg leds, 8*8 chessboard leds	// EAG: 8*7seg leds(2 panels), (8+1)*8 chessboard leds	uint8_t seg_data = BITSWAP8(m_7seg_data,0,1,3,2,7,5,6,4);	set_display_segmask(0x1ff, 0x7f);	display_matrix(16, 9, m_led_data << 8 | seg_data, m_inp_mux);}
开发者ID:crazii,项目名称:mameui,代码行数:8,


示例13: DRIVER_INIT

ROM_ENDstatic DRIVER_INIT(mv4in1){	int i;	for(i=0;i<0x10000;i++)		memory_region(REGION_CPU1)[i]=BITSWAP8(memory_region(REGION_CPU1)[i],7,6,5,4,3,1,2,0);}
开发者ID:broftkd,项目名称:historic-mame,代码行数:8,


示例14: memregion

void darkmist_state::decrypt_snd(){	int i;	UINT8 *ROM = memregion("t5182_z80")->base();	for(i=0x0000;i<0x2000;i++)		ROM[i] = BITSWAP8(ROM[i], 7,1,2,3,4,5,6,0);}
开发者ID:MisterTea,项目名称:MAMEHub,代码行数:8,


示例15: DRIVER_INIT_MEMBER

// this should be correct, the areas of the ROM that differ to the original// after this decode look like intentional changesDRIVER_INIT_MEMBER(md_boot_state,mk3mdb){	UINT8 *rom = machine().root_device().memregion("maincpu")->base();	for (int x = 0x000001; x < 0x100001; x += 2)	{		if (x & 0x80000)		{			rom[x] = rom[x] ^ 0xff;			rom[x] = BITSWAP8(rom[x], 0,3,2,5,4,6,7,1);		}		else		{			rom[x] = rom[x] ^ 0xff;			rom[x] = BITSWAP8(rom[x], 4,0,7,1,3,6,2,5);		}	}	for (int x = 0x100001; x < 0x400000; x += 2)	{		if (x & 0x80000)		{			rom[x] = rom[x] ^ 0xff;			rom[x] = BITSWAP8(rom[x], 2,7,5,4,1,0,3,6);		}		else		{			rom[x] = BITSWAP8(rom[x], 6,1,4,2,7,0,3,5);		}	}	// boot vectors don't seem to be valid, so they are patched...	rom[0x01] = 0x01;	rom[0x00] = 0x00;	rom[0x03] = 0x00;	rom[0x02] = 0x00;	rom[0x05] = 0x00;	rom[0x04] = 0x00;	rom[0x07] = 0x02;	rom[0x06] = 0x10;	machine().device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x770070, 0x770075, FUNC(mk3mdb_dsw_r) );	megadrive_6buttons_pad = 1;	DRIVER_INIT_CALL(megadriv);}
开发者ID:broftkd,项目名称:mess-svn,代码行数:48,


示例16: DRIVER_INIT

ROM_ENDstatic DRIVER_INIT(mv4in1){	int i;	UINT8 *rom = machine.root_device().memregion("maincpu")->base();	for(i=0;i<0x10000;i++)		rom[i]=BITSWAP8(rom[i],7,6,5,4,3,1,2,0);}
开发者ID:j4y4r,项目名称:j4ymame,代码行数:9,


示例17: READ8_MEMBER

ADDRESS_MAP_END/*********************************************************************/READ8_MEMBER(cabal_state::cabalbl_snd2_r){	return BITSWAP8(m_sound_command2, 7,2,4,5,3,6,1,0);}
开发者ID:bradhugh,项目名称:mame,代码行数:9,


示例18: DRIVER_INIT

static DRIVER_INIT( shtridra ){	int A;	UINT8 *rom = memory_region(REGION_CPU1);	/* D3/D4  and  D5/D6 swapped */	for (A = 0; A < 0x2000; A++)		rom[A] = BITSWAP8(rom[A],7,5,6,3,4,2,1,0);}
开发者ID:broftkd,项目名称:historic-mame,代码行数:9,


示例19: DRIVER_INIT_MEMBER

DRIVER_INIT_MEMBER(travrusa_state,shtridra){	int A;	UINT8 *rom = memregion("maincpu")->base();	/* D3/D4  and  D5/D6 swapped */	for (A = 0; A < 0x2000; A++)		rom[A] = BITSWAP8(rom[A],7,5,6,3,4,2,1,0);}
开发者ID:CJBass,项目名称:mame2013-libretro,代码行数:9,


示例20: DRIVER_INIT_MEMBER

ROM_ENDDRIVER_INIT_MEMBER(ltcasino_state,mv4in1){	int i;	UINT8 *rom = memregion("maincpu")->base();	for(i=0;i<0x10000;i++)		rom[i]=BITSWAP8(rom[i],7,6,5,4,3,1,2,0);}
开发者ID:bradhugh,项目名称:mame,代码行数:9,


示例21: DRIVER_INIT

static DRIVER_INIT( shtridra ){	int A;	UINT8 *rom = machine.region("maincpu")->base();	/* D3/D4  and  D5/D6 swapped */	for (A = 0; A < 0x2000; A++)		rom[A] = BITSWAP8(rom[A],7,5,6,3,4,2,1,0);}
开发者ID:LibXenonProject,项目名称:mame-lx,代码行数:9,


示例22: victor21_bitswaps

void victor21_bitswaps(UINT8 *decrypt, int i){	if ((i&7) == 0) decrypt[i] = BITSWAP8(decrypt[i], 7,2,1,0,3,6,5,4 );	if ((i&7) == 1) decrypt[i] = BITSWAP8(decrypt[i], 3,6,1,4,7,2,5,0 );	if ((i&7) == 2) decrypt[i] = BITSWAP8(decrypt[i], 3,2,1,4,7,6,5,0 );	if ((i&7) == 3) decrypt[i] = BITSWAP8(decrypt[i], 7,2,5,4,3,6,1,0 );	if ((i&7) == 4) decrypt[i] = BITSWAP8(decrypt[i], 7,2,5,4,3,6,1,0 );	if ((i&7) == 5) decrypt[i] = BITSWAP8(decrypt[i], 3,6,5,0,7,2,1,4 );	if ((i&7) == 6) decrypt[i] = BITSWAP8(decrypt[i], 7,6,5,4,3,2,1,0 );	if ((i&7) == 7) decrypt[i] = BITSWAP8(decrypt[i], 3,2,1,4,7,6,5,0 );}
开发者ID:Archlogic,项目名称:libretro-mame,代码行数:11,


示例23: BITSWAP8

uint8_t deco_cpu7_device::mi_decrypt::read_sync(uint16_t adr){	uint8_t res = direct->read_byte(adr);	if(had_written) {		had_written = false;		if((adr & 0x0104) == 0x0104)			res = BITSWAP8(res, 6,5,3,4,2,7,1,0);	}	return res;}
开发者ID:qwijibo,项目名称:mame,代码行数:10,


示例24: BITSWAP8

void nmk16_state::nmk16_draw_sprites_swap_flipsupported(bitmap_ind16 &bitmap, const rectangle &cliprect, int *bittbl){	int i;	for ( i = 0; i < 0x100; i++ )	{		int spr = BITSWAP8(i, bittbl[0], bittbl[1], bittbl[2], bittbl[3], bittbl[4], bittbl[5], bittbl[6], bittbl[7]);		nmk16_draw_sprite_flipsupported(bitmap, cliprect, m_spriteram_old2.get() + (spr * 16/2));	}}
开发者ID:bradhugh,项目名称:mame,代码行数:10,


示例25: machine

void seibu_adpcm_device::decrypt(const char *region){	UINT8 *ROM = machine().root_device().memregion(region)->base();	int len = machine().root_device().memregion(region)->bytes();	for (int i = 0; i < len; i++)	{		ROM[i] = BITSWAP8(ROM[i], 7, 5, 3, 1, 6, 4, 2, 0);	}}
开发者ID:curtiszimmerman,项目名称:mame,代码行数:10,


示例26: BITSWAP8

UINT8 deco_cpu7_device::mi_decrypt::read_decrypted(UINT16 adr){	UINT8 res = direct->read_raw_byte(adr);	if(had_written) {		had_written = false;		if((adr & 0x0104) == 0x0104)			res = BITSWAP8(res, 6,5,3,4,2,7,1,0);	}	return res;}
开发者ID:CJBass,项目名称:mame2013-libretro,代码行数:10,



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


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