mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-14 14:48:08 +11:00
7001446212
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.
14 lines
535 B
Plaintext
14 lines
535 B
Plaintext
: _updsel ( -- f, has an action button been pressed? )
|
|
_status _prevstat C@ OVER = IF DROP 0 EXIT THEN
|
|
DUP _prevstat C! ( changed, update ) ( s )
|
|
0x01 ( UP ) OVER AND NOT IF 1 _sel +! THEN
|
|
0x02 ( DOWN ) OVER AND NOT IF -1 _sel +! THEN
|
|
0x04 ( LEFT ) OVER AND NOT IF -5 _sel +! THEN
|
|
0x08 ( RIGHT ) OVER AND NOT IF 5 _sel +! THEN
|
|
0x10 ( BUTB ) OVER AND NOT IF _nxtcls THEN
|
|
( update sel in VDP )
|
|
_chk _sel C@ (emit) -1 XYPOS +!
|
|
( return whether any of the high 3 bits is low )
|
|
0xe0 AND 0xe0 <
|
|
;
|