From f5c77464937ea3340b0ef95b343b25144b0e9648 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 15 Apr 2021 17:31:42 -0400 Subject: [PATCH] Extends fast loading support to the just-introduced models. --- Machines/Sinclair/ZXSpectrum/ZXSpectrum.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Machines/Sinclair/ZXSpectrum/ZXSpectrum.cpp b/Machines/Sinclair/ZXSpectrum/ZXSpectrum.cpp index be0f7bb6a..3b0b9de2e 100644 --- a/Machines/Sinclair/ZXSpectrum/ZXSpectrum.cpp +++ b/Machines/Sinclair/ZXSpectrum/ZXSpectrum.cpp @@ -239,7 +239,7 @@ template class ConcreteMachine: // Fast loading: ROM version. // // The below patches over part of the 'LD-BYTES' routine from the 48kb ROM. - if(use_fast_tape_hack_ && address == 0x056b && read_pointers_[0] == &rom_[0xc000]) { + if(use_fast_tape_hack_ && address == 0x056b && read_pointers_[0] == &rom_[classic_rom_offset()]) { // Stop pressing enter, if neccessry. if(duration_to_press_enter_ > Cycles(0)) { duration_to_press_enter_ = Cycles(0); @@ -733,6 +733,22 @@ template class ConcreteMachine: return true; } + static constexpr int classic_rom_offset() { + switch(model) { + case Model::SixteenK: + case Model::FortyEightK: + return 0x0000; + + case Model::OneTwoEightK: + case Model::Plus2: + return 0x4000; + + case Model::Plus2a: + case Model::Plus3: + return 0xc000; + } + } + // MARK: - Disc. JustInTimeActor fdc_;