1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

Removed some logging.

This commit is contained in:
Thomas Harte 2016-02-07 14:42:40 -05:00
parent 2cb12a7513
commit 2e3ba6bbb2
2 changed files with 3 additions and 17 deletions

View File

@ -144,6 +144,7 @@ unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uin
if( interruptDisable&0x20 ) _interruptStatus &= ~Interrupt::RealTimeClock; if( interruptDisable&0x20 ) _interruptStatus &= ~Interrupt::RealTimeClock;
if( interruptDisable&0x40 ) _interruptStatus &= ~Interrupt::HighToneDetect; if( interruptDisable&0x40 ) _interruptStatus &= ~Interrupt::HighToneDetect;
evaluate_interrupts(); evaluate_interrupts();
// TODO: NMI (?) // TODO: NMI (?)
} }
// else // else
@ -668,19 +669,12 @@ inline void Tape::reset_tape_input()
// } // }
} }
extern uint8_t dr;
inline void Tape::evaluate_interrupts() inline void Tape::evaluate_interrupts()
{ {
if(!_bits_since_start) if(!_bits_since_start)
{ {
if((_data_register&0x3) == 0x1) if((_data_register&0x3) == 0x1)
{ {
if(dr != ((_data_register >> 2)&0xff))
{
printf("Mismatch\n");
}
_interrupt_status |= Interrupt::ReceiveDataFull; _interrupt_status |= Interrupt::ReceiveDataFull;
if(_is_in_input_mode) _bits_since_start = 9; if(_is_in_input_mode) _bits_since_start = 9;
} }
@ -725,8 +719,7 @@ inline void Tape::set_data_register(uint8_t value)
inline uint8_t Tape::get_data_register() inline uint8_t Tape::get_data_register()
{ {
int shift = std::max(_bits_since_start - 7, 0); return (uint8_t)(_data_register >> 2);
return (uint8_t)(_data_register >> shift);
} }
inline void Tape::run_for_cycles(unsigned int number_of_cycles) inline void Tape::run_for_cycles(unsigned int number_of_cycles)
@ -759,11 +752,6 @@ inline void Tape::run_for_cycles(unsigned int number_of_cycles)
float pulse_length = (float)_current_pulse.length.length / (float)_current_pulse.length.clock_rate; float pulse_length = (float)_current_pulse.length.length / (float)_current_pulse.length.clock_rate;
if(pulse_length >= 0.35 / 2400.0 && pulse_length < 0.7 / 2400.0) _crossings[3] = Tape::Short; if(pulse_length >= 0.35 / 2400.0 && pulse_length < 0.7 / 2400.0) _crossings[3] = Tape::Short;
if(pulse_length >= 0.35 / 1200.0 && pulse_length < 0.7 / 1200.0) _crossings[3] = Tape::Long; if(pulse_length >= 0.35 / 1200.0 && pulse_length < 0.7 / 1200.0) _crossings[3] = Tape::Long;
if(_crossings[3] == Tape::Unrecognised)
{
printf("Wah wah?\n");
}
} }
if(_crossings[0] == Tape::Long && _crossings[1] == Tape::Long) if(_crossings[0] == Tape::Long && _crossings[1] == Tape::Long)

View File

@ -9,8 +9,6 @@
#include "TapeUEF.hpp" #include "TapeUEF.hpp"
#include <string.h> #include <string.h>
uint8_t dr;
Storage::UEF::UEF(const char *file_name) : Storage::UEF::UEF(const char *file_name) :
_chunk_id(0), _chunk_length(0), _chunk_position(0), _chunk_id(0), _chunk_length(0), _chunk_position(0),
_time_base(1200) _time_base(1200)
@ -180,7 +178,7 @@ bool Storage::UEF::get_next_bit()
_chunk_position++; _chunk_position++;
if(!bit_position) if(!bit_position)
{ {
dr = _current_byte = (uint8_t)gzgetc(_file); _current_byte = (uint8_t)gzgetc(_file);
} }
if(bit_position == 0) return false; if(bit_position == 0) return false;
if(bit_position == 9) return true; if(bit_position == 9) return true;