From 25bd28617fe77c08d49ccc14348a74138fe13c17 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 11 Feb 2024 11:36:26 -0800 Subject: [PATCH] Starting keyboard input --- gui/shaviankb/shaviankb.tal | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/gui/shaviankb/shaviankb.tal b/gui/shaviankb/shaviankb.tal index 770b01c..3ff7eef 100644 --- a/gui/shaviankb/shaviankb.tal +++ b/gui/shaviankb/shaviankb.tal @@ -3,6 +3,7 @@ |00 @System &vector $2 &expansion $2 &wst $1 &rst $1 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &state $1 |10 @Console &vector $2 &read $1 &pad $4 &type $1 &write $1 &error $1 |20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 +|80 @Controller &vector $2 &button $1 &key $1 |90 @Mouse &vector $2 &x $2 &y $2 &state $1 &chord $1 &pad $4 &scrolly &scrolly-hb $1 &scrolly-lb $1 |0000 @@ -20,6 +21,7 @@ #0130 .Screen/width DEO2 #00d0 .Screen/height DEO2 ;on-mouse .Mouse/vector DEO2 + ;on-control .Controller/vector DEO2 ( #010e DEO ) BRK @@ -46,6 +48,11 @@ [ LIT2 01 -lock ] STZ } BRK +@on-control ( -> ) + .Controller/button DEI #02 SFT #01 AND .layer STZ + + BRK + ( @|core ) @@ -73,21 +80,15 @@ .Mouse/state DEI ( ) DUP #02 AND ?&top ( ) #04 AND ?&bottom - [ LIT2 00 -layer ] LDZ JMP2r + .Controller/button DEI + ( ) #04 AND ?&top + .layer LDZ + ( ) DUP #00 EQU ?&top + ( ) #02 EQU ?&bottom + #0000 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 ! @@ -141,11 +142,11 @@ .Screen/x DEI2k #0002 SUB2 ROT DEO2 .Screen/y DEI2k #0024 STHr SUB STHr SUB SUB2 ROT DEO2 ( | a ) - #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 ( | b ) - #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 ( | c )