mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
some refactor (nw)
This commit is contained in:
parent
85ce5818c1
commit
6bdb818a72
@ -428,6 +428,28 @@ void xavix_state::superxavix_lowbus_map(address_map &map)
|
||||
map(0x7ffd, 0x7ffd).nopw(); // looks like a watchdog?
|
||||
}
|
||||
|
||||
|
||||
|
||||
CUSTOM_INPUT_MEMBER(xavix_i2c_state::i2c_r)
|
||||
{
|
||||
return m_i2cmem->read_sda();
|
||||
}
|
||||
|
||||
CUSTOM_INPUT_MEMBER(xavix_i2c_cart_state::i2c_r)
|
||||
{
|
||||
return m_i2cmem->read_sda();
|
||||
}
|
||||
|
||||
CUSTOM_INPUT_MEMBER(xavix_i2c_lotr_state::camera_r) // seems to be some kind of camera status bits
|
||||
{
|
||||
return machine().rand();
|
||||
}
|
||||
|
||||
CUSTOM_INPUT_MEMBER(xavix_i2c_bowl_state::camera_r) // seems to be some kind of camera status bits
|
||||
{
|
||||
return machine().rand();
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( xavix )
|
||||
PORT_START("IN0")
|
||||
PORT_DIPNAME( 0x01, 0x00, "IN0" )
|
||||
@ -533,6 +555,30 @@ 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( xavix_i2c )
|
||||
PORT_INCLUDE(xavix)
|
||||
|
||||
PORT_MODIFY("IN1")
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_state,i2c_r, nullptr)
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( ttv_lotr )
|
||||
PORT_INCLUDE(xavix)
|
||||
|
||||
PORT_MODIFY("IN1")
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_lotr_state,camera_r, nullptr)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_lotr_state,camera_r, nullptr)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_state,i2c_r, nullptr)
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( xavix_bowl )
|
||||
PORT_INCLUDE(xavix)
|
||||
|
||||
PORT_MODIFY("IN1")
|
||||
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_bowl_state,camera_r, nullptr)
|
||||
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_bowl_state,camera_r, nullptr)
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_state,i2c_r, nullptr)
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( epo_sdb )
|
||||
PORT_INCLUDE(xavix)
|
||||
@ -580,6 +626,9 @@ static INPUT_PORTS_START( taikodp )
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
PORT_MODIFY("AN6") // 12
|
||||
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED )
|
||||
|
||||
PORT_MODIFY("IN1")
|
||||
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, xavix_i2c_cart_state,i2c_r, nullptr)
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
@ -855,7 +904,7 @@ static INPUT_PORTS_START( rad_pingp )
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( nostalgia )
|
||||
PORT_INCLUDE(xavix)
|
||||
PORT_INCLUDE(xavix_i2c)
|
||||
|
||||
PORT_MODIFY("IN0") // mappings based on Dragon Buster button list, inputs don't seem to work properly in some games, probably because bad EEPROM support means all buttons are mapped to the same thing?
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON4 ) // Fire4
|
||||
@ -891,7 +940,7 @@ static INPUT_PORTS_START( rad_bb2 )
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( ttv_mx )
|
||||
PORT_INCLUDE(xavix)
|
||||
PORT_INCLUDE(xavix_i2c)
|
||||
|
||||
PORT_MODIFY("IN0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // Accel
|
||||
@ -935,7 +984,7 @@ static INPUT_PORTS_START( rad_rh )
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( epo_efdx )
|
||||
PORT_INCLUDE(xavix)
|
||||
PORT_INCLUDE(xavix_i2c)
|
||||
|
||||
PORT_MODIFY("IN0")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // select
|
||||
@ -947,6 +996,13 @@ static INPUT_PORTS_START( epo_efdx )
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( has_wamg )
|
||||
PORT_INCLUDE(xavix)
|
||||
|
||||
PORT_MODIFY("IN1")
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // waits for this after fading out title, what is it?
|
||||
INPUT_PORTS_END
|
||||
|
||||
/* correct, 4bpp gfxs */
|
||||
static const gfx_layout charlayout =
|
||||
{
|
||||
@ -1513,9 +1569,9 @@ CONS( 200?, epo_efdx, 0, 0, xavix_i2c_24c08, epo_efdx, xavix_i2c_sta
|
||||
|
||||
CONS( 2005, epo_guru, 0, 0, xavix, xavix, xavix_state, init_xavix, "Epoch / SSD Company LTD", "Gururin World (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND )
|
||||
|
||||
CONS( 2002, epo_dmon, 0, 0, xavix_i2c_24c02, xavix, xavix_i2c_state, init_xavix, "Epoch / SSD Company LTD", "Doraemon Computer Megaphone (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) // full / proper title?
|
||||
CONS( 2002, epo_dmon, 0, 0, xavix_i2c_24c02, xavix_i2c,xavix_i2c_state, init_xavix, "Epoch / SSD Company LTD", "Doraemon Computer Megaphone (Japan)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) // full / proper title?
|
||||
|
||||
CONS( 200?, has_wamg, 0, 0, xavix, xavix, xavix_state, init_xavix, "Hasbro / Milton Bradley / SSD Company LTD", "TV Wild Adventure Mini Golf (NTSC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND )
|
||||
CONS( 200?, has_wamg, 0, 0, xavix, has_wamg, xavix_state, init_xavix, "Hasbro / Milton Bradley / SSD Company LTD", "TV Wild Adventure Mini Golf (NTSC)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND )
|
||||
|
||||
|
||||
/* Music titles: Emulation note:
|
||||
@ -1571,12 +1627,12 @@ ROM_START( drgqst )
|
||||
ROM_LOAD( "dragonquest.bin", 0x000000, 0x800000, CRC(3d24413f) SHA1(1677e81cedcf349de7bf091a232dc82c6424efba) )
|
||||
ROM_END
|
||||
|
||||
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( 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 )
|
||||
CONS( 2005, ttv_mx, 0, 0, xavix2000_i2c_24c04, ttv_mx, xavix_i2c_state, init_xavix, "Tiger / SSD Company LTD", "MX Dirt Rebel", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND )
|
||||
CONS( 2003, drgqst, 0, 0, xavix2000_i2c_24c02, xavix , xavix_i2c_lotr_state, init_xavix, "Square Enix / SSD Company LTD", "Kenshin Dragon Quest: Yomigaerishi Densetsu no Ken", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND )
|
||||
CONS( 2005, ttv_sw, 0, 0, xavix2000_i2c_24c02, ttv_lotr, 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, ttv_lotr, xavix_i2c_lotr_state, init_xavix, "Tiger / SSD Company LTD", "Lord Of The Rings - Warrior of Middle-Earth", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND )
|
||||
CONS( 2005, ttv_mx, 0, 0, xavix2000_i2c_24c04, ttv_mx, xavix_i2c_state, init_xavix, "Tiger / SSD Company LTD", "MX Dirt Rebel", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND )
|
||||
CONS( 2003, drgqst, 0, 0, xavix2000_i2c_24c02, ttv_lotr, xavix_i2c_lotr_state, init_xavix, "Square Enix / SSD Company LTD", "Kenshin Dragon Quest: Yomigaerishi Densetsu no Ken", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND )
|
||||
|
||||
/* SuperXaviX (XaviX 2002 type CPU) hardware titles (3rd XaviX generation?)
|
||||
|
||||
@ -1641,17 +1697,17 @@ ROM_START( domfitch )
|
||||
ROM_END
|
||||
|
||||
// TODO: does it have an SEEPROM? why does it hang? full title?
|
||||
CONS( 2005, tmy_thom, 0, 0, xavix2002_i2c_24c04, xavix, xavix_i2c_state, init_xavix, "Tomy / SSD Company LTD", "Thomas and Friends (Tomy)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
|
||||
CONS( 2005, tmy_thom, 0, 0, xavix2002_i2c_24c04, xavix_i2c, xavix_i2c_state, init_xavix, "Tomy / SSD Company LTD", "Thomas and Friends (Tomy)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
|
||||
|
||||
CONS( 2004, xavtenni, 0, 0, xavix2002_i2c_24c04, xavix, xavix_i2c_state, init_xavix, "SSD Company LTD", "XaviX Tennis (XaviXPORT)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
|
||||
CONS( 2004, xavbaseb, 0, 0, xavix2002_i2c_24c04, xavix, xavix_i2c_state, init_xavix, "SSD Company LTD", "XaviX Baseball (XaviXPORT)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
|
||||
CONS( 2004, xavbowl, 0, 0, xavix2002_i2c_24c04, xavix, xavix_i2c_state, init_xavix, "SSD Company LTD", "XaviX Bowling (XaviXPORT)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // has IR 'Camera'
|
||||
CONS( 2004, xavbox, 0, 0, xavix2002_i2c_24c04, xavix, xavix_i2c_state, init_xavix, "SSD Company LTD", "XaviX Boxing (XaviXPORT)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // has IR 'Camera'
|
||||
CONS( 2004, xavtenni, 0, 0, xavix2002_i2c_24c04, xavix_i2c, xavix_i2c_state, init_xavix, "SSD Company LTD", "XaviX Tennis (XaviXPORT)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
|
||||
CONS( 2004, xavbaseb, 0, 0, xavix2002_i2c_24c04, xavix_i2c, xavix_i2c_state, init_xavix, "SSD Company LTD", "XaviX Baseball (XaviXPORT)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
|
||||
CONS( 2004, xavbowl, 0, 0, xavix2002_i2c_24c04, xavix_bowl, xavix_i2c_bowl_state, init_xavix, "SSD Company LTD", "XaviX Bowling (XaviXPORT)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // has IR 'Camera'
|
||||
CONS( 2004, xavbox, 0, 0, xavix2002_i2c_24c04, xavix_i2c, xavix_i2c_state, init_xavix, "SSD Company LTD", "XaviX Boxing (XaviXPORT)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) // has IR 'Camera'
|
||||
// Bass Fishing PCB is just like Tennis except with an RF daughterboard.
|
||||
CONS( 2004, xavbassf, 0, 0, xavix2002_i2c_24c04, xavix, xavix_i2c_state, init_xavix, "SSD Company LTD", "XaviX Bass Fishing (XaviXPORT)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
|
||||
CONS( 2004, xavbassf, 0, 0, xavix2002_i2c_24c04, xavix_i2c, xavix_i2c_state, init_xavix, "SSD Company LTD", "XaviX Bass Fishing (XaviXPORT)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
|
||||
|
||||
// TODO: check SEEPROM type and hookup, banking!
|
||||
CONS( 2005, xavjmat, 0, 0, xavix2002_i2c_jmat, xavix, xavix_i2c_jmat_state, init_xavix, "SSD Company LTD", "Jackie Chan J-Mat Fitness (XaviXPORT)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
|
||||
CONS( 2005, xavjmat, 0, 0, xavix2002_i2c_jmat, xavix, xavix_i2c_jmat_state, init_xavix, "SSD Company LTD", "Jackie Chan J-Mat Fitness (XaviXPORT)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND )
|
||||
|
||||
// https://arnaudmeyer.wordpress.com/domyos-interactive-system/
|
||||
// Domyos Fitness Adventure
|
||||
|
@ -608,8 +608,10 @@ public:
|
||||
hackaddress1 = 0x958a;
|
||||
hackaddress2 = 0x8524;
|
||||
}
|
||||
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(i2c_r);
|
||||
|
||||
protected:
|
||||
virtual uint8_t read_io1(uint8_t direction) override;
|
||||
virtual void write_io1(uint8_t data, uint8_t direction) override;
|
||||
|
||||
required_device<i2cmem_device> m_i2cmem;
|
||||
@ -642,11 +644,22 @@ public:
|
||||
: xavix_i2c_state(mconfig, type, tag)
|
||||
{ }
|
||||
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(camera_r);
|
||||
|
||||
protected:
|
||||
virtual uint8_t read_io1(uint8_t direction) override;
|
||||
//virtual void write_io1(uint8_t data, uint8_t direction) override;
|
||||
};
|
||||
|
||||
class xavix_i2c_bowl_state : public xavix_i2c_state
|
||||
{
|
||||
public:
|
||||
xavix_i2c_bowl_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: xavix_i2c_state(mconfig, type, tag)
|
||||
{ }
|
||||
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(camera_r);
|
||||
};
|
||||
|
||||
|
||||
|
||||
class xavix_mtrk_state : public xavix_state
|
||||
@ -851,8 +864,9 @@ public:
|
||||
|
||||
void xavix_i2c_taiko(machine_config &config);
|
||||
|
||||
DECLARE_CUSTOM_INPUT_MEMBER(i2c_r);
|
||||
|
||||
protected:
|
||||
virtual uint8_t read_io1(uint8_t direction) override;
|
||||
virtual void write_io1(uint8_t data, uint8_t direction) override;
|
||||
|
||||
required_device<i2cmem_device> m_i2cmem;
|
||||
|
@ -510,14 +510,6 @@ void xavix_state::write_io1(uint8_t data, uint8_t direction)
|
||||
// no special handling
|
||||
}
|
||||
|
||||
uint8_t xavix_i2c_state::read_io1(uint8_t direction)
|
||||
{
|
||||
uint8_t ret = m_in1->read();
|
||||
ret &= ~0x08;
|
||||
ret |= (m_i2cmem->read_sda() & 1) << 3;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void xavix_i2c_state::write_io1(uint8_t data, uint8_t direction)
|
||||
{
|
||||
// ignore these writes so that epo_edfx can send read requests to the ee-prom and doesn't just report an error
|
||||
@ -539,14 +531,6 @@ void xavix_i2c_state::write_io1(uint8_t data, uint8_t direction)
|
||||
}
|
||||
|
||||
// for taikodp
|
||||
uint8_t xavix_i2c_cart_state::read_io1(uint8_t direction)
|
||||
{
|
||||
uint8_t ret = m_in1->read();
|
||||
ret &= ~0x08;
|
||||
ret |= (m_i2cmem->read_sda() & 1) << 3;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void xavix_i2c_cart_state::write_io1(uint8_t data, uint8_t direction)
|
||||
{
|
||||
if (direction & 0x08)
|
||||
@ -561,19 +545,6 @@ void xavix_i2c_cart_state::write_io1(uint8_t data, uint8_t direction)
|
||||
}
|
||||
|
||||
|
||||
uint8_t xavix_i2c_lotr_state::read_io1(uint8_t direction)
|
||||
{
|
||||
uint8_t ret = m_in1->read();
|
||||
|
||||
// some kind of comms with the IR sensor?
|
||||
ret ^= (machine().rand() & 0x02);
|
||||
ret ^= (machine().rand() & 0x04);
|
||||
|
||||
ret &= ~0x08;
|
||||
ret |= (m_i2cmem->read_sda() & 1) << 3;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint8_t xavix_ekara_state::read_io1(uint8_t direction)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user