mirror of
https://github.com/TomHarte/CLK.git
synced 2024-08-16 16:28:59 +00:00
This is as simplified as things seem to be able to get without breaking at least Northern Star. Joe Blade et al remain stubbornly broken but I'm not immediately able to determine why.
This commit is contained in:
parent
f797e6b5b6
commit
fb26b38ff9
@ -850,8 +850,17 @@ inline void Tape::get_next_tape_pulse()
|
||||
inline void Tape::push_tape_bit(uint16_t bit)
|
||||
{
|
||||
_data_register = (uint16_t)((_data_register >> 1) | (bit << 10));
|
||||
|
||||
if(_input.minimum_bits_until_full) _input.minimum_bits_until_full--;
|
||||
if(_input.minimum_bits_until_full == 7) _interrupt_status &= ~Interrupt::ReceiveDataFull;
|
||||
if(_input.minimum_bits_until_full == 8) _interrupt_status &= ~Interrupt::ReceiveDataFull;
|
||||
if(!_input.minimum_bits_until_full)
|
||||
{
|
||||
if((_data_register&0x3) == 0x1)
|
||||
{
|
||||
_interrupt_status |= Interrupt::ReceiveDataFull;
|
||||
if(_is_in_input_mode) _input.minimum_bits_until_full = 9;
|
||||
}
|
||||
}
|
||||
|
||||
if(_output.bits_remaining_until_empty) _output.bits_remaining_until_empty--;
|
||||
if(!_output.bits_remaining_until_empty) _interrupt_status |= Interrupt::TransmitDataEmpty;
|
||||
@ -862,29 +871,8 @@ inline void Tape::push_tape_bit(uint16_t bit)
|
||||
evaluate_interrupts();
|
||||
}
|
||||
|
||||
//inline void Tape::reset_tape_input()
|
||||
//{
|
||||
// _input.minimum_bits_until_full = 0;
|
||||
// _interrupt_status &= ~(Interrupt::ReceiveDataFull | Interrupt::TransmitDataEmpty | Interrupt::HighToneDetect);
|
||||
//
|
||||
// if(_last_posted_interrupt_status != _interrupt_status)
|
||||
// {
|
||||
// _last_posted_interrupt_status = _interrupt_status;
|
||||
// if(_delegate) _delegate->tape_did_change_interrupt_status(this);
|
||||
// }
|
||||
//}
|
||||
|
||||
inline void Tape::evaluate_interrupts()
|
||||
{
|
||||
if(!_input.minimum_bits_until_full)
|
||||
{
|
||||
if((_data_register&0x3) == 0x1)
|
||||
{
|
||||
_interrupt_status |= Interrupt::ReceiveDataFull;
|
||||
if(_is_in_input_mode) _input.minimum_bits_until_full = 9;
|
||||
}
|
||||
}
|
||||
|
||||
if(_last_posted_interrupt_status != _interrupt_status)
|
||||
{
|
||||
_last_posted_interrupt_status = _interrupt_status;
|
||||
@ -893,12 +881,9 @@ inline void Tape::evaluate_interrupts()
|
||||
}
|
||||
|
||||
inline void Tape::clear_interrupts(uint8_t interrupts)
|
||||
{
|
||||
if(_interrupt_status & interrupts)
|
||||
{
|
||||
_interrupt_status &= ~interrupts;
|
||||
if(_delegate) _delegate->tape_did_change_interrupt_status(this);
|
||||
}
|
||||
evaluate_interrupts();
|
||||
}
|
||||
|
||||
inline void Tape::set_is_in_input_mode(bool is_in_input_mode)
|
||||
|
@ -86,7 +86,6 @@ class Tape {
|
||||
|
||||
private:
|
||||
inline void push_tape_bit(uint16_t bit);
|
||||
inline void reset_tape_input(void);
|
||||
inline void get_next_tape_pulse();
|
||||
|
||||
std::shared_ptr<Storage::Tape> _tape;
|
||||
|
Loading…
Reference in New Issue
Block a user