From 68589042811d9210b8f43fc12f3e35ebc1650beb Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Sun, 7 Apr 2024 23:39:21 +0200 Subject: [PATCH] load BIC/tape from debugger --- debugger.cpp | 15 +++++++++++++++ loaders.cpp | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/debugger.cpp b/debugger.cpp index a80f1c9..e4f6885 100644 --- a/debugger.cpp +++ b/debugger.cpp @@ -7,6 +7,7 @@ #include "console.h" #include "cpu.h" #include "gen.h" +#include "loaders.h" #include "log.h" #include "tty.h" #include "utils.h" @@ -474,6 +475,19 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto continue; } + else if (parts.at(0) == "tape") { + if (parts.size() == 2) { + auto addr = loadTape(b, parts.at(1)); + + if (addr.has_value()) + c->setPC(addr.value()); + } + else { + cnsl->put_string_lf("filename parameter missing"); + } + + continue; + } else if (parts[0] == "trl") { if (parts.size() == 1) t_rl.reset(); @@ -523,6 +537,7 @@ void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const sto cnsl->put_string_lf("toggle - set switch (s=, 0...15 (decimal)) of the front panel to state (t=, 0 or 1)"); cnsl->put_string_lf("cls - clear screen"); cnsl->put_string_lf("stats - show run statistics"); + cnsl->put_string_lf("tape - load a tape/BIC file, parameter is filename"); #if defined(ESP32) cnsl->put_string_lf("cfgnet - configure network (e.g. WiFi)"); cnsl->put_string_lf("startnet - start network"); diff --git a/loaders.cpp b/loaders.cpp index 5709e47..62fe35d 100644 --- a/loaders.cpp +++ b/loaders.cpp @@ -1,4 +1,4 @@ -// (C) 2018-2023 by Folkert van Heusden +// (C) 2018-2024 by Folkert van Heusden // Released under MIT license #include