summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Ivan Vangelista <mesgnet@yahoo.it>2015-03-09 18:08:49 +0100
committer Ivan Vangelista <mesgnet@yahoo.it>2015-03-09 18:08:49 +0100
commit4835733a6fbe6ded352b92ae4758f88820b27c3d (patch)
treeac53af715ff52a5a20ac3d02a4975cd7c3d89fb6
parentb5bfb0a9cebbe351e581de40f0ccd7bfb69d85d0 (diff)
tgtpanic.c, xtheball.c: added save state support (nw)
-rw-r--r--src/mame/drivers/tgtpanic.c27
-rw-r--r--src/mame/drivers/xtheball.c18
2 files changed, 33 insertions, 12 deletions
diff --git a/src/mame/drivers/tgtpanic.c b/src/mame/drivers/tgtpanic.c
index 09f01722c71..73d58364756 100644
--- a/src/mame/drivers/tgtpanic.c
+++ b/src/mame/drivers/tgtpanic.c
@@ -18,26 +18,37 @@ class tgtpanic_state : public driver_device
public:
tgtpanic_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_ram(*this, "ram"),
m_maincpu(*this, "maincpu"),
- m_screen(*this, "screen") { }
+ m_screen(*this, "screen"),
+ m_ram(*this, "ram") { }
+ required_device<cpu_device> m_maincpu;
+ required_device<screen_device> m_screen;
+
required_shared_ptr<UINT8> m_ram;
+
UINT8 m_color;
+
DECLARE_WRITE8_MEMBER(color_w);
- UINT32 screen_update_tgtpanic(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
- required_device<cpu_device> m_maincpu;
- required_device<screen_device> m_screen;
+
+ virtual void machine_start();
+
+ UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
};
+void tgtpanic_state::machine_start()
+{
+ save_item(NAME(m_color));
+}
+
/*************************************
*
* Video hardware
*
*************************************/
-UINT32 tgtpanic_state::screen_update_tgtpanic(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
+UINT32 tgtpanic_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
UINT32 colors[4];
UINT32 offs;
@@ -146,7 +157,7 @@ static MACHINE_CONFIG_START( tgtpanic, tgtpanic_state )
MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* Unverified */
MCFG_SCREEN_SIZE(256, 256)
MCFG_SCREEN_VISIBLE_AREA(0, 192 - 1, 0, 192 - 1)
- MCFG_SCREEN_UPDATE_DRIVER(tgtpanic_state, screen_update_tgtpanic)
+ MCFG_SCREEN_UPDATE_DRIVER(tgtpanic_state, screen_update)
MACHINE_CONFIG_END
@@ -168,4 +179,4 @@ ROM_END
*
*************************************/
-GAME( 1996, tgtpanic, 0, tgtpanic, tgtpanic, driver_device, 0, ROT0, "Konami", "Target Panic", GAME_NO_SOUND_HW )
+GAME( 1996, tgtpanic, 0, tgtpanic, tgtpanic, driver_device, 0, ROT0, "Konami", "Target Panic", GAME_NO_SOUND_HW | GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/xtheball.c b/src/mame/drivers/xtheball.c
index 2e45270dca1..51f93712eca 100644
--- a/src/mame/drivers/xtheball.c
+++ b/src/mame/drivers/xtheball.c
@@ -30,21 +30,31 @@ public:
required_device<cpu_device> m_maincpu;
required_device<tlc34076_device> m_tlc34076;
+
required_shared_ptr<UINT16> m_vram_bg;
required_shared_ptr<UINT16> m_vram_fg;
+
required_ioport m_analog_x;
required_ioport m_analog_y;
+
UINT8 m_bitvals[32];
+
DECLARE_WRITE16_MEMBER(bit_controls_w);
DECLARE_READ16_MEMBER(analogx_r);
DECLARE_READ16_MEMBER(analogy_watchdog_r);
+
+ virtual void machine_start();
+
TMS340X0_TO_SHIFTREG_CB_MEMBER(to_shiftreg);
TMS340X0_FROM_SHIFTREG_CB_MEMBER(from_shiftreg);
TMS340X0_SCANLINE_RGB32_CB_MEMBER(scanline_update);
};
-
+void xtheball_state::machine_start()
+{
+ save_item(NAME(m_bitvals));
+}
/*************************************
*
@@ -108,7 +118,7 @@ TMS340X0_TO_SHIFTREG_CB_MEMBER(xtheball_state::to_shiftreg)
else if (address >= 0x02000000 && address <= 0x020fffff)
memcpy(shiftreg, &m_vram_fg[TOWORD(address & 0xff000)], TOBYTE(0x1000));
else
- logerror("%s:xtheball_to_shiftreg(%08X)\n", space.machine().describe_context(), address);
+ logerror("%s:to_shiftreg(%08X)\n", space.machine().describe_context(), address);
}
@@ -119,7 +129,7 @@ TMS340X0_FROM_SHIFTREG_CB_MEMBER(xtheball_state::from_shiftreg)
else if (address >= 0x02000000 && address <= 0x020fffff)
memcpy(&m_vram_fg[TOWORD(address & 0xff000)], shiftreg, TOBYTE(0x1000));
else
- logerror("%s:xtheball_from_shiftreg(%08X)\n", space.machine().describe_context(), address);
+ logerror("%s:from_shiftreg(%08X)\n", space.machine().describe_context(), address);
}
@@ -381,4 +391,4 @@ ROM_END
*
*************************************/
-GAME( 1991, xtheball, 0, xtheball, xtheball, driver_device, 0, ROT0, "Rare", "X the Ball", 0 )
+GAME( 1991, xtheball, 0, xtheball, xtheball, driver_device, 0, ROT0, "Rare", "X the Ball", GAME_SUPPORTS_SAVE )