From 371c26251c34c50a2392a74f3e103a5bc6da6918 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Tue, 14 Jul 2020 22:36:04 -0400 Subject: [PATCH] Switches strategy for the ZX80. --- Machines/ZX8081/ZX8081.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Machines/ZX8081/ZX8081.cpp b/Machines/ZX8081/ZX8081.cpp index cdba753d0..5472b3ebc 100644 --- a/Machines/ZX8081/ZX8081.cpp +++ b/Machines/ZX8081/ZX8081.cpp @@ -250,12 +250,8 @@ template class ConcreteMachine: } } - if(should_autorun_ && address == print_status_address_) { - const uint16_t status_code = z80_.get_value_of_register(CPU::Z80::Register::A); - const uint16_t line_number = 0; // TODO. - if(!status_code && !line_number) { - type_string("r \n"); - } + if(should_autorun_ && address == finished_load_address_) { + type_string("r \n"); should_autorun_ = false; } @@ -431,10 +427,12 @@ template class ConcreteMachine: static constexpr uint16_t automatic_tape_motor_start_address_ = is_zx81 ? 0x340 : 0x206; static constexpr uint16_t automatic_tape_motor_end_address_ = is_zx81 ? 0x3c3 : 0x24d; - // When automatically loading, if the PC gets to the print_status_address_ in order to print 0/0 - // after loading from tape (i.e. loading completed, in context) then the emulator will automatically - // RUN whatever has been loaded. - static constexpr uint16_t print_status_address_ = is_zx81 ? 0x6d1 : 0x4a8; + // When automatically loading, if the PC gets to the finished_load_address_ in order to print 0/0 + // (so it's anything that indicates that loading completed, but the program did not autorun) then the + // emulator will automatically RUN whatever has been loaded. + static constexpr uint16_t finished_load_address_ = is_zx81 ? + 0x6d1 : // ZX81: this is the routine that prints 0/0 (i.e. success). + 0x256; // ZX80: this is the start of the list command; the ZX80 lists a program after loading. bool should_autorun_ = false; std::vector ram_;