summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Ivan Vangelista <mesgnet@yahoo.it>2020-07-06 16:59:14 +0200
committerGravatarGravatar Ivan Vangelista <mesgnet@yahoo.it>2020-07-06 16:59:14 +0200
commit8425638709dfe3c0c6d51cfd24e4c2190eaa5311 (patch) (github)
tree69e0805941a7a4fd849e919ac11945767258435c
parent780609f4f2e675af9bb164e82afffbb54890312f (diff)
downloadmame-master.tar.bz2
mame-master.zip
supertnk.cpp: enabled save state supportHEADmaster
-rw-r--r--src/mame/drivers/supertnk.cpp33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/mame/drivers/supertnk.cpp b/src/mame/drivers/supertnk.cpp
index 400c9308617..32c3b059d65 100644
--- a/src/mame/drivers/supertnk.cpp
+++ b/src/mame/drivers/supertnk.cpp
@@ -127,6 +127,10 @@ public:
void init_supertnk();
+protected:
+ virtual void machine_start() override;
+ virtual void video_start() override;
+
private:
DECLARE_WRITE_LINE_MEMBER(bankswitch_0_w);
DECLARE_WRITE_LINE_MEMBER(bankswitch_1_w);
@@ -139,9 +143,6 @@ private:
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_WRITE_LINE_MEMBER(vblank_interrupt);
- virtual void machine_start() override;
- virtual void machine_reset() override;
- virtual void video_start() override;
void supertnk_io_map(address_map &map);
void supertnk_map(address_map &map);
@@ -159,6 +160,10 @@ private:
void supertnk_state::machine_start()
{
membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x1000);
+
+ save_item(NAME(m_rom_bank));
+ save_item(NAME(m_bitplane_select));
+ save_item(NAME(m_interrupt_enable));
}
@@ -228,9 +233,11 @@ void supertnk_state::video_start()
m_pens[i] = rgb_t(pal1bit(data >> 2), pal1bit(data >> 5), pal1bit(data >> 6));
}
- m_videoram[0] = std::make_unique<uint8_t[]>(0x2000);
- m_videoram[1] = std::make_unique<uint8_t[]>(0x2000);
- m_videoram[2] = std::make_unique<uint8_t[]>(0x2000);
+ for (int i = 0; i < 3; i++)
+ {
+ m_videoram[i] = std::make_unique<uint8_t[]>(0x2000);
+ save_pointer(NAME(m_videoram[i]), 0x2000, i);
+ }
}
@@ -307,18 +314,6 @@ uint32_t supertnk_state::screen_update(screen_device &screen, bitmap_rgb32 &bitm
/*************************************
*
- * Machine reset
- *
- *************************************/
-
-void supertnk_state::machine_reset()
-{
-}
-
-
-
-/*************************************
- *
* Memory handlers
*
*************************************/
@@ -515,4 +510,4 @@ void supertnk_state::init_supertnk()
}
-GAME( 1981, supertnk, 0, supertnk, supertnk, supertnk_state, init_supertnk, ROT90, "Video Games GmbH", "Super Tank", 0 )
+GAME( 1981, supertnk, 0, supertnk, supertnk, supertnk_state, init_supertnk, ROT90, "Video Games GmbH", "Super Tank", MACHINE_SUPPORTS_SAVE )