diff options
Diffstat (limited to 'src/mame/drivers/spg2xx.cpp')
-rw-r--r-- | src/mame/drivers/spg2xx.cpp | 80 |
1 files changed, 43 insertions, 37 deletions
diff --git a/src/mame/drivers/spg2xx.cpp b/src/mame/drivers/spg2xx.cpp index 4b0c45cf0a6..66858f06eb2 100644 --- a/src/mame/drivers/spg2xx.cpp +++ b/src/mame/drivers/spg2xx.cpp @@ -946,33 +946,15 @@ INPUT_PORTS_END static INPUT_PORTS_START( dreamlss ) PORT_START("P1") - PORT_DIPNAME( 0x0001, 0x0001, "P1" ) - PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("A") + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("B") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("C") + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_SERVICE ) PORT_NAME("Test (Debug)") // not externally connected on unit PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) @@ -996,7 +978,7 @@ static INPUT_PORTS_START( dreamlss ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_START("P2") - PORT_DIPNAME( 0x0001, 0x0001, "P2" ) + PORT_DIPNAME( 0x0001, 0x0000, "P2" ) PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) @@ -1256,14 +1238,32 @@ void spg2xx_game_pballpup_state::pballpup(machine_config &config) EEPROM_93C66_16BIT(config, m_eeprom); // type? } + +READ16_MEMBER(spg2xx_game_dreamlss_state::porta_r) +{ + uint16_t ret = m_io_p1->read()&0xefff; + ret |= m_porta_data & 0x1000; // needs to be able to read back current bank + logerror("%s: spg2xx_game_dreamlss_state::porta_r\n", machine().describe_context()); + return ret; +} + +WRITE16_MEMBER(spg2xx_game_dreamlss_state::porta_w) +{ + logerror("%s: spg2xx_game_dreamlss_state::porta_w (%04x)\n", machine().describe_context(), data); + + m_porta_data = data; + + switch_bank((data & 0x1000) ? 1 : 0); +} + + +// TODO: how does the SEEPROM hook up? (will need hack removing in init_dreamlss ) READ16_MEMBER(spg2xx_game_dreamlss_state::portb_r) { - uint16_t ret = 0;// m_io_p2->read() & 0xfffc; - //ret = 0xfffd; - ret |= m_i2cmem->read_sda() ? 0x0: 0x2; + uint16_t ret = m_portb_data & 0xfffe; + //ret |= m_i2cmem->read_sda() ? 0x1: 0x0; logerror("%s: spg2xx_game_dreamlss_state::portb_r\n", machine().describe_context()); - //ret |= m_eeprom->do_read() ? 0x8 : 0x0; return ret; } @@ -1271,10 +1271,10 @@ WRITE16_MEMBER(spg2xx_game_dreamlss_state::portb_w) { logerror("%s: spg2xx_game_dreamlss_state::portb_w (%04x)\n", machine().describe_context(), data); - m_i2cmem->write_scl(BIT(data, 1)); - m_i2cmem->write_sda(BIT(data, 0)); + //m_i2cmem->write_scl(!(BIT(data, 1))); + //m_i2cmem->write_sda(!(BIT(data, 0))); - //switch_bank((data & 0x1000) ? 1 : 0); + m_portb_data = data; } @@ -1285,7 +1285,7 @@ void spg2xx_game_dreamlss_state::dreamlss(machine_config &config) spg2xx_base(config); - m_maincpu->porta_in().set(FUNC(spg2xx_game_dreamlss_state::base_porta_r)); + m_maincpu->porta_in().set(FUNC(spg2xx_game_dreamlss_state::porta_r)); m_maincpu->portb_in().set(FUNC(spg2xx_game_dreamlss_state::portb_r)); m_maincpu->portc_in().set(FUNC(spg2xx_game_dreamlss_state::base_portc_r)); @@ -1468,6 +1468,12 @@ void spg2xx_game_state::init_tvsprt10() if (rom[0x179911] == 0x9240) rom[0x179911] ^= 0x0001; // decathln } +void spg2xx_game_state::init_dreamlss() +{ + // temp hack! skip I2CMEM loading / test! + uint16_t* rom = (uint16_t*)memregion("maincpu")->base(); + rom[0x4bb37] = 0x9640; +} // year, name, parent, compat, machine, input, class, init, company, fullname, flags @@ -1497,7 +1503,7 @@ CONS( 2005, tmntmutm, 0, 0, tmntmutm, tmntmutm, spg2xx_gam CONS( 2006, pballpup, 0, 0, pballpup, pballpup, spg2xx_game_pballpup_state, empty_init, "Hasbro / Tiger Electronics", "Mission: Paintball Powered Up", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2007, dreamlss, 0, 0, dreamlss, dreamlss, spg2xx_game_dreamlss_state, empty_init, "Hasbro / Tiger Electronics", "Dream Life Superstar (Version 0.3, Mar 16 2007)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2007, dreamlss, 0, 0, dreamlss, dreamlss, spg2xx_game_dreamlss_state, init_dreamlss, "Hasbro / Tiger Electronics", "Dream Life Superstar (Version 0.3, Mar 16 2007)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // some garbage sprites (not meant to be displayed at all) seeprom hookup (24LC08), gun fine-tuning etc. |