From 2b092aa72dc58ec3897cff60dc5edb351ee38596 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Fri, 31 Jul 2020 15:20:47 +1000 Subject: [PATCH] hector: added save state --- src/mame/includes/hec2hrp.h | 60 ++++++------------------------------ src/mame/machine/hec2hrp.cpp | 41 ++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 50 deletions(-) diff --git a/src/mame/includes/hec2hrp.h b/src/mame/includes/hec2hrp.h index 51e5038505a..3d99dac37df 100644 --- a/src/mame/includes/hec2hrp.h +++ b/src/mame/includes/hec2hrp.h @@ -3,41 +3,7 @@ ///////////////////////////////////////////////////////////////////// ////// HECTOR HEADER FILE ///////////////////////////////////////// ///////////////////////////////////////////////////////////////////// -/* - Hector 2HR+ - Victor - Hector 2HR - Hector HRX - Hector MX40c - Hector MX80c - Hector 1 - Interact - 12/05/2009 Skeleton driver - Micko : mmicko@gmail.com - 31/06/2009 Video - Robbbert - - 29/10/2009 Update skeleton to functional machine - by yo_fr (jj.stac @ aliceadsl.fr) - - => add Keyboard, - => add color, - => add cassette, - => add sn76477 sound and 1bit sound, - => add joysticks (stick, pot, fire) - => add BR/HR switching - => add bank switch for HRX - => add device MX80c and bank switching for the ROM - 03/01/2010 Update and clean prog by yo_fr (jj.stac@aliceadsl.fr) - => add the port mapping for keyboard - 20/11/2010 : synchronization between uPD765 and Z80 are now OK, CP/M running! JJStacino - 11/11/2011 : add the minidisque support -3 pouces 1/2 driver- JJStacino (jj.stac @ aliceadsl.fr) - - don't forget to keep some information about these machine see DChector project : http://dchector.free.fr/ made by DanielCoulom - (and thank's to Daniel!) and Yves site : http://hectorvictor.free.fr/ (thank's too Yves!) - - TODO : Add the cartridge function, - Adjust the one shot and A/D timing (sn76477) -*/ #ifndef MAME_INCLUDES_HEC2HRP_H #define MAME_INCLUDES_HEC2HRP_H @@ -120,10 +86,10 @@ public: void interact(machine_config &config); void interact_common(machine_config &config); -protected: +private: void hector_hr(bitmap_ind16 &bitmap, uint8_t *page, int ymax, int yram); void hector_reset(bool hr, bool with_d2); - + void video_start() override; void keyboard_w(uint8_t data); uint8_t keyboard_r(offs_t offset); void sn_2000_w(offs_t offset, uint8_t data); @@ -138,19 +104,7 @@ protected: bool m_is_extended; void init_palette(palette_device &); void hector_init(); - - required_device m_maincpu; - required_device m_cassette; - optional_device m_printer; - required_device m_palette; - optional_shared_ptr m_vram; - optional_memory_bank_array<4> m_bank; - required_region_ptr m_rom; - optional_device m_ram; - -private: void minidisc_control_w(uint8_t data); - void switch_bank_w(offs_t offset, uint8_t data); uint8_t io_8255_r(offs_t offset); void io_8255_w(offs_t offset, uint8_t data); @@ -222,8 +176,6 @@ private: void init_sn76477(); void update_sound(uint8_t data); void hector_80c(bitmap_ind16 &bitmap, uint8_t *page, int ymax, int yram); - /*----------- defined in machine/hecdisk2.c -----------*/ - void hector_disc2_reset(); uint32_t screen_update_interact(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void interact_mem(address_map &map); @@ -238,6 +190,14 @@ private: void hecdisc2_io(address_map &map); void hecdisc2_mem(address_map &map); + required_device m_maincpu; + required_device m_cassette; + optional_device m_printer; + required_device m_palette; + optional_shared_ptr m_vram; + optional_memory_bank_array<4> m_bank; + required_region_ptr m_rom; + optional_device m_ram; optional_shared_ptr m_hector_vram; optional_device m_disc2cpu; required_device m_discrete; diff --git a/src/mame/machine/hec2hrp.cpp b/src/mame/machine/hec2hrp.cpp index 4891e4847c7..2a7264fe668 100644 --- a/src/mame/machine/hec2hrp.cpp +++ b/src/mame/machine/hec2hrp.cpp @@ -529,6 +529,47 @@ void hec2hrp_state::mx80_io_port_w(offs_t offset, uint8_t data) m_hector_flag_80c = true; } +void hec2hrp_state::video_start() +{ + save_item(NAME(m_has_disc2)); + save_item(NAME(m_has_minidisc)); + save_item(NAME(m_is_hr)); + save_item(NAME(m_is_extended)); + save_item(NAME(m_hector_flag_hr)); + save_item(NAME(m_hector_flag_80c)); + save_item(NAME(m_hector_color)); + save_item(NAME(m_hector_disc2_data_r_ready)); + save_item(NAME(m_hector_disc2_data_w_ready)); + save_item(NAME(m_hector_disc2_data_read)); + save_item(NAME(m_hector_disc2_data_write)); + save_item(NAME(m_hector_disc2_rnmi)); + save_item(NAME(m_state3000)); + save_item(NAME(m_write_cassette)); + save_item(NAME(m_ck_signal)); + save_item(NAME(m_flag_clk)); + save_item(NAME(m_pin_value)); + save_item(NAME(m_au)); + save_item(NAME(m_val_mixer)); + save_item(NAME(m_oldstate3000)); + save_item(NAME(m_oldstate1000)); + save_item(NAME(m_pot0)); + save_item(NAME(m_pot1)); + save_item(NAME(m_actions)); + save_item(NAME(m_hector_port_a)); + save_item(NAME(m_hector_port_b)); + save_item(NAME(m_hector_port_c_h)); + save_item(NAME(m_hector_port_c_l)); + save_item(NAME(m_hector_port_cmd)); + save_item(NAME(m_cassette_bit)); + save_item(NAME(m_cassette_bit_mem)); + save_item(NAME(m_data_k7)); + save_item(NAME(m_counter_write)); + save_item(NAME(m_irq_current_state)); + save_item(NAME(m_nmi_current_state)); + save_item(NAME(m_hector_videoram_hrx)); +} + + /******************************************************************************** sound management ********************************************************************************/