1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-26 18:08:05 +11:00
collapseos/arch/z80/sms/blk/622
Virgil Dupras 7001446212 Complete overhaul of recipes
Recipes contain bits and pieces of hardware-related knowledge, but
these bits feel sparse. I've been wanting to consolidate hardware-
related documentation for a while, but always fell at odds with the
recipes organisation.

We don't have recipes anymore, just a /doc/hw section that contains
hardware-related documentation which often translate to precise
instructions to run Collapse OS on a specific machine.

With this new organisation, I hope to end up with a better, more
solid documentation.
2020-10-30 20:39:39 -04:00

13 lines
528 B
Plaintext

: (spie) DROP ; ( always enabled )
: (spix) ( x -- x, for port B )
0 SWAP ( rx tx ) 8 0 DO
( send bit 7 to bit 6, TR's output bit )
DUP 1 RSHIFT 0x40 AND ( rx tx bits ) 0x80 OR ( CLK hi )
0x3f PC@ OR 0xf3 AND ( TH and TR output )
DUP 0x3f PC! ( rx tx bits )
( CLK low ) 0x7f AND 0x3f PC! ( rx tx )
( shift tx ) 1 LSHIFT ( rx tx<< )
( read into rx ) SWAP 1 LSHIFT 0xdc PC@ ( tx<< rx<< x )
( out bit is the 6th ) 6 RSHIFT 1 AND OR
SWAP LOOP ( rx tx ) DROP ;