1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-10-01 13:58:20 +00:00

Takes a shot at the keyboard data full flag.

Just a guess. But likely?
This commit is contained in:
Thomas Harte 2021-02-19 20:06:12 -05:00
parent 60cfec6a65
commit 72d7901c88
5 changed files with 12 additions and 6 deletions

View File

@ -55,12 +55,12 @@ uint8_t GLU::get_keyboard_data() {
// The classic Apple II serial keyboard register:
// b7: key strobe.
// b6b0: ASCII code.
return registers_[0];
return registers_[0] | (status_ & uint8_t(CPUFlags::KeyboardDataFull)) ? 0x80 : 0x00;
}
void GLU::clear_key_strobe() {
// Clears the key strobe of the classic Apple II serial keyboard register.
registers_[0] &= 0x7f; // ???
status_ &= ~uint8_t(CPUFlags::KeyboardDataFull);
}
uint8_t GLU::get_any_key_down() {
@ -187,6 +187,7 @@ void GLU::set_port_output(int port, uint8_t value) {
registers_[register_address_] = register_latch_;
switch(register_address_) {
default: break;
case 0: status_ |= uint8_t(CPUFlags::KeyboardDataFull); break;
case 7: status_ |= uint8_t(CPUFlags::CommandDataIsValid); break;
}
} else {

View File

@ -62,12 +62,10 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableAddressSanitizer = "YES"
enableASanStackUseAfterReturn = "YES"
enableUBSanitizer = "YES"
disableMainThreadChecker = "YES"
launchStyle = "0"
useCustomWorkingDirectory = "NO"

View File

@ -80,6 +80,7 @@ template <typename BusHandler, bool uses_ready_line> class Processor: public Pro
private:
BusHandler &bus_handler_;
int count_ = 0;
};
#include "Implementation/65816Implementation.hpp"

View File

@ -30,6 +30,11 @@ template <typename BusHandler, bool uses_ready_line> void Processor<BusHandler,
// Process for as much time is left and/or until ready is signalled.
while((!uses_ready_line || !ready_line_) && number_of_cycles > Cycles(0)) {
++count_;
if(count_ == 148933250) {
printf("");
}
const MicroOp operation = *next_op_;
++next_op_;
@ -39,7 +44,6 @@ template <typename BusHandler, bool uses_ready_line> void Processor<BusHandler,
#endif
switch(operation) {
//
// Scheduling.
//
@ -66,6 +70,7 @@ template <typename BusHandler, bool uses_ready_line> void Processor<BusHandler,
instruction_buffer_.clear();
data_buffer_.clear();
last_operation_pc_ = registers_.pc;
last_operation_program_bank_ = uint8_t(registers_.program_bank >> 16);
memory_lock_ = false;
} continue;

View File

@ -262,6 +262,7 @@ struct ProcessorStorage {
// A helper for testing.
uint16_t last_operation_pc_;
uint8_t last_operation_program_bank_;
Instruction *active_instruction_;
Cycles cycles_left_to_run_;