diff --git a/src/mame/drivers/xavix.cpp b/src/mame/drivers/xavix.cpp index 5e03680fb9a..a1a8000ac27 100644 --- a/src/mame/drivers/xavix.cpp +++ b/src/mame/drivers/xavix.cpp @@ -347,7 +347,10 @@ void xavix_state::xavix_lowbus_map(address_map &map) map(0x7a81, 0x7a81).rw(FUNC(xavix_state::ioevent_irqstate_r), FUNC(xavix_state::ioevent_irqack_w)); // Mouse? - map(0x7b00, 0x7b00).w(FUNC(xavix_state::adc_7b00_w)); // rad_snow (not often, why?) + map(0x7b00, 0x7b00).rw(FUNC(xavix_state::mouse_7b00_r), FUNC(xavix_state::mouse_7b00_w)); + map(0x7b01, 0x7b01).rw(FUNC(xavix_state::mouse_7b01_r), FUNC(xavix_state::mouse_7b01_w)); + map(0x7b10, 0x7b10).rw(FUNC(xavix_state::mouse_7b10_r), FUNC(xavix_state::mouse_7b10_w)); + map(0x7b11, 0x7b11).rw(FUNC(xavix_state::mouse_7b11_r), FUNC(xavix_state::mouse_7b11_w)); // Lightgun / pen 2 control //map(0x7b18, 0x7b1b) @@ -463,6 +466,15 @@ static INPUT_PORTS_START( xavix ) PORT_START("AN7") PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_START("MOUSE0X") + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_START("MOUSE0Y") + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_START("MOUSE1X") + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_START("MOUSE1Y") + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_START("REGION") // PAL/NTSC flag PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) INPUT_PORTS_END @@ -489,6 +501,27 @@ static INPUT_PORTS_START( xavix_an ) PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_SENSITIVITY(100) PORT_KEYDELTA(20) INPUT_PORTS_END + +static INPUT_PORTS_START( epo_sdb ) + PORT_INCLUDE(xavix) + + PORT_MODIFY("MOUSE0X") + PORT_BIT( 0xff, 0x00, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(32) PORT_REVERSE PORT_PLAYER(1) + PORT_MODIFY("MOUSE0Y") + PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(32) PORT_PLAYER(1) + PORT_MODIFY("MOUSE1X") + PORT_BIT( 0xff, 0x00, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(32) PORT_REVERSE PORT_PLAYER(2) + PORT_MODIFY("MOUSE1Y") + PORT_BIT( 0xff, 0x00, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(32) PORT_PLAYER(2) + + PORT_MODIFY("IN0") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2) + + PORT_MODIFY("IN1") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(1) +INPUT_PORTS_END + + // left + right drums together = select / forward (needed on initial screen). left drum = left in menus right drum = right in menus // analog reading depends heavily on timers, they're too fast right now so drum hits are too hard and register multiple times static INPUT_PORTS_START( taikodp ) @@ -1013,6 +1046,13 @@ void xavix_state::xavix2000(machine_config &config) m_palette->set_entries(512); } +void xavix_state::xavix2000_nv(machine_config &config) +{ + xavix2000(config); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); +} + void xavix_i2c_state::xavix2000_i2c_24c04(machine_config &config) { xavix2000(config); @@ -1391,7 +1431,7 @@ ROM_START( drgqst ) ROM_LOAD( "dragonquest.bin", 0x000000, 0x800000, CRC(3d24413f) SHA1(1677e81cedcf349de7bf091a232dc82c6424efba) ) ROM_END -CONS( 2004, epo_sdb, 0, 0, xavix2000, xavix, xavix_state, init_xavix, "Epoch / SSD Company LTD", "Super Dash Ball (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) +CONS( 2004, epo_sdb, 0, 0, xavix2000_nv, epo_sdb, xavix_state, init_xavix, "Epoch / SSD Company LTD", "Super Dash Ball (Japan)", MACHINE_IMPERFECT_SOUND ) CONS( 2005, ttv_sw, 0, 0, xavix2000_i2c_24c02, xavix, xavix_i2c_lotr_state, init_xavix, "Tiger / SSD Company LTD", "Star Wars Saga Edition - Lightsaber Battle Game", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) CONS( 2005, ttv_lotr, 0, 0, xavix2000_i2c_24c02, xavix, xavix_i2c_lotr_state, init_xavix, "Tiger / SSD Company LTD", "Lord Of The Rings - Warrior of Middle-Earth", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/includes/xavix.h b/src/mame/includes/xavix.h index 15dee88c1cc..8df1bb782b1 100644 --- a/src/mame/includes/xavix.h +++ b/src/mame/includes/xavix.h @@ -71,6 +71,10 @@ public: m_in0(*this, "IN0"), m_in1(*this, "IN1"), m_an_in(*this, "AN%u", 0U), + m_mouse0x(*this, "MOUSE0X"), + m_mouse0y(*this, "MOUSE0Y"), + m_mouse1x(*this, "MOUSE1X"), + m_mouse1y(*this, "MOUSE1Y"), m_maincpu(*this, "maincpu"), m_nvram(*this, "nvram"), m_screen(*this, "screen"), @@ -102,6 +106,7 @@ public: void xavixp(machine_config &config); void xavix2000(machine_config &config); void xavix_nv(machine_config &config); + void xavix2000_nv(machine_config &config); void init_xavix(); @@ -169,6 +174,10 @@ protected: required_ioport m_in0; required_ioport m_in1; required_ioport_array<8> m_an_in; + optional_ioport m_mouse0x; + optional_ioport m_mouse0y; + optional_ioport m_mouse1x; + optional_ioport m_mouse1y; required_device m_maincpu; optional_device m_nvram; required_device m_screen; @@ -258,7 +267,16 @@ private: uint8_t m_ioevent_active; void process_ioevent(uint8_t bits); - DECLARE_WRITE8_MEMBER(adc_7b00_w); + DECLARE_READ8_MEMBER(mouse_7b00_r); + DECLARE_READ8_MEMBER(mouse_7b01_r); + DECLARE_READ8_MEMBER(mouse_7b10_r); + DECLARE_READ8_MEMBER(mouse_7b11_r); + + DECLARE_WRITE8_MEMBER(mouse_7b00_w); + DECLARE_WRITE8_MEMBER(mouse_7b01_w); + DECLARE_WRITE8_MEMBER(mouse_7b10_w); + DECLARE_WRITE8_MEMBER(mouse_7b11_w); + DECLARE_READ8_MEMBER(adc_7b80_r); DECLARE_WRITE8_MEMBER(adc_7b80_w); DECLARE_READ8_MEMBER(adc_7b81_r); diff --git a/src/mame/machine/xavix.cpp b/src/mame/machine/xavix.cpp index 18ad71a93cd..5f783570354 100644 --- a/src/mame/machine/xavix.cpp +++ b/src/mame/machine/xavix.cpp @@ -245,13 +245,71 @@ WRITE8_MEMBER(xavix_state::ioevent_irqack_w) update_irqs(); } - - -WRITE8_MEMBER(xavix_state::adc_7b00_w) +READ8_MEMBER(xavix_state::mouse_7b00_r) { - LOG("%s: adc_7b00_w %02x\n", machine().describe_context(), data); + if (m_mouse0x) + { + uint8_t retval = m_mouse0x->read(); + return retval ^ 0x7f; + } + + return 0x00; } +READ8_MEMBER(xavix_state::mouse_7b01_r) +{ + if (m_mouse0y) + { + uint8_t retval = m_mouse0y->read(); + return retval ^ 0x7f; + } + return 0x00; +} + +READ8_MEMBER(xavix_state::mouse_7b10_r) +{ + if (m_mouse1x) + { + uint8_t retval = m_mouse1x->read(); + return retval ^ 0x7f; + } + + return 0x00; +} + +READ8_MEMBER(xavix_state::mouse_7b11_r) +{ + if (m_mouse1y) + { + uint8_t retval = m_mouse1y->read(); + return retval ^ 0x7f; + } + + return 0x00; +} + +WRITE8_MEMBER(xavix_state::mouse_7b00_w) +{ + LOG("%s: mouse_7b00_w %02x\n", machine().describe_context(), data); +} + +WRITE8_MEMBER(xavix_state::mouse_7b01_w) +{ + LOG("%s: mouse_7b01_w %02x\n", machine().describe_context(), data); +} + +WRITE8_MEMBER(xavix_state::mouse_7b10_w) +{ + LOG("%s: mouse_7b10_w %02x\n", machine().describe_context(), data); +} + +WRITE8_MEMBER(xavix_state::mouse_7b11_w) +{ + LOG("%s: mouse_7b11_w %02x\n", machine().describe_context(), data); +} + + + READ8_MEMBER(xavix_state::adc_7b80_r) { LOG("%s: adc_7b80_r\n", machine().describe_context());