Added hover state changes

This commit is contained in:
Devine Lu Linvega 2024-02-11 09:28:18 -08:00
parent fe2bee8a95
commit db9edf663e
2 changed files with 72 additions and 58 deletions

View File

@ -48,6 +48,15 @@
3f3f 3f3f 3f1f 0000 7f7f 7f5f 4020 1f00 3f3f 3f3f 3f1f 0000 7f7f 7f5f 4020 1f00
ffff ffff ffff 0000 ffff ffff 0000 ff00 ffff ffff ffff 0000 ffff ffff 0000 ff00
fcfc fcfc fcf8 0000 fefe fefa 0204 f800 ] 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 @keys
&peep 0000 0060 1008 0808 0808 0808 0000 0000 ={ f090 9190 } &peep 0000 0060 1008 0808 0808 0808 0000 0000 ={ f090 9190 }

View File

@ -42,8 +42,12 @@
JMP2r JMP2r
@<set-hover> ( id* -- ) @<set-hover> ( id* -- )
DUP2 .hover LDZ2 EQU2 ?{ .hover STZ2 DUP2 #0030 LTH2 ?{ POP2 JMP2r }
JMP2r } DUP2 .hover LDZ2 EQU2 ?{
( undraw ) .hover LDZ2 ;btn-chr <draw-key-id>
DUP2 ;btn-hover-chr <draw-key-id>
.hover STZ2
( redraw ) JMP2r }
POP2 JMP2r POP2 JMP2r
@<set-position> ( id* -- ) @<set-position> ( id* -- )
@ -56,6 +60,62 @@
( (
@|drawing ) @|drawing )
@<draw-keyboard> ( -- )
#0020 #0000
&l ( -- )
DUP2 ;btn-chr <draw-key-id>
INC2 GTH2k ?&l
POP2 POP2 JMP2r
@<draw-key-id> ( id* frame* -- )
OVR2 <set-position>
OVR2 #001d EQU2 ?<draw-key-space>
STH2
#0006 MUL2 ;layout ADD2
( ) STH2k #0004 ADD2 LDA2
( ) STH2kr #0002 ADD2 LDA2
( ) STH2r LDA2 STH2r <draw-key>
JMP2r
@<draw-glyph> ( addr* -- )
.Screen/addr DEO2
[ LIT2 15 -Screen/auto ] DEO
[ LIT2 0a -Screen/sprite ] DEO
JMP2r
@<draw-key> ( a* b* c* frame* -- )
<draw-button>
.Screen/x DEI2k #0002 SUB2 ROT DEO2
.Screen/y DEI2k #0024 SUB2 ROT DEO2
( | a )
<draw-glyph>
.Screen/x DEI2k #0002 SUB2 ROT DEO2
.Screen/y DEI2k #000c ADD2 ROT DEO2
( | b )
<draw-glyph>
.Screen/x DEI2k #0002 SUB2 ROT DEO2
.Screen/y DEI2k #000c ADD2 ROT DEO2
( | c )
<draw-glyph>
.Screen/x DEI2k #0006 ADD2 ROT DEO2
.Screen/y DEI2k #001c SUB2 ROT DEO2
JMP2r
@<draw-key-space> ( id* frame* -- )
STH2
POP2 .Screen/x DEI2 .Screen/y DEI2 #1204 STH2r <draw-frame>
;fill-icn .Screen/addr DEO2
[ LIT2 31 -Screen/auto ] DEO
#03ee !<draw-times>
@<draw-button> ( frame* -- )
STH2
.Screen/x DEI2 .Screen/y DEI2 #0204 STH2r <draw-frame>
;fill-icn .Screen/addr DEO2
[ LIT2 12 -Screen/auto ] DEO
[ LIT2 03 -Screen/sprite ] DEOk DEOk DEOk DEO
JMP2r
@<draw-frame> ( x* y* w h sprite* -- ) @<draw-frame> ( x* y* w h sprite* -- )
.Screen/addr DEO2 .Screen/addr DEO2
,&h STR ,&h STR
@ -83,61 +143,6 @@
INC GTHk ?&repeat-loop INC GTHk ?&repeat-loop
POP2 JMP2r POP2 JMP2r
@<draw-keyboard> ( -- )
#0020 #0000
&l ( -- )
DUP2 #00 <draw-key-id>
INC2 GTH2k ?&l
POP2 POP2 JMP2r
@<draw-key-id> ( id* state -- )
POP DUP2 <set-position>
DUP #1d EQU ?<draw-key-space>
#0006 MUL2 ;layout ADD2
( ) STH2k #0004 ADD2 LDA2
( ) STH2kr #0002 ADD2 LDA2
( ) STH2r LDA2 ;btn-chr <draw-key>
JMP2r
@<draw-glyph> ( addr* -- )
.Screen/addr DEO2
[ LIT2 15 -Screen/auto ] DEO
[ LIT2 0a -Screen/sprite ] DEO
JMP2r
@<draw-key> ( a* b* c* frame* -- )
<draw-button>
.Screen/x DEI2k #0002 SUB2 ROT DEO2
.Screen/y DEI2k #0024 SUB2 ROT DEO2
( | a )
<draw-glyph>
.Screen/x DEI2k #0002 SUB2 ROT DEO2
.Screen/y DEI2k #000c ADD2 ROT DEO2
( | b )
<draw-glyph>
.Screen/x DEI2k #0002 SUB2 ROT DEO2
.Screen/y DEI2k #000c ADD2 ROT DEO2
( | c )
<draw-glyph>
.Screen/x DEI2k #0006 ADD2 ROT DEO2
.Screen/y DEI2k #001c SUB2 ROT DEO2
JMP2r
@<draw-key-space> ( id* -- )
.Screen/x DEI2 .Screen/y DEI2 #1204 ;btn-chr <draw-frame>
;fill-icn .Screen/addr DEO2
[ LIT2 31 -Screen/auto ] DEO
#03ee <draw-times>
POP2 JMP2r
@<draw-button> ( frame* -- )
STH2
.Screen/x DEI2 .Screen/y DEI2 #0204 STH2r <draw-frame>
;fill-icn .Screen/addr DEO2
[ LIT2 12 -Screen/auto ] DEO
[ LIT2 03 -Screen/sprite ] DEOk DEOk DEOk DEO
JMP2r
@<draw-times> ( color times -- ) @<draw-times> ( color times -- )
OVR .Screen/sprite DEO OVR .Screen/sprite DEO
INC DUP ?<draw-times> INC DUP ?<draw-times>
@ -167,6 +172,6 @@
&c ( -- ) &c ( -- )
#0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #18 DEO #0f AND DUP #09 GTH #27 MUL ADD [ LIT "0 ] ADD #18 DEO
JMP2r JMP2r
~assets.tal ~assets.tal