From 2252c29495db852758a8742525ce16f0eedf1532 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 13 May 2018 14:02:46 -0400 Subject: [PATCH] Switches the Oric to string insertion at the time of consumption. To avoid issues around keyboard scanning being decoupled from consumption via IRQ, but not buffered. Keys pressed while BASIC is otherwise busy are just lost. --- Machines/Oric/Oric.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Machines/Oric/Oric.cpp b/Machines/Oric/Oric.cpp index 81c9b1dbd..cbc6fd4d4 100644 --- a/Machines/Oric/Oric.cpp +++ b/Machines/Oric/Oric.cpp @@ -305,13 +305,11 @@ template class Co switch(rom_type_) { case Analyser::Static::Oric::Target::ROM::BASIC10: tape_get_byte_address_ = 0xe630; - scan_keyboard_address_ = 0xf43c; tape_speed_address_ = 0x67; break; case Analyser::Static::Oric::Target::ROM::BASIC11: case Analyser::Static::Oric::Target::ROM::Pravetz: tape_get_byte_address_ = 0xe6c9; - scan_keyboard_address_ = 0xf495; tape_speed_address_ = 0x024d; break; } @@ -424,9 +422,12 @@ template class Co } } - if(string_serialiser_ && address == scan_keyboard_address_ && operation == CPU::MOS6502::BusOperation::ReadOpcode) { - m6502_.set_value_of_register(CPU::MOS6502::Register::X, string_serialiser_->head() | 0x80); - *value = 0x60; + // $02df is where the Oric ROMs — all of them, including BASIC 1.0, 1.1 and the Pravetz — have the + // IRQ routine store an incoming keystroke in order for reading to occur later. By capturing the + // read rather than the decode and write: (i) nothing is lost while BASIC is parsing; and + // (ii) keyboard input is much more rapid. + if(string_serialiser_ && address == 0x02df && operation == CPU::MOS6502::BusOperation::Read) { + *value = string_serialiser_->head() | 0x80; if(!string_serialiser_->advance()) string_serialiser_.reset(); } @@ -576,7 +577,7 @@ template class Co } // ROM bookkeeping - uint16_t tape_get_byte_address_ = 0, scan_keyboard_address_ = 0, tape_speed_address_ = 0; + uint16_t tape_get_byte_address_ = 0, tape_speed_address_ = 0; int keyboard_read_count_ = 0; // Outputs