diff options
author | 2015-12-05 10:00:21 +0100 | |
---|---|---|
committer | 2015-12-05 10:00:21 +0100 | |
commit | be704c00abe1eaaa442db81db04c8b71595d5c41 (patch) | |
tree | 93fa0c29d7a997004d0565e49be42dd1c956dffc /src/devices/bus/neogeo | |
parent | a8684b4b03e77e25153d38bb245554253db10fce (diff) |
use c++ cast instead of c casts (nw)
Diffstat (limited to 'src/devices/bus/neogeo')
-rw-r--r-- | src/devices/bus/neogeo/bootleg_prot.cpp | 32 | ||||
-rw-r--r-- | src/devices/bus/neogeo/kof98_prot.cpp | 2 | ||||
-rw-r--r-- | src/devices/bus/neogeo/kog_prot.cpp | 2 | ||||
-rw-r--r-- | src/devices/bus/neogeo/neogeo_slot.cpp | 4 | ||||
-rw-r--r-- | src/devices/bus/neogeo/pcm2_prot.cpp | 2 | ||||
-rw-r--r-- | src/devices/bus/neogeo/sbp_prot.cpp | 4 | ||||
-rw-r--r-- | src/devices/bus/neogeo/sma_prot.cpp | 26 |
7 files changed, 36 insertions, 36 deletions
diff --git a/src/devices/bus/neogeo/bootleg_prot.cpp b/src/devices/bus/neogeo/bootleg_prot.cpp index a577528e271..3b0a868eb4f 100644 --- a/src/devices/bus/neogeo/bootleg_prot.cpp +++ b/src/devices/bus/neogeo/bootleg_prot.cpp @@ -100,7 +100,7 @@ void ngbootleg_prot_device::kof97oro_px_decode(UINT8* cpurom, UINT32 cpurom_size { int i; std::vector<UINT16> tmp( 0x500000 ); - UINT16 *src = (UINT16*)cpurom; + UINT16 *src = reinterpret_cast<UINT16*>(cpurom); for (i = 0; i < 0x500000/2; i++) { tmp[i] = src[i ^ 0x7ffef]; @@ -190,12 +190,12 @@ void ngbootleg_prot_device::decrypt_kof10th(UINT8* cpurom, UINT32 cpurom_size) } // Altera protection chip patches these over P ROM - ((UINT16*)src)[0x0124/2] = 0x000d; // Enables XOR for RAM moves, forces SoftDIPs, and USA region - ((UINT16*)src)[0x0126/2] = 0xf7a8; + reinterpret_cast<UINT16*>(src)[0x0124/2] = 0x000d; // Enables XOR for RAM moves, forces SoftDIPs, and USA region + reinterpret_cast<UINT16*>(src)[0x0126/2] = 0xf7a8; - ((UINT16*)src)[0x8bf4/2] = 0x4ef9; // Run code to change "S" data - ((UINT16*)src)[0x8bf6/2] = 0x000d; - ((UINT16*)src)[0x8bf8/2] = 0xf980; + reinterpret_cast<UINT16*>(src)[0x8bf4/2] = 0x4ef9; // Run code to change "S" data + reinterpret_cast<UINT16*>(src)[0x8bf6/2] = 0x000d; + reinterpret_cast<UINT16*>(src)[0x8bf8/2] = 0xf980; } @@ -205,7 +205,7 @@ void ngbootleg_prot_device::decrypt_kof10th(UINT8* cpurom, UINT32 cpurom_size) void ngbootleg_prot_device::kf10thep_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) { - UINT16 *rom = (UINT16*)cpurom; + UINT16 *rom = reinterpret_cast<UINT16*>(cpurom); std::vector<UINT16> buf(0x100000/2); memcpy(&buf[0x000000/2], &rom[0x060000/2], 0x20000); @@ -454,7 +454,7 @@ void ngbootleg_prot_device::patch_cthd2003(cpu_device* maincpu, neogeo_banked_ca { /* patches thanks to razoola */ int i; - UINT16 *mem16 = (UINT16 *)cpurom; + UINT16 *mem16 = reinterpret_cast<UINT16 *>(cpurom); /* special ROM banking handler */ maincpu->space(AS_PROGRAM).install_write_handler(0x2ffff0, 0x2fffff, write16_delegate(FUNC(ngbootleg_prot_device::cthd2003_bankswitch_w),this)); @@ -561,7 +561,7 @@ void ngbootleg_prot_device::patch_ct2k3sa(UINT8* cpurom, UINT32 cpurom_size) { /* patches thanks to razoola - same as for cthd2003*/ int i; - UINT16 *mem16 = (UINT16 *)cpurom; + UINT16 *mem16 = reinterpret_cast<UINT16 *>(cpurom); // theres still a problem on the character select screen but it seems to be related to cpu core timing issues, // overclocking the 68k prevents it. @@ -631,7 +631,7 @@ void ngbootleg_prot_device::lans2004_decrypt_68k(UINT8* cpurom, UINT32 cpurom_si /* Descrambling P ROMs - Thanks to Razoola for the info */ int i; UINT8 *src = cpurom; - UINT16 *rom = (UINT16*)cpurom; + UINT16 *rom = reinterpret_cast<UINT16*>(cpurom); { static const int sec[] = { 0x3, 0x8, 0x7, 0xC, 0x1, 0xA, 0x6, 0xD }; @@ -788,7 +788,7 @@ void ngbootleg_prot_device::svcplus_px_decrypt(UINT8* cpurom, UINT32 cpurom_size void ngbootleg_prot_device::svcplus_px_hack(UINT8* cpurom, UINT32 cpurom_size) { /* patched by the protection chip? */ - UINT16 *mem16 = (UINT16 *)cpurom; + UINT16 *mem16 = reinterpret_cast<UINT16 *>(cpurom); mem16[0x0f8016/2] = 0x33c1; } @@ -839,7 +839,7 @@ void ngbootleg_prot_device::svcsplus_px_decrypt(UINT8* cpurom, UINT32 cpurom_siz void ngbootleg_prot_device::svcsplus_px_hack(UINT8* cpurom, UINT32 cpurom_size) { /* patched by the protection chip? */ - UINT16 *mem16 = (UINT16 *)cpurom; + UINT16 *mem16 = reinterpret_cast<UINT16 *>(cpurom); mem16[0x9e90/2] = 0x000f; mem16[0x9e92/2] = 0xc9c0; mem16[0xa10c/2] = 0x4eb9; @@ -865,7 +865,7 @@ WRITE16_MEMBER( ngbootleg_prot_device::kof2003_w ) { data = COMBINE_DATA(&m_cartridge_ram[offset]); if (offset == 0x1ff0/2 || offset == 0x1ff2/2) { - UINT8* cr = (UINT8 *)m_cartridge_ram; + UINT8* cr = reinterpret_cast<UINT8 *>(m_cartridge_ram); UINT32 address = (cr[BYTE_XOR_LE(0x1ff3)]<<16)|(cr[BYTE_XOR_LE(0x1ff2)]<<8)|cr[BYTE_XOR_LE(0x1ff1)]; UINT8 prt = cr[BYTE_XOR_LE(0x1ff2)]; @@ -882,7 +882,7 @@ WRITE16_MEMBER( ngbootleg_prot_device::kof2003p_w ) { data = COMBINE_DATA(&m_cartridge_ram[offset]); if (offset == 0x1ff0/2 || offset == 0x1ff2/2) { - UINT8* cr = (UINT8 *)m_cartridge_ram; + UINT8* cr = reinterpret_cast<UINT8 *>(m_cartridge_ram); UINT32 address = (cr[BYTE_XOR_LE(0x1ff3)]<<16)|(cr[BYTE_XOR_LE(0x1ff2)]<<8)|cr[BYTE_XOR_LE(0x1ff0)]; UINT8 prt = cr[BYTE_XOR_LE(0x1ff2)]; @@ -929,7 +929,7 @@ void ngbootleg_prot_device::kf2k3bl_install_protection(cpu_device* maincpu, neog void ngbootleg_prot_device::kf2k3pl_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) { std::vector<UINT16> tmp(0x100000/2); - UINT16*rom16 = (UINT16*)cpurom; + UINT16*rom16 = reinterpret_cast<UINT16*>(cpurom); int j; int i; @@ -977,7 +977,7 @@ void ngbootleg_prot_device::kf2k3upl_px_decrypt(UINT8* cpurom, UINT32 cpurom_siz } } - UINT16*rom16 = (UINT16*)cpurom; + UINT16*rom16 = reinterpret_cast<UINT16*>(cpurom); kof2k3_overlay = rom16[0x58196 / 2]; diff --git a/src/devices/bus/neogeo/kof98_prot.cpp b/src/devices/bus/neogeo/kof98_prot.cpp index 6fdfa5001f3..f3c93178588 100644 --- a/src/devices/bus/neogeo/kof98_prot.cpp +++ b/src/devices/bus/neogeo/kof98_prot.cpp @@ -70,7 +70,7 @@ void kof98_prot_device::kof98_decrypt_68k(UINT8* cpurom, UINT32 cpurom_size) } memmove( &src[0x100000], &src[0x200000], 0x400000 ); - UINT16* mem16 = (UINT16*)cpurom; + UINT16* mem16 = reinterpret_cast<UINT16*>(cpurom); m_default_rom[0] = mem16[0x100 / 2]; m_default_rom[1] = mem16[0x102 / 2]; diff --git a/src/devices/bus/neogeo/kog_prot.cpp b/src/devices/bus/neogeo/kog_prot.cpp index d3caaff3e15..6b7ea2945a8 100644 --- a/src/devices/bus/neogeo/kog_prot.cpp +++ b/src/devices/bus/neogeo/kog_prot.cpp @@ -46,7 +46,7 @@ void kog_prot_device::kog_px_decrypt(UINT8* cpurom, UINT32 cpurom_size) /* the protection chip does some *very* strange things to the rom */ UINT8 *src = cpurom; dynamic_buffer dst( 0x600000 ); - UINT16 *rom = (UINT16 *)cpurom; + UINT16 *rom = reinterpret_cast<UINT16 *>(cpurom); int i; static const int sec[] = { 0x3, 0x8, 0x7, 0xC, 0x1, 0xA, 0x6, 0xD }; diff --git a/src/devices/bus/neogeo/neogeo_slot.cpp b/src/devices/bus/neogeo/neogeo_slot.cpp index 100e53e6e18..6e9a8ddb63b 100644 --- a/src/devices/bus/neogeo/neogeo_slot.cpp +++ b/src/devices/bus/neogeo/neogeo_slot.cpp @@ -125,7 +125,7 @@ bool neogeo_cart_slot_device::call_load() } m_cart->decrypt_all( - (UINT8*)m_cart->get_rom_base(), m_cart->get_rom_size(), + reinterpret_cast<UINT8*>(m_cart->get_rom_base()), m_cart->get_rom_size(), m_cart->get_sprites_base(), m_cart->get_sprites_size(), m_cart->get_fixed_base(), m_cart->get_fixed_size(), m_cart->get_ym_base(), m_cart->get_ym_size(), @@ -151,7 +151,7 @@ void neogeo_cart_slot_device::setup_memory_banks(running_machine &machine) UINT32 size = get_rom_size(); machine.memory().region_free(":maincpu"); machine.memory().region_alloc(":maincpu",size,2, ENDIANNESS_BIG); - memcpy(memregion(":maincpu")->base(),(UINT8*)base16,size); + memcpy(memregion(":maincpu")->base(),reinterpret_cast<UINT8*>(base16),size); UINT8* base = get_audio_base(); size = get_audio_size(); diff --git a/src/devices/bus/neogeo/pcm2_prot.cpp b/src/devices/bus/neogeo/pcm2_prot.cpp index 64159ff4185..730dfe39a50 100644 --- a/src/devices/bus/neogeo/pcm2_prot.cpp +++ b/src/devices/bus/neogeo/pcm2_prot.cpp @@ -34,7 +34,7 @@ NeoGeo 'V' (PCM) ROM encryption /* Neo-Pcm2 Drivers for Encrypted V Roms */ void pcm2_prot_device::neo_pcm2_snk_1999(UINT8* ymrom, UINT32 ymsize, int value) { /* thanks to Elsemi for the NEO-PCM2 info */ - UINT16 *rom = (UINT16 *)ymrom; + UINT16 *rom = reinterpret_cast<UINT16 *>(ymrom); int size = ymsize; int i, j; diff --git a/src/devices/bus/neogeo/sbp_prot.cpp b/src/devices/bus/neogeo/sbp_prot.cpp index b913eba75d9..d890f4d2be1 100644 --- a/src/devices/bus/neogeo/sbp_prot.cpp +++ b/src/devices/bus/neogeo/sbp_prot.cpp @@ -29,7 +29,7 @@ void sbp_prot_device::device_reset() READ16_MEMBER( sbp_prot_device::sbp_lowerrom_r ) { - UINT16* rom = (UINT16*)m_mainrom; + UINT16* rom = reinterpret_cast<UINT16*>(m_mainrom); UINT16 origdata = rom[(offset+(0x200/2))]; UINT16 data = BITSWAP16(origdata, 11,10,9,8,15,14,13,12,3,2,1,0,7,6,5,4); int realoffset = 0x200+(offset*2); @@ -78,7 +78,7 @@ void sbp_prot_device::sbp_install_protection(cpu_device* maincpu, UINT8* cpurom, /* the game code clears the text overlay used ingame immediately after writing it.. why? protection? sloppy code that the hw ignores? imperfect emulation? */ { - UINT16* rom = (UINT16*)cpurom; + UINT16* rom = reinterpret_cast<UINT16*>(cpurom); rom[0x2a6f8 / 2] = 0x4e71; rom[0x2a6fa / 2] = 0x4e71; diff --git a/src/devices/bus/neogeo/sma_prot.cpp b/src/devices/bus/neogeo/sma_prot.cpp index 1c91212c416..6d338dfa876 100644 --- a/src/devices/bus/neogeo/sma_prot.cpp +++ b/src/devices/bus/neogeo/sma_prot.cpp @@ -302,7 +302,7 @@ void sma_prot_device::kof99_decrypt_68k(UINT8* base) UINT16 *rom; int i,j; - rom = (UINT16 *)(base + 0x100000); + rom = reinterpret_cast<UINT16 *>(base + 0x100000); /* swap data lines on the whole ROMs */ for (i = 0;i < 0x800000/2;i++) { @@ -321,7 +321,7 @@ void sma_prot_device::kof99_decrypt_68k(UINT8* base) } /* swap address lines & relocate fixed part */ - rom = (UINT16 *)base; + rom = reinterpret_cast<UINT16 *>(base); for (i = 0;i < 0x0c0000/2;i++) { rom[i] = rom[0x700000/2 + BITSWAP24(i,23,22,21,20,19,18,11,6,14,17,16,5,8,10,12,0,4,3,2,7,9,15,13,1)]; @@ -335,7 +335,7 @@ void sma_prot_device::garou_decrypt_68k(UINT8* base) int i,j; /* thanks to Razoola and Mr K for the info */ - rom = (UINT16 *)(base + 0x100000); + rom = reinterpret_cast<UINT16 *>(base + 0x100000); /* swap data lines on the whole ROMs */ for (i = 0;i < 0x800000/2;i++) { @@ -343,14 +343,14 @@ void sma_prot_device::garou_decrypt_68k(UINT8* base) } /* swap address lines & relocate fixed part */ - rom = (UINT16 *)base; + rom = reinterpret_cast<UINT16 *>(base); for (i = 0;i < 0x0c0000/2;i++) { rom[i] = rom[0x710000/2 + BITSWAP24(i,23,22,21,20,19,18,4,5,16,14,7,9,6,13,17,15,3,1,2,12,11,8,10,0)]; } /* swap address lines for the banked part */ - rom = (UINT16 *)(base + 0x100000); + rom = reinterpret_cast<UINT16 *>(base + 0x100000); for (i = 0;i < 0x800000/2;i+=0x8000/2) { UINT16 buffer[0x8000/2]; @@ -369,7 +369,7 @@ void sma_prot_device::garouh_decrypt_68k(UINT8* base) int i,j; /* thanks to Razoola and Mr K for the info */ - rom = (UINT16 *)(base + 0x100000); + rom = reinterpret_cast<UINT16 *>(base + 0x100000); /* swap data lines on the whole ROMs */ for (i = 0;i < 0x800000/2;i++) { @@ -377,14 +377,14 @@ void sma_prot_device::garouh_decrypt_68k(UINT8* base) } /* swap address lines & relocate fixed part */ - rom = (UINT16 *)base; + rom = reinterpret_cast<UINT16 *>(base); for (i = 0;i < 0x0c0000/2;i++) { rom[i] = rom[0x7f8000/2 + BITSWAP24(i,23,22,21,20,19,18,5,16,11,2,6,7,17,3,12,8,14,4,0,9,1,10,15,13)]; } /* swap address lines for the banked part */ - rom = (UINT16 *)(base + 0x100000); + rom = reinterpret_cast<UINT16 *>(base + 0x100000); for (i = 0;i < 0x800000/2;i+=0x8000/2) { UINT16 buffer[0x8000/2]; @@ -403,7 +403,7 @@ void sma_prot_device::mslug3_decrypt_68k(UINT8* base) int i,j; /* thanks to Razoola and Mr K for the info */ - rom = (UINT16 *)(base + 0x100000); + rom = reinterpret_cast<UINT16 *>(base + 0x100000); /* swap data lines on the whole ROMs */ for (i = 0;i < 0x800000/2;i++) { @@ -411,14 +411,14 @@ void sma_prot_device::mslug3_decrypt_68k(UINT8* base) } /* swap address lines & relocate fixed part */ - rom = (UINT16 *)base; + rom = reinterpret_cast<UINT16 *>(base); for (i = 0;i < 0x0c0000/2;i++) { rom[i] = rom[0x5d0000/2 + BITSWAP24(i,23,22,21,20,19,18,15,2,1,13,3,0,9,6,16,4,11,5,7,12,17,14,10,8)]; } /* swap address lines for the banked part */ - rom = (UINT16 *)(base + 0x100000); + rom = reinterpret_cast<UINT16 *>(base + 0x100000); for (i = 0;i < 0x800000/2;i+=0x10000/2) { UINT16 buffer[0x10000/2]; @@ -437,7 +437,7 @@ void sma_prot_device::kof2000_decrypt_68k(UINT8* base) int i,j; /* thanks to Razoola and Mr K for the info */ - rom = (UINT16 *)(base + 0x100000); + rom = reinterpret_cast<UINT16 *>(base + 0x100000); /* swap data lines on the whole ROMs */ for (i = 0;i < 0x800000/2;i++) { @@ -456,7 +456,7 @@ void sma_prot_device::kof2000_decrypt_68k(UINT8* base) } /* swap address lines & relocate fixed part */ - rom = (UINT16 *)base; + rom = reinterpret_cast<UINT16 *>(base); for (i = 0;i < 0x0c0000/2;i++) { rom[i] = rom[0x73a000/2 + BITSWAP24(i,23,22,21,20,19,18,8,4,15,13,3,14,16,2,6,17,7,12,10,0,5,11,1,9)]; |