Skip to content

Commit e32105a

Browse files
committed
igs/pgmcrypt.cpp: added decryption tables for gonefsh, jhg3d, royal5p [IQ_132]
1 parent b5301c1 commit e32105a

File tree

4 files changed

+165
-4
lines changed

4 files changed

+165
-4
lines changed

src/mame/igs/igs_m027.cpp

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ class igs_m027_state : public driver_device
196196
void init_xypdk() ATTR_COLD;
197197
void init_ccly() ATTR_COLD;
198198
void init_tswxp() ATTR_COLD;
199+
void init_royal5p() ATTR_COLD;
200+
void init_jhg3d() ATTR_COLD;
201+
void init_gonefsh() ATTR_COLD;
199202

200203
protected:
201204
virtual void machine_start() override ATTR_COLD;
@@ -4113,6 +4116,27 @@ void igs_m027_state::init_tswxp()
41134116
m_igs017_igs031->tarzan_decrypt_sprites(0, 0);
41144117
}
41154118

4119+
void igs_m027_state::init_royal5p()
4120+
{
4121+
royal5p_decrypt(machine());
4122+
m_igs017_igs031->sdwx_gfx_decrypt();
4123+
m_igs017_igs031->tarzan_decrypt_sprites(0, 0);
4124+
}
4125+
4126+
void igs_m027_state::init_jhg3d()
4127+
{
4128+
jhg3d_decrypt(machine());
4129+
m_igs017_igs031->sdwx_gfx_decrypt();
4130+
m_igs017_igs031->tarzan_decrypt_sprites(0, 0);
4131+
}
4132+
4133+
void igs_m027_state::init_gonefsh()
4134+
{
4135+
gonefsh_decrypt(machine());
4136+
m_igs017_igs031->sdwx_gfx_decrypt();
4137+
m_igs017_igs031->tarzan_decrypt_sprites(0, 0);
4138+
}
4139+
41164140
} // anonymous namespace
41174141

41184142

