diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 7902a86ae4f..6059c2c7504 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -4729,9 +4729,7 @@ files { MAME_DIR .. "src/mame/drivers/wpc_dot.cpp", MAME_DIR .. "src/mame/includes/wpc_dot.h", MAME_DIR .. "src/mame/drivers/wpc_flip1.cpp", - MAME_DIR .. "src/mame/includes/wpc_flip1.h", MAME_DIR .. "src/mame/drivers/wpc_flip2.cpp", - MAME_DIR .. "src/mame/includes/wpc_flip2.h", MAME_DIR .. "src/mame/drivers/wpc_s.cpp", MAME_DIR .. "src/mame/machine/wpc.cpp", MAME_DIR .. "src/mame/machine/wpc.h", diff --git a/src/mame/drivers/wpc_an.cpp b/src/mame/drivers/wpc_an.cpp index c140a35ae10..c210a5dd386 100644 --- a/src/mame/drivers/wpc_an.cpp +++ b/src/mame/drivers/wpc_an.cpp @@ -131,7 +131,7 @@ private: // driver_device overrides virtual void machine_reset() override; - virtual void machine_start() override { m_digits.resolve(); } + virtual void machine_start() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; static const device_timer_id TIMER_VBLANK = 0; static const device_timer_id TIMER_IRQ = 1; @@ -384,6 +384,15 @@ void wpc_an_state::ram_w(offs_t offset, uint8_t data) if(LOG_WPC) logerror("WPC: Memory protection violation at 0x%04x (mask=0x%04x)\n",offset,m_wpc->get_memprotect_mask()); } +void wpc_an_state::machine_start() +{ + m_digits.resolve(); + save_item(NAME(m_vblank_count)); + save_item(NAME(m_irq_count)); + save_item(NAME(m_bankmask)); + save_item(NAME(m_ram)); +} + void wpc_an_state::machine_reset() { m_cpubank->set_entry(0); diff --git a/src/mame/drivers/wpc_dot.cpp b/src/mame/drivers/wpc_dot.cpp index 67559f056f0..2c787311e37 100644 --- a/src/mame/drivers/wpc_dot.cpp +++ b/src/mame/drivers/wpc_dot.cpp @@ -191,6 +191,15 @@ void wpc_dot_state::device_timer(emu_timer &timer, device_timer_id id, int param } } +void wpc_dot_state::machine_start() +{ + save_item(NAME(m_vblank_count)); + save_item(NAME(m_irq_count)); + save_item(NAME(m_bankmask)); + save_item(NAME(m_ram)); + save_item(NAME(m_dmdram)); +} + void wpc_dot_state::machine_reset() { m_cpubank->set_entry(0); diff --git a/src/mame/drivers/wpc_flip1.cpp b/src/mame/drivers/wpc_flip1.cpp index 81fbce5ff2a..6ebf2a05d13 100644 --- a/src/mame/drivers/wpc_flip1.cpp +++ b/src/mame/drivers/wpc_flip1.cpp @@ -19,7 +19,7 @@ ToDo: *********************************************************************************************/ #include "emu.h" -#include "includes/wpc_flip1.h" +#include "includes/wpc_dot.h" #include "screen.h" #include "speaker.h" diff --git a/src/mame/drivers/wpc_flip2.cpp b/src/mame/drivers/wpc_flip2.cpp index 6f01f4ed3c6..63fcdac4bea 100644 --- a/src/mame/drivers/wpc_flip2.cpp +++ b/src/mame/drivers/wpc_flip2.cpp @@ -34,7 +34,7 @@ ToDo: *********************************************************************************************/ #include "emu.h" -#include "includes/wpc_flip2.h" +#include "includes/wpc_dot.h" #include "screen.h" #include "speaker.h" diff --git a/src/mame/includes/wpc_dot.h b/src/mame/includes/wpc_dot.h index 3d84d923376..80e3504eb2d 100644 --- a/src/mame/includes/wpc_dot.h +++ b/src/mame/includes/wpc_dot.h @@ -45,6 +45,7 @@ protected: required_memory_bank_array<6> m_dmdbanks; // driver_device overrides + virtual void machine_start() override; virtual void machine_reset() override; virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override; static const device_timer_id TIMER_VBLANK = 0; @@ -61,13 +62,41 @@ protected: uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); private: - uint16_t m_vblank_count; - uint32_t m_irq_count; - uint8_t m_bankmask; - uint8_t m_ram[0x3000]; - uint8_t m_dmdram[0x2000]; + uint16_t m_vblank_count = 0U; + uint32_t m_irq_count = 0U; + uint8_t m_bankmask = 0U; + uint8_t m_ram[0x3000]{}; + uint8_t m_dmdram[0x2000]{}; emu_timer* m_vblank_timer; emu_timer* m_irq_timer; }; +class wpc_flip1_state : public wpc_dot_state +{ +public: + wpc_flip1_state(const machine_config &mconfig, device_type type, const char *tag) + : wpc_dot_state(mconfig, type, tag) + { } + + void init_wpc_flip1(); + void wpc_flip1(machine_config &config); + +protected: + void wpc_flip1_map(address_map &map); +}; + +class wpc_flip2_state : public wpc_flip1_state +{ +public: + wpc_flip2_state(const machine_config &mconfig, device_type type, const char *tag) + : wpc_flip1_state(mconfig, type, tag) + { } + + void init_wpc_flip2(); + void wpc_flip2(machine_config &config); + +protected: + void wpc_flip2_map(address_map &map); +}; + #endif // MAME_INCLUDES_WPC_DOT_H diff --git a/src/mame/includes/wpc_flip1.h b/src/mame/includes/wpc_flip1.h deleted file mode 100644 index 8f26f9ebd75..00000000000 --- a/src/mame/includes/wpc_flip1.h +++ /dev/null @@ -1,29 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Barry Rodewald -/* - * wpc_flip1.h - * - */ - -#ifndef MAME_INCLUDES_WPC_FLIP1_H -#define MAME_INCLUDES_WPC_FLIP1_H - -#pragma once - -#include "includes/wpc_dot.h" - -class wpc_flip1_state : public wpc_dot_state -{ -public: - wpc_flip1_state(const machine_config &mconfig, device_type type, const char *tag) - : wpc_dot_state(mconfig, type, tag) - { } - - void init_wpc_flip1(); - void wpc_flip1(machine_config &config); - -protected: - void wpc_flip1_map(address_map &map); -}; - -#endif // MAME_INCLUDES_WPC_FLIP1_H diff --git a/src/mame/includes/wpc_flip2.h b/src/mame/includes/wpc_flip2.h deleted file mode 100644 index 7c07907af1f..00000000000 --- a/src/mame/includes/wpc_flip2.h +++ /dev/null @@ -1,29 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Barry Rodewald -/* - * wpc_flip2.h - * - */ - -#ifndef MAME_INCLUDES_WPC_FLIP2_H -#define MAME_INCLUDES_WPC_FLIP2_H - -#pragma once - -#include "includes/wpc_flip1.h" - -class wpc_flip2_state : public wpc_flip1_state -{ -public: - wpc_flip2_state(const machine_config &mconfig, device_type type, const char *tag) - : wpc_flip1_state(mconfig, type, tag) - { } - - void init_wpc_flip2(); - void wpc_flip2(machine_config &config); - -protected: - void wpc_flip2_map(address_map &map); -}; - -#endif // MAME_INCLUDES_WPC_FLIP2_H