diff options
Diffstat (limited to 'src/devices/bus/neogeo/prot_sma.cpp')
-rw-r--r-- | src/devices/bus/neogeo/prot_sma.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/devices/bus/neogeo/prot_sma.cpp b/src/devices/bus/neogeo/prot_sma.cpp index f18481d51be..9262178be4f 100644 --- a/src/devices/bus/neogeo/prot_sma.cpp +++ b/src/devices/bus/neogeo/prot_sma.cpp @@ -8,7 +8,7 @@ extern const device_type SMA_PROT = &device_creator<sma_prot_device>; -sma_prot_device::sma_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : +sma_prot_device::sma_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, SMA_PROT, "Neo Geo SMA Protection", tag, owner, clock, "sma_prot", __FILE__), m_sma_rng(0) {} @@ -201,7 +201,7 @@ WRITE16_MEMBER( sma_prot_device::kof2000_bankswitch_w ) } #endif -UINT32 sma_prot_device::kof99_bank_base(UINT16 sel) +uint32_t sma_prot_device::kof99_bank_base(uint16_t sel) { static const int bankoffset[64] = { @@ -229,7 +229,7 @@ UINT32 sma_prot_device::kof99_bank_base(UINT16 sel) return bankaddress; } -UINT32 sma_prot_device::garou_bank_base(UINT16 sel) +uint32_t sma_prot_device::garou_bank_base(uint16_t sel) { // thanks to Razoola and Mr K for the info static const int bankoffset[64] = @@ -263,7 +263,7 @@ UINT32 sma_prot_device::garou_bank_base(UINT16 sel) return bankaddress; } -UINT32 sma_prot_device::garouh_bank_base(UINT16 sel) +uint32_t sma_prot_device::garouh_bank_base(uint16_t sel) { // thanks to Razoola and Mr K for the info static const int bankoffset[64] = @@ -299,7 +299,7 @@ UINT32 sma_prot_device::garouh_bank_base(UINT16 sel) return bankaddress; } -UINT32 sma_prot_device::mslug3_bank_base(UINT16 sel) +uint32_t sma_prot_device::mslug3_bank_base(uint16_t sel) { // thanks to Razoola and Mr K for the info static const int bankoffset[64] = @@ -332,7 +332,7 @@ UINT32 sma_prot_device::mslug3_bank_base(UINT16 sel) return bankaddress; } -UINT32 sma_prot_device::kof2000_bank_base(UINT16 sel) +uint32_t sma_prot_device::kof2000_bank_base(uint16_t sel) { // thanks to Razoola and Mr K for the info static const int bankoffset[64] = @@ -374,8 +374,8 @@ READ16_MEMBER( sma_prot_device::prot_9a37_r ) READ16_MEMBER( sma_prot_device::random_r ) { - UINT16 old = m_sma_rng; - UINT16 newbit = ((m_sma_rng >> 2) ^ + uint16_t old = m_sma_rng; + uint16_t newbit = ((m_sma_rng >> 2) ^ (m_sma_rng >> 3) ^ (m_sma_rng >> 5) ^ (m_sma_rng >> 6) ^ @@ -391,9 +391,9 @@ READ16_MEMBER( sma_prot_device::random_r ) // kof99, garou, garouh, mslug3 and kof2000 have an SMA chip which contains program code and decrypts the 68k roms -void sma_prot_device::kof99_decrypt_68k(UINT8* base) +void sma_prot_device::kof99_decrypt_68k(uint8_t* base) { - UINT16 *rom = (UINT16 *)(base + 0x100000); + uint16_t *rom = (uint16_t *)(base + 0x100000); // swap data lines on the whole ROMs for (int i = 0; i < 0x800000/2; i++) @@ -402,38 +402,38 @@ void sma_prot_device::kof99_decrypt_68k(UINT8* base) // swap address lines for the banked part for (int i = 0; i < 0x600000/2; i += 0x800/2) { - UINT16 buffer[0x800/2]; + uint16_t buffer[0x800/2]; memcpy(buffer, &rom[i], 0x800); for (int j = 0; j < 0x800/2; j++) rom[i+j] = buffer[BITSWAP24(j,23,22,21,20,19,18,17,16,15,14,13,12,11,10,6,2,4,9,8,3,1,7,0,5)]; } // swap address lines & relocate fixed part - rom = (UINT16 *)base; + rom = (uint16_t *)base; for (int 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)]; } -void sma_prot_device::garou_decrypt_68k(UINT8* base) +void sma_prot_device::garou_decrypt_68k(uint8_t* base) { // thanks to Razoola and Mr K for the info - UINT16 *rom = (UINT16 *)(base + 0x100000); + uint16_t *rom = (uint16_t *)(base + 0x100000); // swap data lines on the whole ROMs for (int i = 0; i < 0x800000/2; i++) rom[i] = BITSWAP16(rom[i],13,12,14,10,8,2,3,1,5,9,11,4,15,0,6,7); // swap address lines & relocate fixed part - rom = (UINT16 *)base; + rom = (uint16_t *)base; for (int 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 = (uint16_t *)(base + 0x100000); for (int i = 0; i < 0x800000/2; i += 0x8000/2) { - UINT16 buffer[0x8000/2]; + uint16_t buffer[0x8000/2]; memcpy(buffer, &rom[i], 0x8000); for (int j = 0; j < 0x8000/2; j++) rom[i+j] = buffer[BITSWAP24(j,23,22,21,20,19,18,17,16,15,14,9,4,8,3,13,6,2,7,0,12,1,11,10,5)]; @@ -441,25 +441,25 @@ void sma_prot_device::garou_decrypt_68k(UINT8* base) } -void sma_prot_device::garouh_decrypt_68k(UINT8* base) +void sma_prot_device::garouh_decrypt_68k(uint8_t* base) { // thanks to Razoola and Mr K for the info - UINT16 *rom = (UINT16 *)(base + 0x100000); + uint16_t *rom = (uint16_t *)(base + 0x100000); // swap data lines on the whole ROMs for (int i = 0; i < 0x800000/2; i++) rom[i] = BITSWAP16(rom[i],14,5,1,11,7,4,10,15,3,12,8,13,0,2,9,6); // swap address lines & relocate fixed part - rom = (UINT16 *)base; + rom = (uint16_t *)base; for (int 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 = (uint16_t *)(base + 0x100000); for (int i = 0; i < 0x800000/2; i += 0x8000/2) { - UINT16 buffer[0x8000/2]; + uint16_t buffer[0x8000/2]; memcpy(buffer, &rom[i], 0x8000); for (int j = 0; j < 0x8000/2; j++) rom[i+j] = buffer[BITSWAP24(j,23,22,21,20,19,18,17,16,15,14,12,8,1,7,11,3,13,10,6,9,5,4,0,2)]; @@ -467,25 +467,25 @@ void sma_prot_device::garouh_decrypt_68k(UINT8* base) } -void sma_prot_device::mslug3_decrypt_68k(UINT8* base) +void sma_prot_device::mslug3_decrypt_68k(uint8_t* base) { // thanks to Razoola and Mr K for the info - UINT16 *rom = (UINT16 *)(base + 0x100000); + uint16_t *rom = (uint16_t *)(base + 0x100000); // swap data lines on the whole ROMs for (int i = 0; i < 0x800000/2; i++) rom[i] = BITSWAP16(rom[i],4,11,14,3,1,13,0,7,2,8,12,15,10,9,5,6); // swap address lines & relocate fixed part - rom = (UINT16 *)base; + rom = (uint16_t *)base; for (int 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 = (uint16_t *)(base + 0x100000); for (int i = 0; i < 0x800000/2; i += 0x10000/2) { - UINT16 buffer[0x10000/2]; + uint16_t buffer[0x10000/2]; memcpy(buffer, &rom[i], 0x10000); for (int j = 0; j < 0x10000/2; j++) rom[i+j] = buffer[BITSWAP24(j,23,22,21,20,19,18,17,16,15,2,11,0,14,6,4,13,8,9,3,10,7,5,12,1)]; @@ -493,10 +493,10 @@ void sma_prot_device::mslug3_decrypt_68k(UINT8* base) } -void sma_prot_device::kof2000_decrypt_68k(UINT8* base) +void sma_prot_device::kof2000_decrypt_68k(uint8_t* base) { // thanks to Razoola and Mr K for the info - UINT16 *rom = (UINT16 *)(base + 0x100000); + uint16_t *rom = (uint16_t *)(base + 0x100000); // swap data lines on the whole ROMs for (int i = 0; i < 0x800000/2; i++) @@ -505,14 +505,14 @@ void sma_prot_device::kof2000_decrypt_68k(UINT8* base) // swap address lines for the banked part for (int i = 0; i < 0x63a000/2; i += 0x800/2) { - UINT16 buffer[0x800/2]; + uint16_t buffer[0x800/2]; memcpy(buffer, &rom[i], 0x800); for (int j = 0; j < 0x800/2; j++) rom[i+j] = buffer[BITSWAP24(j,23,22,21,20,19,18,17,16,15,14,13,12,11,10,4,1,3,8,6,2,7,0,9,5)]; } // swap address lines & relocate fixed part - rom = (UINT16 *)base; + rom = (uint16_t *)base; for (int 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)]; } |