load init file
Some checks are pending
CodeQL / Analyze (push) Waiting to run

This commit is contained in:
Folkert van Heusden 2025-04-15 19:31:36 +02:00
parent 7e976f0a78
commit 517db4657a
Signed by untrusted user who does not match committer: folkert
GPG key ID: 6B6455EDFEED3BD1
3 changed files with 711 additions and 674 deletions

File diff suppressed because it is too large Load diff

View file

@ -7,6 +7,6 @@
int disassemble(cpu *const c, console *const cnsl, const uint16_t pc, const bool instruction_only);
void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const stop_event);
void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const stop_event, const std::optional<std::string> & init);
void run_bic(console *const cnsl, bus *const b, std::atomic_uint32_t *const stop_event, const uint16_t bic_start);

View file

@ -258,6 +258,7 @@ void help()
printf("-b enable bootloader (builtin)\n");
printf("-n ncurses UI\n");
printf("-d enable debugger\n");
printf("-f x first process the commands from file x before entering the debugger\n");
printf("-S x set ram size (in number of 8 kB pages)\n");
printf("-s x,y set console switche state: set bit x (0...15) to y (0/1)\n");
printf("-t enable tracing (disassemble to stderr, requires -d as well)\n");
@ -276,7 +277,8 @@ int main(int argc, char *argv[])
std::vector<disk_backend *> disk_files;
std::string disk_type = "rk05";
bool run_debugger = false;
bool run_debugger = false;
std::optional<std::string> debugger_init;
bool enable_bootloader = false;
bootloader_t bootloader = BL_NONE;
@ -311,13 +313,17 @@ int main(int argc, char *argv[])
std::optional<std::string> dc11_device;
int opt = -1;
while((opt = getopt(argc, argv, "hqD:MT:Br:R:p:ndtL:bl:s:Q:N:J:XS:P1:")) != -1)
while((opt = getopt(argc, argv, "hqD:MT:Br:R:p:ndf:tL:bl:s:Q:N:J:XS:P1:")) != -1)
{
switch(opt) {
case 'h':
help();
return 1;
case 'f':
debugger_init = optarg;
break;
case '1':
dc11_device = optarg;
break;
@ -612,7 +618,7 @@ int main(int argc, char *argv[])
if (is_bic)
run_bic(cnsl, b, &event, bic_start.value());
else if (run_debugger || (bootloader == BL_NONE && test.empty() && tape.empty()))
debugger(cnsl, b, &event);
debugger(cnsl, b, &event, debugger_init);
else if (benchmark) {
// FILL MEMORY
memory *m = b->getRAM();