From 5d40d70c92de0e0d82c99e4466f46cb10d359074 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 1 Aug 2016 10:32:32 -0400 Subject: [PATCH] Fixed 6560 addressing error, added an autotyper for Vic disks (more work potentially needed), fixed semantics for testing whether a 6502 is about to reset. --- Components/6560/6560.cpp | 2 +- Machines/Commodore/Vic-20/Vic20.cpp | 8 ++++---- Machines/Electron/Electron.cpp | 2 +- Processors/6502/CPU6502.hpp | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Components/6560/6560.cpp b/Components/6560/6560.cpp index a14647c5e..4c393cdcb 100644 --- a/Components/6560/6560.cpp +++ b/Components/6560/6560.cpp @@ -255,7 +255,7 @@ uint16_t MOS6560::get_address() } } } - return fetch_address; + return fetch_address & 0x3fff; } void MOS6560::set_graphics_value(uint8_t value, uint8_t colour_value) diff --git a/Machines/Commodore/Vic-20/Vic20.cpp b/Machines/Commodore/Vic-20/Vic20.cpp index 03b24f7ff..baf359b6c 100644 --- a/Machines/Commodore/Vic-20/Vic20.cpp +++ b/Machines/Commodore/Vic-20/Vic20.cpp @@ -165,12 +165,10 @@ void Machine::set_rom(ROMSlot slot, size_t length, const uint8_t *data) case BASIC: target = _basicROM; break; case Drive: if(_c1540) - { _c1540->set_rom(data); - _c1540->run_for_cycles(2000000); // pretend it booted a couple of seconds ago - } else { + // if there's no 1540 now, hold onto the ROM in case one is added later _driveROM.reset(new uint8_t[length]); memcpy(_driveROM.get(), data, length); } @@ -233,13 +231,15 @@ void Machine::set_disk(std::shared_ptr disk) _c1540->set_rom(_driveROM.get()); _driveROM.reset(); } + + set_typer_for_string("LOAD\"*\",8,1\n"); } #pragma mark - Typer int Machine::get_typer_delay() { - return get_reset_line() ? 1*263*60*65 : 0; // wait two seconds if resetting + return get_is_resetting() ? 1*263*60*65 : 0; // wait a second if resetting } int Machine::get_typer_frequency() diff --git a/Machines/Electron/Electron.cpp b/Machines/Electron/Electron.cpp index cc4c02be3..bf07f869d 100644 --- a/Machines/Electron/Electron.cpp +++ b/Machines/Electron/Electron.cpp @@ -1027,7 +1027,7 @@ inline void Tape::run_for_cycles(unsigned int number_of_cycles) int Machine::get_typer_delay() { - return get_reset_line() ? 625*25*128 : 0; // wait one second if resetting + return get_is_resetting() ? 625*25*128 : 0; // wait one second if resetting } int Machine::get_typer_frequency() diff --git a/Processors/6502/CPU6502.hpp b/Processors/6502/CPU6502.hpp index 3134a8965..baa2a5882 100644 --- a/Processors/6502/CPU6502.hpp +++ b/Processors/6502/CPU6502.hpp @@ -1213,13 +1213,13 @@ template class Processor { } /*! - Gets the current level of the RST line. + Gets whether the 6502 would reset at the next opportunity. @returns @c true if the line is logically active; @c false otherwise. */ - inline bool get_reset_line() + inline bool get_is_resetting() { - return !!(_interrupt_requests & InterruptRequestFlags::Reset); + return !!(_interrupt_requests & (InterruptRequestFlags::Reset | InterruptRequestFlags::PowerOn)); } /*!