hook the 036 decryption up to igs_m036.c and pgm2.c (nw)

This commit is contained in:
David Haywood 2014-02-23 16:06:13 +00:00
parent dfd44f91f4
commit 35a4d4560a
4 changed files with 60 additions and 11 deletions

View File

@ -58,7 +58,7 @@ check more info and photo from cjdh2.zip!!!
#include "emu.h"
#include "cpu/arm7/arm7.h"
#include "cpu/arm7/arm7core.h"
#include "machine/igs036crypt.h"
class igs_m036_state : public driver_device
@ -70,6 +70,11 @@ public:
UINT32 screen_update_igs_m036(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_DRIVER_INIT(igs_m036);
DECLARE_DRIVER_INIT(cjdh2);
DECLARE_DRIVER_INIT(cjddzsp);
DECLARE_DRIVER_INIT(igsm312);
required_device<cpu_device> m_maincpu;
void pgm_create_dummy_internal_arm_region(void);
@ -191,7 +196,6 @@ ROM_START( igsm312 )
ROM_REGION( 0x200000, "user1", 0 ) // external ARM data / prg
ROM_LOAD( "m312cn.rom", 0x000000, 0x200000, CRC(5069c310) SHA1(d53a2e8acddfbb7afc27c68c0b3167419a3ec3e6) )
// ROM_LOAD( "decrypted_m312cn.rom", 0x000000, 0x200000, CRC(ccea5ea0) SHA1(5e8e1e7fca8c52e1a12c8e44efffd5821fe9abfc) )
ROM_REGION( 0x800100, "oki", ROMREGION_ERASE00 ) // TT5665 samples
/* missing */
@ -280,6 +284,29 @@ DRIVER_INIT_MEMBER(igs_m036_state,igs_m036)
pgm_create_dummy_internal_arm_region();
}
DRIVER_INIT_MEMBER(igs_m036_state, cjdh2)
{
DRIVER_INIT_CALL(igs_m036);
igs036_decryptor decrypter(cjdh2_key);
decrypter.decrypter_rom(memregion("user1"));
}
DRIVER_INIT_MEMBER(igs_m036_state, cjddzsp)
{
DRIVER_INIT_CALL(igs_m036);
igs036_decryptor decrypter(cjddzsp_key);
decrypter.decrypter_rom(memregion("user1"));
}
DRIVER_INIT_MEMBER(igs_m036_state, igsm312)
{
DRIVER_INIT_CALL(igs_m036);
igs036_decryptor decrypter(m312cn_key);
decrypter.decrypter_rom(memregion("user1"));
}
/***************************************************************************
@ -287,11 +314,11 @@ DRIVER_INIT_MEMBER(igs_m036_state,igs_m036)
***************************************************************************/
GAME( 200?, cjdh2, 0, igs_m036, igs_m036, igs_m036_state, igs_m036, ROT0, "IGS", "Chao Ji Da Heng 2 (V311CN)", GAME_IS_SKELETON )
GAME( 200?, cjdh2a, cjdh2, igs_m036, igs_m036, igs_m036_state, igs_m036, ROT0, "IGS", "Chao Ji Da Heng 2 (V311CNA)", GAME_IS_SKELETON )
GAME( 200?, cjdh2b, cjdh2, igs_m036, igs_m036, igs_m036_state, igs_m036, ROT0, "IGS", "Chao Ji Da Heng 2 (V311CNB)", GAME_IS_SKELETON )
GAME( 200?, cjdh2c, cjdh2, igs_m036, igs_m036, igs_m036_state, igs_m036, ROT0, "IGS", "Chao Ji Da Heng 2 (V215CN)", GAME_IS_SKELETON )
GAME( 200?, cjdh2, 0, igs_m036, igs_m036, igs_m036_state, cjdh2, ROT0, "IGS", "Chao Ji Da Heng 2 (V311CN)", GAME_IS_SKELETON )
GAME( 200?, cjdh2a, cjdh2, igs_m036, igs_m036, igs_m036_state, cjdh2, ROT0, "IGS", "Chao Ji Da Heng 2 (V311CNA)", GAME_IS_SKELETON )
GAME( 200?, cjdh2b, cjdh2, igs_m036, igs_m036, igs_m036_state, cjdh2, ROT0, "IGS", "Chao Ji Da Heng 2 (V311CNB)", GAME_IS_SKELETON )
GAME( 200?, cjdh2c, cjdh2, igs_m036, igs_m036, igs_m036_state, cjdh2, ROT0, "IGS", "Chao Ji Da Heng 2 (V215CN)", GAME_IS_SKELETON )
GAME( 200?, cjddzsp, 0, igs_m036_tt, igs_m036, igs_m036_state, igs_m036, ROT0, "IGS", "Super Dou Di Zhu Special (V122CN)", GAME_IS_SKELETON )
GAME( 200?, cjddzsp, 0, igs_m036_tt, igs_m036, igs_m036_state, cjddzsp, ROT0, "IGS", "Super Dou Di Zhu Special (V122CN)", GAME_IS_SKELETON )
GAME( 200?, igsm312, 0, igs_m036_tt, igs_m036, igs_m036_state, igs_m036, ROT0, "IGS", "Unknown 'IGS 6POKER2' game (V312CN)", GAME_IS_SKELETON ) // there's very little code and no gfx roms, might be a 'set/clear' chip for a gambling game.
GAME( 200?, igsm312, 0, igs_m036_tt, igs_m036, igs_m036_state, igsm312, ROT0, "IGS", "Unknown 'IGS 6POKER2' game (V312CN)", GAME_IS_SKELETON ) // there's very little code and no gfx roms, might be a 'set/clear' chip for a gambling game.

