From db9edf663e69f419800e50588e30c728c45e507e Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 11 Feb 2024 09:28:18 -0800 Subject: [PATCH] Added hover state changes --- gui/shaviankb/assets.tal | 9 +++ gui/shaviankb/shaviankb.tal | 121 +++++++++++++++++++----------------- 2 files changed, 72 insertions(+), 58 deletions(-) diff --git a/gui/shaviankb/assets.tal b/gui/shaviankb/assets.tal index 4dbc408..1e5e9a3 100644 --- a/gui/shaviankb/assets.tal +++ b/gui/shaviankb/assets.tal @@ -48,6 +48,15 @@ 3f3f 3f3f 3f1f 0000 7f7f 7f5f 4020 1f00 ffff ffff ffff 0000 ffff ffff 0000 ff00 fcfc fcfc fcf8 0000 fefe fefa 0204 f800 ] +@btn-hover-chr [ + 0000 001f 3f3f 3f3f 0000 1f3f 7f7f 7f7f + 0000 00ff ffff ffff 0000 ffff ffff ffff + 0000 00f8 fcfc fcfc 0000 f8fc fefe fefe + fcfc fcfc fcfc fcfc fefe fefe fefe fefe + 3f3f 3f3f 3f3f 3f3f 7f7f 7f7f 7f7f 7f7f + 3f3f 3f3f 3f1f 0000 7f7f 7f7f 5f20 1f00 + ffff ffff ffff 0000 ffff ffff ff00 ff00 + fcfc fcfc fcf8 0000 fefe fefe fa04 f800 ] @keys &peep 0000 0060 1008 0808 0808 0808 0000 0000 ={ f090 9190 } diff --git a/gui/shaviankb/shaviankb.tal b/gui/shaviankb/shaviankb.tal index d236653..9b60528 100644 --- a/gui/shaviankb/shaviankb.tal +++ b/gui/shaviankb/shaviankb.tal @@ -42,8 +42,12 @@ JMP2r @ ( id* -- ) - DUP2 .hover LDZ2 EQU2 ?{ .hover STZ2 - JMP2r } + DUP2 #0030 LTH2 ?{ POP2 JMP2r } + DUP2 .hover LDZ2 EQU2 ?{ + ( undraw ) .hover LDZ2 ;btn-chr + DUP2 ;btn-hover-chr + .hover STZ2 + ( redraw ) JMP2r } POP2 JMP2r @ ( id* -- ) @@ -56,6 +60,62 @@ ( @|drawing ) +@ ( -- ) + #0020 #0000 + &l ( -- ) + DUP2 ;btn-chr + INC2 GTH2k ?&l + POP2 POP2 JMP2r + +@ ( id* frame* -- ) + OVR2 + OVR2 #001d EQU2 ? + STH2 + #0006 MUL2 ;layout ADD2 + ( ) STH2k #0004 ADD2 LDA2 + ( ) STH2kr #0002 ADD2 LDA2 + ( ) STH2r LDA2 STH2r + JMP2r + +@ ( addr* -- ) + .Screen/addr DEO2 + [ LIT2 15 -Screen/auto ] DEO + [ LIT2 0a -Screen/sprite ] DEO + JMP2r + +@ ( a* b* c* frame* -- ) + + .Screen/x DEI2k #0002 SUB2 ROT DEO2 + .Screen/y DEI2k #0024 SUB2 ROT DEO2 + ( | a ) + + .Screen/x DEI2k #0002 SUB2 ROT DEO2 + .Screen/y DEI2k #000c ADD2 ROT DEO2 + ( | b ) + + .Screen/x DEI2k #0002 SUB2 ROT DEO2 + .Screen/y DEI2k #000c ADD2 ROT DEO2 + ( | c ) + + .Screen/x DEI2k #0006 ADD2 ROT DEO2 + .Screen/y DEI2k #001c SUB2 ROT DEO2 + JMP2r + +@ ( id* frame* -- ) + STH2 + POP2 .Screen/x DEI2 .Screen/y DEI2 #1204 STH2r + ;fill-icn .Screen/addr DEO2 + [ LIT2 31 -Screen/auto ] DEO + #03ee ! + +@ ( frame* -- ) + STH2 + .Screen/x DEI2 .Screen/y DEI2 #0204 STH2r + ;fill-icn .Screen/addr DEO2 + [ LIT2 12 -Screen/auto ] DEO + [ LIT2 03 -Screen/sprite ] DEOk DEOk DEOk DEO + JMP2r + @ ( x* y* w h sprite* -- ) .Screen/addr DEO2 ,&h STR @@ -83,61 +143,6 @@ INC GTHk ?&repeat-loop POP2 JMP2r -@ ( -- ) - #0020 #0000 - &l ( -- ) - DUP2 #00 - INC2 GTH2k ?&l - POP2 POP2 JMP2r - -@ ( id* state -- ) - POP DUP2 - DUP #1d EQU ? - #0006 MUL2 ;layout ADD2 - ( ) STH2k #0004 ADD2 LDA2 - ( ) STH2kr #0002 ADD2 LDA2 - ( ) STH2r LDA2 ;btn-chr - JMP2r - -@ ( addr* -- ) - .Screen/addr DEO2 - [ LIT2 15 -Screen/auto ] DEO - [ LIT2 0a -Screen/sprite ] DEO - JMP2r - -@ ( a* b* c* frame* -- ) - - .Screen/x DEI2k #0002 SUB2 ROT DEO2 - .Screen/y DEI2k #0024 SUB2 ROT DEO2 - ( | a ) - - .Screen/x DEI2k #0002 SUB2 ROT DEO2 - .Screen/y DEI2k #000c ADD2 ROT DEO2 - ( | b ) - - .Screen/x DEI2k #0002 SUB2 ROT DEO2 - .Screen/y DEI2k #000c ADD2 ROT DEO2 - ( | c ) - - .Screen/x DEI2k #0006 ADD2 ROT DEO2 - .Screen/y DEI2k #001c SUB2 ROT DEO2 - JMP2r - -@ ( id* -- ) - .Screen/x DEI2 .Screen/y DEI2 #1204 ;btn-chr - ;fill-icn .Screen/addr DEO2 - [ LIT2 31 -Screen/auto ] DEO - #03ee - POP2 JMP2r - -@ ( frame* -- ) - STH2 - .Screen/x DEI2 .Screen/y DEI2 #0204 STH2r - ;fill-icn .Screen/addr DEO2 - [ LIT2 12 -Screen/auto ] DEO - [ LIT2 03 -Screen/sprite ] DEOk DEOk DEOk DEO - JMP2r - @ ( color times -- ) OVR .Screen/sprite DEO INC DUP ? @@ -167,6 +172,6 @@ &c ( -- ) #0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #18 DEO JMP2r - + ~assets.tal