@@ -4179,9 +4203,9 @@ GAME( 200?, luckycrs, 0, m027_1ppi<false>, base, igs_m027_state
41794203
GAME( 2003, amazoni2, 0, m027_1ppi<false>, base, igs_m027_state, init_amazoni2, ROT0, "IGS", "Amazonia King II (V202BR)", MACHINE_NOT_WORKING )
41804204
GAME( 2002, sdwx, 0, m027_1ppi<false>, base, igs_m027_state, init_sdwx, ROT0, "IGS", "Sheng Dan Wu Xian", MACHINE_NOT_WORKING ) // aka Christmas 5 Line? (or Amazonia King II, shares roms at least?)
41814205
GAME( 2001, cjdh6th, 0, m027_1ppi<false>, base, igs_m027_state, init_extradrw, ROT0, "IGS", "Chaoji Daheng 6th", MACHINE_NOT_WORKING )
4182-
GAME( 200?, royal5p, 0, m027_1ppi<false>, base, igs_m027_state, empty_init, ROT0, "IGS", "Royal 5+ (V101US)", MACHINE_NOT_WORKING )
4183-
GAME( 200?, jhg3d, 0, m027_1ppi<false>, base, igs_m027_state, empty_init, ROT0, "IGS", "Jin Huangguan 3-dai (V445CN)", MACHINE_NOT_WORKING )
4184-
GAME( 200?, gonefsh, 0, m027_1ppi<false>, base, igs_m027_state, empty_init, ROT0, "IGS", "Gone Fishing (V602US)", MACHINE_NOT_WORKING )
4206+
GAME( 2005, royal5p, 0, m027_1ppi<false>, base, igs_m027_state, init_royal5p, ROT0, "IGS", "Royal 5+ (V101US)", MACHINE_NOT_WORKING )
4207+
GAME( 200?, jhg3d, 0, m027_1ppi<false>, base, igs_m027_state, init_jhg3d, ROT0, "IGS", "Jin Huangguan 3-dai (V445CN)", MACHINE_NOT_WORKING )
4208+
GAME( 2002, gonefsh, 0, m027_1ppi<false>, base, igs_m027_state, init_gonefsh, ROT0, "IGS", "Gone Fishing (V602US)", MACHINE_NOT_WORKING )
41854209

41864210
// these have an IGS025 protection device instead of the 8255
41874211
GAME( 200?, gonefsh2, 0, m027_noppi<false>,base, igs_m027_state, init_gonefsh2, ROT0, "IGS", "Gone Fishing 2", MACHINE_NOT_WORKING )

src/mame/igs/pgmcrypt.cpp

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2027,3 +2027,137 @@ void krzykeno_decrypt(running_machine &machine)
20272027
src[i] = x;
20282028
}
20292029
}
2030+
2031+
static const uint8_t gonefsh_tab[0x100] = { // IGS0054RD4020621
2032+
0x49, 0x47, 0x53, 0x30, 0x30, 0x35, 0x34, 0x52, 0x44, 0x34, 0x30, 0x32, 0x30, 0x36, 0x32, 0x31,
2033+
0x79, 0x34, 0x29, 0xac, 0x98, 0xd9, 0x3e, 0x24, 0x97, 0xc9, 0x53, 0xed, 0xa8, 0x4c, 0xa4, 0x5d,
2034+
0x95, 0xba, 0xdd, 0x28, 0xc5, 0xa3, 0x3b, 0x28, 0x73, 0x3e, 0xe5, 0x6c, 0x29, 0x17, 0x8d, 0x85,
2035+
0x83, 0xf5, 0x43, 0x0c, 0x22, 0x0a, 0x99, 0x78, 0xef, 0x5e, 0xfd, 0x1e, 0x92, 0x7d, 0x52, 0x89,
2036+
0x31, 0x60, 0xd1, 0xfd, 0x6d, 0x99, 0x20, 0x46, 0x9b, 0xc3, 0xb0, 0xc6, 0x40, 0x29, 0x5c, 0xbe,
2037+
0xcf, 0xb6, 0x40, 0xdc, 0xa6, 0x1d, 0xd6, 0x06, 0x46, 0x49, 0x57, 0x66, 0xd2, 0x07, 0x51, 0xb6,
2038+
0xcb, 0xf2, 0x85, 0xcd, 0x0a, 0x9f, 0x03, 0x6b, 0xff, 0x0a, 0x89, 0x41, 0x28, 0x41, 0x18, 0x44,
2039+
0xd5, 0x4f, 0xd8, 0x34, 0x1a, 0x6b, 0x2e, 0x67, 0x15, 0x62, 0x1b, 0xdb, 0x61, 0x42, 0xd8, 0x7b,
2040+
0xdb, 0x48, 0xb0, 0xb2, 0x94, 0x0c, 0x1d, 0x2e, 0x17, 0xeb, 0x26, 0xf6, 0xdc, 0xb5, 0xf8, 0xaf,
2041+
0x0c, 0x98, 0xc4, 0x2a, 0x77, 0x4c, 0xd8, 0x33, 0xd3, 0x80, 0x01, 0x95, 0x38, 0x85, 0x20, 0x71,
2042+
0xd8, 0x3a, 0x0a, 0xc1, 0x03, 0x38, 0xa6, 0x28, 0x5a, 0x3e, 0x41, 0xfc, 0x53, 0xde, 0x35, 0x96,
2043+
0xed, 0x69, 0xbb, 0xd9, 0xb5, 0x19, 0x0d, 0x01, 0xfa, 0x7d, 0xbf, 0xae, 0x4c, 0x2a, 0x5f, 0x30,
2044+
0x3b, 0xa0, 0x4c, 0x14, 0x4e, 0x7a, 0xd4, 0xf0, 0x42, 0xdb, 0x92, 0x6c, 0x84, 0x15, 0x06, 0x92,
2045+
0xf1, 0x9a, 0x75, 0x57, 0xcc, 0x28, 0x03, 0x69, 0x00, 0x30, 0x0f, 0x3b, 0x98, 0x88, 0xcf, 0x4f,
2046+
0x7c, 0x52, 0x2d, 0xc3, 0x6e, 0x2c, 0xe1, 0x1f, 0x45, 0x9a, 0xcf, 0x5e, 0x68, 0xb0, 0xa3, 0x3a,
2047+
0x8d, 0x04, 0xab, 0xbd, 0xb4, 0xd3, 0xf4, 0x05, 0x5e, 0x71, 0xa8, 0x56, 0x13, 0xf7, 0xa8, 0x67
2048+
};
2049+
2050+
void gonefsh_decrypt(running_machine &machine)
2051+
{
2052+
auto const src = reinterpret_cast<u16 *>(machine.root_device().memregion("user1")->base());
2053+
2054+
int const rom_size = 0x80000;
2055+
2056+
for (int i = 0; i < rom_size / 2; i++)
2057+
{
2058+
uint16_t x = src[i];
2059+
2060+
IGS27_CRYPT1_ALT
2061+
IGS27_CRYPT2_ALT
2062+
IGS27_CRYPT3
2063+
IGS27_CRYPT4
2064+
IGS27_CRYPT5_ALT
2065+
IGS27_CRYPT6
2066+
IGS27_CRYPT7
2067+
IGS27_CRYPT8
2068+
2069+
x ^= gonefsh_tab[(i >> 1) & 0xff] << 8;
2070+
2071+
src[i] = x;
2072+
}
2073+
}
2074+
2075+
static const uint8_t jhg3d_tab[0x100] = { // IGS2200RD4011127
2076+
0x49, 0x47, 0x53, 0x32, 0x32, 0x30, 0x30, 0x52, 0x44, 0x34, 0x30, 0x31, 0x31, 0x31, 0x32, 0x37,
2077+
0x01, 0x8c, 0xa0, 0x88, 0x54, 0x47, 0xca, 0xa8, 0x5f, 0xc9, 0xae, 0x1b, 0x81, 0x07, 0xc7, 0x96,
2078+
0x6c, 0xe1, 0x23, 0x35, 0x7c, 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x2e, 0x8e, 0x1e, 0x8a, 0x66, 0x1c, 0x67, 0xd9, 0x3a, 0x37, 0x33, 0xe8, 0x6b,
2090+
0x0c, 0x0d, 0x61, 0x5f, 0xb4, 0xb5, 0x41, 0xd2, 0xcc, 0x69, 0x90, 0xba, 0x59, 0x76, 0x62, 0x7a,
2091+
0xda, 0x00, 0x0f, 0x4c, 0xaf, 0x0e, 0xaf, 0xe8, 0xaa, 0xd9, 0xd8, 0x7a, 0xf3, 0x56, 0x9b, 0xc3
2092+
};
2093+
2094+
void jhg3d_decrypt(running_machine &machine)
2095+
{
2096+
auto const src = reinterpret_cast<u16 *>(machine.root_device().memregion("user1")->base());
2097+
2098+
int const rom_size = 0x80000;
2099+
2100+
for (int i = 0; i < rom_size / 2; i++)
2101+
{
2102+
uint16_t x = src[i];
2103+
2104+
// not confident that these are 100% correct
2105+
IGS27_CRYPT1_ALT2
2106+
IGS27_CRYPT2_ALT
2107+
IGS27_CRYPT3
2108+
IGS27_CRYPT4_ALT
2109+
IGS27_CRYPT5
2110+
IGS27_CRYPT6
2111+
IGS27_CRYPT7
2112+
IGS27_CRYPT8
2113+
2114+
x ^= jhg3d_tab[(i >> 1) & 0xff] << 8;
2115+
2116+
src[i] = x;
2117+
}
2118+
}
2119+
2120+
2121+
static const uint8_t royal5p_tab[0x100] = { // IGS0164RD1040521
2122+
0x49, 0x47, 0x53, 0x30, 0x31, 0x36, 0x34, 0x52, 0x44, 0x31, 0x30, 0x34, 0x30, 0x35, 0x32, 0x31,
2123+
0x1d, 0x28, 0xe4, 0xf9, 0xfc, 0x37, 0xf3, 0xb4, 0xdb, 0x89, 0x17, 0xf3, 0xfd, 0x11, 0x83, 0x31,
2124+
0x82, 0x72, 0x2e, 0xe0, 0xd0, 0x5b, 0xe7, 0xe2, 0x3e, 0x20, 0x9a, 0x46, 0x03, 0x99, 0xe1, 0x44,
2125+
0x5e, 0x40, 0xce, 0x7b, 0x07, 0x86, 0xf7, 0x69, 0xd7, 0x76, 0xc3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, 0x0c, 0xc4, 0xbd, 0x0f, 0x97,
2137+
0x18, 0x2c, 0x26, 0xd2, 0xe9, 0xb9, 0xe9, 0x18, 0x9d, 0x68, 0xe8, 0xa1, 0xe7, 0xf4, 0x53, 0x7f
2138+
};
2139+
2140+
void royal5p_decrypt(running_machine &machine)
2141+
{
2142+
auto const src = reinterpret_cast<u16 *>(machine.root_device().memregion("user1")->base());
2143+
2144+
int const rom_size = 0x80000;
2145+
2146+
for (int i = 0; i < rom_size / 2; i++)
2147+
{
2148+
uint16_t x = src[i];
2149+
2150+
IGS27_CRYPT1
2151+
IGS27_CRYPT2_ALT
2152+
IGS27_CRYPT3
2153+
IGS27_CRYPT4
2154+
IGS27_CRYPT5_ALT
2155+
IGS27_CRYPT6
2156+
IGS27_CRYPT7
2157+
IGS27_CRYPT8
2158+
2159+
x ^= royal5p_tab[(i >> 1) & 0xff] << 8;
2160+
2161+
src[i] = x;
2162+
}
2163+
}

