From b15cf14dfc63b3f01ce8c34af562d8529a6bcfdd Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 11 Feb 2024 11:21:55 -0800 Subject: [PATCH] Draw layer --- gui/shaviankb/shaviankb.tal | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/gui/shaviankb/shaviankb.tal b/gui/shaviankb/shaviankb.tal index 4614f32..770b01c 100644 --- a/gui/shaviankb/shaviankb.tal +++ b/gui/shaviankb/shaviankb.tal @@ -61,14 +61,33 @@ .hover LDZ2 ;btn-chr DUP2 ;btn-press-chr ( | 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 /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 + +@ ( 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 + @ ( -- ) .layer LDZ INC #03 DIVk MUL SUB .layer STZ ! @@ -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 ] + #0a00 [ LIT2 00 -layer ] LDZ EQU [ JMP SWP POP ] .Screen/x DEI2k #0002 SUB2 ROT DEO2 .Screen/y DEI2k #000c ADD2 ROT DEO2 ( | b ) - #0a00 [ LIT2 00 -layer ] LDZ EQU [ JMP SWP POP ] + #0a00 [ LIT2 01 -layer ] LDZ EQU [ JMP SWP POP ] .Screen/x DEI2k #0002 SUB2 ROT DEO2 .Screen/y DEI2k #000c ADD2 ROT DEO2 ( | c )