diff options
| author | 2012-05-06 02:57:11 +0000 | |
|---|---|---|
| committer | 2012-05-06 02:57:11 +0000 | |
| commit | cfe5e0c5f15ade141a13435e04e9fdd805578ec6 (patch) | |
| tree | d9471a1455cd1b9fcf45f7ecf02275b3ab3fce89 /src | |
| parent | 129a27ad382dd2346a41aedb596f0cda0d4e4f93 (diff) | |
Added basic protection simulation for Battle Emporer, allowing for gameplay to the end. [David Haywood]
New games added or promoted from NOT_WORKING status
---------------------------------------------------
Jue Zhan Tian Huang/Battle Emporer [Yohji, Mr. CAST, B. Stahl, Smitdogg, The Dumping Union, David Haywood]
Diffstat (limited to 'src')
| -rw-r--r-- | src/mame/drivers/puckpkmn.c | 7 | ||||
| -rw-r--r-- | src/mame/includes/megadriv.h | 78 |
2 files changed, 82 insertions, 3 deletions
diff --git a/src/mame/drivers/puckpkmn.c b/src/mame/drivers/puckpkmn.c index 7d707c3a0a0..4e2e17fb9b8 100644 --- a/src/mame/drivers/puckpkmn.c +++ b/src/mame/drivers/puckpkmn.c @@ -247,7 +247,6 @@ static ADDRESS_MAP_START( batlemp_map, AS_PROGRAM, 16, md_boot_state ) AM_RANGE(0xa04000, 0xa04003) AM_DEVREADWRITE8_LEGACY("ymsnd", megadriv_68k_YM2612_read, megadriv_68k_YM2612_write, 0xffff) AM_RANGE(0xc00000, 0xc0001f) AM_READWRITE_LEGACY(megadriv_vdp_r, megadriv_vdp_w) - AM_RANGE(0x000000, 0x00001f) AM_WRITE_LEGACY(megadriv_vdp_w) // vdp writes mirrored at 0, or is there some unhandled protection?? AM_RANGE(0xe00000, 0xe0ffff) AM_RAM AM_MIRROR(0x1f0000) AM_BASE_LEGACY(&megadrive_ram) @@ -255,6 +254,10 @@ static ADDRESS_MAP_START( batlemp_map, AS_PROGRAM, 16, md_boot_state ) AM_RANGE(0xA11100, 0xA11101) AM_NOP + AM_RANGE(0x710000, 0x710001) AM_READWRITE(bl_710000_r,bl_710000_w) // protection, will erase the VDP address causing writes to 0 unless this returns 0xe + + + ADDRESS_MAP_END @@ -477,4 +480,4 @@ ROM_END /* Genie Hardware (uses Genesis VDP) also has 'Sun Mixing Co' put into tile ram */ GAME( 2000, puckpkmn, 0, puckpkmn, puckpkmn, puckpkmn, ROT0, "Genie", "Puckman Pockimon (set 1)", 0 ) GAME( 2000, puckpkmna,puckpkmn, puckpkmna, puckpkmn, puckpkmn, ROT0, "IBS", "Puckman Pockimon (set 2)", 0 ) -GAME( 2000, batlemp, 0, batlemp, batlemp, puckpkmn, ROT0, "<unknown>", "Battle Emporer", GAME_IMPERFECT_SOUND ) +GAME( 2000, batlemp, 0, batlemp, batlemp, puckpkmn, ROT0, "<unknown>", "Jue Zhan Tian Huang/Battle Emporer", GAME_IMPERFECT_SOUND ) diff --git a/src/mame/includes/megadriv.h b/src/mame/includes/megadriv.h index 5eba2a7726c..5e1da8dbf99 100644 --- a/src/mame/includes/megadriv.h +++ b/src/mame/includes/megadriv.h @@ -103,10 +103,86 @@ class md_boot_state : public md_base_state { public: md_boot_state(const machine_config &mconfig, device_type type, const char *tag) - : md_base_state(mconfig, type, tag) { } + : md_base_state(mconfig, type, tag) { m_protcount = 0;} // bootleg specific int m_aladmdb_mcu_port; + + int m_protcount; + + // batlemp protection + DECLARE_WRITE16_MEMBER( bl_710000_w ) + { + int pc = cpu_get_pc(&space.device()); + + logerror("%06x writing to bl_710000_w %04x %04x\n", pc, data, mem_mask); + + // protection value is read from 0x710000 after a series of writes.. and stored at ff0007 + // startup + /* + 059ce0 writing to bl_710000_w ff08 ffff + 059d04 writing to bl_710000_w 000a ffff + 059d04 writing to bl_710000_w 000b ffff + 059d04 writing to bl_710000_w 000c ffff + 059d04 writing to bl_710000_w 000f ffff + 059d1c writing to bl_710000_w ff09 ffff + 059d2a reading from bl_710000_r (wants 0xe) + 059ce0 writing to bl_710000_w ff08 ffff + 059d04 writing to bl_710000_w 000a ffff + 059d04 writing to bl_710000_w 000b ffff + 059d04 writing to bl_710000_w 000c ffff + 059d04 writing to bl_710000_w 000f ffff + 059d1c writing to bl_710000_w ff09 ffff + 059d2a reading from bl_710000_r (wants 0xe) + */ + // before lv stage 3 + /* + 059ce0 writing to bl_710000_w 0008 ffff + 059d04 writing to bl_710000_w 000b ffff + 059d04 writing to bl_710000_w 000f ffff + 059d1c writing to bl_710000_w ff09 ffff + 059d2a reading from bl_710000_r (wants 0x4) + */ + // start level 3 + /* + 059ce0 writing to bl_710000_w ff08 ffff + 059d04 writing to bl_710000_w 000b ffff + 059d04 writing to bl_710000_w 000c ffff + 059d04 writing to bl_710000_w 000e ffff + 059d1c writing to bl_710000_w ff09 ffff + 059d2a reading from bl_710000_r (wants 0x5) + + // after end sequence + 059ce0 writing to bl_710000_w 0008 ffff + 059d04 writing to bl_710000_w 000a ffff + 059d04 writing to bl_710000_w 000b ffff + 059d04 writing to bl_710000_w 000c ffff + 059d04 writing to bl_710000_w 000f ffff + 059d1c writing to bl_710000_w ff09 ffff + 059d2a reading from bl_710000_r (wants 0xe) + + */ + m_protcount++; + + + + } + + + DECLARE_READ16_MEMBER( bl_710000_r ) + { + UINT16 ret; + int pc = cpu_get_pc(&space.device()); + logerror("%06x reading from bl_710000_r\n", pc); + + if (m_protcount==6) { ret = 0xe; } + else if (m_protcount==5) { ret = 0x5; } + else if (m_protcount==4) { ret = 0x4; } + else ret = 0xf; + + m_protcount = 0; + return ret; + } }; class segac2_state : public md_base_state |