src/mame/igs/pgmcrypt.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,8 @@ void mjzb_decrypt(running_machine& machine) ATTR_COLD;
6666
void tswxp_decrypt(running_machine& machine) ATTR_COLD;
6767
void jking04_decrypt(running_machine& machine) ATTR_COLD;
6868
void krzykeno_decrypt(running_machine& machine) ATTR_COLD;
69+
void royal5p_decrypt(running_machine& machine) ATTR_COLD;
70+
void jhg3d_decrypt(running_machine& machine) ATTR_COLD;
71+
void gonefsh_decrypt(running_machine& machine) ATTR_COLD;
6972

7073
#endif // MAME_IGS_PGMCRYPT_H

src/mame/skeleton/vgame.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ GFXDECODE_END
120120

121121
void vgame_state::vgame(machine_config &config)
122122
{
123-
ARM7(config, m_maincpu, 44_MHz_XTAL); // CPU core unknown; ROMs seem to contain at least some ARM or Thumb code
123+
ARM7(config, m_maincpu, 44_MHz_XTAL); // CPU core unknown (possibly AT91SAM7SE256 or similar); ROMs seem to contain at least some ARM or Thumb code
124124
m_maincpu->set_addrmap(AS_PROGRAM, &vgame_state::program_map);
125125
// m_maincpu->set_vblank_int("screen", FUNC(vgame_state::irq0_line_hold));
126126

0 commit comments

Comments
 (0)