summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-05-21 11:15:38 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-05-21 11:15:38 -0400
commit28913b6929ae14c6ea1a779c5e2ccd5bf07bd93f (patch)
tree99daea0a210da20151cd66cec8901e1cd87c14e0
parent6ee9c864a867a388ba6b7cf7040673becb4dc34d (diff)
eaglshot: Add uPD4701A device
-rw-r--r--src/mame/drivers/ssv.cpp42
-rw-r--r--src/mame/includes/ssv.h12
2 files changed, 21 insertions, 33 deletions
diff --git a/src/mame/drivers/ssv.cpp b/src/mame/drivers/ssv.cpp
index 26a41dcb49f..3e181c9c58d 100644
--- a/src/mame/drivers/ssv.cpp
+++ b/src/mame/drivers/ssv.cpp
@@ -850,33 +850,19 @@ ADDRESS_MAP_END
Eagle Shot Golf
***************************************************************************/
-WRITE16_MEMBER(ssv_state::eaglshot_gfxrom_bank_w)
+WRITE8_MEMBER(ssv_state::eaglshot_gfxrom_bank_w)
{
- if (ACCESSING_BITS_0_7)
- {
- membank("gfxrom")->set_entry(data < 6 ? data : 6);
- }
-}
-
-READ16_MEMBER(ssv_state::eaglshot_trackball_r)
-{
- switch(m_trackball_select)
- {
- case 0x60: return (m_io_trackx->read() >> 8) & 0xff;
- case 0x40: return (m_io_trackx->read() >> 0) & 0xff;
-
- case 0x70: return (m_io_tracky->read() >> 8) & 0xff;
- case 0x50: return (m_io_tracky->read() >> 0) & 0xff;
- }
- return 0;
+ membank("gfxrom")->set_entry(data < 6 ? data : 6);
}
-WRITE16_MEMBER(ssv_state::eaglshot_trackball_w)
+WRITE8_MEMBER(ssv_state::eaglshot_trackball_w)
{
- if (ACCESSING_BITS_0_7)
- {
- m_trackball_select = data;
- }
+ // All these get toggled during trackball reads; the precise arrangement is uncertain
+ m_upd4701->cs_w(!BIT(data, 6));
+ m_upd4701->ul_w(BIT(data, 5));
+ m_upd4701->xy_w(BIT(data, 4));
+ m_upd4701->resetx_w(BIT(data, 3));
+ m_upd4701->resety_w(BIT(data, 2));
}
@@ -900,11 +886,11 @@ static ADDRESS_MAP_START( eaglshot_map, AS_PROGRAM, 16, ssv_state )
AM_RANGE(0x210000, 0x210001) AM_READNOP /*AM_DEVREAD("watchdog", watchdog_timer_device, reset16_r)*/ // Watchdog
// AM_RANGE(0x210002, 0x210003) AM_WRITENOP // ? 0,4 at the start
AM_RANGE(0x21000e, 0x21000f) AM_WRITE(lockout_inv_w) // Inverted lockout lines
- AM_RANGE(0x800000, 0x800001) AM_WRITE(eaglshot_gfxrom_bank_w)
- AM_RANGE(0x900000, 0x900001) AM_WRITE(eaglshot_trackball_w)
+ AM_RANGE(0x800000, 0x800001) AM_WRITE8(eaglshot_gfxrom_bank_w, 0x00ff)
+ AM_RANGE(0x900000, 0x900001) AM_WRITE8(eaglshot_trackball_w, 0x00ff)
AM_RANGE(0xa00000, 0xbfffff) AM_ROMBANK("gfxrom")
AM_RANGE(0xc00000, 0xc007ff) AM_RAM AM_SHARE("nvram") // NVRAM
- AM_RANGE(0xd00000, 0xd00001) AM_READ(eaglshot_trackball_r)
+ AM_RANGE(0xd00000, 0xd00001) AM_DEVREAD8("upd4701", upd4701_device, d_r, 0x00ff)
SSV_MAP( 0xf00000 )
ADDRESS_MAP_END
@@ -2827,6 +2813,10 @@ static MACHINE_CONFIG_DERIVED( eaglshot, ssv )
MCFG_NVRAM_ADD_0FILL("nvram")
+ MCFG_DEVICE_ADD("upd4701", UPD4701A, 0)
+ MCFG_UPD4701_PORTX("TRACKX")
+ MCFG_UPD4701_PORTY("TRACKY")
+
MCFG_WATCHDOG_ADD("watchdog")
/* video hardware */
diff --git a/src/mame/includes/ssv.h b/src/mame/includes/ssv.h
index 19f7d75b68a..7ae04442df6 100644
--- a/src/mame/includes/ssv.h
+++ b/src/mame/includes/ssv.h
@@ -3,6 +3,7 @@
#include "cpu/upd7725/upd7725.h"
#include "video/st0020.h"
#include "machine/eepromser.h"
+#include "machine/upd4701.h"
#include "sound/es5506.h"
#include "screen.h"
@@ -15,6 +16,7 @@ public:
m_ensoniq(*this, "ensoniq"),
m_eeprom(*this, "eeprom"),
m_dsp(*this, "dsp"),
+ m_upd4701(*this, "upd4701"),
m_mainram(*this, "mainram"),
m_spriteram(*this, "spriteram"),
m_scroll(*this, "scroll"),
@@ -30,8 +32,6 @@ public:
m_io_key3(*this, "KEY3"),
m_io_service(*this, "SERVICE"),
m_io_paddle(*this, "PADDLE"),
- m_io_trackx(*this, "TRACKX"),
- m_io_tracky(*this, "TRACKY"),
m_gfxdecode(*this, "gfxdecode"),
m_screen(*this, "screen"),
m_palette(*this, "palette")
@@ -41,6 +41,7 @@ public:
required_device<es5506_device> m_ensoniq;
optional_device<eeprom_serial_93cxx_device> m_eeprom;
optional_device<upd96050_device> m_dsp;
+ optional_device<upd4701_device> m_upd4701;
required_shared_ptr<uint16_t> m_mainram;
required_shared_ptr<uint16_t> m_spriteram;
@@ -91,9 +92,8 @@ public:
DECLARE_WRITE32_MEMBER(latch32_w);
DECLARE_READ16_MEMBER(latch16_r);
DECLARE_WRITE16_MEMBER(latch16_w);
- DECLARE_WRITE16_MEMBER(eaglshot_gfxrom_bank_w);
- DECLARE_READ16_MEMBER(eaglshot_trackball_r);
- DECLARE_WRITE16_MEMBER(eaglshot_trackball_w);
+ DECLARE_WRITE8_MEMBER(eaglshot_gfxrom_bank_w);
+ DECLARE_WRITE8_MEMBER(eaglshot_trackball_w);
DECLARE_READ16_MEMBER(eaglshot_gfxram_r);
DECLARE_WRITE16_MEMBER(eaglshot_gfxram_w);
DECLARE_WRITE16_MEMBER(gdfs_tmapram_w);
@@ -158,8 +158,6 @@ protected:
optional_ioport m_io_key3;
optional_ioport m_io_service;
optional_ioport m_io_paddle;
- optional_ioport m_io_trackx;
- optional_ioport m_io_tracky;
required_device<gfxdecode_device> m_gfxdecode;
required_device<screen_device> m_screen;
required_device<palette_device> m_palette;