1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 13:38:06 +11:00

trs80: implement a standalone RS-232 driver

No more relying on the TRS-DOS driver!
This commit is contained in:
Virgil Dupras 2020-12-25 16:54:02 -05:00
parent 18f6978399
commit 5ca99ad410
2 changed files with 17 additions and 13 deletions

View File

@ -100,9 +100,10 @@ EXX, ( unprotect BC ) ;CODE
: FD! ['] @WRSEC SWAP FD@! ; : FD! ['] @WRSEC SWAP FD@! ;
: FD$ ['] FD@ BLK@* ! ['] FD! BLK!* ! ; : FD$ ['] FD@ BLK@* ! ['] FD! BLK!* ! ;
: _err LIT" *CLerr" ERR ; : CL$ 0x02 0xe8 PC! ( UART RST ) 0xee 0xe9 PC! ( 9600 bauds )
: *CL< 0 BEGIN DROP 0x0238 @GET UNTIL ; 0b01101100 0xea PC! ( word8 no parity RTS ) ;
: *CL> 0x0238 @PUT NOT IF _err THEN ; : CL> BEGIN 0xea PC@ 0x40 AND UNTIL 0xeb PC! ;
: CL< BEGIN 0xea PC@ 0x80 AND UNTIL 0xeb PC@ ;
( ----- 612 ) ( ----- 612 )
( We process the 0x20 exception by pre-putting a mask in the ( We process the 0x20 exception by pre-putting a mask in the
(HL) we're going to write to. If it wasn't a 0x20, we put a (HL) we're going to write to. If it wasn't a 0x20, we put a

View File

@ -257,8 +257,8 @@ And there we go! A Collapse OS launchable from floppy!
# Sending blkfs to floppy # Sending blkfs to floppy
As it is, your system fully supports reading and writing to As it is, your system fully supports reading and writing to
floppy drive 1. It also had *CL< to read a char from *cl and floppy drive 1. It also had CL< to read a char from its RS-232
*CL> to emit a char to *cl. port and CL> to emit to it.
That's all you need to have a full Collapse OS with access to That's all you need to have a full Collapse OS with access to
disk blocks. disk blocks.
@ -267,16 +267,19 @@ First, make sure your floppies are formatted. Collapse OS is
currently hardcoded to single side and single density, which currently hardcoded to single side and single density, which
means there's a limit of 100 blocks per disk. means there's a limit of 100 blocks per disk.
You'll need to send those blocks through RS-232. Begin by taking You'll need to send those blocks through RS-232. First, let's
over the prompt: initialize the driver with CL$. This driver does not require
the TRS-DOS driver to be loaded. Also, it is hardcoded to
"no parity, 8 bit words, 9600 bauds". Now, let's have the CL
take over the prompt:
' *CL> ' EMIT **! ' CL> ' EMIT **!
' *CL< ' KEY **! ' CL< ' KEY **!
See B80 for details about those RAM offsets. Your serial link See "Aliases" in usage.txt for details. Your serial link now has
now has the prompt. You will also have to make your newlines the prompt. You will also have to make your newlines CRLF. The
CRLF. The TRS-80 wants CR only, but serial communications (and TRS-80 wants CR only, but serial communications (and blkup)
blkup) expect CRLF: expect CRLF:
' CRLF ' NL **! ' CRLF ' NL **!