Decrypted external ARM code in slqz3 [Dave]

This commit is contained in:
Luca Elia 2015-07-25 16:16:38 +02:00
parent 3354e6583d
commit 03dff3284b
3 changed files with 59 additions and 1 deletions

View File

@ -66,6 +66,7 @@ public:
DECLARE_DRIVER_INIT(zhongguo);
DECLARE_DRIVER_INIT(klxyj);
DECLARE_DRIVER_INIT(fearless);
DECLARE_DRIVER_INIT(slqz3);
TILE_GET_INFO_MEMBER(get_tx_tilemap_tile_info);
TILE_GET_INFO_MEMBER(get_bg_tilemap_tile_info);
virtual void video_start();
@ -998,13 +999,20 @@ DRIVER_INIT_MEMBER(igs_m027_state,zhongguo)
pgm_create_dummy_internal_arm_region();
}
DRIVER_INIT_MEMBER(igs_m027_state,slqz3)
{
slqz3_decrypt(machine());
//sdwx_gfx_decrypt(machine());
pgm_create_dummy_internal_arm_region();
}
/***************************************************************************
Game Drivers
***************************************************************************/
GAME( 1999, slqz3, 0, igs_majhong, sdwx, igs_m027_state, sdwx, ROT0, "IGS", "Mahjong Shuang Long Qiang Zhu 3", GAME_IS_SKELETON )
GAME( 1999, slqz3, 0, igs_majhong, sdwx, igs_m027_state, slqz3, ROT0, "IGS", "Mahjong Shuang Long Qiang Zhu 3 (China, VS107C)", GAME_IS_SKELETON )
GAME( 2002, sdwx, 0, igs_majhong, sdwx, igs_m027_state, sdwx, ROT0, "IGS", "Sheng Dan Wu Xian", GAME_IS_SKELETON ) // aka Christmas 5 Line?
GAME( 200?, sddz, 0, igs_majhong, sdwx, igs_m027_state, sddz, ROT0, "IGS", "Super Dou Di Zhu", GAME_IS_SKELETON )
GAME( 2000, zhongguo, 0, igs_majhong, sdwx, igs_m027_state, zhongguo, ROT0, "IGS", "Zhong Guo Chu Da D", GAME_IS_SKELETON )

View File

@ -1478,3 +1478,52 @@ void pgm_decrypt_pgm3in1(running_machine &machine)
src[i] = x;
}
}
// IGS MAHJONG CHINA VS107C
static const UINT8 slqz3_tab[0x100] = {
0xef, 0xdf, 0x90, 0x60, 0x46, 0x43, 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 0x0d, 0x3e, 0x8c, 0x65, 0xa0, 0xf8, 0xd8, 0x2f, 0x35, 0xc6, 0x26, 0x6c, 0x81, 0xe6, 0x29,
0x50, 0x30, 0x4a, 0x8e, 0xfa, 0xc2, 0x1e, 0xfd, 0xa7, 0xa5, 0x98, 0x53, 0x18, 0x94, 0xff, 0x1d,
0x41, 0x2f, 0xff, 0x58, 0x33, 0xdc, 0x2b, 0x67, 0x4b, 0xdd, 0xd3, 0x56, 0x9c, 0xb2, 0x09, 0x4e,
0x9b, 0xb1, 0xee, 0x58, 0x0a, 0xe4, 0x42, 0x56, 0x26, 0x23, 0x2c, 0x3f, 0x14, 0x73, 0x46, 0x9a
};
void slqz3_decrypt(running_machine &machine)
{
int i;
UINT16 *src = (UINT16 *) machine.root_device().memregion("user1")->base();
int rom_size = 0x200000;
for(i=0; i<rom_size/2; i++) {
UINT16 x = src[i];
// not 100% verified
IGS27_CRYPT1
IGS27_CRYPT2_ALT
IGS27_CRYPT3
IGS27_CRYPT4
IGS27_CRYPT5
IGS27_CRYPT6_ALT
IGS27_CRYPT7
IGS27_CRYPT8
x ^= slqz3_tab[(i/2) & 0xff] << 8;
src[i] = x;
}
}

View File

@ -34,3 +34,4 @@ void mgfx_decrypt(running_machine &machine);
void lhzb4_decrypt(running_machine &machine);
void fearless_decrypt(running_machine &machine);
void pgm_decrypt_pgm3in1(running_machine &machine);
void slqz3_decrypt(running_machine &machine);