From 9739b4d15c9b36a54d1584c832009ccaf48971f9 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Sun, 8 Feb 2015 09:43:12 +0100 Subject: taxidriv.c: added save state support (nw) --- src/mame/drivers/taxidriv.c | 33 ++++++++++++++++++++++----------- src/mame/includes/taxidriv.h | 36 +++++++++++++++++++++--------------- src/mame/video/taxidriv.c | 4 ++-- 3 files changed, 45 insertions(+), 28 deletions(-) diff --git a/src/mame/drivers/taxidriv.c b/src/mame/drivers/taxidriv.c index 515a6b8d7e9..7e6fe117762 100644 --- a/src/mame/drivers/taxidriv.c +++ b/src/mame/drivers/taxidriv.c @@ -16,16 +16,27 @@ OTHER: 5 * M5L8255AP #include "sound/ay8910.h" +void taxidriv_state::machine_start() +{ + save_item(NAME(m_s1)); + save_item(NAME(m_s2)); + save_item(NAME(m_s3)); + save_item(NAME(m_s4)); + save_item(NAME(m_latchA)); + save_item(NAME(m_latchB)); + save_item(NAME(m_bghide)); + save_item(NAME(m_spritectrl)); +} -WRITE8_MEMBER(taxidriv_state::p2a_w){ taxidriv_spritectrl_w(space,0,data); } -WRITE8_MEMBER(taxidriv_state::p2b_w){ taxidriv_spritectrl_w(space,1,data); } -WRITE8_MEMBER(taxidriv_state::p2c_w){ taxidriv_spritectrl_w(space,2,data); } -WRITE8_MEMBER(taxidriv_state::p3a_w){ taxidriv_spritectrl_w(space,3,data); } -WRITE8_MEMBER(taxidriv_state::p3b_w){ taxidriv_spritectrl_w(space,4,data); } -WRITE8_MEMBER(taxidriv_state::p3c_w){ taxidriv_spritectrl_w(space,5,data); } -WRITE8_MEMBER(taxidriv_state::p4a_w){ taxidriv_spritectrl_w(space,6,data); } -WRITE8_MEMBER(taxidriv_state::p4b_w){ taxidriv_spritectrl_w(space,7,data); } -WRITE8_MEMBER(taxidriv_state::p4c_w){ taxidriv_spritectrl_w(space,8,data); } +WRITE8_MEMBER(taxidriv_state::p2a_w){ spritectrl_w(space,0,data); } +WRITE8_MEMBER(taxidriv_state::p2b_w){ spritectrl_w(space,1,data); } +WRITE8_MEMBER(taxidriv_state::p2c_w){ spritectrl_w(space,2,data); } +WRITE8_MEMBER(taxidriv_state::p3a_w){ spritectrl_w(space,3,data); } +WRITE8_MEMBER(taxidriv_state::p3b_w){ spritectrl_w(space,4,data); } +WRITE8_MEMBER(taxidriv_state::p3c_w){ spritectrl_w(space,5,data); } +WRITE8_MEMBER(taxidriv_state::p4a_w){ spritectrl_w(space,6,data); } +WRITE8_MEMBER(taxidriv_state::p4b_w){ spritectrl_w(space,7,data); } +WRITE8_MEMBER(taxidriv_state::p4c_w){ spritectrl_w(space,8,data); } READ8_MEMBER(taxidriv_state::p0a_r) @@ -366,7 +377,7 @@ static MACHINE_CONFIG_START( taxidriv, taxidriv_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 1*8, 27*8-1) - MCFG_SCREEN_UPDATE_DRIVER(taxidriv_state, screen_update_taxidriv) + MCFG_SCREEN_UPDATE_DRIVER(taxidriv_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", taxidriv) @@ -432,4 +443,4 @@ ROM_START( taxidriv ) ROM_END -GAME( 1984, taxidriv, 0, taxidriv, taxidriv, driver_device, 0, ROT90, "Graphic Techno", "Taxi Driver", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL ) +GAME( 1984, taxidriv, 0, taxidriv, taxidriv, driver_device, 0, ROT90, "Graphic Techno", "Taxi Driver", GAME_IMPERFECT_GRAPHICS | GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) diff --git a/src/mame/includes/taxidriv.h b/src/mame/includes/taxidriv.h index 63bd13d8bf4..b661783fb81 100644 --- a/src/mame/includes/taxidriv.h +++ b/src/mame/includes/taxidriv.h @@ -3,6 +3,9 @@ class taxidriv_state : public driver_device public: taxidriv_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), m_vram0(*this, "vram0"), m_vram1(*this, "vram1"), m_vram2(*this, "vram2"), @@ -11,17 +14,12 @@ public: m_vram5(*this, "vram5"), m_vram6(*this, "vram6"), m_vram7(*this, "vram7"), - m_scroll(*this, "scroll"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_scroll(*this, "scroll") { } + + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_palette; - int m_s1; - int m_s2; - int m_s3; - int m_s4; - int m_latchA; - int m_latchB; required_shared_ptr m_vram0; required_shared_ptr m_vram1; required_shared_ptr m_vram2; @@ -31,8 +29,16 @@ public: required_shared_ptr m_vram6; required_shared_ptr m_vram7; required_shared_ptr m_scroll; + + int m_s1; + int m_s2; + int m_s3; + int m_s4; + int m_latchA; + int m_latchB; int m_bghide; int m_spritectrl[9]; + DECLARE_WRITE8_MEMBER(p2a_w); DECLARE_WRITE8_MEMBER(p2b_w); DECLARE_WRITE8_MEMBER(p2c_w); @@ -53,10 +59,10 @@ public: DECLARE_READ8_MEMBER(p8910_0a_r); DECLARE_READ8_MEMBER(p8910_1a_r); DECLARE_WRITE8_MEMBER(p8910_0b_w); - DECLARE_WRITE8_MEMBER(taxidriv_spritectrl_w); + DECLARE_WRITE8_MEMBER(spritectrl_w); + + virtual void machine_start(); DECLARE_PALETTE_INIT(taxidriv); - UINT32 screen_update_taxidriv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/video/taxidriv.c b/src/mame/video/taxidriv.c index 619e74e25db..6341ba6a30b 100644 --- a/src/mame/video/taxidriv.c +++ b/src/mame/video/taxidriv.c @@ -2,14 +2,14 @@ #include "includes/taxidriv.h" -WRITE8_MEMBER(taxidriv_state::taxidriv_spritectrl_w) +WRITE8_MEMBER(taxidriv_state::spritectrl_w) { m_spritectrl[offset] = data; } -UINT32 taxidriv_state::screen_update_taxidriv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 taxidriv_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int offs; int sx,sy; -- cgit v1.2.3