Skip to content

Commit

Permalink
fix number of bits
Browse files Browse the repository at this point in the history
  • Loading branch information
davervw committed May 8, 2024
1 parent 4d22d1a commit 63d64f7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion mc6850.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,25 @@ byte MC6850::read_data()
// TODO: on async receive (simulated?) set receive_data_register_full, set interrupt if enabled
clear_irq();
byte data = getchar();
if (control.mode == MODE::b7e1
|| control.mode == MODE::b7e2
|| control.mode == MODE::b7o1
|| control.mode == MODE::b7o2
)
data = data & 0x7F; // TODO: parity
clear_receive_data_register_full();
set_receive_data_register_full(); // TODO: wait for data
return data;
}

void MC6850::write_data(byte value)
{
if (control.mode & b8n2)
// TODO: parity
if (control.mode == MODE::b8e1
|| control.mode == MODE::b8n1
|| control.mode == MODE::b8n2
|| control.mode == MODE::b8o1
)
putchar(value);
else
putchar(value & 0x7F);
Expand Down

0 comments on commit 63d64f7

Please sign in to comment.