From 72ba2e3e570544613f999051eb3136ea7fae227d Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Sun, 26 Aug 2012 21:31:48 +0000 Subject: [PATCH] Got the protection to work (still says no slot for whatever reason tho) --- src/emu/machine/rp5h01.c | 22 +++++++++++++++++++++ src/emu/machine/rp5h01.h | 1 + src/mame/drivers/nss.c | 41 +++++++++++++++++++++++++++------------- 3 files changed, 51 insertions(+), 13 deletions(-) diff --git a/src/emu/machine/rp5h01.c b/src/emu/machine/rp5h01.c index 115b040d812..f2e7f5f45cb 100644 --- a/src/emu/machine/rp5h01.c +++ b/src/emu/machine/rp5h01.c @@ -2,6 +2,9 @@ RP5H01 + TODO: + - convert to modern and follow the datasheet better (all dumps + presumably needs to be redone from scratch?) 2009-06 Converted to be a device @@ -88,6 +91,25 @@ WRITE8_DEVICE_HANDLER( rp5h01_reset_w ) rp5h01->old_reset = newstate; } +/*------------------------------------------------- + rp5h01_cs_w +-------------------------------------------------*/ + +WRITE8_DEVICE_HANDLER( rp5h01_cs_w ) +{ + rp5h01_state *rp5h01 = get_safe_token(device); + + /* if it's not enabled, ignore */ + if (!rp5h01->enabled) + return; + + if (data == 1) + { + /* reset the counter */ + rp5h01->counter = 0; + } +} + /*------------------------------------------------- rp5h01_clock_w -------------------------------------------------*/ diff --git a/src/emu/machine/rp5h01.h b/src/emu/machine/rp5h01.h index 6bca1a2250c..78bb2426147 100644 --- a/src/emu/machine/rp5h01.h +++ b/src/emu/machine/rp5h01.h @@ -31,6 +31,7 @@ DECLARE_LEGACY_DEVICE(RP5H01, rp5h01); WRITE8_DEVICE_HANDLER( rp5h01_enable_w ); /* /CE */ WRITE8_DEVICE_HANDLER( rp5h01_reset_w ); /* RESET */ +WRITE8_DEVICE_HANDLER( rp5h01_cs_w ); /* CS */ WRITE8_DEVICE_HANDLER( rp5h01_clock_w ); /* DATA CLOCK (active low) */ WRITE8_DEVICE_HANDLER( rp5h01_test_w ); /* TEST */ READ8_DEVICE_HANDLER( rp5h01_counter_r ); /* COUNTER OUT */ diff --git a/src/mame/drivers/nss.c b/src/mame/drivers/nss.c index af605bc970a..a99b506d467 100644 --- a/src/mame/drivers/nss.c +++ b/src/mame/drivers/nss.c @@ -333,6 +333,8 @@ public: DECLARE_READ8_MEMBER(nss_prot_r); DECLARE_WRITE8_MEMBER(nss_prot_w); DECLARE_WRITE8_MEMBER(eeprom_w); + + DECLARE_DRIVER_INIT(nss); }; UINT32 nss_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect ) @@ -503,7 +505,7 @@ WRITE8_MEMBER(nss_state::nss_prot_w) rp5h01_enable_w(m_rp5h01, 0, 0); rp5h01_test_w(m_rp5h01, 0, data & 0x10); /* D4 */ rp5h01_clock_w(m_rp5h01, 0, data & 0x08); /* D3 */ - rp5h01_reset_w(m_rp5h01, 0, ~data & 0x01); /* D0, check me */ + rp5h01_cs_w(m_rp5h01, 0, ~data & 0x01); rp5h01_enable_w(m_rp5h01, 0, 1); } //ioport("EEPROMOUT")->write(data, 0xff); @@ -1035,18 +1037,31 @@ ROM_START( nss_sten ) ROM_LOAD( "security.prm", 0x000000, 0x000010, NO_DUMP ) ROM_END +DRIVER_INIT_MEMBER(nss_state,nss) +{ + UINT8 *PROM = memregion("rp5h01")->base(); + int i; + UINT8 tmp; + DRIVER_INIT_CALL(snes); + + for(i=0;i<0x10;i++) + { + tmp = BITSWAP8(PROM[i],0,1,2,3,4,5,6,7); + PROM[i] = tmp ^ 0xff; + } +} GAME( 199?, nss, 0, nss, snes, snes_state, snes, ROT0, "Nintendo", "Nintendo Super System BIOS", GAME_IS_BIOS_ROOT ) -GAME( 1992, nss_actr, nss, nss, snes, snes_state, snes, ROT0, "Enix", "Act Raiser (Nintendo Super System)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) // sound sometimes dies, timing issues -GAME( 1992, nss_adam, nss, nss, snes, snes_state, snes, ROT0, "Ocean", "The Addams Family (Nintendo Super System)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) -GAME( 1992, nss_aten, nss, nss, snes, snes_state, snes, ROT0, "Absolute Entertainment Inc.", "David Crane's Amazing Tennis (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) -GAME( 1992, nss_con3, nss, nss, snes, snes_state, snes, ROT0, "Konami", "Contra 3: The Alien Wars (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) -GAME( 1992, nss_lwep, nss, nss, snes, snes_state, snes, ROT0, "Ocean", "Lethal Weapon (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) -GAME( 1992, nss_ncaa, nss, nss, snes, snes_state, snes, ROT0, "Sculptured Software Inc.", "NCAA Basketball (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) -GAME( 1992, nss_rob3, nss, nss, snes, snes_state, snes, ROT0, "Ocean", "Robocop 3 (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // any sprite minus Robocop is missing -GAME( 1992, nss_skin, nss, nss, snes, snes_state, snes, ROT0, "Irem", "Skins Game (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // gfx issue caused by timing at start-up -GAME( 1992, nss_ssoc, nss, nss, snes, snes_state, snes, ROT0, "Human Inc.", "Super Soccer (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) -GAME( 1991, nss_smw, nss, nss, snes, snes_state, snes, ROT0, "Nintendo", "Super Mario World (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) -GAME( 1991, nss_fzer, nss, nss, snes, snes_state, snes, ROT0, "Nintendo", "F-Zero (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) -GAME( 1991, nss_sten, nss, nss, snes, snes_state, snes, ROT0, "Nintendo", "Super Tennis (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) +GAME( 1992, nss_actr, nss, nss, snes, nss_state, nss, ROT0, "Enix", "Act Raiser (Nintendo Super System)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) // sound sometimes dies, timing issues +GAME( 1992, nss_adam, nss, nss, snes, nss_state, nss, ROT0, "Ocean", "The Addams Family (Nintendo Super System)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND ) +GAME( 1992, nss_aten, nss, nss, snes, nss_state, nss, ROT0, "Absolute Entertainment Inc.", "David Crane's Amazing Tennis (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) +GAME( 1992, nss_con3, nss, nss, snes, nss_state, nss, ROT0, "Konami", "Contra 3: The Alien Wars (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) +GAME( 1992, nss_lwep, nss, nss, snes, nss_state, nss, ROT0, "Ocean", "Lethal Weapon (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) +GAME( 1992, nss_ncaa, nss, nss, snes, nss_state, nss, ROT0, "Sculptured Software Inc.", "NCAA Basketball (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) +GAME( 1992, nss_rob3, nss, nss, snes, nss_state, nss, ROT0, "Ocean", "Robocop 3 (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // any sprite minus Robocop is missing +GAME( 1992, nss_skin, nss, nss, snes, nss_state, nss, ROT0, "Irem", "Skins Game (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) // gfx issue caused by timing at start-up +GAME( 1992, nss_ssoc, nss, nss, snes, nss_state, nss, ROT0, "Human Inc.", "Super Soccer (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) +GAME( 1991, nss_smw, nss, nss, snes, nss_state, nss, ROT0, "Nintendo", "Super Mario World (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) +GAME( 1991, nss_fzer, nss, nss, snes, nss_state, nss, ROT0, "Nintendo", "F-Zero (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING ) +GAME( 1991, nss_sten, nss, nss, snes, nss_state, nss, ROT0, "Nintendo", "Super Tennis (Nintendo Super System)", GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )