diff options
author | 2019-09-10 05:20:41 +0200 | |
---|---|---|
committer | 2019-09-10 05:20:41 +0200 | |
commit | 6fc14b90edf76c6fff6d0d4ab43586b6e824a5c8 (patch) | |
tree | f02c8b855a48bf30cf75cbf02280e0d10d8a7988 | |
parent | 2c485b158c1c1ccb9434ab6ec4148244dfae586e (diff) |
igspoker.cpp: Workaround to fix the random locks for protection
in the sets cpoker, cpokert and cpokerx. Also fixes MT03635.
[Roberto Fresca]
-rw-r--r-- | src/mame/drivers/igspoker.cpp | 78 |
1 files changed, 74 insertions, 4 deletions
diff --git a/src/mame/drivers/igspoker.cpp b/src/mame/drivers/igspoker.cpp index 661898dcd9a..6993004728d 100644 --- a/src/mame/drivers/igspoker.cpp +++ b/src/mame/drivers/igspoker.cpp @@ -62,6 +62,11 @@ FIX: csk227it has video issues, as after Ability game, bg_tilemap is not reset FIX: PK Tetris have an input named AMUSE which I couldn't map. Maybe it is necessary for the Amuse game, because I can't understand how to play it. +TODO: + +- Sets cpoker & cpokert spit 660K of whatever they have in the hopper when keyout... +- Check if the cpoker sets lock randomly due to protection. + *****************************************************************************/ #include "emu.h" @@ -110,6 +115,7 @@ public: void init_pktet346(); void init_tet341(); void init_cpokert(); + void init_cpoker101(); void init_chleague(); void init_cska(); void init_cpoker(); @@ -2102,6 +2108,25 @@ void igspoker_state::init_cpoker() if ((A & 0x0282) == 0x0282) rom[A] ^= 0x01; if ((A & 0x0940) == 0x0940) rom[A] ^= 0x02; } + +/* Patch to avoid traps at $0eed and $206e + that run subs in RAM, operate registers, + and finally lock the game at $72c2. + + All these are triggered if RAM contents of $ff18 + matches the $ff19 (normally 0x20 due to an AND + against the $ff1b contents) +*/ +// this NOP the $0eed call... + rom[0x214a] = 0x00; + rom[0x214b] = 0x00; + rom[0x214c] = 0x00; + +// this NOP the conditional jump to $206e + rom[0x214d] = 0x00; + rom[0x214e] = 0x00; + rom[0x214f] = 0x00; + } void igspoker_state::init_cpoker300us() @@ -2116,7 +2141,52 @@ void igspoker_state::init_cpoker300us() } } -void igspoker_state::init_cpokert() +void igspoker_state::init_cpokert() // same decryption as cpokert +{ + uint8_t *rom = memregion("maincpu")->base(); + /* decrypt the program ROM */ + for (int i = 0; i < 0x10000; i++) + { + if((i & 0x200) && (i & 0x80)) + { + rom[i] ^= ((~i & 2) >> 1); + } + else + { + rom[i] ^= 0x01; + } + + if((i & 0x30) != 0x10) + { + rom[i] ^= 0x20; + } + + if((i & 0x900) == 0x900 && ((i & 0xc0) == 0x40 || (i & 0xc0) == 0xc0)) + { + rom[i] ^= 0x02; + } + } + +/* Patch to avoid traps at $0eed and $206e + that run subs in RAM, operate registers, + and finally lock the game at $72c2. + + All these are triggered if RAM contents of $ff18 + matches the $ff19 (normally 0x20 due to an AND + against the $ff1b contents) +*/ +// this NOP the $0eed call... + rom[0x214a] = 0x00; + rom[0x214b] = 0x00; + rom[0x214c] = 0x00; + +// this NOP the conditional jump to $206e + rom[0x214d] = 0x00; + rom[0x214e] = 0x00; + rom[0x214f] = 0x00; +} + +void igspoker_state::init_cpoker101() // same decryption as cpokert { uint8_t *rom = memregion("maincpu")->base(); /* decrypt the program ROM */ @@ -2933,9 +3003,9 @@ void igspoker_state::init_kungfu() GAMEL( 1993?,cpoker, 0, igspoker, cpoker, igspoker_state, init_cpoker, ROT0, "IGS", "Champion Poker (v220I)", 0, layout_igspoker ) GAMEL( 1993?,cpokert, cpoker, igspoker, cpoker, igspoker_state, init_cpokert, ROT0, "IGS (Tuning license)", "Champion Poker (v200G)", 0, layout_igspoker ) GAMEL( 1993, cpokerx, cpoker, igspoker, cpokerx, igspoker_state, init_cpokert, ROT0, "IGS", "Champion Poker (v100)", 0, layout_igspoker ) -GAMEL( 1993, cpoker101, cpoker, igspoker, cpokerx, igspoker_state, init_cpokert, ROT0, "IGS", "Champion Poker (v101)", MACHINE_NOT_WORKING, layout_igspoker ) // need to verify protection handling and inputs/outputs -GAMEL( 1993, cpoker201f, cpoker, igspoker, cpokerx, igspoker_state, init_cpokert, ROT0, "IGS", "Champion Poker (v201F)", MACHINE_NOT_WORKING, layout_igspoker ) // " -GAMEL( 1993, cpoker210ks, cpoker, igspoker, cpokerx, igspoker_state, init_cpokert, ROT0, "IGS", "Champion Poker (v210KS)", MACHINE_NOT_WORKING, layout_igspoker ) // " +GAMEL( 1993, cpoker101, cpoker, igspoker, cpokerx, igspoker_state, init_cpoker101, ROT0, "IGS", "Champion Poker (v101)", MACHINE_NOT_WORKING, layout_igspoker ) // need to verify protection handling and inputs/outputs +GAMEL( 1993, cpoker201f, cpoker, igspoker, cpokerx, igspoker_state, init_cpoker101, ROT0, "IGS", "Champion Poker (v201F)", MACHINE_NOT_WORKING, layout_igspoker ) // " +GAMEL( 1993, cpoker210ks, cpoker, igspoker, cpokerx, igspoker_state, init_cpoker101, ROT0, "IGS", "Champion Poker (v210KS)", MACHINE_NOT_WORKING, layout_igspoker ) // " GAMEL( 1993, cpoker300us, cpoker, igspoker, cpoker, igspoker_state, init_cpoker300us, ROT0, "IGS", "Champion Poker (v300US)", MACHINE_NOT_WORKING, layout_igspoker ) // " GAMEL( 2000, chleague, 0, igspoker, chleague, igspoker_state, init_chleague, ROT0, "IGS", "Champion League (v220I, Poker)", 0, layout_igspoker ) |