Skip to content

v2.0.1

Choose a tag to compare

@acwright acwright released this 17 Sep 21:24
· 3 commits to main since this release

Serial flow control, fixed against a real R6551 on the bench.

Four faults, all on the serial console's path, none visible on the emulator before it modelled the chip:

  • Raising RTS also stops the transmitter (command register TIC 00). BASIC echoes every character it reads, so once the input buffer filled, the echo could never finish: the machine deadlocked mid-paste and ignored even Ctrl-C. SerialChrout now drops RTS around each byte.
  • The interrupt handler read the ACIA's data register whenever the interrupt bit was set, without checking a byte was waiting, so a character could be stored twice. On the bench a 50-line paste came back with LINEE, JUMPSS, PPRINT.
  • WriteBuffer could lap the reader. At 256 unread bytes the count wrapped to zero, the buffer looked empty, and a whole ring was overwritten: exactly six lines vanished from the middle of long pastes.
  • Every echo reopened the gate. Sending needs RTS down, so a flooded buffer never recovered and lost 2-3 characters a line. Above the high-water mark the console now goes quiet instead, and the far end really stops.

Water marks moved to $C0/$80. XModem is exempt throughout: it owns the line.

On hardware (KIM, real R6551, 19,200 baud, RTS/CTS): pastes of 50, 150 and 300 lines (to 14 KB) arrive byte-perfect, with and without the EhBASIC cartridge, and CF and XModem round trips verify byte for byte.

ROM sha256 f5fb454b9f407c9cbb4cb349ac833b7c92400122d44b6a5840ebe6ab9cf0d97b