summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author David Haywood <davidhaywood@users.noreply.github.com>2017-07-20 13:01:05 +0100
committer David Haywood <davidhaywood@users.noreply.github.com>2017-07-20 13:01:05 +0100
commit2834e15e9acec906f10657c9a40478b696018ac2 (patch)
tree2f2c5eaebd6dc5f14234a35f4879bcdac1b4ac02 /src
parentd1159c6f0798901db228d7a74053b54a96fb95b7 (diff)
improve naming etc.
Diffstat (limited to 'src')
-rw-r--r--src/mame/drivers/gaelco2.cpp4
-rw-r--r--src/mame/drivers/glass.cpp1
-rw-r--r--src/mame/drivers/targeth.cpp1
-rw-r--r--src/mame/drivers/thoop2.cpp1
-rw-r--r--src/mame/drivers/wrally.cpp1
-rw-r--r--src/mame/machine/gaelco_ds5002fp.cpp30
-rw-r--r--src/mame/machine/gaelco_ds5002fp.h15
7 files changed, 36 insertions, 17 deletions
diff --git a/src/mame/drivers/gaelco2.cpp b/src/mame/drivers/gaelco2.cpp
index 3a3e0f4be9a..e37a63bce68 100644
--- a/src/mame/drivers/gaelco2.cpp
+++ b/src/mame/drivers/gaelco2.cpp
@@ -196,6 +196,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( maniacsq_d5002fp, maniacsq )
MCFG_DEVICE_ADD("gaelco_ds5002fp", GAELCO_DS5002FP, XTAL_24MHz / 2) /* ? */
+ GAELCO_DS5002FP_SET_SHARE_TAG("shareram")
MACHINE_CONFIG_END
ROM_START( maniacsq )
@@ -577,6 +578,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( alighunt_d5002fp, alighunt )
MCFG_DEVICE_ADD("gaelco_ds5002fp", GAELCO_DS5002FP, XTAL_24MHz / 2) /* ? */
+ GAELCO_DS5002FP_SET_SHARE_TAG("shareram")
MACHINE_CONFIG_END
/*
@@ -833,6 +835,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( touchgo_d5002fp, touchgo )
MCFG_DEVICE_ADD("gaelco_ds5002fp", GAELCO_DS5002FP, XTAL_24MHz / 2) /* ? */
+ GAELCO_DS5002FP_SET_SHARE_TAG("shareram")
MACHINE_CONFIG_END
/*
@@ -1275,6 +1278,7 @@ static MACHINE_CONFIG_START( wrally2 )
MCFG_CPU_VBLANK_INT_DRIVER("lscreen", gaelco2_state, irq6_line_hold)
MCFG_DEVICE_ADD("gaelco_ds5002fp", GAELCO_DS5002FP, XTAL_24MHz / 2)
+ GAELCO_DS5002FP_SET_SHARE_TAG("shareram")
MCFG_EEPROM_SERIAL_93C66_ADD("eeprom")
diff --git a/src/mame/drivers/glass.cpp b/src/mame/drivers/glass.cpp
index cacd1364dcc..c7d419d144e 100644
--- a/src/mame/drivers/glass.cpp
+++ b/src/mame/drivers/glass.cpp
@@ -230,6 +230,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( glass_ds5002fp, glass )
MCFG_DEVICE_ADD("gaelco_ds5002fp", GAELCO_DS5002FP_WRALLY, XTAL_24MHz / 2) /* verified on pcb */
+ GAELCO_DS5002FP_SET_SHARE_TAG("shareram")
MACHINE_CONFIG_END
ROM_START( glass ) /* Version 1.1 */
diff --git a/src/mame/drivers/targeth.cpp b/src/mame/drivers/targeth.cpp
index bbbf81ee882..0bc5f85d6e8 100644
--- a/src/mame/drivers/targeth.cpp
+++ b/src/mame/drivers/targeth.cpp
@@ -234,6 +234,7 @@ static MACHINE_CONFIG_START( targeth )
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", targeth_state, interrupt, "screen", 0, 1)
MCFG_DEVICE_ADD("gaelco_ds5002fp", GAELCO_DS5002FP, XTAL_24MHz / 2)
+ GAELCO_DS5002FP_SET_SHARE_TAG("shareram")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/drivers/thoop2.cpp b/src/mame/drivers/thoop2.cpp
index 8bdac670a66..629eacbe4d2 100644
--- a/src/mame/drivers/thoop2.cpp
+++ b/src/mame/drivers/thoop2.cpp
@@ -202,6 +202,7 @@ static MACHINE_CONFIG_START( thoop2 )
MCFG_CPU_VBLANK_INT_DRIVER("screen", thoop2_state, irq6_line_hold)
MCFG_DEVICE_ADD("gaelco_ds5002fp", GAELCO_DS5002FP, XTAL_24MHz / 2)
+ GAELCO_DS5002FP_SET_SHARE_TAG("shareram")
MCFG_WATCHDOG_ADD("watchdog")
diff --git a/src/mame/drivers/wrally.cpp b/src/mame/drivers/wrally.cpp
index bc5e5c00187..6dca3688eaa 100644
--- a/src/mame/drivers/wrally.cpp
+++ b/src/mame/drivers/wrally.cpp
@@ -261,6 +261,7 @@ static MACHINE_CONFIG_START( wrally )
MCFG_CPU_VBLANK_INT_DRIVER("screen", wrally_state, irq6_line_hold)
MCFG_DEVICE_ADD("gaelco_ds5002fp", GAELCO_DS5002FP_WRALLY, XTAL_24MHz / 2) /* verified on pcb */
+ GAELCO_DS5002FP_SET_SHARE_TAG("shareram")
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
diff --git a/src/mame/machine/gaelco_ds5002fp.cpp b/src/mame/machine/gaelco_ds5002fp.cpp
index 45e90a5d258..16336e3dc7b 100644
--- a/src/mame/machine/gaelco_ds5002fp.cpp
+++ b/src/mame/machine/gaelco_ds5002fp.cpp
@@ -6,33 +6,39 @@
DEFINE_DEVICE_TYPE(GAELCO_DS5002FP, gaelco_ds5002fp_device, "gaelco_ds5002fp", "Gaelco DS5002FP")
DEFINE_DEVICE_TYPE(GAELCO_DS5002FP_WRALLY, gaelco_ds5002fp_wrally_device, "gaelco_ds5002fp_wr", "Gaelco DS5002FP (World Rally)")
+
gaelco_ds5002fp_device_base::gaelco_ds5002fp_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock)
: device_t(mconfig, type, tag, owner, clock),
- m_shareram(*this, ":shareram"),
- m_mcu_ram(*this, "sram")
+ m_shareram(*this, finder_base::DUMMY_TAG),
+ m_sram(*this, "sram")
+{
+}
+
+void gaelco_ds5002fp_device_base::static_set_share_tag(device_t &device, const char *tag)
{
+ downcast<gaelco_ds5002fp_device_base &>(device).m_shareram.set_tag(tag);
}
-READ8_MEMBER(gaelco_ds5002fp_device_base::dallas_share_r)
+READ8_MEMBER(gaelco_ds5002fp_device_base::shareram_r)
{
uint8_t *shareram = (uint8_t *)m_shareram.target();
return shareram[BYTE_XOR_BE(offset)];
}
-WRITE8_MEMBER(gaelco_ds5002fp_device_base::dallas_share_w)
+WRITE8_MEMBER(gaelco_ds5002fp_device_base::shareram_w)
{
uint8_t *shareram = (uint8_t *)m_shareram.target();
shareram[BYTE_XOR_BE(offset)] = data;
}
-READ8_MEMBER(gaelco_ds5002fp_device_base::dallas_ram_r)
+READ8_MEMBER(gaelco_ds5002fp_device_base::sram_r)
{
- return m_mcu_ram[offset];
+ return m_sram[offset];
}
-WRITE8_MEMBER(gaelco_ds5002fp_device_base::dallas_ram_w)
+WRITE8_MEMBER(gaelco_ds5002fp_device_base::sram_w)
{
- m_mcu_ram[offset] = data;
+ m_sram[offset] = data;
}
void gaelco_ds5002fp_device_base::device_start()
@@ -49,11 +55,11 @@ gaelco_ds5002fp_device::gaelco_ds5002fp_device(const machine_config &mconfig, co
}
static ADDRESS_MAP_START( dallas_rom, AS_PROGRAM, 8, gaelco_ds5002fp_device )
- AM_RANGE(0x00000, 0x07fff) AM_READ(dallas_ram_r) /* Code in NVRAM */
+ AM_RANGE(0x00000, 0x07fff) AM_READ(sram_r) /* Code in SRAM */
ADDRESS_MAP_END
static ADDRESS_MAP_START( dallas_ram, AS_IO, 8, gaelco_ds5002fp_device )
- AM_RANGE(0x08000, 0x0ffff) AM_READWRITE(dallas_share_r, dallas_share_w) /* confirmed that 0x8000 - 0xffff is a window into 68k shared RAM */
+ AM_RANGE(0x08000, 0x0ffff) AM_READWRITE(shareram_r, shareram_w) /* confirmed that 0x8000 - 0xffff is a window into 68k shared RAM */
AM_RANGE(0x10000, 0x17fff) AM_RAM AM_SHARE("sram") /* yes, the games access it as data and use it for temporary storage!! */
ADDRESS_MAP_END
@@ -74,11 +80,11 @@ gaelco_ds5002fp_wrally_device::gaelco_ds5002fp_wrally_device(const machine_confi
}
static ADDRESS_MAP_START( dallas_rom_wr, AS_PROGRAM, 8, gaelco_ds5002fp_wrally_device )
- AM_RANGE(0x00000, 0x07fff) AM_READ(dallas_ram_r) /* Code in NVRAM */
+ AM_RANGE(0x00000, 0x07fff) AM_READ(sram_r) /* Code in SRAM */
ADDRESS_MAP_END
static ADDRESS_MAP_START( dallas_ram_wr, AS_IO, 8, gaelco_ds5002fp_wrally_device )
- AM_RANGE(0x00000, 0x0ffff) AM_READWRITE(dallas_share_r, dallas_share_w) AM_MASK(0x3fff) /* Shared RAM with the main CPU */
+ AM_RANGE(0x00000, 0x0ffff) AM_READWRITE(shareram_r, shareram_w) AM_MASK(0x3fff) /* Shared RAM with the main CPU */
AM_RANGE(0x10000, 0x17fff) AM_RAM AM_SHARE("sram") /*don't think World Rally actually uses it for storage tho */
ADDRESS_MAP_END
diff --git a/src/mame/machine/gaelco_ds5002fp.h b/src/mame/machine/gaelco_ds5002fp.h
index 75c2882cfb9..088f9d11fe9 100644
--- a/src/mame/machine/gaelco_ds5002fp.h
+++ b/src/mame/machine/gaelco_ds5002fp.h
@@ -11,13 +11,18 @@
DECLARE_DEVICE_TYPE(GAELCO_DS5002FP, gaelco_ds5002fp_device)
DECLARE_DEVICE_TYPE(GAELCO_DS5002FP_WRALLY, gaelco_ds5002fp_wrally_device)
+#define GAELCO_DS5002FP_SET_SHARE_TAG(_tag) \
+ gaelco_ds5002fp_device_base::static_set_share_tag(*device, "^" _tag);
+
class gaelco_ds5002fp_device_base : public device_t
{
public:
- DECLARE_READ8_MEMBER(dallas_ram_r);
- DECLARE_WRITE8_MEMBER(dallas_ram_w);
- DECLARE_READ8_MEMBER(dallas_share_r);
- DECLARE_WRITE8_MEMBER(dallas_share_w);
+ static void static_set_share_tag(device_t &device, const char *tag);
+
+ DECLARE_READ8_MEMBER(sram_r);
+ DECLARE_WRITE8_MEMBER(sram_w);
+ DECLARE_READ8_MEMBER(shareram_r);
+ DECLARE_WRITE8_MEMBER(shareram_w);
protected:
gaelco_ds5002fp_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock);
@@ -27,7 +32,7 @@ protected:
private:
required_shared_ptr<uint16_t> m_shareram;
- required_region_ptr<uint8_t> m_mcu_ram;
+ required_region_ptr<uint8_t> m_sram;
};