View File

@ -36,7 +36,7 @@ Knights of Valour 3
NO internal ROMs are dumped.
Other games that might be on this HW
These were only released as single board PGM2 based hardware, seen for sale in Japan for around $250-$300
Jigsaw World Arena
Puzzle of Ocha / Ochainu No Pazuru
@ -50,6 +50,7 @@ Puzzle of Ocha / Ochainu No Pazuru
#include "cpu/arm7/arm7.h"
#include "cpu/arm7/arm7core.h"
#include "sound/ymz770.h"
#include "machine/igs036crypt.h"
class pgm2_state : public driver_device
{
@ -224,7 +225,6 @@ ROM_START( orleg2 )
ROM_REGION( 0x800000, "user1", 0 )
ROM_LOAD( "xyj2_v104cn.u7", 0x00000000, 0x0800000, CRC(7c24a4f5) SHA1(3cd9f9264ef2aad0869afdf096e88eb8d74b2570) )
// ROM_LOAD( "decrypted4.bin", 0x00000000, 0x0800000, CRC(9a4101ac) SHA1(364aed3a3bee7caed598db1c5100e125adc42a79) )
ROM_REGION( 0x200000, "tiles", ROMREGION_ERASEFF )
ROM_LOAD( "ig-a_text.u4", 0x00000000, 0x0200000, CRC(fa444c32) SHA1(31e5e3efa92d52bf9ab97a0ece51e3b77f52ce8a) )
@ -251,7 +251,6 @@ ROM_START( orleg2o )
ROM_REGION( 0x800000, "user1", 0 )
ROM_LOAD( "xyj2_v103cn.u7", 0x000000, 0x800000, CRC(21c1fae8) SHA1(36eeb7a5e8dc8ee7c834f3ff1173c28cf6c2f1a3) )
// ROM_LOAD( "decrypted3.bin", 0x00000000, 0x0800000, CRC(eec442b4) SHA1(f5f4f65702f7384e7971240b835783be24ebc723) )
ROM_REGION( 0x200000, "tiles", ROMREGION_ERASEFF )
ROM_LOAD( "ig-a_text.u4", 0x00000000, 0x0200000, CRC(fa444c32) SHA1(31e5e3efa92d52bf9ab97a0ece51e3b77f52ce8a) )
@ -441,6 +440,9 @@ DRIVER_INIT_MEMBER(pgm2_state,orleg2)
iga_u12_decode(src, 0x2000000, 0x4761);
iga_u16_decode(src, 0x2000000, 0xc79f);
igs036_decryptor decrypter(orleg2_key);
decrypter.decrypter_rom(memregion("user1"));
pgm_create_dummy_internal_arm_region();
}
@ -451,6 +453,9 @@ DRIVER_INIT_MEMBER(pgm2_state,kov2nl)
iga_u12_decode(src, 0x2000000, 0xa193);
iga_u16_decode(src, 0x2000000, 0xb780);
igs036_decryptor decrypter(kov2_key);
decrypter.decrypter_rom(memregion("user1"));
pgm_create_dummy_internal_arm_region();
}
@ -461,6 +466,9 @@ DRIVER_INIT_MEMBER(pgm2_state,ddpdojh)
iga_u12_decode(src, 0x800000, 0x1e96);
iga_u16_decode(src, 0x800000, 0x869c);
igs036_decryptor decrypter(ddpdoj_key);
decrypter.decrypter_rom(memregion("user1"));
pgm_create_dummy_internal_arm_region();
}
@ -471,6 +479,9 @@ DRIVER_INIT_MEMBER(pgm2_state,kov3)
iga_u12_decode(src, 0x2000000, 0x956d);
iga_u16_decode(src, 0x2000000, 0x3d17);
igs036_decryptor decrypter(kov3_key);
decrypter.decrypter_rom(memregion("user1"));
pgm_create_dummy_internal_arm_region();
}

View File

@ -63,6 +63,16 @@ 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();
for (int i = 0; i < size / 2; i++)
{
rom[i] = decrypt(rom[i], i);
}
}
UINT16 igs036_decryptor::decrypt(UINT16 cipherword, int word_address)const
{
// key-independent manipulation

View File

@ -7,6 +7,7 @@ class igs036_decryptor
{
public:
igs036_decryptor(const UINT16* game_key);
void decrypter_rom(memory_region* region);
UINT16 decrypt(UINT16 cipherword, int word_address)const;
UINT16 deobfuscate(UINT16 cipherword, int word_address)const;