diff options
Diffstat (limited to 'src/mame/drivers/vii.cpp')
-rw-r--r-- | src/mame/drivers/vii.cpp | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/src/mame/drivers/vii.cpp b/src/mame/drivers/vii.cpp index 16321836cbd..ba586013476 100644 --- a/src/mame/drivers/vii.cpp +++ b/src/mame/drivers/vii.cpp @@ -127,6 +127,9 @@ protected: DECLARE_READ16_MEMBER(rad_portb_r); DECLARE_READ16_MEMBER(rad_portc_r); + DECLARE_WRITE16_MEMBER(jakks_porta_w); + DECLARE_WRITE16_MEMBER(jakks_portb_w); + required_device<unsp_device> m_maincpu; required_device<screen_device> m_screen; required_device<spg2xx_device> m_spg; @@ -157,6 +160,7 @@ class jakks_gkr_state : public spg2xx_game_state public: jakks_gkr_state(const machine_config &mconfig, device_type type, const char *tag) : spg2xx_game_state(mconfig, type, tag) + , m_porta_key_mode(false) , m_cart(*this, "cartslot") , m_cart_region(nullptr) { } @@ -168,6 +172,10 @@ public: private: virtual void machine_start() override; + DECLARE_WRITE16_MEMBER(jakks_porta_key_io_w); + DECLARE_READ16_MEMBER(jakks_porta_key_io_r); + bool m_porta_key_mode; + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(gamekey_cart); required_device<generic_slot_device> m_cart; @@ -305,9 +313,50 @@ WRITE16_MEMBER(spg2xx_game_state::walle_portc_w) READ16_MEMBER(spg2xx_game_state::jakks_porta_r) { + //logerror("%s: jakks_porta_r\n", machine().describe_context()); return m_io_p1->read(); } +WRITE16_MEMBER(spg2xx_game_state::jakks_porta_w) +{ + //logerror("%s: jakks_porta_w %04x\n", machine().describe_context(), data); +} + +WRITE16_MEMBER(spg2xx_game_state::jakks_portb_w) +{ + //logerror("%s: jakks_portb_w %04x\n", machine().describe_context(), data); +} + +READ16_MEMBER(jakks_gkr_state::jakks_porta_key_io_r) +{ + //logerror("%s: jakks_porta_key_io_r\n", machine().describe_context()); + if (m_porta_key_mode == false) + { + return m_io_p1->read(); + } + else + { + /* masks with 0xf, inverts, and combines it with a previous read (when data written to jakks_porta_key_io_w was 0x0000) and expects result to be 0x0000 + could just expect data written to be returned, but that would be a strange check. + all systems seem to respond to the same result, so how is the per-system lock implemented? */ + return (m_io_p1->read() & 0xfff0) | 0x000f; + } +} + +WRITE16_MEMBER(jakks_gkr_state::jakks_porta_key_io_w) +{ + //logerror("%s: jakks_porta_key_io_w %04x\n", machine().describe_context(), data); + // only seen 0xffff and 0x0000 written here.. writes 0xffff before the 2nd part of the port a gamekey check read. + if (data == 0xffff) + { + m_porta_key_mode = true; + } + else + { + m_porta_key_mode = false; + } +} + READ16_MEMBER(spg2xx_game_state::rad_porta_r) { uint16_t data = m_io_p1->read(); @@ -828,6 +877,8 @@ void spg2xx_game_state::jakks(machine_config &config) spg2xx_base(config); m_spg->porta_in().set(FUNC(spg2xx_game_state::jakks_porta_r)); + m_spg->porta_out().set(FUNC(spg2xx_game_state::jakks_porta_w)); + m_spg->portb_out().set(FUNC(spg2xx_game_state::jakks_portb_w)); I2CMEM(config, m_i2cmem, 0).set_data_size(0x200); } @@ -861,6 +912,9 @@ void jakks_gkr_state::jakks_gkr(machine_config &config) { walle(config); + m_spg->porta_in().set(FUNC(jakks_gkr_state::jakks_porta_key_io_r)); + m_spg->porta_out().set(FUNC(jakks_gkr_state::jakks_porta_key_io_w)); + GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "jakks_gamekey"); m_cart->set_width(GENERIC_ROM16_WIDTH); m_cart->set_device_load(device_image_load_delegate(&jakks_gkr_state::device_image_load_gamekey_cart, this)); @@ -1182,7 +1236,7 @@ CONS( 2008, jak_wall, 0, 0, walle, walle, spg2xx_game_state, empty_init, "JAKKS CONS( 2005, jak_wwe, 0, 0, jakks_gkr, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "WWE (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // WW (no game-keys released) CONS( 2005, jak_fan4, 0, 0, jakks_gkr, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Digital Eclipse", "Fantastic Four (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // F4 (no game-keys released) CONS( 2005, jak_just, 0, 0, jakks_gkr, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Taniko", "Justice League (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // DC (no game-keys released) -CONS( 2005, jak_dora, 0, 0, jakks_gkr_nk, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Handheld Games", "Dora the Explorer (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NK keys (same as Nicktoons & Spongebob) (3+ released) +CONS( 2005, jak_dora, 0, 0, jakks_gkr_nk, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Handheld Games", "Dora the Explorer - Race To Play Park (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NK keys (same as Nicktoons & Spongebob) (3+ released) CONS( 2005, jak_sdoo, 0, 0, jakks_gkr, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Jolliford Management","Scooby-Doo! and the Mystery of the Castle (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // SD (no game-keys released) CONS( 2005, jak_disf, 0, 0, jakks_gkr_dy, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "Disney Friends (JAKKS Pacific TV Game, Game-Key Ready)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses DY keys (3 released) |