diff options
| author | 2022-04-27 22:50:09 +1000 | |
|---|---|---|
| committer | 2022-04-27 22:50:09 +1000 | |
| commit | 0ca2ad5affaf3682baea6f15264aba945e8774e7 (patch) | |
| tree | 5a92634d30bff3eda4288183db2daccaee1b8abf /src | |
| parent | 8afcaaec3daf4f9c51868da1d6bf38a86ea12773 (diff) | |
Fixed crashes on start in ZX Spectrum clones and NWK-TR games.
Diffstat (limited to 'src')
| -rw-r--r-- | src/mame/drivers/nwk-tr.cpp | 12 | ||||
| -rw-r--r-- | src/mame/includes/spectrum.h | 3 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/mame/drivers/nwk-tr.cpp b/src/mame/drivers/nwk-tr.cpp index 006e69c1bbb..109258a358a 100644 --- a/src/mame/drivers/nwk-tr.cpp +++ b/src/mame/drivers/nwk-tr.cpp @@ -291,8 +291,8 @@ namespace { class nwktr_state : public driver_device { public: - nwktr_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + nwktr_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_work_ram(*this, "work_ram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), @@ -345,6 +345,8 @@ private: memory_view m_cg_view; emu_timer *m_sound_irq_timer; + bool m_exrgb; + void paletteram32_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); uint8_t sysreg_r(offs_t offset); void sysreg_w(offs_t offset, uint8_t data); @@ -352,8 +354,6 @@ private: void soundtimer_count_w(uint16_t data); double adc12138_input_callback(uint8_t input); - bool m_exrgb; - TIMER_CALLBACK_MEMBER(sound_irq); uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); @@ -508,6 +508,10 @@ void nwktr_state::machine_start() m_maincpu->ppcdrc_add_fastram(0x00000000, 0x003fffff, false, m_work_ram); m_sound_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(nwktr_state::sound_irq), this)); + + m_exrgb = false; + + save_item(NAME(m_exrgb)); } void nwktr_state::ppc_map(address_map &map) diff --git a/src/mame/includes/spectrum.h b/src/mame/includes/spectrum.h index 5a52ae6e713..c392c32e4e1 100644 --- a/src/mame/includes/spectrum.h +++ b/src/mame/includes/spectrum.h @@ -52,6 +52,7 @@ public: spectrum_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_video_ram(*this, "video_ram"), + m_scanline_timer(nullptr), m_maincpu(*this, "maincpu"), m_screen(*this, "screen"), m_cassette(*this, "cassette"), @@ -113,7 +114,7 @@ protected: optional_shared_ptr<uint8_t> m_video_ram; uint8_t *m_screen_location; - int m_ROMSelection; + int m_ROMSelection = 0; // FIXME: this is used for various things in derived classes, but not by this base class, and should be removed // Build up the screen bitmap line-by-line as the z80 uses CPU cycles. // Eliminates sprite flicker on various games (E.g. Marauder and |
