diff --git a/src/mame/drivers/pgm.c b/src/mame/drivers/pgm.c index a5261c62a42..98b35859d1d 100644 --- a/src/mame/drivers/pgm.c +++ b/src/mame/drivers/pgm.c @@ -3921,10 +3921,13 @@ GAME( 1997, orlegendca, orlegend, pgm_asic3, orlegend, pgm_asic3_state, o GAME( 1997, orlegend111c, orlegend, pgm_asic3, orlegend, pgm_asic3_state, orlegend, ROT0, "IGS", "Oriental Legend / Xi You Shi E Zhuan (ver. 111, Chinese Board)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // V0001 no date! - runs as HongKong, China, China GAME( 1997, orlegend105k, orlegend, pgm_asic3, orld105k, pgm_asic3_state, orlegend, ROT0, "IGS", "Oriental Legend / Xi You Shi E Zhuan (ver. 105, Korean Board)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // V0000 no date! - runs as Korea -GAME( 1997, drgw2, pgm, pgm, pgm, pgm_state, drgw2, ROT0, "IGS", "Dragon World II (ver. 110X, Export)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) -GAME( 1997, dw2v100x, drgw2, pgm, pgm, pgm_state, dw2v100x, ROT0, "IGS", "Dragon World II (ver. 100X, Export)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) -GAME( 1997, drgw2j, drgw2, pgm, pgm, pgm_state, drgw2j, ROT0, "IGS", "Chuugokuryuu II (ver. 100J, Japan)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) -GAME( 1997, drgw2c, drgw2, pgm, pgm, pgm_state, drgw2c, ROT0, "IGS", "Zhong Guo Long II (ver. 100C, China)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) +GAME( 1997, drgw2, pgm, pgm_012_025_drgw2, pgm, pgm_012_025_state, drgw2, ROT0, "IGS", "Dragon World II (ver. 110X, Export)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) +GAME( 1997, dw2v100x, drgw2, pgm_012_025_drgw2, pgm, pgm_012_025_state, dw2v100x, ROT0, "IGS", "Dragon World II (ver. 100X, Export)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) +GAME( 1997, drgw2j, drgw2, pgm_012_025_drgw2, pgm, pgm_012_025_state, drgw2j, ROT0, "IGS", "Chuugokuryuu II (ver. 100J, Japan)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) +GAME( 1997, drgw2c, drgw2, pgm_012_025_drgw2, pgm, pgm_012_025_state, drgw2c, ROT0, "IGS", "Zhong Guo Long II (ver. 100C, China)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) + +GAME( 1998, killbld, pgm, pgm_022_025_kb, killbld, pgm_022_025_state, killbld, ROT0, "IGS", "The Killing Blade (ver. 109, Chinese Board)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) /* region provided by protection device */ +GAME( 1998, killbld104, killbld, pgm_022_025_kb, killbld, pgm_022_025_state, killbld, ROT0, "IGS", "The Killing Blade (ver. 104)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) /* region provided by protection device */ // region provided by internal ARM rom GAME( 1999, photoy2k, pgm, pgm_arm_type1, photoy2k, pgm_arm_type1_state, photoy2k, ROT0, "IGS", "Photo Y2K (ver. 105)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) /* region provided by protection device */ @@ -3977,8 +3980,6 @@ GAME( 2001, ddp2101c, ddp2, pgm_arm_type2, pgm, pgm_arm_type2_state, GAME( 2001, ddp2100c, ddp2, pgm_arm_type2, pgm, pgm_arm_type2_state, ddp2, ROT270, "IGS", "DoDonPachi II - Bee Storm (China, ver. 100)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) - - // japan region only? GAME( 2001, dw2001, pgm, pgm_arm_type2, dw2001, pgm_arm_type2_state, dw2001, ROT0, "IGS", "Dragon World 2001 (V100?, Japan)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // 02/21/01 16:05:16 @@ -3993,7 +3994,6 @@ GAME( 2002, dmnfrnta, dmnfrnt, pgm_arm_type3, pgm, pgm_arm_type3_state GAME( 2002, dmnfrntpcb, dmnfrnt, pgm_arm_type3, pgm, pgm_arm_type3_state, dmnfrnt, ROT0, "IGS", "Demon Front (68k label V107KR, ROM M107KR 11/03/03) (ARM label V106KR, ROM 10/16/03 S106KR) (JAMMA PCB)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // works but reports version mismatch (wants internal rom version and region to match external?) - /* these don't use an External ARM rom, and don't have any weak internal functions which would allow the internal ROM to be read out */ GAME( 2002, ddpdoj, 0, pgm_arm_type1_cave, pgm, pgm_arm_type1_state, ddp3, ROT270, "Cave", "DoDonPachi Dai-Ou-Jou V101 (2002.04.05.Master Ver)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // is there a v101 without the . after 05? GAME( 2002, ddpdoja, ddpdoj, pgm_arm_type1_cave, pgm, pgm_arm_type1_state, ddp3, ROT270, "Cave", "DoDonPachi Dai-Ou-Jou V100 (2002.04.05.Master Ver)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) @@ -4012,16 +4012,12 @@ GAME( 2003, espgal, 0, pgm_arm_type1_cave, pgm, pgm_arm_type1_s Partially Working, playable, but some imperfections -----------------------------------------------------------------------------------------------------------------------*/ - // it's playable, but the region check is still patched (different IGS025 chips return different sequences so that the game can determine the region) -GAME( 1998, killbld, pgm, pgm_022_025_kb, killbld, pgm_022_025_state, killbld, ROT0, "IGS", "The Killing Blade (ver. 109, Chinese Board)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) -GAME( 1998, killbld104, killbld, pgm_022_025_kb, killbld, pgm_022_025_state, killbld, ROT0, "IGS", "The Killing Blade (ver. 104)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) - GAME( 1998, olds, pgm, pgm_028_025_ol, olds, pgm_028_025_state, olds, ROT0, "IGS", "Oriental Legend Special / Xi You Shi E Zhuan Super (ver. 101, Korean Board)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) GAME( 1998, olds100, olds, pgm_028_025_ol, olds, pgm_028_025_state, olds, ROT0, "IGS", "Oriental Legend Special / Xi You Shi E Zhuan Super (ver. 100, set 1)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) GAME( 1998, olds100a, olds, pgm_028_025_ol, olds, pgm_028_025_state, olds, ROT0, "IGS", "Oriental Legend Special / Xi You Shi E Zhuan Super (ver. 100, set 2)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // crashes on some bosses, high score table etc. -GAME( 1998, olds103t, olds, pgm, pgm, pgm_state, pgm, ROT0, "IGS", "Oriental Legend Special / Xi You Shi E Zhuan Super (ver. 103, China, Tencent) (unprotected)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // why is this version not protected? internal leak? bootleg? - - +// this version was specially made for a Chinese online gaming company. While it may not be entirely suitable for +// mame, it can give some insight into how protection should work. +GAME( 1998, olds103t, olds, pgm, pgm, pgm_state, pgm, ROT0, "IGS", "Oriental Legend Special / Xi You Shi E Zhuan Super (ver. 103, China, Tencent) (unprotected)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) GAME( 1999, kov, pgm, pgm_arm_type1_sim, sango, pgm_arm_type1_state, kov, ROT0, "IGS", "Knights of Valour / Sangoku Senki (ver. 117)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ // V0008 04/27/99 10:33:33 GAME( 1999, kov115, kov, pgm_arm_type1_sim, sango, pgm_arm_type1_state, kov, ROT0, "IGS", "Knights of Valour / Sangoku Senki (ver. 115)", GAME_IMPERFECT_SOUND | GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ // V0006 02/22/99 11:53:18 diff --git a/src/mame/includes/pgm.h b/src/mame/includes/pgm.h index d92ea4ae36c..a65b4369390 100644 --- a/src/mame/includes/pgm.h +++ b/src/mame/includes/pgm.h @@ -122,19 +122,6 @@ public: void screen_eof_pgm(screen_device &screen, bool state); TIMER_DEVICE_CALLBACK_MEMBER(pgm_interrupt); - // from pgmprot5.c - int protection_address; - - UINT16 dw2_asic_reg[2]; - UINT8 dw2_asic_z; - UINT8 dw2_asic_y; - UINT16 dw2_asic_hold; - - DECLARE_READ16_MEMBER( dw2_d80000_r ); - DECLARE_WRITE16_MEMBER( dw2_d80000_w ); - DECLARE_WRITE16_MEMBER(dw2_unk_w); - void pgm_dw2_decrypt(); - void drgwld2_common_init(); inline void pgm_draw_pix( int xdrawpos, int pri, UINT16* dest, UINT8* destpri, UINT16 srcdat); inline void pgm_draw_pix_nopri( int xdrawpos, UINT16* dest, UINT8* destpri, UINT16 srcdat); inline void pgm_draw_pix_pri( int xdrawpos, UINT16* dest, UINT8* destpri, UINT16 srcdat); @@ -401,6 +388,41 @@ public: DECLARE_READ16_MEMBER( killbld_igs025_prot_r ); }; +/* for machine/pgmprot5.c type games */ +class pgm_012_025_state : public pgm_state +{ +public: + pgm_012_025_state(const machine_config &mconfig, device_type type, const char *tag) + : pgm_state(mconfig, type, tag) { + } + + UINT32 m_drgw2_protection_region; + + const UINT8 (*m_drgw2_source_data)[0xec]; + + UINT16 m_drgw2_prot_hold; + UINT16 m_drgw2_prot_hilo; + UINT16 m_drgw2_prot_hilo_select; + int m_drgw2_cmd; + int m_drgw2_ptr; + + void pgm_drgw2_decrypt(); + void drgw2_common_init(); + + DECLARE_DRIVER_INIT(drgw2); + DECLARE_DRIVER_INIT(dw2v100x); + DECLARE_DRIVER_INIT(drgw2c); + DECLARE_DRIVER_INIT(drgw2j); + + DECLARE_MACHINE_RESET(drgw2); + + DECLARE_READ16_MEMBER( drgw2_d80000_protection_r ); + DECLARE_WRITE16_MEMBER( drgw2_d80000_protection_w ); + + void drgw2_protection_calculate_hilo(); + void drgw2_protection_calculate_hold(int y, int z); +}; + /* for machine/pgmprot6.c type games */ class pgm_028_025_state : public pgm_state { @@ -508,6 +530,10 @@ MACHINE_CONFIG_EXTERN( pgm_022_025_dw ); INPUT_PORTS_EXTERN( killbld ); INPUT_PORTS_EXTERN( dw3 ); +/*----------- defined in machine/pgmprot5.c -----------*/ + +MACHINE_CONFIG_EXTERN( pgm_012_025_drgw2 ); + /*----------- defined in machine/pgmprot6.c -----------*/ MACHINE_CONFIG_EXTERN( pgm_028_025_ol ); diff --git a/src/mame/machine/pgmprot5.c b/src/mame/machine/pgmprot5.c index 8c4e719a269..e008beb9cc9 100644 --- a/src/mame/machine/pgmprot5.c +++ b/src/mame/machine/pgmprot5.c @@ -13,151 +13,22 @@ IGS025 is some kind of state machine / logic device which the game uses for various security checks bitswap checks. - To do: - How is the additional xor data is calculated? - Should the "hold" value be reset if the power is turned off? How? - Patches are actually overlays or just hacks? - ***********************************************************************/ #include "emu.h" #include "includes/pgm.h" - /* Dragon World 2 */ -READ16_MEMBER(pgm_state::dw2_d80000_r ) -{ - UINT16 ret; -/* UINT16 test; - - switch (dw2_asic_reg[0]) - { - case 0x05: // Read to $80eec0 - case 0x13: // Read to $80eeb8 - case 0x1f: // Read to $80eeb8 - case 0x40: // Read to $80eeb8, increase counters - case 0xf4: // Read to $80eeb8 - case 0xf6: // Read to $80eeb8 - case 0xf8: // Read to $80eeb8 - break; - - default: - logerror("%06x: warning, reading with igs003_reg = %02x\n", space.device().safe_pc(), dw2_asic_reg[0]); - } - - test = BITSWAP16(m_mainram[protection_address], 14,11,8,6,4,3,1,0, 5,2,9,7,10,13,12,15) & 0xff; // original hack -*/ - // This bitswap seems to also be common to a few IGS protection devices (igs011.c, Oriental Legend) - ret = BITSWAP16(dw2_asic_hold, 14,11,8,6,4,3,1,0, 5,2,9,7,10,13,12,15) & 0xff; -/* - if ((ret != test) || (dw2_asic_hold != m_mainram[protection_address])) { - logerror ("Protection calculation error: SIMRET: %2.2x, HACKRET: %2.2x, SIMHOLD: %4.4x, REALHOLD: %4.4x\n", ret, test, dw2_asic_hold, m_mainram[protection_address]); - } -*/ - return ret; -} - -WRITE16_MEMBER(pgm_state::dw2_d80000_w ) -{ - COMBINE_DATA(&dw2_asic_reg[offset]); - - if (offset == 0) - return; - - switch (dw2_asic_reg[0]) - { - case 0x08: - // This reg doesn't seem to be used for anything useful but is - // initialized. Ok to use as reset?? - // The last "hold" value used is stored in NVRAM. Otherwise we either - // need to set the "hold" value as non-volatile or wipe NVRAM. - dw2_asic_hold = m_mainram[protection_address]; // hack - break; - - case 0x09: // Used only on init... - case 0x0a: - case 0x0b: - case 0x0c: - break; - - case 0x15: // ???? - case 0x17: - break; - - case 0x20: - case 0x21: - case 0x22: - case 0x23: - case 0x24: - case 0x25: - case 0x26: - case 0x27: - { - // computed ~$107000 - UINT16 old; - - dw2_asic_y = dw2_asic_reg[0] & 0x07; - dw2_asic_z = data; - - // drgw2c = $80eecc, drgw2/dw2v100x = $80cb7c, drgw2j = $8091ca - old = dw2_asic_hold; - - // drgw2c = $80eece, drgw2/dw2v100x = $80cb7e, drgw2j = $8091cc - - // roation, fixed xor, and z/y xor all also common to asic-type protection devices - dw2_asic_hold = old << 1; - dw2_asic_hold |= BIT(old, 15); // rotate - dw2_asic_hold ^= 0x2bad; - dw2_asic_hold ^= BIT(dw2_asic_z, dw2_asic_y); - - dw2_asic_hold ^= BIT( old, 7); - dw2_asic_hold ^= BIT( old, 3) << 11; - dw2_asic_hold ^= BIT(~old, 13) << 4; // inverted! - - /* - // additional... - // how is this calculated? is it ever used?? - // drgw2c = $80eeca, drgw2/dw2v100x = $80cb7a, drgw2j = $809168 - dw2_asic_hold ^= BIT(space.read_byte(0x80eecb), 0) << 1; - dw2_asic_hold ^= BIT(space.read_byte(0x80eecb), 1) << 2; - dw2_asic_hold ^= BIT(space.read_byte(0x80eecb), 2) << 3; - dw2_asic_hold ^= BIT(space.read_byte(0x80eecb), 4) << 5; - dw2_asic_hold ^= BIT(space.read_byte(0x80eecb), 5) << 6; - dw2_asic_hold ^= BIT(space.read_byte(0x80eecb), 6) << 7; - dw2_asic_hold ^= BIT(space.read_byte(0x80eecb), 7) << 8; - dw2_asic_hold ^= BIT(space.read_byte(0x80eeca), 0) << 9; - dw2_asic_hold ^= BIT(space.read_byte(0x80eeca), 1) << 10; - dw2_asic_hold ^= BIT(space.read_byte(0x80eeca), 3) << 12; - dw2_asic_hold ^= BIT(space.read_byte(0x80eeca), 4) << 13; - dw2_asic_hold ^= BIT(space.read_byte(0x80eeca), 5) << 14; - dw2_asic_hold ^= BIT(space.read_byte(0x80eeca), 6) << 15; - */ - } - break; - - case 0xf2: // ???? - break; - - default: - logerror("%06x: warning, writing to igs003_reg %02x = %02x\n", space.device().safe_pc(), dw2_asic_reg[0], data); - } -} - -// What purpose to writes to this region serve? Written, but never read back? Must be related to the protection device? -WRITE16_MEMBER(pgm_state::dw2_unk_w) -{ -// logerror("%06x: warning, writing to address %6.6x = %4.4x\n", space.device().safe_pc(), 0xd00000+(offset*2), data); -} - -void pgm_state::pgm_dw2_decrypt() +void pgm_012_025_state::pgm_drgw2_decrypt() { int i; UINT16 *src = (UINT16 *) (memregion("maincpu")->base()+0x100000); int rom_size = 0x80000; - for (i=0; ispace(AS_PROGRAM).install_read_handler(0xd80000, 0xd80003, read16_delegate(FUNC(pgm_state::dw2_d80000_r),this)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0xd80000, 0xd80003, write16_delegate(FUNC(pgm_state::dw2_d80000_w),this)); - m_maincpu->space(AS_PROGRAM).install_write_handler(0xd00000, 0xd00fff, write16_delegate(FUNC(pgm_state::dw2_unk_w),this)); +void pgm_012_025_state::drgw2_protection_calculate_hold(int y, int z) +{ + unsigned short old = m_drgw2_prot_hold; + + m_drgw2_prot_hold = ((old << 1) | (old >> 15)); + + m_drgw2_prot_hold ^= 0x2bad; + m_drgw2_prot_hold ^= BIT(z, y); + m_drgw2_prot_hold ^= BIT( old, 7) << 0; + m_drgw2_prot_hold ^= BIT(~old, 13) << 4; + m_drgw2_prot_hold ^= BIT( old, 3) << 11; + + m_drgw2_prot_hold ^= (m_drgw2_prot_hilo & ~0x0408) << 1; } -DRIVER_INIT_MEMBER(pgm_state,drgw2) +void pgm_012_025_state::drgw2_protection_calculate_hilo() +{ + UINT8 source; + + m_drgw2_prot_hilo_select++; + if (m_drgw2_prot_hilo_select > 0xeb) { + m_drgw2_prot_hilo_select = 0; + } + + source = m_drgw2_source_data[m_drgw2_protection_region][m_drgw2_prot_hilo_select]; + + if (m_drgw2_prot_hilo_select & 1) + { + m_drgw2_prot_hilo = (m_drgw2_prot_hilo & 0x00ff) | (source << 8); + } + else + { + m_drgw2_prot_hilo = (m_drgw2_prot_hilo & 0xff00) | (source << 0); + } +} + +READ16_MEMBER(pgm_012_025_state::drgw2_d80000_protection_r ) +{ + switch (m_drgw2_cmd) + { + case 0x05: + { + switch (m_drgw2_ptr) + { + case 1: return 0x3f00 | ((m_drgw2_protection_region >> 0) & 0xff); + + case 2: + return 0x3f00 | ((m_drgw2_protection_region >> 8) & 0xff); + + case 3: + return 0x3f00 | ((m_drgw2_protection_region >> 16) & 0xff); + + case 4: + return 0x3f00 | ((m_drgw2_protection_region >> 24) & 0xff); + + case 5: + default: + return 0x3f00 | BITSWAP8(m_drgw2_prot_hold, 5,2,9,7,10,13,12,15); + } + + return 0x3f00; + } + + case 0x40: + drgw2_protection_calculate_hilo(); + return 0; + + // case 0x13: // Read to $80eeb8 + // case 0x1f: // Read to $80eeb8 + // case 0xf4: // Read to $80eeb8 + // case 0xf6: // Read to $80eeb8 + // case 0xf8: // Read to $80eeb8 + // return 0; + + // default: + // logerror("%06x: warning, reading with igs003_reg = %02x\n", space.device().safe_pc(), m_drgw2_cmd); + } + + return 0; +} + +WRITE16_MEMBER(pgm_012_025_state::drgw2_d80000_protection_w ) +{ + if (offset == 0) + { + m_drgw2_cmd = data; + return; + } + + switch (m_drgw2_cmd) + { + case 0x20: + case 0x21: + case 0x22: + case 0x23: + case 0x24: + case 0x25: + case 0x26: + case 0x27: + m_drgw2_ptr++; + drgw2_protection_calculate_hold(m_drgw2_cmd & 0x0f, data & 0xff); + break; + + // case 0x08: // Used only on init.. + // case 0x09: + // case 0x0a: + // case 0x0b: + // case 0x0c: + // break; + + // case 0x15: // ???? + // case 0x17: + // case 0xf2: + // break; + + // default: + // logerror("%06x: warning, writing to igs003_reg %02x = %02x\n", space.device().safe_pc(), m_drgw2_cmd, data); + } +} + +MACHINE_RESET_MEMBER(pgm_012_025_state,drgw2) +{ + MACHINE_RESET_CALL_MEMBER(pgm); + + m_drgw2_cmd = 0; + m_drgw2_ptr = 0; + m_drgw2_prot_hilo = 0; + m_drgw2_prot_hilo_select = 0; + m_drgw2_prot_hold = 0; +} + +void pgm_012_025_state::drgw2_common_init() +{ + m_drgw2_source_data = drgw2_source_data; + + pgm_basic_init(); + pgm_drgw2_decrypt(); + + save_item(NAME(m_drgw2_cmd)); + save_item(NAME(m_drgw2_ptr)); + save_item(NAME(m_drgw2_prot_hilo)); + save_item(NAME(m_drgw2_prot_hilo_select)); + save_item(NAME(m_drgw2_prot_hold)); +} + +static ADDRESS_MAP_START( drgw2_mem, AS_PROGRAM, 16, pgm_012_025_state ) + AM_IMPORT_FROM(pgm_mem) + AM_RANGE(0x100000, 0x1fffff) AM_ROMBANK("bank1") /* Game ROM */ + AM_RANGE(0xd00000, 0xd00fff) AM_NOP // Written, but never read back? Related to the protection device? + AM_RANGE(0xd80000, 0xd80003) AM_READWRITE(drgw2_d80000_protection_r, drgw2_d80000_protection_w) +ADDRESS_MAP_END + +MACHINE_CONFIG_START( pgm_012_025_drgw2, pgm_012_025_state ) + MCFG_FRAGMENT_ADD(pgmbase) + + MCFG_CPU_MODIFY("maincpu") + MCFG_CPU_PROGRAM_MAP(drgw2_mem) + + MCFG_MACHINE_RESET_OVERRIDE(pgm_012_025_state,drgw2) +MACHINE_CONFIG_END + + +DRIVER_INIT_MEMBER(pgm_012_025_state,drgw2) { /* incomplete? */ UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base(); - drgwld2_common_init(); + drgw2_common_init(); - protection_address = 0xcb7e/2; // $80cb7e; + m_drgw2_protection_region = 0x00000006; /* These ROM patches are not hacks, the protection device overlays the normal ROM code, this has been confirmed on a real PCB @@ -197,13 +281,13 @@ DRIVER_INIT_MEMBER(pgm_state,drgw2) mem16[0x1311ce / 2] = 0x4e93; } -DRIVER_INIT_MEMBER(pgm_state,dw2v100x) +DRIVER_INIT_MEMBER(pgm_012_025_state,dw2v100x) { UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base(); - drgwld2_common_init(); + drgw2_common_init(); - protection_address = 0xcb7e/2; // $80cb7e; + m_drgw2_protection_region = 0x00000006; /* These ROM patches are not hacks, the protection device overlays the normal ROM code, this has been confirmed on a real PCB @@ -213,13 +297,13 @@ DRIVER_INIT_MEMBER(pgm_state,dw2v100x) mem16[0x1311ba / 2] = 0x4e93; } -DRIVER_INIT_MEMBER(pgm_state,drgw2c) +DRIVER_INIT_MEMBER(pgm_012_025_state,drgw2c) { UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base(); - drgwld2_common_init(); + drgw2_common_init(); - protection_address = 0xeece/2; // $80eece; + m_drgw2_protection_region = 0x00000005; /* These ROM patches are not hacks, the protection device overlays the normal ROM code, this has been confirmed on a real PCB @@ -229,13 +313,13 @@ DRIVER_INIT_MEMBER(pgm_state,drgw2c) mem16[0x1304f2 / 2] = 0x4e93; } -DRIVER_INIT_MEMBER(pgm_state,drgw2j) +DRIVER_INIT_MEMBER(pgm_012_025_state,drgw2j) { UINT16 *mem16 = (UINT16 *)memregion("maincpu")->base(); - drgwld2_common_init(); + drgw2_common_init(); - protection_address = 0x91cc/2; // $8091cc; + m_drgw2_protection_region = 0x00000001; /* These ROM patches are not hacks, the protection device overlays the normal ROM code, this has been confirmed on a real PCB