From 6c23ea53f645b86f4c04b2617457860066533166 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 22 Oct 2018 18:02:56 +0200 Subject: bfmsys85.cpp: added save state support, no idea why this was marked as SUPPORTS_SAVE (nw) --- src/mame/drivers/bfmsys85.cpp | 75 ++++++++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 29 deletions(-) diff --git a/src/mame/drivers/bfmsys85.cpp b/src/mame/drivers/bfmsys85.cpp index 9a3b6b8f2c8..f2f2b292a51 100644 --- a/src/mame/drivers/bfmsys85.cpp +++ b/src/mame/drivers/bfmsys85.cpp @@ -87,51 +87,33 @@ public: m_lamps(*this, "lamp%u", 0U) { } - DECLARE_WRITE_LINE_MEMBER(reel0_optic_cb) { if (state) m_optic_pattern |= 0x01; else m_optic_pattern &= ~0x01; } - DECLARE_WRITE_LINE_MEMBER(reel1_optic_cb) { if (state) m_optic_pattern |= 0x02; else m_optic_pattern &= ~0x02; } - DECLARE_WRITE_LINE_MEMBER(reel2_optic_cb) { if (state) m_optic_pattern |= 0x04; else m_optic_pattern &= ~0x04; } - DECLARE_WRITE_LINE_MEMBER(reel3_optic_cb) { if (state) m_optic_pattern |= 0x08; else m_optic_pattern &= ~0x08; } - DECLARE_WRITE8_MEMBER(watchdog_w); - DECLARE_READ8_MEMBER(irqlatch_r); - DECLARE_WRITE8_MEMBER(reel12_w); - DECLARE_WRITE8_MEMBER(reel34_w); - DECLARE_WRITE8_MEMBER(mmtr_w); - DECLARE_READ8_MEMBER(mmtr_r); - DECLARE_WRITE8_MEMBER(vfd_w); - DECLARE_WRITE8_MEMBER(mux_ctrl_w); - DECLARE_READ8_MEMBER(mux_ctrl_r); - DECLARE_WRITE8_MEMBER(mux_data_w); - DECLARE_READ8_MEMBER(mux_data_r); - DECLARE_WRITE8_MEMBER(mux_enable_w); - DECLARE_WRITE8_MEMBER(triac_w); - DECLARE_READ8_MEMBER(triac_r); - DECLARE_WRITE_LINE_MEMBER(sys85_data_w); - DECLARE_WRITE_LINE_MEMBER(write_acia_clock); - void init_decode(); - void init_nodecode(); - INTERRUPT_GEN_MEMBER(timer_irq); - int b85_find_project_string(); void bfmsys85(machine_config &config); void memmap(address_map &map); + INTERRUPT_GEN_MEMBER(timer_irq); + + void init_decode(); + void init_nodecode(); + protected: virtual void machine_start() override; virtual void machine_reset() override; +private: int m_mmtr_latch; int m_triac_latch; - int m_alpha_clock; + int m_alpha_clock; // always 0 int m_irq_status; int m_optic_pattern; - int m_locked; - int m_is_timer_enabled; - int m_coin_inhibits; + int m_locked; // always 0 + int m_is_timer_enabled; // always 1 + int m_coin_inhibits; // always 0 int m_mux_output_strobe; int m_mux_input_strobe; int m_mux_input; uint8_t m_Inputs[64]; uint8_t m_codec_data[256]; - uint8_t m_sys85_data_line_t; + uint8_t m_sys85_data_line_t; // never read optional_device m_vfd; required_device m_maincpu; required_device m_reel0; @@ -141,6 +123,28 @@ protected: required_device m_acia6850_0; required_device m_meters; output_finder<256> m_lamps; + + DECLARE_WRITE_LINE_MEMBER(reel0_optic_cb) { if (state) m_optic_pattern |= 0x01; else m_optic_pattern &= ~0x01; } + DECLARE_WRITE_LINE_MEMBER(reel1_optic_cb) { if (state) m_optic_pattern |= 0x02; else m_optic_pattern &= ~0x02; } + DECLARE_WRITE_LINE_MEMBER(reel2_optic_cb) { if (state) m_optic_pattern |= 0x04; else m_optic_pattern &= ~0x04; } + DECLARE_WRITE_LINE_MEMBER(reel3_optic_cb) { if (state) m_optic_pattern |= 0x08; else m_optic_pattern &= ~0x08; } + DECLARE_WRITE8_MEMBER(watchdog_w); + DECLARE_READ8_MEMBER(irqlatch_r); + DECLARE_WRITE8_MEMBER(reel12_w); + DECLARE_WRITE8_MEMBER(reel34_w); + DECLARE_WRITE8_MEMBER(mmtr_w); + DECLARE_READ8_MEMBER(mmtr_r); + DECLARE_WRITE8_MEMBER(vfd_w); + DECLARE_WRITE8_MEMBER(mux_ctrl_w); + DECLARE_READ8_MEMBER(mux_ctrl_r); + DECLARE_WRITE8_MEMBER(mux_data_w); + DECLARE_READ8_MEMBER(mux_data_r); + DECLARE_WRITE8_MEMBER(mux_enable_w); + DECLARE_WRITE8_MEMBER(triac_w); + DECLARE_READ8_MEMBER(triac_r); + DECLARE_WRITE_LINE_MEMBER(sys85_data_w); + DECLARE_WRITE_LINE_MEMBER(write_acia_clock); + int b85_find_project_string(); }; #define MASTER_CLOCK (XTAL(4'000'000)) @@ -356,6 +360,19 @@ READ8_MEMBER(bfmsys85_state::triac_r) void bfmsys85_state::machine_start() { m_lamps.resolve(); + + save_item(NAME(m_mmtr_latch)); + save_item(NAME(m_triac_latch)); + // save_item(NAME(m_alpha_clock)); + save_item(NAME(m_irq_status)); + save_item(NAME(m_optic_pattern)); + // save_item(NAME(m_locked)); + // save_item(NAME(m_is_timer_enabled)); + // save_item(NAME(m_coin_inhibits)); + save_item(NAME(m_mux_output_strobe)); + save_item(NAME(m_mux_input_strobe)); + save_item(NAME(m_mux_input)); + save_item(NAME(m_Inputs)); } // memory map for bellfruit system85 board //////////////////////////////// -- cgit v1.2.3