From b30fda3c36c8afbc81b7c94622c836f2ce2d1a59 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 29 Oct 2025 12:19:25 -0400 Subject: [PATCH 1/3] Localise shorthand `Storage`; note that labels may be unused. --- Processors/6502Mk2/6502Mk2.hpp | 3 --- Processors/6502Mk2/Implementation/6502.hpp | 6 ++++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Processors/6502Mk2/6502Mk2.hpp b/Processors/6502Mk2/6502Mk2.hpp index 609703212..bd4388347 100644 --- a/Processors/6502Mk2/6502Mk2.hpp +++ b/Processors/6502Mk2/6502Mk2.hpp @@ -266,9 +266,6 @@ struct Processor: public Storage { the next thing it intends to do is fetch a new opcode. */ inline void restart_operation_fetch(); - -private: - using Storage = Storage; }; } diff --git a/Processors/6502Mk2/Implementation/6502.hpp b/Processors/6502Mk2/Implementation/6502.hpp index 9f8ffff37..0df53caeb 100644 --- a/Processors/6502Mk2/Implementation/6502.hpp +++ b/Processors/6502Mk2/Implementation/6502.hpp @@ -21,12 +21,14 @@ namespace CPU::MOS6502Mk2 { template void Processor::restart_operation_fetch() { + using Storage = Storage; Storage::resume_point_ = Storage::ResumePoint::FetchDecode; Storage::cycles_ = Cycles(0); } template void Processor::run_for(const Cycles cycles) { + using Storage = Storage; using ResumePoint = Storage::ResumePoint; using InterruptRequest = Storage::Inputs::InterruptRequest; auto ®isters = Storage::registers_; @@ -395,7 +397,7 @@ void Processor::run_for(const Cycles cycles) { std::swap(Storage::address_.halves.high, Storage::operand_); goto access_absolute; - absolute_indexed_65c02_tail: + [[maybe_unused]] absolute_indexed_65c02_tail: access(BusOperation::Read, Literal(registers.pc.full), throwaway); goto access_absolute; @@ -449,7 +451,7 @@ void Processor::run_for(const Cycles cycles) { goto access_absolute; - indirect_indexed_65c02_tail: + [[maybe_unused]] indirect_indexed_65c02_tail: access(BusOperation::Read, Literal(registers.pc.full), throwaway); goto access_absolute; From fd7142f6a1469bac6880c646422333b45e6e8002 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 29 Oct 2025 12:28:09 -0400 Subject: [PATCH 2/3] Comment out unused storage. --- Machines/Acorn/BBCMicro/BBCMicro.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Machines/Acorn/BBCMicro/BBCMicro.cpp b/Machines/Acorn/BBCMicro/BBCMicro.cpp index 65bfb9da7..174c5e5c1 100644 --- a/Machines/Acorn/BBCMicro/BBCMicro.cpp +++ b/Machines/Acorn/BBCMicro/BBCMicro.cpp @@ -609,7 +609,7 @@ private: OutputMode previous_output_mode_ = OutputMode::Sync; int cycles_ = 0; - int cycles_into_hsync_ = 0; +// int cycles_into_hsync_ = 0; Outputs::CRT::CRT crt_; From 1c4c3a6cae6c5f07f9cc8541cb6a8a97e9b0b00d Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 29 Oct 2025 12:29:15 -0400 Subject: [PATCH 3/3] Avoid VLA extension. --- Outputs/OpenGL/Screenshot.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Outputs/OpenGL/Screenshot.hpp b/Outputs/OpenGL/Screenshot.hpp index c0e5af299..716417d69 100644 --- a/Outputs/OpenGL/Screenshot.hpp +++ b/Outputs/OpenGL/Screenshot.hpp @@ -10,6 +10,8 @@ #include "OpenGL.hpp" +#include + namespace Outputs::Display::OpenGL { /*! @@ -37,13 +39,13 @@ struct Screenshot { // Flip the contents into raster order. const size_t line_size = size_t(width * 4); + std::vector temp(line_size, 0); for(size_t y = 0; y < size_t(height) / 2; ++y) { const size_t flipped_y = size_t(height - 1) - y; - uint8_t temp[line_size]; - memcpy(temp, &pixel_data[flipped_y * line_size], line_size); + memcpy(temp.data(), &pixel_data[flipped_y * line_size], line_size); memcpy(&pixel_data[flipped_y * line_size], &pixel_data[y * line_size], line_size); - memcpy(&pixel_data[y * line_size], temp, line_size); + memcpy(&pixel_data[y * line_size], temp.data(), line_size); } }