igs/igs_m027.cpp: added preliminary decryptions for jking02, luckycrs and olympic5 [IQ_132]

This commit is contained in:
Ivan Vangelista 2024-07-23 22:12:05 +02:00
parent 9f31d42e2d
commit 0103e4da7f
4 changed files with 169 additions and 7 deletions

View File

@ -71,6 +71,9 @@ public:
void init_mgzz();
void init_mgcs3();
void init_crzybugs();
void init_jking02();
void init_luckycrs();
void init_olympic5();
[[maybe_unused]] void init_no_dec();
protected:
@ -1340,6 +1343,27 @@ void igs_m027_state::init_crzybugs()
pgm_create_dummy_internal_arm_region();
}
void igs_m027_state::init_jking02()
{
jking02_decrypt(machine());
//qlgs_gfx_decrypt(machine());
pgm_create_dummy_internal_arm_region();
}
void igs_m027_state::init_luckycrs()
{
luckycrs_decrypt(machine());
//qlgs_gfx_decrypt(machine());
pgm_create_dummy_internal_arm_region();
}
void igs_m027_state::init_olympic5()
{
olympic5_decrypt(machine());
//qlgs_gfx_decrypt(machine());
pgm_create_dummy_internal_arm_region();
}
} // anonymous namespace
@ -1356,11 +1380,11 @@ GAME( 1999, amazonkp, amazonia, igs_mahjong, amazonia, igs_m027_state, init_ama
GAME( 1999, fruitpar, 0, igs_mahjong, sdwx, igs_m027_state, init_fruitpar, ROT0, "IGS", "Fruit Paradise (V214)", MACHINE_IS_SKELETON )
GAME( 1999, oceanpar, 0, igs_mahjong, sdwx, igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V105US)", MACHINE_IS_SKELETON ) // 1999 copyright in ROM
GAME( 1999, oceanpara, oceanpar, igs_mahjong, sdwx, igs_m027_state, init_oceanpar, ROT0, "IGS", "Ocean Paradise (V101US)", MACHINE_IS_SKELETON ) // 1999 copyright in ROM
GAME( 200?, luckycrs, 0, igs_mahjong, sdwx, igs_m027_state, init_no_dec, ROT0, "IGS", "Lucky Cross (V106SA)", MACHINE_IS_SKELETON )
GAME( 200?, luckycrs, 0, igs_mahjong, sdwx, igs_m027_state, init_luckycrs, ROT0, "IGS", "Lucky Cross (V106SA)", MACHINE_IS_SKELETON )
GAME( 2002, sdwx, 0, igs_mahjong, sdwx, igs_m027_state, init_sdwx, ROT0, "IGS", "Sheng Dan Wu Xian", MACHINE_IS_SKELETON ) // aka Christmas 5 Line? (or Amazonia King II, shares roms at least?)
GAME( 200?, jking02, 0, igs_mahjong, sdwx, igs_m027_state, init_no_dec, ROT0, "IGS", "Jungle King 2002 (V209US)", MACHINE_IS_SKELETON )
GAME( 200?, olympic5, 0, igs_mahjong, sdwx, igs_m027_state, init_no_dec, ROT0, "IGS", "Olympic 5 (V112US)", MACHINE_IS_SKELETON )
GAME( 200?, olympic5a, 0, igs_mahjong, sdwx, igs_m027_state, init_no_dec, ROT0, "IGS", "Olympic 5 (V107US)", MACHINE_IS_SKELETON )
GAME( 200?, jking02, 0, igs_mahjong, sdwx, igs_m027_state, init_jking02, ROT0, "IGS", "Jungle King 2002 (V209US)", MACHINE_IS_SKELETON )
GAME( 2005, olympic5, 0, igs_mahjong, sdwx, igs_m027_state, init_olympic5, ROT0, "IGS", "Olympic 5 (V112US)", MACHINE_IS_SKELETON ) // IGS FOR V112US 2005 02 14
GAME( 2003, olympic5a, olympic5, igs_mahjong, sdwx, igs_m027_state, init_olympic5, ROT0, "IGS", "Olympic 5 (V107US)", MACHINE_IS_SKELETON ) // IGS FOR V107US 2003 10 2
GAME( 2003, amazoni2, 0, igs_mahjong, sdwx, igs_m027_state, init_amazoni2, ROT0, "IGS", "Amazonia King II (V202BR)", MACHINE_IS_SKELETON )
GAME( 200?, sddz, 0, igs_mahjong, sdwx, igs_m027_state, init_sddz, ROT0, "IGS", "Super Dou Di Zhu", MACHINE_IS_SKELETON )
GAME( 2000, zhongguo, 0, igs_mahjong, sdwx, igs_m027_state, init_zhongguo, ROT0, "IGS", "Zhong Guo Chu Da D", MACHINE_IS_SKELETON )

View File

@ -5,7 +5,7 @@
the IGS027 chips are typically used with encrypted ROMs.
Games with an External ARM Rom usually have that ROM encrypted
Games with an External ARM ROM usually have that ROM encrypted
otherwise (in the case of PGM) the 68k ROM ends up encrypted
instead. The encryption is controlled by a set of registers
mapped to ARM space where the table and some additional values
@ -1957,3 +1957,138 @@ void qlgs_decrypt(running_machine &machine)
src[i] = x;
}
}
static const uint8_t jking02_tab[0x100] = {
0x49, 0x47, 0x53, 0x30, 0x30, 0x30, 0x34, 0x52, 0x44, 0x34, 0x30, 0x31, 0x30, 0x39, 0x32, 0x31, // IGS0004RD4010921
0xa5, 0x04, 0x3d, 0x57, 0xe3, 0x8d, 0x44, 0xf3, 0x50, 0x21, 0x8a, 0xe5, 0x75, 0x22, 0x3a, 0xb3,
0xd5, 0x76, 0x66, 0x07, 0x89, 0xd4, 0xb8, 0x96, 0x20, 0x4e, 0x77, 0x53, 0xb5, 0x20, 0xbd, 0xd6,
0x52, 0xb8, 0xf7, 0x07, 0x85, 0x05, 0x9d, 0x0f, 0x41, 0x04, 0x33, 0x80, 0xf7, 0x89, 0x81, 0xc3,
0xf5, 0x4b, 0x0e, 0xc2, 0xfe, 0x33, 0xe3, 0xd7, 0x2b, 0xe6, 0x7e, 0xf5, 0x02, 0x91, 0x14, 0x15,
0xd4, 0xf4, 0x0c, 0xe4, 0x5c, 0xb2, 0xb8, 0xab, 0x95, 0xd7, 0x56, 0x7e, 0xdc, 0xaa, 0x47, 0xa9,
0x47, 0xb6, 0x8e, 0x57, 0x44, 0x13, 0x8c, 0x84, 0x76, 0xfa, 0xfa, 0x26, 0xcc, 0x89, 0x27, 0x97,
0xe3, 0xd2, 0x74, 0x46, 0x9f, 0x2b, 0x0d, 0x9f, 0x04, 0xb1, 0xe9, 0x37, 0x5a, 0x1e, 0x05, 0x3c,
0x82, 0xce, 0xdc, 0x1d, 0x92, 0x0c, 0x2a, 0x75, 0xb8, 0xa1, 0xe3, 0x3e, 0x4d, 0x9f, 0x6e, 0x33,
0x38, 0x6a, 0x26, 0x85, 0x86, 0x08, 0x13, 0xc3, 0x47, 0xab, 0xe5, 0x04, 0xab, 0x7d, 0x32, 0x56,
0x5e, 0xab, 0xf1, 0x6b, 0x21, 0xb4, 0x37, 0x82, 0xa9, 0xf4, 0x30, 0x94, 0xbc, 0x6c, 0x61, 0xc1,
0x8a, 0xd3, 0x1c, 0xfa, 0x49, 0xe3, 0x44, 0xef, 0x15, 0xdd, 0x42, 0x3b, 0x07, 0x5e, 0x48, 0xce,
0x94, 0x66, 0xc5, 0x9b, 0x27, 0xa6, 0x29, 0x84, 0x02, 0x0a, 0xdb, 0x82, 0x52, 0x87, 0x77, 0x19,
0x91, 0x26, 0x4c, 0xfb, 0x21, 0x51, 0x16, 0xfb, 0x26, 0x5e, 0xf8, 0x35, 0xa5, 0x5a, 0xbd, 0x7c,
0xda, 0x17, 0x50, 0x04, 0xde, 0x78, 0x79, 0x51, 0x7a, 0xfc, 0xda, 0x5f, 0x46, 0x89, 0x29, 0x13,
0x06, 0x7b, 0xaf, 0xe2, 0x46, 0xed, 0x02, 0xc0, 0x33, 0x46, 0xff, 0x4b, 0xbd, 0x08, 0x0a, 0x38
};
void jking02_decrypt(running_machine &machine)
{
auto const src = reinterpret_cast<u16 *>(machine.root_device().memregion("user1")->base());
int const rom_size = 0x80000;
for (int i = 0; i < rom_size / 2; i++)
{
uint16_t x = src[i];
// probably needs work...
IGS27_CRYPT1
IGS27_CRYPT2_ALT
// IGS27_CRYPT3
IGS27_CRYPT4
IGS27_CRYPT5
IGS27_CRYPT6_ALT
IGS27_CRYPT7
IGS27_CRYPT8
x ^= jking02_tab[(i>> 1) & 0xff] << 8;
src[i] = x;
}
}
static const uint8_t luckycrs_tab[0x100] = {
0x4b, 0x99, 0xa3, 0xa6, 0x69, 0xad, 0xb2, 0x1e, 0x42, 0x9a, 0x02, 0x91, 0x04, 0x90, 0x64, 0xcf,
0x68, 0xe0, 0xa3, 0x8e, 0x1b, 0x53, 0x8d, 0xe6, 0x6f, 0xcd, 0x40, 0x09, 0x42, 0x23, 0xb7, 0x47,
0x2f, 0x39, 0x95, 0x41, 0xf4, 0x60, 0x30, 0x6d, 0x23, 0xee, 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xf9, 0xbf, 0xd1, 0x19, 0x17, 0x7f, 0x86, 0xbc, 0x94, 0x50, 0xae, 0xa7, 0xc0, 0x1a,
0x8e, 0x8f, 0x84, 0xc8, 0x05, 0xc5, 0x6b, 0xc7, 0x2f, 0xd2, 0xf1, 0xc2, 0x5b, 0x50, 0x11, 0x9b
};
void luckycrs_decrypt(running_machine &machine)
{
auto const src = reinterpret_cast<u16 *>(machine.root_device().memregion("user1")->base());
int const rom_size = 0x80000;
for (int i = 0; i < rom_size / 2; i++)
{
uint16_t x = src[i];
// fairly high confidence in conditional xors with comments
IGS27_CRYPT1_ALT // 3900
IGS27_CRYPT2 // 8bd0
IGS27_CRYPT3 // 3a20
IGS27_CRYPT4_ALT // 8db0
IGS27_CRYPT5_ALT // 140d0
IGS27_CRYPT6_ALT
IGS27_CRYPT7
IGS27_CRYPT8_ALT // 3a40
x ^= luckycrs_tab[(i>> 1) & 0xff] << 8;
src[i] = x;
}
}
static const uint8_t olympic5_tab[0x100] = {
0x49, 0x47, 0x53, 0x30, 0x30, 0x34, 0x34, 0x52, 0x44, 0x34, 0x30, 0x32, 0x30, 0x35, 0x33, 0x31, // IGS0044RD4020531
0xb6, 0x32, 0xe0, 0xf9, 0x95, 0x3c, 0xa7, 0x99, 0xd9, 0x14, 0xf0, 0x81, 0x05, 0xd5, 0xc4, 0xe8,
0x64, 0x59, 0x78, 0x83, 0xe5, 0xca, 0xaa, 0xaf, 0x37, 0x66, 0x80, 0xe1, 0x20, 0x92, 0x1d, 0x50,
0x23, 0x22, 0x64, 0xe1, 0x53, 0xe8, 0xf1, 0x53, 0x71, 0x7b, 0x54, 0xab, 0x4d, 0x49, 0x90, 0xe2,
0x5b, 0xdf, 0xd3, 0xcd, 0x93, 0x78, 0x78, 0x4e, 0x8f, 0xc5, 0x3b, 0xb9, 0xe0, 0xfc, 0xbb, 0x89,
0xb1, 0x23, 0x35, 0x44, 0x9f, 0x9e, 0x7f, 0xac, 0xd7, 0xf8, 0x44, 0x27, 0x72, 0xee, 0x7e, 0x71,
0x0d, 0xc2, 0x39, 0x80, 0xad, 0xbe, 0x86, 0xb7, 0xd2, 0x06, 0xbd, 0x50, 0xd9, 0xa3, 0xf8, 0x03,
0x97, 0xcd, 0xcd, 0xfc, 0x33, 0x79, 0x4b, 0xfc, 0x44, 0x23, 0x37, 0xcd, 0x2c, 0xdd, 0x88, 0xec,
0xb4, 0x99, 0x20, 0x72, 0xe9, 0xb3, 0xcd, 0x44, 0x36, 0xc2, 0x80, 0x7c, 0xc3, 0xa0, 0xcc, 0x16,
0x0d, 0xb8, 0xa2, 0xdf, 0xc6, 0x8f, 0x4b, 0x9b, 0xef, 0x95, 0xa7, 0x76, 0x34, 0x2e, 0xa4, 0xad,
0x88, 0xfc, 0x01, 0x7d, 0x01, 0x70, 0x45, 0x4c, 0xf6, 0x91, 0xfa, 0x16, 0x56, 0x0b, 0x2f, 0x1b,
0x4c, 0x7a, 0x2d, 0xc7, 0x11, 0xf9, 0x79, 0xe1, 0x11, 0xe6, 0x0a, 0xf8, 0x41, 0xf8, 0xcc, 0x0b,
0xc0, 0x85, 0x54, 0x77, 0xac, 0x0c, 0xe6, 0x27, 0x47, 0x0a, 0xa5, 0xf6, 0x4b, 0xfb, 0x19, 0x68,
0x8b, 0xae, 0xe6, 0x8a, 0xcb, 0xce, 0xcb, 0x27, 0xe0, 0xae, 0xd9, 0x2c, 0x0c, 0x54, 0xf6, 0x5e,
0x94, 0xc9, 0x91, 0x3a, 0xa3, 0xa0, 0xa7, 0x2c, 0x63, 0xc5, 0xf7, 0xf5, 0x59, 0x88, 0x81, 0x56,
0x02, 0xea, 0x45, 0x02, 0xac, 0x27, 0x3a, 0xc3, 0x96, 0x83, 0x8c, 0xeb, 0x4b, 0x5a, 0x1a, 0xfd,
};
void olympic5_decrypt(running_machine &machine)
{
auto const src = reinterpret_cast<u16 *>(machine.root_device().memregion("user1")->base());
int const rom_size = 0x80000;
for (int i = 0; i < rom_size / 2; i++)
{
uint16_t x = src[i];
// fairly high confidence in conditional xors with comments
IGS27_CRYPT1 // 2df0
IGS27_CRYPT2_ALT // ac50
IGS27_CRYPT3
IGS27_CRYPT4 // 2df0
IGS27_CRYPT5 // 109f0
IGS27_CRYPT6
IGS27_CRYPT7
IGS27_CRYPT8 // 3340
x ^= olympic5_tab[(i>> 1) & 0xff] << 8;
src[i] = x;
}
}

View File

@ -45,3 +45,6 @@ void mgzz_decrypt(running_machine &machine);
void mgcs3_decrypt(running_machine &machine);
void crzybugs_decrypt(running_machine &machine);
void qlgs_decrypt(running_machine &machine);
void jking02_decrypt(running_machine &machine);
void luckycrs_decrypt(running_machine &machine);
void olympic5_decrypt(running_machine &machine);

View File

@ -20220,8 +20220,8 @@ mgfx // (c) 200?
mgzz // (c) 2003
oceanpar //
oceanpara //
olympic5 // (c) 200?
olympic5a // (c) 200?
olympic5 // (c) 2005
olympic5a // (c) 2003
qlgs // (c) 1999
sddz // (c) 200?
sdwx // (c) 2002