From 25100642186d2746cc5868b199ee1f1927b2d112 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 25 Apr 2021 14:20:40 -0400 Subject: [PATCH] Completes state object. Subject to not yet dealing with last_fetches_ and last_contended_access_ correctly. Thought required. --- Machines/Sinclair/ZXSpectrum/Video.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Machines/Sinclair/ZXSpectrum/Video.hpp b/Machines/Sinclair/ZXSpectrum/Video.hpp index a6bc38a14..4304c5542 100644 --- a/Machines/Sinclair/ZXSpectrum/Video.hpp +++ b/Machines/Sinclair/ZXSpectrum/Video.hpp @@ -366,6 +366,7 @@ template class Video { Sets the current border colour. */ void set_border_colour(uint8_t colour) { + border_byte_ = colour; border_colour_ = palette[colour]; } @@ -389,6 +390,7 @@ template class Video { Outputs::CRT::CRT crt_; const uint8_t *memory_ = nullptr; uint8_t border_colour_ = 0; + uint8_t border_byte_ = 0; uint8_t *pixel_target_ = nullptr; int attribute_address_ = 0; @@ -430,6 +432,14 @@ struct State: public Reflection::StructImpl { } } + template State(const Video &source) : State() { + border_colour = source.border_byte_; + time_into_frame = source.time_into_frame_; + flash = source.flash_mask_; + flash_counter = source.flash_counter_; + is_alternate_line = source. is_alternate_line_; + } + template void apply(Video &target) { target.set_border_colour(border_colour); target.time_into_frame_ = time_into_frame;