diff options
author | Angelo Salese <angelosa@users.noreply.github.com> | 2010-06-15 15:41:15 +0000 |
---|---|---|
committer | Angelo Salese <angelosa@users.noreply.github.com> | 2010-06-15 15:41:15 +0000 |
commit | 19368c8436c8b6a0f393be4e80a9fea821c65db3 (patch) | |
tree | e6637ba7d05c8b6747cb6bb058d85888af7bc37a | |
parent | 09081c7dfde0b85409f2379871b736cfd92fad71 (diff) |
Emulated protection check in Ron Jan [Angelo Salese]
-rw-r--r-- | src/mame/drivers/pinkiri8.c | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/src/mame/drivers/pinkiri8.c b/src/mame/drivers/pinkiri8.c index 27fd36c5669..1ba8baab992 100644 --- a/src/mame/drivers/pinkiri8.c +++ b/src/mame/drivers/pinkiri8.c @@ -246,6 +246,49 @@ ROM_START( ronjan ) ROM_END +static UINT8 prot_read_index; + +static READ8_HANDLER( ronjan_prot_r ) +{ + static const char wing_str[6] = { 'W', 'I', 'N', 'G', '8', '9' }; + + prot_read_index++; + + if(prot_read_index & 1) + return 0xff; //value is discarded + + return wing_str[(prot_read_index >> 1)-1]; +} + +static WRITE8_HANDLER( ronjan_prot_w ) +{ + static UINT8 prot_char[6],prot_index; + + if(data == 0) + { + prot_index = 0; + } + else + { + prot_char[prot_index] = data; + prot_index++; + + if(prot_char[0] == 'E' && prot_char[1] == 'R' && prot_char[2] == 'R' && prot_char[3] == 'O' && prot_char[4] == 'R') + prot_read_index = 0; + } +} + +static READ8_HANDLER( ronjan_prot_status_r ) +{ + return 0; //bit 0 seems a protection status bit +} + +static DRIVER_INIT( ronjan ) +{ + memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x90, 0x90, 0, 0, ronjan_prot_r, ronjan_prot_w); + memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x66, 0x66, 0, 0, ronjan_prot_status_r); +} + GAME( 2005?, pinkiri8, 0, pinkiri8, pinkiri8, 0, ROT0, "Wing Co., Ltd", "Pinkiri 8", GAME_NOT_WORKING| GAME_NO_SOUND ) GAME( 1992, janshi, 0, pinkiri8, pinkiri8, 0, ROT0, "Eagle", "Janshi", GAME_NOT_WORKING | GAME_NO_SOUND ) -GAME( 1996, ronjan, 0, pinkiri8, pinkiri8, 0, ROT0, "Eagle", "Ron Jan", GAME_NOT_WORKING | GAME_NO_SOUND ) +GAME( 1996, ronjan, 0, pinkiri8, pinkiri8, ronjan, ROT0, "Eagle", "Ron Jan", GAME_NOT_WORKING | GAME_NO_SOUND ) |