226 lines
4.3 KiB
Tal
226 lines
4.3 KiB
Tal
|00 @System &vector $2 &pad $6 &r $2 &g $2 &b $2
|
|
|10 @Console &vector $2 &read $1 &pad $5 &write $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
|
|
|a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2
|
|
|
|
|0100
|
|
|
|
( theme )
|
|
#f0f0 .System/r DEO2
|
|
#f000 .System/g DEO2
|
|
#f00f .System/b DEO2
|
|
( size )
|
|
#00e0 .Screen/width DEO2
|
|
#00f8 .Screen/height DEO2
|
|
( unlock )
|
|
;on-console .Console/vector DEO2
|
|
;on-mouse-body .Mouse/vector DEO2
|
|
|
|
draw-header
|
|
draw-footer
|
|
|
|
BRK
|
|
|
|
@on-console ( -> )
|
|
|
|
BRK
|
|
|
|
@on-mouse-head ( -> )
|
|
|
|
[ LIT2 00 -Mouse/state ] DEI NEQ #41 ADD ;mouse-icn update-cursor
|
|
|
|
trap-mouse
|
|
|
|
.Mouse/state DEI ?&on-mouse-down
|
|
|
|
BRK
|
|
|
|
&on-mouse-down ( -> )
|
|
|
|
BRK
|
|
|
|
@on-mouse-body ( -> )
|
|
|
|
[ LIT2 00 -Mouse/state ] DEI NEQ #41 ADD ;caret-icn update-cursor
|
|
|
|
trap-mouse
|
|
|
|
.Mouse/state DEI ?&on-mouse-down
|
|
|
|
BRK
|
|
|
|
&on-mouse-down ( -> )
|
|
|
|
BRK
|
|
|
|
@on-mouse-foot ( -> )
|
|
|
|
[ LIT2 00 -Mouse/state ] DEI NEQ #41 ADD ;mouse-icn update-cursor
|
|
|
|
trap-mouse
|
|
|
|
.Mouse/state DEI #00 NEQ .Mouse/x DEI2 #0018 LTH2 AND ?&on-mouse-down
|
|
|
|
BRK
|
|
|
|
&on-mouse-down ( -> )
|
|
|
|
.Mouse/y DEI2 #00d6 SUB2 NIP
|
|
#18 .Mouse/x DEI2 NIP SUB
|
|
ADD #18 LTH ?&go-next prev-page BRK
|
|
&go-next next-page
|
|
|
|
BRK
|
|
|
|
(
|
|
@|core )
|
|
|
|
@trap-mouse ( -- )
|
|
|
|
.Mouse/y DEI2
|
|
DUP2 #0018 GTH2 ?&no-head
|
|
POP2 ;on-mouse-head .Mouse/vector DEO2 JMP2r
|
|
&no-head
|
|
DUP2 #00d6 LTH2 ?&no-foot
|
|
POP2 ;on-mouse-foot .Mouse/vector DEO2 JMP2r
|
|
&no-foot
|
|
POP2
|
|
;on-mouse-body .Mouse/vector DEO2
|
|
|
|
JMP2r
|
|
|
|
@prev-page ( -- )
|
|
|
|
#ff phex/b #0a18 DEO
|
|
|
|
JMP2r
|
|
|
|
@next-page ( -- )
|
|
|
|
#01 phex/b #0a18 DEO
|
|
|
|
JMP2r
|
|
|
|
@update-cursor ( color addr* -- )
|
|
|
|
[ LIT2 15 -Screen/auto ] DEO
|
|
#40 draw-cursor
|
|
.Mouse/x DEI2 ,draw-cursor/x STR2
|
|
.Mouse/y DEI2 ,draw-cursor/y STR2
|
|
.Screen/addr DEO2
|
|
|
|
@draw-cursor ( color -- )
|
|
|
|
[ LIT2 &x $2 ] .Screen/x DEO2
|
|
[ LIT2 &y $2 ] .Screen/y DEO2
|
|
.Screen/sprite DEO
|
|
|
|
JMP2r
|
|
|
|
(
|
|
@|drawing )
|
|
|
|
@draw-header ( -- )
|
|
|
|
( a )
|
|
#0000
|
|
DUP2 .Screen/x DEO2
|
|
.Screen/y DEO2
|
|
#15 .Screen/auto DEO
|
|
;bar-icn/a .Screen/addr DEO2
|
|
#01 .Screen/sprite DEO
|
|
( close )
|
|
;close-icn/default .Screen/addr DEO2
|
|
#01 .Screen/sprite DEOk DEO
|
|
( lead )
|
|
#e9 &l
|
|
;bar-icn/b .Screen/addr DEO2
|
|
#01 .Screen/sprite DEO
|
|
INC DUP ?&l
|
|
POP
|
|
;bar-icn/b .Screen/addr DEO2
|
|
#01 .Screen/sprite DEOk DEO
|
|
( title )
|
|
#004b .Screen/x DEO2
|
|
#86 .Screen/auto DEO
|
|
;title-icn .Screen/addr DEO2
|
|
#01 .Screen/sprite DEOk DEO
|
|
( line )
|
|
#d2 .Screen/auto DEO
|
|
#0000 .Screen/x DEO2
|
|
#0010 .Screen/y DEO2
|
|
;line-icn .Screen/addr DEO2
|
|
#01 .Screen/sprite DEO
|
|
#0070 .Screen/x DEO2
|
|
#0010 .Screen/y DEO2
|
|
#01 .Screen/sprite DEO
|
|
|
|
JMP2r
|
|
|
|
@draw-footer ( -- )
|
|
|
|
#26 .Screen/auto DEO
|
|
#0000 .Screen/x DEO2
|
|
.Screen/height DEI2 #0020 SUB2 .Screen/y DEO2
|
|
;page-icn .Screen/addr DEO2
|
|
#01 .Screen/sprite DEOk DEOk DEOk DEO
|
|
( across )
|
|
#01 .Screen/auto DEO
|
|
#0018 .Screen/x DEO2
|
|
.Screen/height DEI2 #0008 SUB2 .Screen/y DEO2
|
|
;page-icn/bottom .Screen/addr DEO2
|
|
#e7 &l
|
|
#01 .Screen/sprite DEO
|
|
INC DUP ?&l
|
|
POP
|
|
|
|
JMP2r
|
|
|
|
@phex ( short* -- ) SWP phex/b &b ( byte -- ) DUP #04 SFT phex/c &c ( char -- ) #0f AND DUP #09 GTH #27 MUL ADD #30 ADD #18 DEO JMP2r
|
|
|
|
(
|
|
@|assets )
|
|
|
|
@caret-icn [
|
|
c628 1010 1010 1010 1010 1010 1010 28c6 ]
|
|
@mouse-icn [
|
|
80c0 e0f0 f8fc feff f8d8 8c0c 0606 0000 ]
|
|
@bar-icn
|
|
&a [
|
|
0000 007e 007e 007e 007e 007e 007e 0000 ]
|
|
&b [
|
|
0000 00ff 00ff 00ff 00ff 00ff 00ff 0000 ]
|
|
&c [
|
|
0000 00fe 00fe 00fe 00fe 00fe 00fe 0000 ]
|
|
@close-icn
|
|
&default [
|
|
0000 00ff 8080 8080 8080 8080 80ff 0000
|
|
0000 00ef 202f 202f 202f 202f 20ef 0000 ]
|
|
&active [
|
|
0000 00ff 84a4 9580 f180 95a4 84ff 0000
|
|
0000 00ef 20af 202f e02f 20af 20ef 0000 ]
|
|
@title-icn [
|
|
0000 0080 0080 0080 0000 0000 82c2 e2f2
|
|
0000 0000 0000 3c66 0000 0000 3030 7831
|
|
0000 0000 0000 f098 0000 0000 1f19 1919
|
|
0000 0000 0080 8f91 0000 0000 0101 0f99
|
|
0000 0000 8080 8080 0080 0080 0080 0000
|
|
ba9e 8e86 8200 0000 6666 6666 3c00 0000
|
|
3131 3131 1800 0000 98f8 8088 f000 0000
|
|
1f18 1818 1800 0000 0f19 1919 0f00 0000
|
|
9999 9999 8f00 0000 8080 8080 8000 0000 ]
|
|
@page-icn [
|
|
00ff 4020 1008 0402 00ff 0000 0000 0000
|
|
00ff 0101 0101 0101 0100 0000 0000 0000
|
|
0080 4020 1008 0402 0101 0101 0101 0101
|
|
0000 0000 0000 0000 0100 0000 0000 0000
|
|
0181 4121 1109 0503 0000 ff00 ff00 ffff
|
|
0000 ff00 ff00 ffff 0100 ff00 ff00 ffff ]
|
|
&bottom [
|
|
ff00 ff00 ff00 ffff ]
|
|
@line-icn [
|
|
00ff 0000 0000 0000 ]
|
|
|