Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
535B

  1. : _updsel ( -- f, has an action button been pressed? )
  2. _status _prevstat C@ OVER = IF DROP 0 EXIT THEN
  3. DUP _prevstat C! ( changed, update ) ( s )
  4. 0x01 ( UP ) OVER AND NOT IF 1 _sel +! THEN
  5. 0x02 ( DOWN ) OVER AND NOT IF -1 _sel +! THEN
  6. 0x04 ( LEFT ) OVER AND NOT IF -5 _sel +! THEN
  7. 0x08 ( RIGHT ) OVER AND NOT IF 5 _sel +! THEN
  8. 0x10 ( BUTB ) OVER AND NOT IF _nxtcls THEN
  9. ( update sel in VDP )
  10. _chk _sel C@ (emit) -1 XYPOS +!
  11. ( return whether any of the high 3 bits is low )
  12. 0xe0 AND 0xe0 <
  13. ;