diff options
author | David Haywood <28625134+DavidHaywood@users.noreply.github.com> | 2019-12-04 19:26:23 +0000 |
---|---|---|
committer | R. Belmont <rb6502@users.noreply.github.com> | 2019-12-04 14:26:23 -0500 |
commit | 3127f799a2f97298e2c071548e0a0d7a354dbb8f (patch) | |
tree | 1568be305e67a825d49d1e1c57af13527453c431 /src/mame | |
parent | c4fcbb0ce7e1ef899b125e08e8ac7ad73e4c6a96 (diff) |
Sunplus Plug & Play work (cleanup + fixes + notes based on wrlshunt code analysis) (#6010)
* misc sunplus work (nw)
* unbreak a few things, remove some test code (nw)
* mask shift values, maybe correct based on code study (nw)
* refactor (nw)
* notes based on code study (nw)
* force a different codepath in wrlshunt, static screen, but differnet, no crash, need to see if it's valid (nw)
* test (nw)
Diffstat (limited to 'src/mame')
-rw-r--r-- | src/mame/drivers/sunplus_gcm394.cpp | 69 | ||||
-rw-r--r-- | src/mame/drivers/vii.cpp | 59 |
2 files changed, 42 insertions, 86 deletions
diff --git a/src/mame/drivers/sunplus_gcm394.cpp b/src/mame/drivers/sunplus_gcm394.cpp index 72f06a6a32b..dfc1a220d72 100644 --- a/src/mame/drivers/sunplus_gcm394.cpp +++ b/src/mame/drivers/sunplus_gcm394.cpp @@ -241,6 +241,10 @@ void wrlshunt_game_state::wrlshunt(machine_config &config) m_maincpu->porta_in().set(FUNC(wrlshunt_game_state::hunt_porta_r)); m_maincpu->porta_out().set(FUNC(wrlshunt_game_state::hunt_porta_w)); + m_screen->set_size(320*2, 262*2); + m_screen->set_visarea(0, (320*2)-1, 0, (240*2)-1); + + } void gcm394_game_state::switch_bank(uint32_t bank) @@ -299,47 +303,26 @@ void wrlshunt_game_state::wrlshunt_map(address_map &map) static INPUT_PORTS_START( gcm394 ) 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_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0800, 0x0800, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) // hold button 1 and 4 on startup for test screen - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) - + // entirely non-standard mat based controller (0-11 are where your feet are placed normally, row of selection places to step above those) + // no sensible default mapping unless forced + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_Q) PORT_NAME("0") + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_CODE(KEYCODE_W) PORT_NAME("1") + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_CODE(KEYCODE_E) PORT_NAME("2") + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_CODE(KEYCODE_R) PORT_NAME("3") + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_CODE(KEYCODE_T) PORT_NAME("4") + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON10 ) PORT_CODE(KEYCODE_Y) PORT_NAME("5") + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON11 ) PORT_CODE(KEYCODE_U) PORT_NAME("6") + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON12 ) PORT_CODE(KEYCODE_I) PORT_NAME("7") + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON13 ) PORT_CODE(KEYCODE_O) PORT_NAME("8") + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON14 ) PORT_CODE(KEYCODE_P) PORT_NAME("9") + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON15 ) PORT_CODE(KEYCODE_OPENBRACE) PORT_NAME("10") + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON16 ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_NAME("11") + + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_A) PORT_NAME("Circle / Red") // hold button Circle and Star on startup for test menu (other conditions? doesn't always work?) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_S) PORT_NAME("Square / Orange") + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_D) PORT_NAME("Triangle / Yellow") + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_F) PORT_NAME("Star / Blue") + PORT_START("P2") PORT_DIPNAME( 0x0001, 0x0001, "P2" ) PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) @@ -365,9 +348,7 @@ static INPUT_PORTS_START( gcm394 ) 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( 0x0100, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("HOME") PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) diff --git a/src/mame/drivers/vii.cpp b/src/mame/drivers/vii.cpp index 2a39ae58b2b..d278831a206 100644 --- a/src/mame/drivers/vii.cpp +++ b/src/mame/drivers/vii.cpp @@ -152,7 +152,6 @@ #include "cpu/unsp/unsp.h" #include "machine/i2cmem.h" -#include "machine/nvram.h" #include "machine/eepromser.h" #include "machine/spg2xx.h" @@ -179,7 +178,6 @@ public: , m_io_p2(*this, "P2") , m_io_p3(*this, "P3") , m_i2cmem(*this, "i2cmem") - , m_nvram(*this, "nvram") { } void spg2xx_base(machine_config &config); @@ -204,8 +202,8 @@ protected: void switch_bank(uint32_t bank); - DECLARE_WRITE8_MEMBER(eeprom_w); - DECLARE_READ8_MEMBER(eeprom_r); + DECLARE_WRITE8_MEMBER(i2c_w); + DECLARE_READ8_MEMBER(i2c_r); DECLARE_READ16_MEMBER(jakks_porta_r); @@ -229,15 +227,12 @@ protected: uint32_t m_current_bank; - std::unique_ptr<uint8_t[]> m_serial_eeprom; - uint16_t m_walle_portc_data; required_ioport m_io_p1; optional_ioport m_io_p2; optional_ioport m_io_p3; optional_device<i2cmem_device> m_i2cmem; - optional_device<nvram_device> m_nvram; }; class wireless60_state : public spg2xx_game_state @@ -634,14 +629,15 @@ void spg2xx_game_state::switch_bank(uint32_t bank) } } -WRITE8_MEMBER(spg2xx_game_state::eeprom_w) +WRITE8_MEMBER(spg2xx_game_state::i2c_w) { - m_serial_eeprom[offset & 0x3ff] = data; + logerror("%s: i2c_w %05x %04x\n", machine().describe_context(), offset, data); } -READ8_MEMBER(spg2xx_game_state::eeprom_r) +READ8_MEMBER(spg2xx_game_state::i2c_r) { - return m_serial_eeprom[offset & 0x3ff]; + logerror("%s: i2c_r %04x\n", machine().describe_context(), offset); + return 0x0000; } WRITE16_MEMBER(wireless60_state::wireless60_porta_w) @@ -2521,13 +2517,6 @@ void spg2xx_game_state::machine_start() m_bank->set_entry(0); } - if (m_serial_eeprom) - { - m_serial_eeprom = std::make_unique<uint8_t[]>(0x400); - if (m_nvram) - m_nvram->set_base(&m_serial_eeprom[0], 0x400); - } - save_item(NAME(m_current_bank)); save_item(NAME(m_walle_portc_data)); } @@ -2654,10 +2643,8 @@ void vii_state::vii(machine_config &config) spg2xx_base(config); m_maincpu->portb_out().set(FUNC(vii_state::vii_portb_w)); - m_maincpu->eeprom_w().set(FUNC(vii_state::eeprom_w)); - m_maincpu->eeprom_r().set(FUNC(vii_state::eeprom_r)); - - NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_1); + m_maincpu->i2c_w().set(FUNC(vii_state::i2c_w)); + m_maincpu->i2c_r().set(FUNC(vii_state::i2c_r)); GENERIC_CARTSLOT(config, m_cart, generic_plain_slot, "vii_cart"); m_cart->set_width(GENERIC_ROM16_WIDTH); @@ -2718,10 +2705,8 @@ void icanpian_state::icanpian(machine_config &config) WRITE8_MEMBER(tvgogo_state::tvg_i2c_w) { // unsure what is mapped here (Camera?) but it expects to be able to read back the same byte it writes before it boots. - // (offset certainly isn't eeprom address as the generic spg2xx_game_state::eeprom_r / eeprom_r code expects) m_i2cunk = data; logerror("%s: tvg_i2c_w %04x %02x\n", machine().describe_context(), offset, data); - m_serial_eeprom[offset & 0x3ff] = data; } READ8_MEMBER(tvgogo_state::tvg_i2c_r) @@ -2748,8 +2733,8 @@ void tvgogo_state::tvgogo(machine_config &config) m_cart->set_device_load(FUNC(tvgogo_state::cart_load_tvgogo)); m_cart->set_must_be_loaded(true); - m_maincpu->eeprom_w().set(FUNC(tvgogo_state::tvg_i2c_w)); - m_maincpu->eeprom_r().set(FUNC(tvgogo_state::tvg_i2c_r)); + m_maincpu->i2c_w().set(FUNC(tvgogo_state::tvg_i2c_w)); + m_maincpu->i2c_r().set(FUNC(tvgogo_state::tvg_i2c_r)); SOFTWARE_LIST(config, "tvgogo_cart").set_original("tvgogo"); } @@ -2972,10 +2957,8 @@ void spg2xx_game_state::rad_skat(machine_config &config) m_maincpu->porta_in().set_ioport("P1"); m_maincpu->portb_in().set_ioport("P2"); m_maincpu->portc_in().set_ioport("P3"); - m_maincpu->eeprom_w().set(FUNC(spg2xx_game_state::eeprom_w)); - m_maincpu->eeprom_r().set(FUNC(spg2xx_game_state::eeprom_r)); - - NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_1); + m_maincpu->i2c_w().set(FUNC(spg2xx_game_state::i2c_w)); + m_maincpu->i2c_r().set(FUNC(spg2xx_game_state::i2c_r)); } void dreamlif_state::dreamlif(machine_config &config) @@ -3011,10 +2994,8 @@ void spg2xx_game_state::rad_sktv(machine_config &config) m_maincpu->porta_in().set(FUNC(spg2xx_game_state::rad_porta_r)); m_maincpu->portb_in().set(FUNC(spg2xx_game_state::rad_portb_r)); m_maincpu->portc_in().set(FUNC(spg2xx_game_state::rad_portc_r)); - m_maincpu->eeprom_w().set(FUNC(spg2xx_game_state::eeprom_w)); - m_maincpu->eeprom_r().set(FUNC(spg2xx_game_state::eeprom_r)); - - NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_1); + m_maincpu->i2c_w().set(FUNC(spg2xx_game_state::i2c_w)); + m_maincpu->i2c_r().set(FUNC(spg2xx_game_state::i2c_r)); } void spg2xx_game_state::rad_crik(machine_config &config) @@ -3027,10 +3008,8 @@ void spg2xx_game_state::rad_crik(machine_config &config) m_maincpu->porta_in().set_ioport("P1"); m_maincpu->portb_in().set_ioport("P2"); m_maincpu->portc_in().set_ioport("P3"); - m_maincpu->eeprom_w().set(FUNC(spg2xx_game_state::eeprom_w)); - m_maincpu->eeprom_r().set(FUNC(spg2xx_game_state::eeprom_r)); - - NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_1); + m_maincpu->i2c_w().set(FUNC(spg2xx_game_state::i2c_w)); + m_maincpu->i2c_r().set(FUNC(spg2xx_game_state::i2c_r)); } void pvmil_state::pvmil(machine_config &config) @@ -3051,8 +3030,6 @@ void pvmil_state::pvmil(machine_config &config) m_maincpu->portb_out().set(FUNC(pvmil_state::pvmil_portb_w)); m_maincpu->portc_out().set(FUNC(pvmil_state::pvmil_portc_w)); -// NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_1); - config.set_default_layout(layout_pvmil); } @@ -3070,8 +3047,6 @@ void spg2xx_game_state::taikeegr(machine_config &config) m_maincpu->porta_in().set_ioport("P1"); // m_maincpu->portb_in().set_ioport("P2"); // m_maincpu->portc_in().set_ioport("P3"); - - NVRAM(config, m_nvram, nvram_device::DEFAULT_ALL_1); } void sentx6p_state::machine_start() |