From 3af6cad39858c3d2888f6794827b51043d874967 Mon Sep 17 00:00:00 2001 From: arbee Date: Sat, 26 Sep 2020 08:42:50 -0400 Subject: [PATCH] seibuspi: allow recovery if MAME is exited during the initial flash process [R. Belmont] --- src/mame/drivers/seibuspi.cpp | 6 ++++++ src/mame/includes/seibuspi.h | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/mame/drivers/seibuspi.cpp b/src/mame/drivers/seibuspi.cpp index 495b44ca4f0..c970d99cd1d 100644 --- a/src/mame/drivers/seibuspi.cpp +++ b/src/mame/drivers/seibuspi.cpp @@ -1778,6 +1778,12 @@ MACHINE_RESET_MEMBER(seibuspi_state,spi) m_z80_bank->set_entry(0); m_z80_lastbank = 0; m_z80_prg_transfer_pos = 0; + + // fix the magic ID byte so users can't "brick" the machine + if (m_soundflash1 && m_soundflash1_region) + { + m_soundflash1->write_raw(0, m_soundflash1_region[0]); + } } void seibuspi_state::spi(machine_config &config) diff --git a/src/mame/includes/seibuspi.h b/src/mame/includes/seibuspi.h index 19c64116ba8..1ee4287d3ae 100644 --- a/src/mame/includes/seibuspi.h +++ b/src/mame/includes/seibuspi.h @@ -8,6 +8,7 @@ #include "machine/eepromser.h" #include "machine/7200fifo.h" +#include "machine/intelfsh.h" #include "sound/okim6295.h" #include "emupal.h" #include "tilemap.h" @@ -29,6 +30,9 @@ public: , m_key(*this, "KEY.%u", 0) , m_special(*this, "SPECIAL") , m_z80_bank(*this, "z80_bank") + , m_soundflash1(*this, "soundflash1") + , m_soundflash2(*this, "soundflash2") + , m_soundflash1_region(*this, "soundflash1") { } void sys386f(machine_config &config); @@ -75,6 +79,10 @@ protected: optional_memory_bank m_z80_bank; + optional_device m_soundflash1, m_soundflash2; + + optional_region_ptr m_soundflash1_region; + int m_z80_prg_transfer_pos; int m_z80_lastbank; u8 m_sb_coin_latch;