diff options
Diffstat (limited to 'src/mame/machine/r2crypt.cpp')
-rw-r--r-- | src/mame/machine/r2crypt.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/mame/machine/r2crypt.cpp b/src/mame/machine/r2crypt.cpp index 46f2cf5eac0..3101c690f8c 100644 --- a/src/mame/machine/r2crypt.cpp +++ b/src/mame/machine/r2crypt.cpp @@ -43,7 +43,7 @@ the suggested one for zero team), but, of course, it should be taken just as what it is: a guess. */ -static const UINT8 rotate_r2[512] = { +static const uint8_t rotate_r2[512] = { 0x11, 0x17, 0x0d, 0x03, 0x17, 0x1f, 0x08, 0x1a, 0x0f, 0x04, 0x1e, 0x13, 0x19, 0x0e, 0x0e, 0x05, 0x06, 0x07, 0x08, 0x08, 0x0d, 0x18, 0x11, 0x1a, 0x0b, 0x06, 0x12, 0x0c, 0x1f, 0x0b, 0x1c, 0x19, 0x00, 0x1b, 0x0c, 0x09, 0x1d, 0x18, 0x1a, 0x16, 0x1a, 0x08, 0x03, 0x04, 0x0f, 0x1d, 0x16, 0x07, @@ -79,7 +79,7 @@ static const UINT8 rotate_r2[512] = { 0x08, 0x19, 0x18, 0x15, 0x1f, 0x05, 0x00, 0x09, 0x0e, 0x05, 0x16, 0x1b, 0x01, 0x08, 0x08, 0x1f, }; -static const UINT8 x5_r2[256] = { +static const uint8_t x5_r2[256] = { 0x08, 0x09, 0x1f, 0x0f, 0x09, 0x09, 0x0b, 0x1d, 0x06, 0x13, 0x02, 0x15, 0x02, 0x0c, 0x0d, 0x19, 0x03, 0x13, 0x0c, 0x1f, 0x1a, 0x18, 0x17, 0x10, 0x0a, 0x19, 0x15, 0x04, 0x1f, 0x11, 0x1c, 0x02, 0x0e, 0x08, 0x06, 0x0a, 0x07, 0x1c, 0x10, 0x04, 0x11, 0x0c, 0x0a, 0x19, 0x0a, 0x04, 0x17, 0x07, @@ -98,7 +98,7 @@ static const UINT8 x5_r2[256] = { 0x05, 0x15, 0x11, 0x0a, 0x1c, 0x00, 0x1e, 0x1f, 0x17, 0x12, 0x0a, 0x1c, 0x07, 0x04, 0x1f, 0x1a, }; -static const UINT16 x11_r2[256] = { +static const uint16_t x11_r2[256] = { 0x347, 0x0f2, 0x182, 0x58f, 0x1f4, 0x42c, 0x407, 0x5f0, 0x6df, 0x2db, 0x585, 0x5fe, 0x394, 0x542, 0x3e8, 0x574, 0x4ea, 0x6d3, 0x6b7, 0x65b, 0x324, 0x143, 0x22a, 0x11d, 0x124, 0x365, 0x7ca, 0x3d6, 0x1d2, 0x7cd, 0x6b1, 0x4f1, 0x1de, 0x674, 0x685, 0x779, 0x264, 0x6d8, 0x379, 0x7ce, 0x201, 0x73b, 0x5c9, 0x025, 0x338, 0x4b2, 0x697, 0x567, @@ -117,7 +117,7 @@ static const UINT16 x11_r2[256] = { 0x1c1, 0x7de, 0x106, 0x275, 0x1e1, 0x503, 0x30a, 0x271, 0x4f8, 0x52b, 0x266, 0x375, 0x024, 0x399, 0x672, 0x6f8, }; -static const UINT8 rotate_zt[256] = { +static const uint8_t rotate_zt[256] = { 0x0a, 0x0a, 0x0b, 0x0e, 0x02, 0x12, 0x0d, 0x16, 0x01, 0x1b, 0x08, 0x15, 0x03, 0x14, 0x0f, 0x1f, 0x10, 0x1d, 0x03, 0x0b, 0x16, 0x07, 0x10, 0x19, 0x1f, 0x1c, 0x03, 0x0b, 0x15, 0x0d, 0x00, 0x14, 0x15, 0x0d, 0x0c, 0x1b, 0x18, 0x18, 0x0b, 0x1b, 0x16, 0x17, 0x01, 0x0e, 0x14, 0x0c, 0x1e, 0x13, @@ -136,7 +136,7 @@ static const UINT8 rotate_zt[256] = { 0x14, 0x0a, 0x0c, 0x16, 0x02, 0x0a, 0x0f, 0x0d, 0x0c, 0x1d, 0x1e, 0x13, 0x0a, 0x08, 0x12, 0x0b, }; -static const UINT8 x5_zt[256] = { +static const uint8_t x5_zt[256] = { 0x0d, 0x14, 0x13, 0x1b, 0x1a, 0x05, 0x1a, 0x05, 0x1b, 0x17, 0x0d, 0x0f, 0x00, 0x17, 0x09, 0x04, 0x13, 0x0f, 0x14, 0x17, 0x14, 0x0f, 0x1b, 0x0a, 0x0a, 0x15, 0x07, 0x0b, 0x0e, 0x05, 0x18, 0x12, 0x1c, 0x01, 0x17, 0x02, 0x04, 0x00, 0x06, 0x12, 0x00, 0x0a, 0x1c, 0x19, 0x10, 0x1b, 0x16, 0x03, @@ -155,7 +155,7 @@ static const UINT8 x5_zt[256] = { 0x05, 0x16, 0x11, 0x06, 0x12, 0x0c, 0x0c, 0x0f, 0x1c, 0x18, 0x08, 0x1e, 0x1c, 0x16, 0x15, 0x03, }; -static const UINT16 x11_zt[512] = { +static const uint16_t x11_zt[512] = { 0x7e9, 0x625, 0x625, 0x006, 0x006, 0x14a, 0x14a, 0x7e9, 0x657, 0x417, 0x417, 0x1a7, 0x1a7, 0x22f, 0x22f, 0x657, 0x37e, 0x447, 0x447, 0x117, 0x117, 0x735, 0x735, 0x37e, 0x3be, 0x487, 0x487, 0x724, 0x724, 0x6e3, 0x6e3, 0x3be, 0x646, 0x035, 0x035, 0x57e, 0x57e, 0x134, 0x134, 0x646, 0x09a, 0x4d1, 0x4d1, 0x511, 0x511, 0x5d5, 0x5d5, 0x09a, @@ -191,14 +191,14 @@ static const UINT16 x11_zt[512] = { }; -static UINT32 yrot(UINT32 v, int r) +static uint32_t yrot(uint32_t v, int r) { return (v << r) | (v >> (32-r)); } -static UINT16 gm(int i4) +static uint16_t gm(int i4) { - UINT16 x=0; + uint16_t x=0; for (int i=0; i<4; ++i) { @@ -209,20 +209,20 @@ static UINT16 gm(int i4) return x; } -static UINT32 core_decrypt(UINT32 ciphertext, int i1, int i2, int i3, int i4, - const UINT8 *rotate, const UINT8 *x5, const UINT16 *x11, UINT32 preXor, UINT32 carryMask, UINT32 postXor) +static uint32_t core_decrypt(uint32_t ciphertext, int i1, int i2, int i3, int i4, + const uint8_t *rotate, const uint8_t *x5, const uint16_t *x11, uint32_t preXor, uint32_t carryMask, uint32_t postXor) { - UINT32 v1 = BITSWAP32(yrot(ciphertext, rotate[i1]), 25,28,15,19, 6,0,3,24, 11,1,2,30, 16,7,22,17, 31,14,23,9, 27,18,4,10, 13,20,5,12, 8,29,26,21); + uint32_t v1 = BITSWAP32(yrot(ciphertext, rotate[i1]), 25,28,15,19, 6,0,3,24, 11,1,2,30, 16,7,22,17, 31,14,23,9, 27,18,4,10, 13,20,5,12, 8,29,26,21); - UINT16 x1Low = (x5[i2]<<11) ^ x11[i3] ^ gm(i4); - UINT32 x1 = x1Low | (BITSWAP16(x1Low, 0,8,1,9, 2,10,3,11, 4,12,5,13, 6,14,7,15)<<16); + uint16_t x1Low = (x5[i2]<<11) ^ x11[i3] ^ gm(i4); + uint32_t x1 = x1Low | (BITSWAP16(x1Low, 0,8,1,9, 2,10,3,11, 4,12,5,13, 6,14,7,15)<<16); return partial_carry_sum32(v1, x1^preXor, carryMask) ^ postXor; } void raiden2_decrypt_sprites(running_machine &machine) { - UINT32 *data = (UINT32 *)machine.root_device().memregion("gfx3")->base(); + uint32_t *data = (uint32_t *)machine.root_device().memregion("gfx3")->base(); for(int i=0; i<0x800000/4; i++) { data[i] = core_decrypt(data[i], @@ -242,7 +242,7 @@ void raiden2_decrypt_sprites(running_machine &machine) void zeroteam_decrypt_sprites(running_machine &machine) { - UINT32 *data = (UINT32 *)machine.root_device().memregion("gfx3")->base(); + uint32_t *data = (uint32_t *)machine.root_device().memregion("gfx3")->base(); for(int i=0; i<0x400000/4; i++) { data[i] = core_decrypt(data[i], |