neuttower/state.jor

17 lines
489 B
Plaintext
Executable file

0 const PROG-VIEW userword
1 const FLAG-COUNT
array flags FLAG-COUNT 8 / 1 + allot
: flagstof ( f -- v f ) dup 8 / flags + swap 8 % 1 swap << ;
: flagsf! ( b f -- ) flagstof f! ;
: flag@ ( f -- b ) flagstof f@ ; userword
: setflag 1 swap flagsf! ; userword
: clearflag 0 swap flagsf! ; userword
: human-view s" tiles.gfx" loadtiles invalidate-map PROG-VIEW clearflag ; userword
: prog-view s" ntiles.gfx" loadtiles invalidate-map PROG-VIEW setflag ; userword