From 2913368a0601a6dcc83d97b252fc63f6cbf77d3d Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 8 Mar 2023 23:12:02 -0500 Subject: [PATCH] Attempt YMMM. --- Components/9918/Implementation/9918.cpp | 6 +++--- Components/9918/Implementation/9918Base.hpp | 10 +++++++--- Components/9918/Implementation/YamahaCommands.hpp | 2 ++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Components/9918/Implementation/9918.cpp b/Components/9918/Implementation/9918.cpp index 8466e66ce..a3e2ff7fe 100644 --- a/Components/9918/Implementation/9918.cpp +++ b/Components/9918/Implementation/9918.cpp @@ -930,12 +930,12 @@ void Base::commit_register(int reg, uint8_t value) { case 0b1000: Begin(LogicalFill); break; // LMMV [logical move, VDP to VRAM, i.e. solid-colour fill]. case 0b1001: Begin(Move); break; // LMMM [logical move, VRAM to VRAM]. case 0b1010: break; // TODO: lmcm. [logical move, VRAM to CPU] - case 0b1011: Begin(MoveFromCPU); break; // LMMC [logical move, CPU to VRAM]. + case 0b1011: Begin(MoveFromCPU); break; // LMMC [logical move, CPU to VRAM]. case 0b1100: Begin(HighSpeedFill); break; // HMMV [high-speed move, VDP to VRAM, i.e. single-byte fill]. case 0b1101: Begin(Move); break; // HMMM [high-speed move, VRAM to VRAM]. - case 0b1110: break; // TODO: ymmm. [high-speed move, y only, VRAM to VRAM] - case 0b1111: Begin(MoveFromCPU); break; // HMMC [high-speed move, CPU to VRAM]. + case 0b1110: Begin(Move); break; // YMMM [high-speed move, y only, VRAM to VRAM]. + case 0b1111: Begin(MoveFromCPU); break; // HMMC [high-speed move, CPU to VRAM]. } #undef Begin diff --git a/Components/9918/Implementation/9918Base.hpp b/Components/9918/Implementation/9918Base.hpp index c0532805f..88983a646 100644 --- a/Components/9918/Implementation/9918Base.hpp +++ b/Components/9918/Implementation/9918Base.hpp @@ -440,12 +440,16 @@ template struct Base: public Storage { Storage::update_command_step(access_column); } break; - case CommandStep::ReadSourceByte: - context.latched_colour.set(source[command_address(context.source, context.arguments & 0x10)]); + case CommandStep::ReadSourceByte: { + Vector source_vector = context.source; + if(Storage::command_->y_only) { + source_vector.v[0] = context.destination.v[0]; + } + context.latched_colour.set(source[command_address(source_vector, context.arguments & 0x10)]); Storage::minimum_command_column_ = access_column + 24; Storage::next_command_step_ = CommandStep::WriteByte; - break; + } break; case CommandStep::WriteByte: destination[command_address(context.destination, context.arguments & 0x20)] = context.latched_colour.has_value() ? context.latched_colour.colour : context.colour.colour; diff --git a/Components/9918/Implementation/YamahaCommands.hpp b/Components/9918/Implementation/YamahaCommands.hpp index b684bb27a..f3e7349af 100644 --- a/Components/9918/Implementation/YamahaCommands.hpp +++ b/Components/9918/Implementation/YamahaCommands.hpp @@ -118,6 +118,7 @@ struct Command { AccessType access = AccessType::PlotPoint; int cycles = 0; bool is_cpu_transfer = false; + bool y_only = false; /// Current command parameters. CommandContext &context; @@ -342,6 +343,7 @@ template struct Move: public Rectangle