summaryrefslogtreecommitdiffstats
path: root/src/mame/includes/tigeroad.h
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2017-01-16 18:35:32 +1100
committer Vas Crabb <vas@vastheman.com>2017-01-16 23:12:44 +1100
commit5ae669c1958dc1d56e2700ca43438fa7513b6f6d (patch)
treef33a981920197f16ee8b654d18e176c124fbb8a5 /src/mame/includes/tigeroad.h
parent650ca8b573ecbf408c837eeb91f6cbe3ac07e34e (diff)
tstrike, ddungeon, darktowr: use new MC68705P3 core
tigeroad.cpp: cleanup and modernisation * split out bballs and pushman state classes * use new MC68705R3 core for pushman (this one uses port D - another test case) * make pushman MCU hookup believable (internal registers can't be in shared RAM) * use derived memory maps rather than installing handlers in init members
Diffstat (limited to 'src/mame/includes/tigeroad.h')
-rw-r--r--src/mame/includes/tigeroad.h92
1 files changed, 69 insertions, 23 deletions
diff --git a/src/mame/includes/tigeroad.h b/src/mame/includes/tigeroad.h
index 4a41ebcd907..51341e89a31 100644
--- a/src/mame/includes/tigeroad.h
+++ b/src/mame/includes/tigeroad.h
@@ -1,22 +1,26 @@
// license:BSD-3-Clause
// copyright-holders:Phil Stroffolino
-#include "video/bufsprite.h"
-#include "sound/msm5205.h"
+#include "video/tigeroad_spr.h"
+
#include "cpu/m68000/m68000.h"
+#include "cpu/m6805/m68705.h"
#include "cpu/z80/z80.h"
+
#include "machine/gen_latch.h"
+
#include "sound/2203intf.h"
#include "sound/msm5205.h"
-#include "cpu/m6805/m68705.h"
-#include "video/tigeroad_spr.h"
+
+#include "video/bufsprite.h"
+
class tigeroad_state : public driver_device
{
public:
tigeroad_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_spriteram(*this, "spriteram") ,
+ m_spriteram(*this, "spriteram"),
m_videoram(*this, "videoram"),
m_ram16(*this, "ram16"),
m_maincpu(*this, "maincpu"),
@@ -24,10 +28,9 @@ public:
m_msm(*this, "msm"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
- m_mcu(*this, "mcu"),
m_spritegen(*this, "spritegen"),
m_soundlatch(*this, "soundlatch"),
- m_has_coinlock(1)
+ m_has_coinlock(true)
{ }
required_device<buffered_spriteram16_device> m_spriteram;
@@ -43,8 +46,6 @@ public:
DECLARE_WRITE16_MEMBER(tigeroad_scroll_w);
DECLARE_WRITE8_MEMBER(msm5205_w);
DECLARE_DRIVER_INIT(f1dream);
- DECLARE_DRIVER_INIT(pushman);
- DECLARE_DRIVER_INIT(bballs);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
TILEMAP_MAPPER_MEMBER(tigeroad_tilemap_scan);
@@ -56,28 +57,73 @@ public:
optional_device<msm5205_device> m_msm;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
- optional_device<cpu_device> m_mcu;
required_device<tigeroad_spr_device> m_spritegen;
required_device<generic_latch_8_device> m_soundlatch;
- uint16_t m_control[2];
-
+protected:
/* misc */
- uint8_t m_shared_ram[8];
- uint16_t m_latch;
- uint16_t m_new_latch;
- int m_has_coinlock;
-
- /* protection handling */
- DECLARE_READ16_MEMBER(pushman_68705_r);
- DECLARE_WRITE16_MEMBER(pushman_68705_w);
+ bool m_has_coinlock;
+};
+
+
+class pushman_state : public tigeroad_state
+{
+public:
+ pushman_state(const machine_config &mconfig, device_type type, const char *tag)
+ : tigeroad_state(mconfig, type, tag)
+ , m_mcu(*this, "mcu")
+ , m_mcu_semaphore(false)
+ , m_host_latch(0xffff)
+ , m_mcu_latch(0xffff)
+ , m_mcu_output(0xffff)
+ , m_mcu_latch_ctl(0xff)
+ {
+ m_has_coinlock = false;
+ }
+
+ DECLARE_READ16_MEMBER(mcu_data_r);
+ DECLARE_READ16_MEMBER(mcu_ack_r);
+ DECLARE_WRITE16_MEMBER(mcu_data_w);
+ DECLARE_WRITE16_MEMBER(mcu_cmd_w);
+
+ DECLARE_WRITE8_MEMBER(mcu_pa_w);
+ DECLARE_WRITE8_MEMBER(mcu_pb_w);
+ DECLARE_WRITE8_MEMBER(mcu_pc_w);
+
+protected:
+ virtual void machine_start() override;
+
+ required_device<m68705u_device> m_mcu;
+
+ bool m_mcu_semaphore;
+ u16 m_host_latch, m_mcu_latch;
+ u16 m_mcu_output;
+ u8 m_mcu_latch_ctl;
+};
+
+
+class bballs_state : public tigeroad_state
+{
+public:
+ bballs_state(const machine_config &mconfig, device_type type, const char *tag)
+ : tigeroad_state(mconfig, type, tag)
+ , m_shared_ram{ 0, 0, 0, 0, 0, 0, 0, 0 }
+ , m_latch(0xffff)
+ , m_new_latch(0)
+ {
+ m_has_coinlock = false;
+ }
+
DECLARE_READ16_MEMBER(bballs_68705_r);
DECLARE_WRITE16_MEMBER(bballs_68705_w);
- DECLARE_READ8_MEMBER(pushman_68000_r);
- DECLARE_WRITE8_MEMBER(pushman_68000_w);
- DECLARE_MACHINE_RESET(pushman);
+
DECLARE_MACHINE_RESET(bballs);
+ DECLARE_DRIVER_INIT(bballs);
+protected:
virtual void machine_start() override;
+ u8 m_shared_ram[8];
+ u16 m_latch;
+ u16 m_new_latch;
};