Draw layer

This commit is contained in:
Devine Lu Linvega 2024-02-11 11:21:55 -08:00
parent 9920d169bd
commit b15cf14dfc
1 changed files with 24 additions and 5 deletions

View File

@ -61,14 +61,33 @@
.hover LDZ2 ;btn-chr <draw-key-id>
DUP2 ;btn-press-chr <draw-key-id>
( | event )
( key ) #0006 MUL2 ;layout ADD2 LDA2
( key ) #0006 MUL2 ;layout ADD2
( layer ) get-layer #10 SFT2 ADD2 LDA2
( length ) #0010 ADD2 LDA2k SWP2 INC2 INC2
&l ( -- )
LDAk <phex>/b
#0a18 DEO
LDAk #18 DEO
INC2 GTH2k ?&l
POP2 POP2 JMP2r
@get-layer ( -- layer* )
.Mouse/state DEI
( ) DUP #02 AND ?&top
( ) #04 AND ?&bottom
[ LIT2 00 -layer ] LDZ JMP2r
&top POP #0001 JMP2r
&bottom #0002 JMP2r
@<detect-layer> ( state -- )
DUP #02 AND ?&top
DUP #04 AND ?&bottom
POP JMP2r
&top ( state -- )
POP #01 .layer STZ
JMP2r
&bottom ( state -- )
POP #02 .layer STZ
JMP2r
@<toggle-layer> ( -- )
.layer LDZ INC #03 DIVk MUL SUB .layer STZ
!<draw-keyboard>
@ -122,11 +141,11 @@
.Screen/x DEI2k #0002 SUB2 ROT DEO2
.Screen/y DEI2k #0024 STHr SUB STHr SUB SUB2 ROT DEO2
( | a )
#0a00 [ LIT2 01 -layer ] LDZ EQU [ JMP SWP POP ] <draw-glyph>
#0a00 [ LIT2 00 -layer ] LDZ EQU [ JMP SWP POP ] <draw-glyph>
.Screen/x DEI2k #0002 SUB2 ROT DEO2
.Screen/y DEI2k #000c ADD2 ROT DEO2
( | b )
#0a00 [ LIT2 00 -layer ] LDZ EQU [ JMP SWP POP ] <draw-glyph>
#0a00 [ LIT2 01 -layer ] LDZ EQU [ JMP SWP POP ] <draw-glyph>
.Screen/x DEI2k #0002 SUB2 ROT DEO2
.Screen/y DEI2k #000c ADD2 ROT DEO2
( | c )