Apple2 and Atmos have Index in X, but can still use it for the
best-case path as long as we reload it in the worst-case part
(when we assert flow control).
Also, standardize the free space to trigger flow control to 32
characters left (compare with RecvFreeCnt before decrement)
The OSI C1P alternative boot file format works, but the code in the
source listing does not match the ASCII-coded hex translation (which
is actually used). This is confusing to anyone trying to maintain the
code.
Also, the source code did not assemble when ASM is defined.
Also removed use of branch macros and an unnecessary "<" operator.
With these changes the source file should correctly match what
is used at run time.
Tested on real KIM-1 hardware.
read.s:
- Remove commented out line.
- Remove unused check for bell character.
- Remove echo of newline (hardware always echoes entered characters).
- This fixes gets() and fgets() so they return when CR is entered.
write.s:
- Fix check for adding return after linefeed (failed to work because OUTCHR changes A)
- Remove unused check for bell character.
kim1.inc:
- Add symbol for monitor entry
crt0.s:
- Jump to KIM-1 monitor by address rather than using BRK (which relies on vector being set in RAM)
There's no target with more than one serial driver (and I don't see that change anytime soon) so it's a no-brainer to apply the standard driver concept to serial drivers.
The Receive Data Register and the Transmit Data Register share share a single address. Accessing that address with STA abs,X in order to fill the Transmit Data Register causes a 6502 false read which causes the Receive Data Register to be emptied.
The simplest way to work around that issue - which I chose here - is to move the base address for all ACIA accesses from page $C0 to page $BF. However, that adds an additional cycle to all read accesses. An alternative approach would be to only modify the single line `sta ACIA_DATA,x`.