diff options
Diffstat (limited to 'src/mame/machine/igs036crypt.cpp')
-rw-r--r-- | src/mame/machine/igs036crypt.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mame/machine/igs036crypt.cpp b/src/mame/machine/igs036crypt.cpp index 7f837e9f755..3f1785ff467 100644 --- a/src/mame/machine/igs036crypt.cpp +++ b/src/mame/machine/igs036crypt.cpp @@ -60,7 +60,7 @@ TO-DO: complete the table with the 20-bytes values *****************************************************************************/ -igs036_decryptor::igs036_decryptor(const UINT16* game_key) +igs036_decryptor::igs036_decryptor(const uint16_t* game_key) : key(game_key) { } @@ -68,14 +68,14 @@ igs036_decryptor::igs036_decryptor(const UINT16* game_key) void igs036_decryptor::decrypter_rom(memory_region* region) { int size = region->bytes(); - UINT16* rom = (UINT16*)region->base(); + uint16_t* rom = (uint16_t*)region->base(); for (int i = 0; i < size / 2; i++) { rom[i] = decrypt(rom[i], i); } } -UINT16 igs036_decryptor::decrypt(UINT16 cipherword, int word_address)const +uint16_t igs036_decryptor::decrypt(uint16_t cipherword, int word_address)const { // key-independent manipulation int aux = deobfuscate(cipherword, word_address); @@ -93,7 +93,7 @@ UINT16 igs036_decryptor::decrypt(UINT16 cipherword, int word_address)const return aux^0x1a3a; } -UINT16 igs036_decryptor::deobfuscate(UINT16 cipherword, int word_address)const +uint16_t igs036_decryptor::deobfuscate(uint16_t cipherword, int word_address)const { // key-independent manipulation int shift = rotation(word_address); @@ -155,17 +155,17 @@ int igs036_decryptor::rot_group(int address, const int* group)const return (aux*2)-1; } -UINT16 igs036_decryptor::rol(UINT16 num, int shift)const +uint16_t igs036_decryptor::rol(uint16_t num, int shift)const { - UINT16 r = num<<shift; - UINT16 l = num>>(16-shift); + uint16_t r = num<<shift; + uint16_t l = num>>(16-shift); return r|l; } // the triggers describe under what conditions are every one of the 16 XORs activated -const UINT16 igs036_decryptor::triggers[16][2] = { +const uint16_t igs036_decryptor::triggers[16][2] = { {0x0001, 0x0000}, {0x0008, 0x0008}, {0x0002, 0x0000}, {0x0004, 0x0004}, {0x0100, 0x0000}, {0x0200, 0x0000}, {0x0400, 0x0000}, {0x0800, 0x0800}, {0x1001, 0x0001}, {0x2002, 0x2000}, {0x4004, 0x4000}, {0x8008, 0x0000}, // (the one at index #10 is a guess; his effect is not observed in any game) @@ -234,7 +234,7 @@ int (*igs036_decryptor::rot_direction[4][8])(int) = { // while simple, seems to be pretty robust, so few errors should be expected, // if any. The only exception is DDPDOJ (see below). -const UINT16 orleg2_key[0x100] = { +const uint16_t orleg2_key[0x100] = { 0x8100, 0x9202, 0x3000, 0x1200, 0x0100, 0x0800, 0x2100, 0xab05, 0x130a, 0xba0a, 0x0308, 0x9200, 0x8306, 0xab0f, 0x200c, 0x0301, 0x9010, 0x1b13, 0x1310, 0x1b11, 0x8104, 0x0212, 0x8204, 0x8214, @@ -269,7 +269,7 @@ const UINT16 orleg2_key[0x100] = { 0x121a, 0x80a0, 0x1238, 0x0000, 0x82ba, 0x0030, 0xc0c0, 0x4264, }; -const UINT16 m312cn_key[0x100] = { +const uint16_t m312cn_key[0x100] = { 0x1102, 0x1103, 0x1000, 0xb101, 0x2100, 0x2802, 0xa000, 0x0901, 0x000a, 0x8101, 0xa000, 0x2909, 0x000e, 0x2004, 0x210c, 0x2909, 0x8000, 0x0903, 0x0100, 0x8901, 0x0100, 0x8814, 0x8110, 0x0810, @@ -304,7 +304,7 @@ const UINT16 m312cn_key[0x100] = { 0xc0e2, 0xc0c0, 0x0028, 0x9191, 0x80b2, 0x0020, 0x4040, 0x80b0, }; -const UINT16 cjddzsp_key[0x100] = { +const uint16_t cjddzsp_key[0x100] = { 0x0142, 0x3903, 0xb0c0, 0x0040, 0x8006, 0xa145, 0x2004, 0x0141, 0x21c0, 0xa1c1, 0x0048, 0x8141, 0x8182, 0x884a, 0x2184, 0x0040, 0x8102, 0x98d2, 0x8180, 0x8941, 0x80d2, 0x0151, 0x01c0, 0x8901, @@ -339,7 +339,7 @@ const UINT16 cjddzsp_key[0x100] = { 0x4082, 0xd9d9, 0x5110, 0x4000, 0xc164, 0x41c7, 0xc050, 0xc9bd, }; -const UINT16 cjdh2_key[0x100] = { +const uint16_t cjdh2_key[0x100] = { 0x1180, 0x2983, 0x8080, 0x3981, 0x2182, 0x2181, 0x2100, 0x2901, 0x2182, 0x198b, 0xa008, 0x8181, 0x0106, 0xa000, 0x018c, 0x880c, 0x1110, 0x8101, 0x1190, 0x9890, 0x8090, 0x0812, 0x8014, 0x0111, @@ -374,7 +374,7 @@ const UINT16 cjdh2_key[0x100] = { 0x517a, 0x41e3, 0xd0d8, 0x49c9, 0xc1e6, 0x891d, 0x4044, 0x0125, }; -const UINT16 kov3_key[0x100] = { +const uint16_t kov3_key[0x100] = { 0x9100, 0x0202, 0x0200, 0xb101, 0x2306, 0x8004, 0x0104, 0x2b01, 0x8100, 0x3a0a, 0xa108, 0x2b09, 0x8206, 0x2b0f, 0xa004, 0x2b09, 0x9110, 0x0b03, 0x8200, 0x1b11, 0x8306, 0x0010, 0x8304, 0x0814, @@ -409,7 +409,7 @@ const UINT16 kov3_key[0x100] = { 0x1010, 0x4b6b, 0x1318, 0x5371, 0x023e, 0x0327, 0x0314, 0xc3d5, }; -const UINT16 kov2_key[0x100] = { +const uint16_t kov2_key[0x100] = { 0x1000, 0x3101, 0x9300, 0x0101, 0xa100, 0x8804, 0x8100, 0x2000, 0x0100, 0x1101, 0xb208, 0xa101, 0x8100, 0x0b0f, 0x200c, 0x0305, 0x0000, 0x9b13, 0x8000, 0x9911, 0x0302, 0x8804, 0x8200, 0x8a10, @@ -449,7 +449,7 @@ const UINT16 kov2_key[0x100] = { // more probable for this key to still contain errors than for the // other ones. -const UINT16 ddpdoj_key[0x100] = { +const uint16_t ddpdoj_key[0x100] = { 0xb102, 0x8802, 0x0000, 0x9101, 0x2004, 0xa105, 0x0000, 0x8905, 0x8102, 0x2000, 0x3000, 0x3808, 0x210e, 0xa006, 0x800c, 0xa004, 0x9110, 0x9911, 0x9010, 0x8800, 0x8006, 0x0901, 0x8114, 0x0115, |