sinclair: Reset caches after loading a saved state. (#12700)

Updated sinclair/specnext_sprites.cpp, sinclair/sprinter.cpp and sinclair/tsconf.cpp.
This commit is contained in:
holub 2024-08-29 13:36:10 -04:00 committed by GitHub
parent ffc49cad9a
commit 33cfe5e253
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 23 additions and 3 deletions

View file

@ -317,6 +317,11 @@ void specnext_sprites_device::device_reset()
update_config();
}
void specnext_sprites_device::device_post_load()
{
m_sprites_cache.clear();
}
// device type definition
DEFINE_DEVICE_TYPE(SPECNEXT_SPRITES, specnext_sprites_device, "sprites", "Spectrum Next Sprites")

View file

@ -44,6 +44,7 @@ protected:
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;
virtual void device_post_load() override ATTR_COLD;
memory_share_creator<u8> m_sprite_pattern_ram;
memory_share_creator<u8> m_sprite_attr_ram;

View file

@ -108,9 +108,10 @@ public:
INPUT_CHANGED_MEMBER(turbo_changed);
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
virtual void video_start() override ATTR_COLD;
virtual void device_post_load() override ATTR_COLD;
void map_io(address_map &map);
void map_mem(address_map &map);
@ -1416,6 +1417,12 @@ void sprinter_state::machine_reset()
update_memory();
}
void sprinter_state::device_post_load()
{
spectrum_128_state::device_post_load();
m_ints.clear();
}
static const gfx_layout sprinter_charlayout =
{
8, 8, // 8 x 8 characters

View file

@ -237,6 +237,12 @@ void tsconf_state::machine_reset()
while (m_keyboard->read() != 0) { /* invalidate buffer */ }
}
void tsconf_state::device_post_load()
{
spectrum_128_state::device_post_load();
m_sprites_cache.clear();
}
INPUT_PORTS_START( tsconf )
PORT_INCLUDE( spec_plus )

View file

@ -54,6 +54,7 @@ protected:
virtual void video_start() override ATTR_COLD;
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
virtual void device_post_load() override ATTR_COLD;
virtual TIMER_CALLBACK_MEMBER(irq_off) override;
TIMER_CALLBACK_MEMBER(irq_frame);