From d30d4e8f89f4612f311430876fbc5a09ab3dd40d Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 7 Nov 2025 09:08:16 -0500 Subject: [PATCH 1/4] Add DFS 0.9 to the ROM catalogue. --- Machines/Acorn/BBCMicro/BBCMicro.cpp | 6 +++--- Machines/Utility/ROMCatalogue.cpp | 10 +++++++++- Machines/Utility/ROMCatalogue.hpp | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Machines/Acorn/BBCMicro/BBCMicro.cpp b/Machines/Acorn/BBCMicro/BBCMicro.cpp index 97f70bf98..051f68132 100644 --- a/Machines/Acorn/BBCMicro/BBCMicro.cpp +++ b/Machines/Acorn/BBCMicro/BBCMicro.cpp @@ -766,7 +766,7 @@ public: auto request = Request(Name::AcornBASICII) && Request(Name::BBCMicroMOS12); if(target.has_1770dfs || tube_processor != TubeProcessor::None) { - request = request && Request(Name::BBCMicroDFS226); + request = request && Request(Name::BBCMicro1770DFS226); } if(target.has_adfs) { request = request && Request(Name::BBCMicroADFS130); @@ -794,13 +794,13 @@ public: install_sideways(fs_slot--, roms.find(name)->second, false); }; if(target.has_1770dfs) { - add_sideways(Name::BBCMicroDFS226); + add_sideways(Name::BBCMicro1770DFS226); } if(target.has_adfs) { add_sideways(Name::BBCMicroADFS130); } if(!target.has_1770dfs && tube_processor != TubeProcessor::None) { - add_sideways(Name::BBCMicroDFS226); + add_sideways(Name::BBCMicro1770DFS226); } // Throw the tube ROM to its target. diff --git a/Machines/Utility/ROMCatalogue.cpp b/Machines/Utility/ROMCatalogue.cpp index 2657d1618..d5b2355fb 100644 --- a/Machines/Utility/ROMCatalogue.cpp +++ b/Machines/Utility/ROMCatalogue.cpp @@ -430,7 +430,15 @@ const std::vector &Description::all_roms() { 0x3c14fc70u }, { - BBCMicroDFS226, + BBCMicro8271DFS09, + "BBCMicro", + "the Acorn 8271 DFS 0.9 ROM", + "dfs09.rom", + 8_kb, + 0x3ce609cfu + }, + { + BBCMicro1770DFS226, "BBCMicro", "the Acorn 1770 DFS 2.26 ROM", "dfs-2.26.rom", diff --git a/Machines/Utility/ROMCatalogue.hpp b/Machines/Utility/ROMCatalogue.hpp index b0ce7b40e..3d46e70cd 100644 --- a/Machines/Utility/ROMCatalogue.hpp +++ b/Machines/Utility/ROMCatalogue.hpp @@ -82,7 +82,8 @@ enum Name { // BBC Micro. BBCMicroMOS12, - BBCMicroDFS226, + BBCMicro8271DFS09, + BBCMicro1770DFS226, BBCMicroADFS130, BBCMicroAdvancedDiscToolkit140, BBCMicro6502Tube110, From 34992126a874d799d5c5c248c8747995bf581340 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 7 Nov 2025 09:12:47 -0500 Subject: [PATCH 2/4] Allow installation of smaller ROMs. --- Machines/Acorn/BBCMicro/BBCMicro.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Machines/Acorn/BBCMicro/BBCMicro.cpp b/Machines/Acorn/BBCMicro/BBCMicro.cpp index 051f68132..f11b6f334 100644 --- a/Machines/Acorn/BBCMicro/BBCMicro.cpp +++ b/Machines/Acorn/BBCMicro/BBCMicro.cpp @@ -1195,8 +1195,12 @@ private: rom_write_masks_[slot] = is_writeable; rom_inserted_[slot] = true; - assert(source.size() == roms_[slot].size()); - std::copy(source.begin(), source.end(), roms_[slot].begin()); + assert(roms_[slot].size() % source.size() == 0); + auto begin = roms_[slot].begin(); + while(begin != roms_[slot].end()) { + std::copy(source.begin(), source.end(), begin); + std::advance(begin, source.size()); + } } // MARK: - Components. From 056028e07bbc95a0c82e96e83a9eae7938e1327f Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 7 Nov 2025 10:43:14 -0500 Subject: [PATCH 3/4] Put bit restriction on register pointer. --- Components/6845/CRTC6845.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Components/6845/CRTC6845.hpp b/Components/6845/CRTC6845.hpp index 17966d525..771a0d7d7 100644 --- a/Components/6845/CRTC6845.hpp +++ b/Components/6845/CRTC6845.hpp @@ -76,7 +76,7 @@ public: CRTC6845(BusHandlerT &bus_handler) noexcept : bus_handler_(bus_handler), status_(0) {} - void select_register(uint8_t r) { + void select_register(const uint8_t r) { selected_register_ = r; } @@ -101,11 +101,11 @@ public: // Per the BBC Wiki, attempting to read such a register results in 0. if(selected_register_ < 12 || selected_register_ > 17) return 0x00; - return registers_[selected_register_]; + return registers_[selected_register_.get()]; } void set_register(const uint8_t value) { - switch(selected_register_) { + switch(selected_register_.get()) { case 0: layout_.horizontal.total = value; break; case 1: layout_.horizontal.displayed = value; break; case 2: layout_.horizontal.start_sync = value; break; @@ -168,9 +168,9 @@ public: }; if(selected_register_ < 16) { - registers_[selected_register_] = value & masks[selected_register_]; + registers_[selected_register_.get()] = value & masks[selected_register_.get()]; } - if(selected_register_ == 31 && personality == Personality::UM6845R) { + if(selected_register_.get() == 31 && personality == Personality::UM6845R) { dummy_register_ = value; } } @@ -527,7 +527,7 @@ private: uint8_t registers_[18]{}; uint8_t dummy_register_ = 0; - int selected_register_ = 0; + Numeric::SizedInt<5> selected_register_ = 0; CharacterAddress character_counter_; // h_counter Numeric::SizedInt<3> character_reset_history_; // sol From 7658edca62cdc6c38c113c74c8bac7e3f37dfa2f Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 7 Nov 2025 10:49:26 -0500 Subject: [PATCH 4/4] Remove unused enum. --- Components/6845/CRTC6845.hpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/Components/6845/CRTC6845.hpp b/Components/6845/CRTC6845.hpp index 771a0d7d7..9c962e53a 100644 --- a/Components/6845/CRTC6845.hpp +++ b/Components/6845/CRTC6845.hpp @@ -492,9 +492,6 @@ private: /// Provide interlaced sync and scan even/odd lines depending on field. SyncAndVideo, }; - enum class BlinkMode { - // TODO. - }; // Comments on the right provide the corresponding signal name in hoglet's VHDL implementation. struct {