Merge pull request #2869 from DavidHaywood/251117

new NOT WORKING
This commit is contained in:
MetalliC 2017-11-30 06:08:46 +02:00 committed by GitHub
commit 7c314ec44d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 122 additions and 106 deletions

View File

@ -29,7 +29,7 @@
The platform has since been superseded by PGM3, see pgm3.cpp
Oriental Legend 2
The King of Fighters '98 - Ultimate Match - Hero (NOT DUMPED)
The King of Fighters '98 - Ultimate Match - Hero
Knights of Valour 2 New Legend
Dodonpachi Daioujou Tamashii
Knights of Valour 3
@ -93,7 +93,7 @@ static ADDRESS_MAP_START( pgm2_map, AS_PROGRAM, 32, pgm2_state )
AM_RANGE(0x03900000, 0x03900003) AM_READ_PORT("INPUTS0")
AM_RANGE(0x03a00000, 0x03a00003) AM_READ_PORT("INPUTS1")
AM_RANGE(0x10000000, 0x107fffff) AM_ROM AM_REGION("user1", 0) // external ROM
AM_RANGE(0x10000000, 0x10ffffff) AM_ROM AM_REGION("user1", 0) // external ROM
AM_RANGE(0x20000000, 0x2007ffff) AM_RAM AM_SHARE("mainram")
AM_RANGE(0x30000000, 0x30001fff) AM_RAM AM_SHARE("sp_videoram") // spriteram ('move' ram in test mode)
@ -279,87 +279,6 @@ static GFXDECODE_START( pgm2_bg )
GFXDECODE_ENTRY( "bgtile", 0, tiles32x32x8_layout, 0, 0x2000/4/0x80 )
GFXDECODE_END
void pgm2_state::pgm_create_dummy_internal_arm_region()
{
uint16_t *temp16 = (uint16_t *)memregion("maincpu")->base();
int i;
for (i = 0;i < 0x4000 / 2;i += 2)
{
temp16[i] = 0xFFFE;
temp16[i + 1] = 0xEAFF;
}
int base = 0;
int addr = 0x10000000;
// just do a jump to 0x10000000 because that looks possibly correct.
// we probably should be setting up stack and other things too, but we
// don't really know that info yet.
temp16[(base) / 2] = 0x0004; base += 2;
temp16[(base) / 2] = 0xe59f; base += 2;
temp16[(base) / 2] = 0x0000; base += 2;
temp16[(base) / 2] = 0xe590; base += 2;
temp16[(base) / 2] = 0xff10; base += 2;
temp16[(base) / 2] = 0xe12f; base += 2;
temp16[(base) / 2] = 0x0010; base += 2;
temp16[(base) / 2] = 0x0000; base += 2;
temp16[(base) / 2] = addr & 0xffff; base += 2;
temp16[(base) / 2] = (addr >> 16) & 0xffff; base += 2;
/* debug code to find jumps to the internal ROM and put jumps back to where we came from in the internal ROM space */
uint16_t *gamerom = (uint16_t *)memregion("user1")->base();
int gameromlen = memregion("user1")->bytes() / 2;
for (int i = 0;i < gameromlen - 3;i++)
{
uint16_t val1 = gamerom[i];
uint16_t val2 = gamerom[i + 1];
if ((val1 == 0xF004) && (val2 == 0xe51f))
{
uint16_t val3 = gamerom[i + 2];
uint16_t val4 = gamerom[i + 3];
uint32_t jump = (val4 << 16) | val3;
if (jump < 0x10000000) // jumps to internal ROM
{
logerror("internal ROM jump found at %08x (jump is %08x)", i * 2, jump);
if (jump & 1)
{
logerror(" (To THUMB)");
jump &= ~1;
// put a BX R14 there
temp16[(jump / 2)] = 0x4770;
}
else
{
// put a BX R14 there
temp16[(jump / 2)] = 0xFF1E;
temp16[(jump / 2) + 1] = 0xE12F;
}
logerror("\n");
}
else if (jump < 0x20000000) // jumps to RAM
{
logerror("RAM jump found at %08x (jump is %08x)", i * 2, jump);
if (jump & 1) logerror(" (To THUMB)");
logerror("\n");
}
else // anything else is to ROM
{
logerror("ROM jump found at %08x (jump is %08x)", i * 2, jump);
if (jump & 1) logerror(" (To THUMB)");
logerror("\n");
}
}
}
}
static MACHINE_CONFIG_START( pgm2 )
/* basic machine hardware */
@ -431,20 +350,20 @@ MACHINE_CONFIG_END
ROM_LOAD( "xyj2_nvram", 0x00000000, 0x10000, CRC(ccccc71c) SHA1(585b5ccbf89dd28d8532da785d7c8af12f31c6d6) )
#define ORLEG2_PROGRAM_104 \
ROM_REGION( 0x800000, "user1", 0 ) \
ROM_REGION( 0x1000000, "user1", 0 ) \
ROM_LOAD( "xyj2_v104cn.u7", 0x00000000, 0x0800000, CRC(7c24a4f5) SHA1(3cd9f9264ef2aad0869afdf096e88eb8d74b2570) )
#define ORLEG2_PROGRAM_103 \
ROM_REGION( 0x800000, "user1", 0 ) \
ROM_REGION( 0x1000000, "user1", 0 ) \
ROM_LOAD( "xyj2_v103cn.u7", 0x000000, 0x800000, CRC(21c1fae8) SHA1(36eeb7a5e8dc8ee7c834f3ff1173c28cf6c2f1a3) )
#define ORLEG2_PROGRAM_101 \
ROM_REGION( 0x800000, "user1", 0 ) \
ROM_REGION( 0x1000000, "user1", 0 ) \
ROM_LOAD( "xyj2_v101cn.u7", 0x000000, 0x800000, CRC(45805b53) SHA1(f2a8399c821b75fadc53e914f6f318707e70787c) )
#define ORLEG2_INTERNAL_CHINA \
ROM_REGION( 0x04000, "maincpu", 0 ) \
/* offset 3cb8 of the internal rom controls the region, however only China is dumped at the moment and it appears Overseas and Japan at least need different external ROMs or will crash later in game */ \
/* Offset 3cb8 of the internal rom controls the region, however only China is dumped at the moment. Overseas (English) external ROM is confirmed to match (with FA rom label extensions) but th Internal rom might differ by more than the region byte so needs dumping */ \
ROM_LOAD( "xyj2_igs036_china.rom", 0x00000000, 0x0004000, CRC(bcce7641) SHA1(c3b5cf6e9f6eae09b6785314777a52b34c3c7657) )
ROM_START( orleg2 )
@ -490,15 +409,15 @@ ROM_END
ROM_LOAD("gsyx_nvram", 0x00000000, 0x10000, CRC(22400c16) SHA1(f775a16299c30f2ce23d683161b910e06eff37c1) )
#define KOV2NL_PROGRAM_302 \
ROM_REGION( 0x800000, "user1", 0 ) \
ROM_REGION( 0x1000000, "user1", 0 ) \
ROM_LOAD("gsyx_v302cn.u7", 0x00000000, 0x0800000, CRC(b19cf540) SHA1(25da5804bbfd7ef2cdf5cc5aabaa803d18b98929) )
#define KOV2NL_PROGRAM_301 \
ROM_REGION( 0x800000, "user1", 0 ) \
ROM_REGION( 0x1000000, "user1", 0 ) \
ROM_LOAD("gsyx_v301cn.u7", 0x000000, 0x800000, CRC(c4595c2c) SHA1(09e379556ef76f81a63664f46d3f1415b315f384) )
#define KOV2NL_PROGRAM_300 \
ROM_REGION( 0x800000, "user1", 0 ) \
ROM_REGION( 0x1000000, "user1", 0 ) \
ROM_LOAD("gsyx_v300tw.u7", 0x000000, 0x800000, CRC(08da7552) SHA1(303b97d7694405474c8133a259303ccb49db48b1) )
#define KOV2NL_INTERNAL_CHINA \
@ -546,9 +465,9 @@ ROM_END
ROM_START( ddpdojh )
ROM_REGION( 0x04000, "maincpu", 0 )
ROM_LOAD( "ddpdoj_igs036.rom", 0x00000000, 0x0004000, NO_DUMP )
ROM_LOAD( "ddpdoj_igs036.rom", 0x00000000, 0x0004000, NO_DUMP ) // CRC(5db91464) SHA1(723d8086285805bd815e62120dfa9a4269bcd932)
ROM_REGION( 0x800000, "user1", 0 )
ROM_REGION( 0x1000000, "user1", 0 )
ROM_LOAD( "ddpdoj_v201cn.u4", 0x00000000, 0x0200000, CRC(89e4b760) SHA1(9fad1309da31d12a413731b416a8bbfdb304ed9e) )
DDPDOJH_VIDEO_SOUND_ROMS
@ -584,9 +503,9 @@ ROM_END
ROM_START( kov3 )
ROM_REGION( 0x04000, "maincpu", 0 )
ROM_LOAD( "kov3_igs036.rom", 0x00000000, 0x0004000, NO_DUMP )
ROM_LOAD( "kov3_igs036.rom", 0x00000000, 0x0004000, NO_DUMP ) // CRC(c7d33764) SHA1(5cd48f876e637d60391d39ac6e40bf243300cc75)
ROM_REGION( 0x800000, "user1", 0 )
ROM_REGION( 0x1000000, "user1", 0 )
ROM_LOAD( "kov3_v104cn_raw.bin", 0x00000000, 0x0800000, CRC(1b5cbd24) SHA1(6471d4842a08f404420dea2bd1c8b88798c80fd5) )
KOV3_VIDEO_SOUND_ROMS
@ -596,7 +515,7 @@ ROM_START( kov3_102 )
ROM_REGION( 0x04000, "maincpu", 0 )
ROM_LOAD( "kov3_igs036.rom", 0x00000000, 0x0004000, NO_DUMP )
ROM_REGION( 0x800000, "user1", 0 )
ROM_REGION( 0x1000000, "user1", 0 )
ROM_LOAD( "kov3_v102cn_raw.bin", 0x00000000, 0x0800000, CRC(61d0dabd) SHA1(959b22ef4e342ca39c2386549ac7274f9d580ab8) )
KOV3_VIDEO_SOUND_ROMS
@ -606,12 +525,54 @@ ROM_START( kov3_100 )
ROM_REGION( 0x04000, "maincpu", 0 )
ROM_LOAD( "kov3_igs036.rom", 0x00000000, 0x0004000, NO_DUMP )
ROM_REGION( 0x800000, "user1", 0 )
ROM_REGION( 0x1000000, "user1", 0 )
ROM_LOAD( "kov3_v100cn_raw.bin", 0x00000000, 0x0800000, CRC(93bca924) SHA1(ecaf2c4676eb3d9f5e4fdbd9388be41e51afa0e4) )
KOV3_VIDEO_SOUND_ROMS
ROM_END
/* King of Fighters '98: Ultimate Match HERO
device types were as follows
kof98umh_v100cn.u4 SAMSUNG K8Q2815UQB
ig-d3_text.u1 cFeon EN29LV160AB
all others: SPANSION S99-50070
*/
#define KOF98UMH_VIDEO_SOUND_ROMS \
ROM_REGION( 0x200000, "tiles", ROMREGION_ERASEFF ) \
ROM_LOAD( "ig-d3_text.u1", 0x00000000, 0x0200000, CRC(9a0ea82e) SHA1(7844fd7e46c3fbb2164060f160da528254fd177e) ) \
\
ROM_REGION( 0x2000000, "bgtile", ROMREGION_ERASEFF ) \
/* bgl/bgh unpopulated (no background tilemap) */ \
\
ROM_REGION( 0x08000000, "sprites_mask", 0 ) /* 1bpp sprite mask data */ \
ROM_LOAD32_WORD( "ig-d3_mapl0.u13", 0x00000000, 0x4000000, CRC(5571d63e) SHA1(dad73797a35738013d82e3b8ca96fa001ec56f69) ) \
ROM_LOAD32_WORD( "ig-d3_maph0.u15", 0x00000002, 0x4000000, CRC(0da7b1b8) SHA1(87741242bd827eca3788b490df6dcb65f7a89733) ) \
\
ROM_REGION( 0x20000000, "sprites_colour", 0 ) /* sprite colour data - some byte are 0x40 or even 0xff, but verified on 2 boards */ \
ROM_LOAD32_WORD( "ig-d3_spa0.u9", 0x00000000, 0x4000000, CRC(cfef8f7d) SHA1(54f58d1b9eb7d2e4bbe13fbdfd98f5b14ce2086b) ) \
ROM_LOAD32_WORD( "ig-d3_spb0.u18", 0x00000002, 0x4000000, CRC(f199d5c8) SHA1(91f5e8efd1f6a9e5aada51afdf5a8f52bac24185) ) \
/* spa1/spb1 unpopulated */ \
ROM_LOAD32_WORD( "ig-d3_spa2.u10", 0x10000000, 0x4000000, CRC(03bfd35c) SHA1(814998cd5ee01c9da775b73f7a0ba4216fe4970e) ) \
ROM_LOAD32_WORD( "ig-d3_spb2.u20", 0x10000002, 0x4000000, CRC(9aaa840b) SHA1(3c6078d53bb5eca5c501540214287dd102102ea1) ) \
/* spa3/spb3 unpopulated */ \
\
ROM_REGION( 0x08000000, "ymz774", ROMREGION_ERASEFF ) /* ymz770 */ \
ROM_LOAD16_WORD_SWAP( "ig-d3_wave0.u12", 0x00000000, 0x4000000, CRC(edf2332d) SHA1(7e01c7e03e515814d7de117c265c3668d32842fa) ) \
ROM_LOAD16_WORD_SWAP( "ig-d3_wave1.u11", 0x04000000, 0x4000000, CRC(62321b20) SHA1(a388c8a2489430fbe92fb26b3ef81c66ce97f318) )
ROM_START( kof98umh )
ROM_REGION( 0x04000, "maincpu", 0 )
ROM_LOAD( "kof98uhm_igs036.rom", 0x00000000, 0x0004000, NO_DUMP ) // CRC(3ed2e50f) SHA1(35310045d375d9dda36c325e35257123a7b5b8c7)
ROM_REGION( 0x1000000, "user1", 0 )
ROM_LOAD( "kof98umh_v100cn.u4", 0x00000000, 0x1000000, CRC(2ea91e3b) SHA1(5a586bb99cc4f1b02e0db462d5aff721512e0640) )
KOF98UMH_VIDEO_SOUND_ROMS
ROM_END
static void iga_u16_decode(uint16_t *rom, int len, int ixor)
{
@ -783,26 +744,28 @@ DRIVER_INIT_MEMBER(pgm2_state,ddpdojh)
{
uint16_t *src = (uint16_t *)memregion("sprites_mask")->base();
iga_u12_decode(src, 0x800000, 0x1e96);
iga_u16_decode(src, 0x800000, 0x869c);
iga_u12_decode(src, 0x1000000, 0x1e96);
iga_u16_decode(src, 0x1000000, 0x869c);
src = (uint16_t *)memregion("sprites_colour")->base();
sprite_colour_decode(src, 0x2000000);
igs036_decryptor decrypter(ddpdoj_key);
decrypter.decrypter_rom(memregion("user1"));
pgm_create_dummy_internal_arm_region();
}
DRIVER_INIT_MEMBER(pgm2_state,kov3)
{
uint16_t *src = (uint16_t *)memregion("sprites_mask")->base();
iga_u12_decode(src, 0x2000000, 0x956d);
iga_u16_decode(src, 0x2000000, 0x3d17);
iga_u12_decode(src, 0x4000000, 0x956d);
iga_u16_decode(src, 0x4000000, 0x3d17);
src = (uint16_t *)memregion("sprites_colour")->base();
sprite_colour_decode(src, 0x8000000);
igs036_decryptor decrypter(kov3_key);
decrypter.decrypter_rom(memregion("user1"));
pgm_create_dummy_internal_arm_region();
}
void pgm2_state::decrypt_kov3_module(uint32_t addrxor, uint16_t dataxor)
@ -836,6 +799,19 @@ DRIVER_INIT_MEMBER(pgm2_state, kov3_100)
DRIVER_INIT_CALL(kov3);
}
DRIVER_INIT_MEMBER(pgm2_state,kof98umh)
{
uint16_t *src = (uint16_t *)memregion("sprites_mask")->base();
iga_u12_decode(src, 0x08000000, 0x1e96); // wrong
iga_u16_decode(src, 0x08000000, 0x869c); // wrong
src = (uint16_t *)memregion("sprites_colour")->base();
sprite_colour_decode(src, 0x20000000);
igs036_decryptor decrypter(kof98umh_key);
decrypter.decrypter_rom(memregion("user1"));
}
/* PGM2 */
@ -857,7 +833,8 @@ GAME( 2011, kov3, 0, pgm2, pgm2, pgm2_state, kov3_104, ROT0,
GAME( 2011, kov3_102, kov3, pgm2, pgm2, pgm2_state, kov3_102, ROT0, "IGS", "Knights of Valour 3 (V102, China)", MACHINE_NOT_WORKING )
GAME( 2011, kov3_100, kov3, pgm2, pgm2, pgm2_state, kov3_100, ROT0, "IGS", "Knights of Valour 3 (V100, China)", MACHINE_NOT_WORKING )
// The King of Fighters '98 - Ultimate Match - Hero
// King of Fighters '98: Ultimate Match Hero
GAME( 2009, kof98umh, 0, pgm2, pgm2, pgm2_state, kof98umh, ROT0, "IGS / SNK Playmore / NewChannel", "The King of Fighters '98: Ultimate Match HERO (China, V100, 09-08-23)", MACHINE_NOT_WORKING )
// Jigsaw World Arena

View File

@ -55,6 +55,7 @@ public:
DECLARE_DRIVER_INIT(kov3_104);
DECLARE_DRIVER_INIT(kov3_102);
DECLARE_DRIVER_INIT(kov3_100);
DECLARE_DRIVER_INIT(kof98umh);
uint32_t screen_update_pgm2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(screen_vblank_pgm2);
@ -71,7 +72,6 @@ private:
TILE_GET_INFO_MEMBER(get_fg_tile_info);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
void pgm_create_dummy_internal_arm_region();
void decrypt_kov3_module(uint32_t addrxor, uint16_t dataxor);
tilemap_t *m_fg_tilemap;

View File

@ -487,3 +487,40 @@ const uint16_t ddpdoj_key[0x100] = {
0xd1d0, 0x9193, 0xc1e0, 0xc9c1, 0x0014, 0x0830, 0x4050, 0x4961,
0x103a, 0xc9e9, 0x1118, 0x1111, 0x404e, 0x8898, 0x0024, 0x0020,
};
// WRONG
const uint16_t kof98umh_key[0x100] = {
0x9202, 0x0000, 0x0220, 0x3b01, 0x2004, 0x00a0, 0x0000, 0x0905,
0x830a, 0x8000, 0x8228, 0xa20a, 0x8206, 0x0000, 0x0020, 0x8808,
0x9212, 0x0800, 0x0000, 0x0301, 0x0020, 0x0a02, 0x0000, 0x0105,
0x020a, 0x0000, 0x0000, 0x1111, 0x021a, 0x0121, 0x0000, 0x8111,
0x8020, 0x0802, 0xb120, 0xb901, 0x8326, 0x0800, 0x0000, 0xa101,
0x922a, 0x0000, 0x1200, 0x9022, 0x0128, 0x0800, 0x0020, 0xaa0c,
0x0202, 0x0800, 0x8000, 0x1b31, 0x8024, 0x8804, 0x0000, 0x8111,
0x8120, 0x8000, 0x0080, 0x9030, 0x032e, 0x083c, 0x0000, 0x893d,
0xe342, 0x0800, 0x0120, 0x7b41, 0xa000, 0x00a0, 0x0000, 0x4141,
0x130a, 0x0000, 0x8320, 0xdb49, 0x010c, 0x0000, 0x0020, 0xc84c,
0x0202, 0x0000, 0x0000, 0x1911, 0x0014, 0x0b13, 0x0000, 0x8a10,
0x434a, 0x0020, 0x0000, 0x5250, 0xc050, 0x0034, 0x0000, 0xc355,
0x7242, 0x0002, 0x9000, 0xcb61, 0x8120, 0x0020, 0x0000, 0x0921,
0x4068, 0x0000, 0x6068, 0x922a, 0xc36e, 0x0020, 0x0020, 0x280c,
0x0322, 0x0800, 0x8020, 0x9810, 0xc060, 0x4b73, 0x0000, 0x4870,
0xd050, 0x0020, 0x0000, 0x1b39, 0xc26e, 0x0121, 0x0000, 0x4375,
0x2202, 0x0000, 0x0120, 0xb0a0, 0x2202, 0x2020, 0x2000, 0x8280,
0x838a, 0x0080, 0x81a0, 0xb082, 0x2004, 0x0000, 0x0020, 0xa385,
0x8080, 0x0080, 0x0000, 0x9191, 0x80a0, 0x0004, 0x0000, 0x8280,
0x9098, 0x0020, 0x0080, 0x0808, 0x030e, 0x0337, 0x0000, 0x8290,
0xb382, 0x0002, 0x0000, 0x1220, 0x2004, 0x0000, 0x0080, 0x2301,
0x81a8, 0x0000, 0x0228, 0x1121, 0x230a, 0x2000, 0x0000, 0x80a0,
0x1232, 0x0020, 0x0020, 0x9b91, 0x0114, 0x8185, 0x0080, 0x0010,
0x82aa, 0x0000, 0x0080, 0x98b8, 0x0226, 0x0a2e, 0x0000, 0x80b4,
0x1100, 0x0000, 0xa1a0, 0xf2e0, 0x6144, 0x0020, 0x0000, 0x4145,
0x1108, 0x0000, 0xb280, 0x9a8a, 0xa084, 0x0000, 0x0020, 0x4044,
0x9190, 0x0000, 0x0000, 0x0a00, 0x4266, 0x0814, 0x0080, 0x8b91,
0x434a, 0x00a0, 0x0080, 0x0808, 0x4352, 0x83a3, 0x0000, 0xc3c5,
0x3302, 0x0002, 0xd1c0, 0xf3c1, 0xa080, 0x00a0, 0x0000, 0x0b25,
0x0128, 0x0000, 0xb288, 0x3b09, 0x200c, 0x2000, 0x0020, 0xeac8,
0xd1f0, 0x0000, 0x0020, 0x83a1, 0xc3f2, 0xc8d0, 0x0000, 0x8b91,
0x5272, 0x0080, 0x0000, 0x0b29, 0x4376, 0x0828, 0x0000, 0x8ab8,
};

View File

@ -32,5 +32,6 @@ extern const uint16_t cjdh2_key[0x100];
extern const uint16_t kov3_key[0x100];
extern const uint16_t kov2_key[0x100];
extern const uint16_t ddpdoj_key[0x100];
extern const uint16_t kof98umh_key[0x100];
#endif

View File

@ -31285,6 +31285,7 @@ kov3_100 //
orleg2 // (c) 2007
orleg2_103 //
orleg2_101 //
kof98umh // (c) 2009
@source:pgm3.cpp
kov3hd