From a892523c09536f1876b35d2ce54d4dec9378d6d9 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 4 Feb 2023 11:43:06 -0500 Subject: [PATCH] Advance to the next breaking point. --- Components/9918/Implementation/9918Base.hpp | 38 ++++++++++++++++++--- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/Components/9918/Implementation/9918Base.hpp b/Components/9918/Implementation/9918Base.hpp index 480ed24c9..663a3cd83 100644 --- a/Components/9918/Implementation/9918Base.hpp +++ b/Components/9918/Implementation/9918Base.hpp @@ -204,8 +204,12 @@ template struct Storage struct Storagecycles; switch(command_->access) { - case Command::AccessType::PlotPoint: - next_command_step_ = CommandStep::ReadPixel; + case Command::AccessType::CopyPoint: + next_command_step_ = CommandStep::ReadSourcePixel; break; + case Command::AccessType::PlotPoint: + next_command_step_ = CommandStep::ReadDestinationPixel; + break; + case Command::AccessType::WaitForColourReceipt: // i.e. nothing to do until a colour is received. next_command_step_ = CommandStep::None; break; + + case Command::AccessType::CopyByte: + next_command_step_ = CommandStep::ReadSourceByte; + break; case Command::AccessType::WriteByte: next_command_step_ = CommandStep::WriteByte; break; @@ -713,7 +725,17 @@ template struct Base: public Storage { case CommandStep::None: break; - case CommandStep::ReadPixel: + case CommandStep::ReadSourcePixel: + // TODO: the read as below, but to an appropriate piece of temporary colour + // storage; per the manual the colour register is unchanged, so I can't just + // put it there. +// Storage::command_latch_ = ram_[command_address(context.source)]; + + Storage::minimum_command_column_ = access_column + 32; + Storage::next_command_step_ = CommandStep::ReadDestinationPixel; + break; + + case CommandStep::ReadDestinationPixel: Storage::command_latch_ = ram_[command_address(context.destination)]; Storage::minimum_command_column_ = access_column + 24; @@ -755,6 +777,14 @@ template struct Base: public Storage { Storage::update_command_step(access_column); } break; + case CommandStep::ReadSourceByte: + // TODO: the read as below, and store somewhere for future write. +// Storage::command_latch_ = ram_[command_address(context.source)]; + + Storage::minimum_command_column_ = access_column + 24; + Storage::next_command_step_ = CommandStep::WriteByte; + break; + case CommandStep::WriteByte: ram_[command_address(context.destination)] = context.colour; Storage::command_->advance(pixels_per_byte(this->underlying_mode_));