2020-11-15 10:00:31 +11:00
|
|
|
( ----- 600 )
|
2020-12-30 13:36:19 +11:00
|
|
|
601 MC6850 driver 606 Zilog SIO driver
|
2020-11-15 10:00:31 +11:00
|
|
|
615 SPI relay 619 Xcomp unit
|
|
|
|
( ----- 601 )
|
2020-12-30 13:36:19 +11:00
|
|
|
( MC6850 Driver. Load range B601-B603. Requires:
|
|
|
|
6850_CTL for control register
|
|
|
|
6850_IO for data register.
|
|
|
|
CTL numbers used: 0x16 = no interrupt, 8bit words, 1 stop bit
|
|
|
|
64x divide. 0x56 = RTS high )
|
Make KEY non-blocking
... and rename it to KEY?. Then, add KEY from KEY? for its blocking
version.
I need this for an upcoming Remote Shell feature. If a Collapse OS
system remotely controls another shell, it needs to be able to poll
both the remote system and the local keyboard at the same time. A
blocking KEY is incompatible with this.
In some places, the polling mechanism doesn't make sense, so this
new KEY? always returns a character. In some places, I just haven't
implemented the mechanism yet, so I kept the old blocking code and
added a "always 1" flag as a temporary shim.
I have probably broken something, but in emulators, Collapse OS runs
fine. It's an important reminder of what will be lost with the new
"dogfooding" approach (see recent mailing list message): without
emulators, it's much harder to to sweeping changes like this without
breaking stuff.
It's fine, I don't expect many more of these core changes to the
system. It's nearly feature-complete.
2021-01-02 00:05:29 +11:00
|
|
|
: _rts 0x16 ( RTS low ) [ 6850_CTL LITN ] PC! ;
|
|
|
|
: _rts^ 0x56 ( RTS high ) [ 6850_CTL LITN ] PC! ;
|
|
|
|
: 6850<? ( -- c? f )
|
|
|
|
[ 6850_CTL LITN ] PC@ 1 AND ( is rcv buff full ? )
|
|
|
|
NOT IF ( RTS low, then wait 1ms and try again )
|
|
|
|
_rts 10 TICKS ( 1ms ) _rts^
|
|
|
|
[ 6850_CTL LITN ] PC@ 1 AND ( is rcv buff full ? )
|
|
|
|
NOT IF 0 EXIT THEN
|
|
|
|
THEN [ 6850_IO LITN ] PC@ ( c ) 1 ( f ) ;
|
2020-11-15 10:00:31 +11:00
|
|
|
( ----- 602 )
|
2020-12-30 13:36:19 +11:00
|
|
|
CODE 6850>
|
|
|
|
HL POP, chkPS,
|
|
|
|
BEGIN,
|
|
|
|
6850_CTL INAi, 0x02 ANDi, ( are we transmitting? )
|
|
|
|
JRZ, ( yes, loop ) AGAIN,
|
|
|
|
A L LDrr, 6850_IO OUTiA,
|
|
|
|
;CODE
|
2020-11-15 10:00:31 +11:00
|
|
|
( ----- 603 )
|
Make KEY non-blocking
... and rename it to KEY?. Then, add KEY from KEY? for its blocking
version.
I need this for an upcoming Remote Shell feature. If a Collapse OS
system remotely controls another shell, it needs to be able to poll
both the remote system and the local keyboard at the same time. A
blocking KEY is incompatible with this.
In some places, the polling mechanism doesn't make sense, so this
new KEY? always returns a character. In some places, I just haven't
implemented the mechanism yet, so I kept the old blocking code and
added a "always 1" flag as a temporary shim.
I have probably broken something, but in emulators, Collapse OS runs
fine. It's an important reminder of what will be lost with the new
"dogfooding" approach (see recent mailing list message): without
emulators, it's much harder to to sweeping changes like this without
breaking stuff.
It's fine, I don't expect many more of these core changes to the
system. It's nearly feature-complete.
2021-01-02 00:05:29 +11:00
|
|
|
: (key?) 6850<? ;
|
2020-12-30 13:36:19 +11:00
|
|
|
: (emit) 6850> ;
|
|
|
|
: 6850$ 0x56 ( RTS high ) [ 6850_CTL LITN ] PC! ;
|
2020-11-15 10:00:31 +11:00
|
|
|
( ----- 605 )
|
2020-12-30 13:36:19 +11:00
|
|
|
( Zilog SIO driver. Load range B605-607. Requires:
|
|
|
|
SIOA_CTL for ch A control register
|
|
|
|
SIOA_DATA for ch A data register
|
|
|
|
SIOB_CTL for ch B control register
|
|
|
|
SIOB_DATA for ch B data register )
|
Make KEY non-blocking
... and rename it to KEY?. Then, add KEY from KEY? for its blocking
version.
I need this for an upcoming Remote Shell feature. If a Collapse OS
system remotely controls another shell, it needs to be able to poll
both the remote system and the local keyboard at the same time. A
blocking KEY is incompatible with this.
In some places, the polling mechanism doesn't make sense, so this
new KEY? always returns a character. In some places, I just haven't
implemented the mechanism yet, so I kept the old blocking code and
added a "always 1" flag as a temporary shim.
I have probably broken something, but in emulators, Collapse OS runs
fine. It's an important reminder of what will be lost with the new
"dogfooding" approach (see recent mailing list message): without
emulators, it's much harder to to sweeping changes like this without
breaking stuff.
It's fine, I don't expect many more of these core changes to the
system. It's nearly feature-complete.
2021-01-02 00:05:29 +11:00
|
|
|
: _<? ( io ctl -- c? f )
|
|
|
|
DUP ( io ctl ctl ) PC@ 1 AND ( is rcv buff full ? )
|
|
|
|
NOT IF ( io ctl )
|
|
|
|
0x05 ( PTR5 ) OVER PC! 0b01101000 OVER PC! ( RTS low )
|
|
|
|
10 TICKS ( 1ms )
|
|
|
|
0x05 ( PTR5 ) OVER PC! 0b01101010 OVER PC! ( RTS high )
|
|
|
|
PC@ 1 AND ( is rcv buff full ? )
|
|
|
|
NOT IF DROP 0 ( f ) EXIT THEN
|
|
|
|
ELSE DROP THEN ( io ) PC@ ( c ) 1 ( f ) ;
|
|
|
|
: SIOA<? [ SIOA_DATA LITN SIOA_CTL LITN ] _<? ;
|
2020-11-15 10:00:31 +11:00
|
|
|
( ----- 606 )
|
2020-12-30 13:36:19 +11:00
|
|
|
CODE SIOA>
|
|
|
|
HL POP, chkPS,
|
|
|
|
BEGIN,
|
|
|
|
SIOA_CTL INAi, 0x04 ANDi, ( are we transmitting? )
|
|
|
|
JRZ, ( yes, loop ) AGAIN,
|
|
|
|
A L LDrr, SIOA_DATA OUTiA,
|
|
|
|
;CODE
|
|
|
|
CREATE _ ( init data ) 0x18 C, ( CMD3 )
|
|
|
|
0x24 C, ( CMD2/PTR4 ) 0b11000100 C, ( WR4/64x/1stop/nopar )
|
|
|
|
0x03 C, ( PTR3 ) 0b11000001 C, ( WR3/RXen/8char )
|
|
|
|
0x05 C, ( PTR5 ) 0b01101010 C, ( WR5/TXen/8char/RTS )
|
|
|
|
0x21 C, ( CMD2/PTR1 ) 0 C, ( WR1/Rx no INT )
|
|
|
|
: SIOA$ 9 0 DO _ I + C@ [ SIOA_CTL LITN ] PC! LOOP ;
|
2020-11-15 10:00:31 +11:00
|
|
|
( ----- 607 )
|
Make KEY non-blocking
... and rename it to KEY?. Then, add KEY from KEY? for its blocking
version.
I need this for an upcoming Remote Shell feature. If a Collapse OS
system remotely controls another shell, it needs to be able to poll
both the remote system and the local keyboard at the same time. A
blocking KEY is incompatible with this.
In some places, the polling mechanism doesn't make sense, so this
new KEY? always returns a character. In some places, I just haven't
implemented the mechanism yet, so I kept the old blocking code and
added a "always 1" flag as a temporary shim.
I have probably broken something, but in emulators, Collapse OS runs
fine. It's an important reminder of what will be lost with the new
"dogfooding" approach (see recent mailing list message): without
emulators, it's much harder to to sweeping changes like this without
breaking stuff.
It's fine, I don't expect many more of these core changes to the
system. It's nearly feature-complete.
2021-01-02 00:05:29 +11:00
|
|
|
: SIOB<? [ SIOB_DATA LITN SIOB_CTL LITN ] _<? ;
|
2020-12-30 13:36:19 +11:00
|
|
|
CODE SIOB>
|
|
|
|
HL POP, chkPS,
|
|
|
|
BEGIN,
|
|
|
|
SIOB_CTL INAi, 0x04 ANDi, ( are we transmitting? )
|
|
|
|
JRZ, ( yes, loop ) AGAIN,
|
|
|
|
A L LDrr, SIOB_DATA OUTiA,
|
|
|
|
;CODE
|
|
|
|
: SIOB$ 9 0 DO _ I + C@ [ SIOB_CTL LITN ] PC! LOOP ;
|
2020-11-15 10:00:31 +11:00
|
|
|
( ----- 619 )
|
2020-12-30 13:36:19 +11:00
|
|
|
( RC2014 classic with MC6850 )
|
2020-11-15 10:00:31 +11:00
|
|
|
0xff00 CONSTANT RS_ADDR 0xfffa CONSTANT PS_ADDR
|
2021-01-03 06:20:50 +11:00
|
|
|
RS_ADDR 0xa0 - CONSTANT SYSVARS
|
2020-11-15 10:00:31 +11:00
|
|
|
0x8000 CONSTANT HERESTART
|
2020-12-30 13:36:19 +11:00
|
|
|
0x80 CONSTANT 6850_CTL 0x81 CONSTANT 6850_IO
|
2020-11-15 10:00:31 +11:00
|
|
|
4 CONSTANT SPI_DATA 5 CONSTANT SPI_CTL 1 CONSTANT SDC_DEVID
|
|
|
|
5 LOAD ( z80 assembler )
|
|
|
|
262 LOAD ( xcomp ) 282 LOAD ( boot.z80.decl )
|
|
|
|
270 LOAD ( xcomp overrides ) 283 335 LOADR ( boot.z80 )
|
2020-12-30 13:36:19 +11:00
|
|
|
353 LOAD ( xcomp core low ) 601 603 LOADR ( MC6850 )
|
2020-12-13 02:08:16 +11:00
|
|
|
419 LOAD ( SPI relay ) 423 436 LOADR ( SD Card )
|
|
|
|
400 LOAD ( AT28 )
|
2020-11-15 10:00:31 +11:00
|
|
|
390 LOAD ( xcomp core high )
|
|
|
|
(entry) _
|
2020-12-13 02:08:16 +11:00
|
|
|
PC ORG @ 8 + ! ( Update LATEST )
|
2020-12-30 13:36:19 +11:00
|
|
|
," 6850$ BLK$ " EOT,
|
2020-12-13 02:08:16 +11:00
|
|
|
( ----- 620 )
|
|
|
|
( RC2014 classic with SIO )
|
|
|
|
0xff00 CONSTANT RS_ADDR 0xfffa CONSTANT PS_ADDR
|
2021-01-03 06:20:50 +11:00
|
|
|
RS_ADDR 0xa0 - CONSTANT SYSVARS
|
2020-12-13 02:08:16 +11:00
|
|
|
0x8000 CONSTANT HERESTART
|
2020-12-30 13:36:19 +11:00
|
|
|
0x80 CONSTANT SIOA_CTL 0x81 CONSTANT SIOA_DATA
|
|
|
|
0x82 CONSTANT SIOB_CTL 0x83 CONSTANT SIOB_DATA
|
2020-12-13 02:08:16 +11:00
|
|
|
4 CONSTANT SPI_DATA 5 CONSTANT SPI_CTL 1 CONSTANT SDC_DEVID
|
|
|
|
5 LOAD ( z80 assembler )
|
|
|
|
262 LOAD ( xcomp ) 282 LOAD ( boot.z80.decl )
|
|
|
|
270 LOAD ( xcomp overrides ) 283 335 LOADR ( boot.z80 )
|
2020-12-30 13:36:19 +11:00
|
|
|
353 LOAD ( xcomp core low ) 605 607 LOADR ( SIO )
|
2020-12-13 02:08:16 +11:00
|
|
|
419 LOAD ( SPI relay ) 423 436 LOADR ( SD Card )
|
Make KEY non-blocking
... and rename it to KEY?. Then, add KEY from KEY? for its blocking
version.
I need this for an upcoming Remote Shell feature. If a Collapse OS
system remotely controls another shell, it needs to be able to poll
both the remote system and the local keyboard at the same time. A
blocking KEY is incompatible with this.
In some places, the polling mechanism doesn't make sense, so this
new KEY? always returns a character. In some places, I just haven't
implemented the mechanism yet, so I kept the old blocking code and
added a "always 1" flag as a temporary shim.
I have probably broken something, but in emulators, Collapse OS runs
fine. It's an important reminder of what will be lost with the new
"dogfooding" approach (see recent mailing list message): without
emulators, it's much harder to to sweeping changes like this without
breaking stuff.
It's fine, I don't expect many more of these core changes to the
system. It's nearly feature-complete.
2021-01-02 00:05:29 +11:00
|
|
|
400 LOAD ( AT28 ) : (key?) SIOA<? ; : (emit) SIOA> ;
|
2020-12-13 02:08:16 +11:00
|
|
|
390 LOAD ( xcomp core high )
|
2020-12-30 13:36:19 +11:00
|
|
|
(entry) _ PC ORG @ 8 + ! ( Update LATEST )
|
Make KEY non-blocking
... and rename it to KEY?. Then, add KEY from KEY? for its blocking
version.
I need this for an upcoming Remote Shell feature. If a Collapse OS
system remotely controls another shell, it needs to be able to poll
both the remote system and the local keyboard at the same time. A
blocking KEY is incompatible with this.
In some places, the polling mechanism doesn't make sense, so this
new KEY? always returns a character. In some places, I just haven't
implemented the mechanism yet, so I kept the old blocking code and
added a "always 1" flag as a temporary shim.
I have probably broken something, but in emulators, Collapse OS runs
fine. It's an important reminder of what will be lost with the new
"dogfooding" approach (see recent mailing list message): without
emulators, it's much harder to to sweeping changes like this without
breaking stuff.
It's fine, I don't expect many more of these core changes to the
system. It's nearly feature-complete.
2021-01-02 00:05:29 +11:00
|
|
|
," SIOA$ BLK$ " EOT,
|