1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-04 18:29:40 +00:00

Gave the binary tape player a more logical assignment of wave level to output level. Which miraculously appears to have been the issue with the ZX80/81 tape loading — the inconsistency of silences seems to have been the issue.

This commit is contained in:
Thomas Harte 2017-06-21 22:13:24 -04:00
parent 93f251dbcd
commit 52d9ddf9e5
4 changed files with 6 additions and 6 deletions

View File

@ -307,7 +307,7 @@ void Machine::configure_as_target(const StaticAnalyser::Target &target) {
}
void Machine::tape_did_change_input(Storage::Tape::BinaryTapePlayer *tape) {
keyboard_via_->set_control_line_input(KeyboardVIA::Port::A, KeyboardVIA::Line::One, tape->get_input());
keyboard_via_->set_control_line_input(KeyboardVIA::Port::A, KeyboardVIA::Line::One, !tape->get_input());
}
#pragma mark - Disc

View File

@ -187,7 +187,7 @@ void Machine::set_output_device(Outputs::CRT::OutputDevice output_device) {
void Machine::tape_did_change_input(Storage::Tape::BinaryTapePlayer *tape_player) {
// set CB1
via_.set_control_line_input(VIA::Port::B, VIA::Line::One, tape_player->get_input());
via_.set_control_line_input(VIA::Port::B, VIA::Line::One, !tape_player->get_input());
}
std::shared_ptr<Outputs::CRT::CRT> Machine::get_crt() {

View File

@ -54,7 +54,7 @@ int Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) {
}
if(is_zx81_) horizontal_counter_ %= 207;
// tape_player_.run_for_cycles(cycle.length);
tape_player_.run_for_cycles(cycle.length);
if(!cycle.is_terminal()) {
return 0;
@ -117,7 +117,7 @@ int Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) {
case CPU::Z80::PartialMachineCycle::ReadOpcodeStart:
case CPU::Z80::PartialMachineCycle::ReadOpcodeWait:
// Check for use of the fast tape hack.
if(address == tape_trap_address_) { // TODO: && fast_tape_hack_enabled_
/* if(address == tape_trap_address_) { // TODO: && fast_tape_hack_enabled_
int next_byte = parser_.get_next_byte(tape_player_.get_tape());
if(next_byte != -1) {
uint16_t hl = get_value_of_register(CPU::Z80::Register::HL);
@ -126,7 +126,7 @@ int Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) {
set_value_of_register(CPU::Z80::Register::ProgramCounter, tape_return_address_ - 1);
return 0;
}
}
}*/
is_opcode_read = true;
case CPU::Z80::PartialMachineCycle::Read:

View File

@ -109,7 +109,7 @@ void BinaryTapePlayer::set_delegate(Delegate *delegate) {
}
void BinaryTapePlayer::process_input_pulse(Storage::Tape::Tape::Pulse pulse) {
bool new_input_level = pulse.type == Tape::Pulse::Low;
bool new_input_level = pulse.type == Tape::Pulse::High;
if(input_level_ != new_input_level) {
input_level_ = new_input_level;
if(delegate_) delegate_->tape_did_change_input(this);