From 2775da3d53cb7ea07678f3dd8e5a6c3b3375c35b Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Tue, 29 Jul 2025 12:51:40 +0200 Subject: [PATCH] =?UTF-8?q?-=20[NEW]=20C=C3=A0rrega=20"instant=C3=A0nea"?= =?UTF-8?q?=20de=20TAPs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 2 +- z80.cpp | 10 ++++++++-- zx_tape.cpp | 24 +++++++++++++++++++++++- zx_tape.h | 1 + 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 304aaed..2a9896e 100644 --- a/main.cpp +++ b/main.cpp @@ -125,7 +125,7 @@ int main(int argc, char *argv[]) ui::menu::addoption(menu, "SAVE STATE", nullptr); menu = ui::menu::addsubmenu("TAPE"); - ui::menu::addbooloption(menu, "BERSERK MODE", zx_tape::getOption(ZXTAPE_OPTION_FAST_LOAD), actions::fastload); + ui::menu::addbooloption(menu, "FAST LOAD", zx_tape::getOption(ZXTAPE_OPTION_FAST_LOAD), actions::fastload); ui::menu::addbooloption(menu, "STOP AT END", zx_tape::getOption(ZXTAPE_OPTION_STOP_AT_END), actions::stopatend); menu = ui::menu::addsubmenu("SCREEN"); diff --git a/z80.cpp b/z80.cpp index 6034bb1..192c9d3 100644 --- a/z80.cpp +++ b/z80.cpp @@ -1,7 +1,7 @@ #include "z80.h" #include "z80debug.h" #include "zx_mem.h" -//#include "zx_tape.h" +#include "zx_tape.h" #include #include @@ -191,7 +191,13 @@ namespace z80 t+=1; reading_m1 = true; if (rPC==0x056A) { - z80debug::stop(); + //z80debug::stop(); + if (zx_tape::getOption(ZXTAPE_OPTION_FAST_LOAD)) { + rIX = zx_tape::fastLoad(rA2, rIX, rDE); + rDE = 0; + rA = 0; + rPC = 0x05E0; + } //zx_tape::rewind(); //zx_tape::play(); } diff --git a/zx_tape.cpp b/zx_tape.cpp index 3d09197..bf3d625 100644 --- a/zx_tape.cpp +++ b/zx_tape.cpp @@ -1,6 +1,7 @@ #include "zx_tape.h" #include "zx_ula.h" #include "zx_screen.h" +#include "zx_mem.h" #include "z80debug.h" #include "z80.h" #include @@ -36,7 +37,7 @@ namespace zx_tape bool playing = false; bool loaded = false; - bool options[ZXTAPE_NUM_OPTIONS] = { false, true }; + bool options[ZXTAPE_NUM_OPTIONS] = { true, true }; std::vector blocks; uint8_t current_block = 0; @@ -244,6 +245,27 @@ namespace zx_tape printf("tape loading: %i%\n", percent); } + uint16_t fastLoad(const uint8_t block_type, const uint16_t address, const uint16_t length) + { + block_pos=0; + current_bit=0; + current_section = PULSE_PILOT; + current_pulse = 0; + pulse_pos = 0; + pulse_level = 0; + + if (blocks[current_block].data[0] != block_type || + blocks[current_block].length != length+2) { + printf("ERROR: Tape data not consistent with expectation\n"); + z80debug::stop(); + } + for (int i=0;i