restore behavior (nw)

This commit is contained in:
DavidHaywood 2019-01-24 14:56:25 +00:00
parent f15c6daa43
commit c8eb725b7c
4 changed files with 71 additions and 23 deletions

View File

@ -1152,14 +1152,23 @@ void xavix_state::xavix2002(machine_config &config)
m_palette->set_entries(512);
XAVIX2002IO(config, "xavix2002io", 0);
XAVIX2002IO(config, m_xavix2002io, 0);
}
void xavix_i2c_jmat_state::xavix2002_i2c_jmat(machine_config &config)
{
xavix2002(config);
I2CMEM(config, "i2cmem", 0)/*.set_page_size(16)*/.set_data_size(0x200); // ?
m_xavix2002io->read_0_callback().set(FUNC(xavix_i2c_jmat_state::read_extended_io0));
m_xavix2002io->write_0_callback().set(FUNC(xavix_i2c_jmat_state::write_extended_io0));
m_xavix2002io->read_1_callback().set(FUNC(xavix_i2c_jmat_state::read_extended_io1));
m_xavix2002io->write_1_callback().set(FUNC(xavix_i2c_jmat_state::write_extended_io1));
m_xavix2002io->read_2_callback().set(FUNC(xavix_i2c_jmat_state::read_extended_io2));
m_xavix2002io->write_2_callback().set(FUNC(xavix_i2c_jmat_state::write_extended_io2));
}
@ -1687,7 +1696,7 @@ CONS( 2004, xavbox, 0, 0, xavix2002_i2c_24c04, xavix_i2c, xavix_i2c_state,
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_i2c, 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

View File

@ -568,11 +568,12 @@ private:
required_device<xavix_sound_device> m_sound;
optional_device<xavix2002_io_device> m_xavix2002io;
DECLARE_READ8_MEMBER(sound_regram_read_cb);
protected:
optional_device<xavix2002_io_device> m_xavix2002io;
// additional SuperXaviX / XaviX2002 stuff
uint8_t m_sx_extended_extbus[3];
@ -621,19 +622,22 @@ private:
int hackaddress2;
};
class xavix_i2c_jmat_state : public xavix_state
class xavix_i2c_jmat_state : public xavix_i2c_state
{
public:
xavix_i2c_jmat_state(const machine_config &mconfig, device_type type, const char *tag)
: xavix_state(mconfig, type, tag),
m_i2cmem(*this, "i2cmem")
: xavix_i2c_state(mconfig, type, tag)
{ }
void xavix2002_i2c_jmat(machine_config &config);
private:
required_device<i2cmem_device> m_i2cmem;
READ8_MEMBER(read_extended_io0);
READ8_MEMBER(read_extended_io1);
READ8_MEMBER(read_extended_io2);
WRITE8_MEMBER(write_extended_io0);
WRITE8_MEMBER(write_extended_io1);
WRITE8_MEMBER(write_extended_io2);
};

View File

@ -590,15 +590,8 @@ void xavix_i2c_state::write_io1(uint8_t data, uint8_t direction)
// for taikodp
void xavix_i2c_cart_state::write_io1(uint8_t data, uint8_t direction)
{
if (direction & 0x08)
{
m_i2cmem->write_sda((data & 0x08) >> 3);
}
if (direction & 0x10)
{
m_i2cmem->write_scl((data & 0x10) >> 4);
}
m_i2cmem->write_sda((data & 0x08) >> 3);
m_i2cmem->write_scl((data & 0x10) >> 4);
}
void xavix_ekara_state::write_io0(uint8_t data, uint8_t direction)
@ -613,6 +606,36 @@ void xavix_ekara_state::write_io1(uint8_t data, uint8_t direction)
m_extraiowrite = extraiowrite;
}
/* SuperXavix IO port handliner (per game) */
READ8_MEMBER(xavix_i2c_jmat_state::read_extended_io0)
{
return 0x00;
}
READ8_MEMBER(xavix_i2c_jmat_state::read_extended_io1)
{
return 0x00;
}
READ8_MEMBER(xavix_i2c_jmat_state::read_extended_io2)
{
return 0x00;
}
WRITE8_MEMBER(xavix_i2c_jmat_state::write_extended_io0)
{
}
WRITE8_MEMBER(xavix_i2c_jmat_state::write_extended_io1)
{
}
WRITE8_MEMBER(xavix_i2c_jmat_state::write_extended_io2)
{
}
/* General IO port handling */
READ8_MEMBER(xavix_state::io0_data_r)

View File

@ -59,7 +59,6 @@ WRITE8_MEMBER(xavix2002_io_device::pio_dir_w)
READ8_MEMBER(xavix2002_io_device::pio_dir_r)
{
LOG("%s: superxavix pio_dir_r (port %d)\n", machine().describe_context(), offset);
uint8_t ret = 0x00;
if (offset < 3)
@ -78,20 +77,33 @@ WRITE8_MEMBER(xavix2002_io_device::pio_out_w)
{
m_sx_pio_out[offset] = data;
// look at direction register and output
// TODO: look at direction register
uint8_t outdata = m_sx_pio_out[offset];
switch (offset)
{
case 0: m_out0_cb(space,0,outdata); break;
case 1: m_out1_cb(space,0,outdata); break;
case 2: m_out2_cb(space,0,outdata); break;
default: break;
}
}
}
READ8_MEMBER(xavix2002_io_device::pio_out_r)
{
// what does this actually read?
LOG("%s: superxavix pio_out_r (port %d)\n", machine().describe_context(), offset);
return 0x00;
uint8_t ret = 0x00;
// uint8_t ret = 0x00;
if (offset<3)
ret = m_sx_pio_out[offset];
// if (offset<3)
// ret = m_sx_pio_out[offset];
return ret;
// return ret;
}