about page works

This commit is contained in:
~d6 2024-08-06 23:10:57 -04:00
parent e6f26332e0
commit 9196a3795b
3 changed files with 231 additions and 36 deletions

64
ascii.tal Normal file
View File

@ -0,0 +1,64 @@
7f 71 75 75 75 71 7f 00 7f 7d 7d 7d 7d 7d 7f 00
7f 71 7d 71 77 71 7f 00 7f 71 7d 71 7d 71 7f 00
7f 75 75 71 7d 7d 7f 00 7f 71 77 71 7d 71 7f 00
7f 71 77 71 75 71 7f 00 7f 71 7d 7d 7d 7d 7f 00
7f 71 75 71 75 71 7f 00 7f 71 75 71 7d 7d 7f 00
7f 7b 75 71 75 75 7f 00 7f 73 75 73 75 73 7f 00
7f 79 77 77 77 79 7f 00 7f 73 75 75 75 73 7f 00
7f 71 77 73 77 71 7f 00 7f 71 77 73 77 77 7f 00
7f 51 55 55 55 51 7f 00 7f 5d 5d 5d 5d 5d 7f 00
7f 51 5d 51 57 51 7f 00 7f 51 5d 51 5d 51 7f 00
7f 55 55 51 5d 5d 7f 00 7f 51 57 51 5d 51 7f 00
7f 51 57 51 55 51 7f 00 7f 51 5d 5d 5d 5d 7f 00
7f 51 55 51 55 51 7f 00 7f 51 55 51 5d 5d 7f 00
7f 5b 55 51 55 55 7f 00 7f 53 55 53 55 53 7f 00
7f 59 57 57 57 59 7f 00 7f 53 55 55 55 53 7f 00
7f 51 57 53 57 51 7f 00 7f 51 57 53 57 57 7f 00
00 00 00 00 00 00 00 00 18 18 18 18 18 00 18 00
66 66 66 00 00 00 00 00 66 66 ff 66 ff 66 66 00
18 3e 40 3c 02 7c 18 00 62 66 0c 18 30 66 46 00
3c 66 3c 38 67 66 3f 00 0c 18 30 00 00 00 00 00
0c 18 30 30 30 18 0c 00 30 18 0c 0c 0c 18 30 00
00 66 3c ff 3c 66 00 00 00 18 18 7e 18 18 00 00
00 00 00 00 18 18 30 00 00 00 00 7e 00 00 00 00
00 00 00 00 00 18 18 00 03 06 0c 18 30 60 c0 00
3c 66 6e 76 66 66 3c 00 18 18 38 18 18 18 7e 00
3c 66 06 0c 30 60 7e 00 3c 66 06 1c 06 66 3c 00
0c 1c 3c cc fe 0c 0c 00 7e 60 7c 06 06 66 3c 00
3c 66 60 7c 66 66 3c 00 7e 66 0c 18 18 18 18 00
3c 66 66 3c 66 66 3c 00 3c 66 66 3e 06 66 3c 00
00 00 18 00 18 00 00 00 00 00 18 00 18 18 30 00
0c 18 30 60 30 18 0c 00 00 00 7e 00 7e 00 00 00
30 18 0c 06 0c 18 30 00 3c 66 06 0c 18 00 18 00
3c 66 6e 6e 60 62 3c 00 18 3c 66 7e 66 66 66 00
7c 66 66 7c 66 66 7c 00 3c 66 60 60 60 66 3c 00
78 6c 66 66 66 6c 78 00 7e 60 60 78 60 60 7e 00
7e 60 60 78 60 60 60 00 3c 66 60 6e 66 66 3c 00
66 66 66 7e 66 66 66 00 3c 18 18 18 18 18 3c 00
1e 0c 0c 0c 0c 6c 38 00 66 6c 78 70 78 6c 66 00
60 60 60 60 60 60 7e 00 63 77 7f 6b 63 63 63 00
66 76 7e 7e 6e 66 66 00 3c 66 66 66 66 66 3c 00
7c 66 66 7c 60 60 60 00 3c 66 66 66 66 3c 0e 00
7c 66 66 7c 78 6c 66 00 3c 66 60 3c 06 66 3c 00
7e 18 18 18 18 18 18 00 66 66 66 66 66 66 3c 00
66 66 66 66 66 3c 18 00 63 63 63 6b 7f 77 63 00
66 66 3c 18 3c 66 66 00 66 66 66 3c 18 18 18 00
7e 06 0c 18 30 60 7e 00 3c 30 30 30 30 30 3c 00
c0 60 30 18 0c 06 03 00 3c 0c 0c 0c 0c 0c 3c 00
00 18 3c 66 00 00 00 00 00 00 00 00 00 00 ff ff
30 18 0c 00 00 00 00 00 00 00 3c 06 3e 46 3e 00
00 60 60 7c 66 66 7c 00 00 00 3c 60 60 60 3c 00
00 06 06 3e 66 66 3e 00 00 00 3c 66 7e 60 3c 00
00 0e 18 3e 18 18 18 00 00 00 3e 66 66 3e 06 7c
00 60 60 7c 66 66 66 00 00 18 00 38 18 18 3c 00
00 06 00 06 06 06 06 3c 00 60 60 6c 78 6c 66 00
00 38 18 18 18 18 3c 00 00 00 66 7f 7f 6b 63 00
00 00 7c 66 66 66 66 00 00 00 3c 66 66 66 3c 00
00 00 7c 66 66 7c 60 60 00 00 3e 66 66 3e 06 06
00 00 7c 66 60 60 60 00 00 00 3e 60 3c 06 7c 00
00 18 7e 18 18 18 0e 00 00 00 66 66 66 66 3e 00
00 00 66 66 66 3c 18 00 00 00 63 6b 7f 3e 36 00
00 00 66 3c 18 3c 66 00 00 00 66 66 66 3e 0c 78
00 00 7e 0c 18 30 7e 00 1c 30 30 60 30 30 1c 00
18 18 18 18 18 18 18 18 38 0c 0c 06 0c 0c 38 00
3b 6e 00 00 00 00 00 00 7f 77 67 41 67 77 7f 00

Binary file not shown.

View File

@ -60,9 +60,9 @@
&y0 $2 ( starting y coord )
&x1 $2 ( ending x coord )
&y1 $2 ] ( ending y coord )
@about $1 ( is about screen visible? 01 start, ff resume )
@audio [ $1 ( is audio enabled? )
&pos $2 ] ( position in music )
@about $1 ( is about screen visible? 01 start, ff resume )
|0100
( metadata )
@ -93,11 +93,14 @@
#011f #00b0 ;noise #0200 #44 .Audio4 setup-audio
start-audio
( display about window when first starting )
#01 .about STZ
reset BRK
@metadata 00
( title ) "kodiak 0a
( details ) "klondike 20 "solitaire 20 "game 0a
( details ) &details "klondike 20 "solitaire 20 "game 0a
( author ) "by 20 "d_m 0a
( version ) "version 20 "0 0a
( date ) "5 20 "aug 20 2024 00
@ -134,10 +137,9 @@
shuffle-stock
deal-tableau
clear-fg
#01 .about STZ
draw-about
( draw auto-move )
JMP2r
.about LDZ ?draw-about
draw !auto-move
@clear-fg ( -> )
#0000 .Screen/x DEO2
@ -195,6 +197,7 @@
.prev #06 dump-mem
.auto #04 dump-mem
.move #0e dump-mem
.about #01 dump-mem
LIT "- .Console/w DEOk DEOk DEOk DEOk DEO
#0a .Console/w DEO JMP2r
@ -260,40 +263,138 @@
#00 .about STZ draw !auto-move
@resume-button-addr ( -> addr* )
.about LDZ #00 LTH ?&resume
.about LDZ #7f GTH ?&resume
;start-button JMP2r
&resume ;resume-button JMP2r
@draw-about ( -> )
.about LDZ #7f GTH ?{ clear-screen !draw-about-content }
fill-box !draw-about-content
@draw-horiz ( len^ -> )
#01 .Screen/auto DEO
;horiz .Screen/addr DEO2
#00 SWP SUB
LITr 00 LITr -Screen/sprite
&loop DEOkr INC DUP ?&loop
POP POP2r JMP2r
@draw-vert ( len^ -> )
#02 .Screen/auto DEO
;vert .Screen/addr DEO2
#00 SWP SUB
LITr 00 LITr -Screen/sprite
&loop DEOkr INC DUP ?&loop
POP POP2r JMP2r
@clear-screen ( -> )
#0000 .Screen/x DEO2
#0000 .Screen/y DEO2
#83 .Screen/px DEO
JMP2r
#0010 .Screen/x DEO2
#0010 .Screen/y DEO2
;logo .Screen/addr DEO2
#a6 .Screen/auto DEO
#80 .Screen/sprite DEOk DEO
@fill-box ( -> )
#01 .Screen/auto DEO
#20 load-ch
LITr 0c LITr -Screen/sprite
#0008 .Screen/y DEO2 #1600
&yloop #0020 .Screen/x DEO2 #1800
&xloop DEOkr INC GTHk ?&xloop
.Screen/y DEI2 #0008 ADD2 .Screen/y DEO2
POP2 INC GTHk ?&yloop
POP2 POP2r JMP2r
#0008 #00b4 resume-button-addr draw-button
#0030 #00b4 ;quit-button draw-button
@draw-box ( -> )
#00 .Screen/auto DEO
;corner .Screen/addr DEO2
#0028 .Screen/x DEO2
#0010 .Screen/y DEO2 #00 .Screen/sprite DEO
#00d0 .Screen/x DEO2 #10 .Screen/sprite DEO
#00a8 .Screen/y DEO2 #30 .Screen/sprite DEO
#0028 .Screen/x DEO2 #20 .Screen/sprite DEO
#0030 .Screen/x DEO2 #0010 .Screen/y DEO2 #14 draw-horiz
#0030 .Screen/x DEO2 #00a8 .Screen/y DEO2 #14 draw-horiz
#0028 .Screen/x DEO2 #0018 .Screen/y DEO2 #12 draw-vert
#00d0 .Screen/x DEO2 #0018 .Screen/y DEO2 #12 draw-vert
JMP2r
@draw-bear-head ( x* y* head* -> )
.Screen/addr DEO2 ( x* y* ; s/addr<-head )
.Screen/y DEO2 ( y* x* ; s/y<- )
.Screen/x DEO2 ( y* x* ; s/x<- )
#16 .Screen/auto DEO ( y* x* ; s/auto<-0x16 )
#80 .Screen/sprite DEOk DEO JMP2r ( y* x* ; draw 2x2 tiles )
@draw-logo ( -> )
#0054 .Screen/x DEO2
#0020 .Screen/y DEO2
;logo .Screen/addr DEO2
#a6 .Screen/auto DEO
#80 .Screen/sprite DEOk DEO
JMP2r
@draw-bear ( x* y* head* -> )
STH2 OVR2 OVR2 STH2r draw-bear-head ( x* y* )
;sprites #0140 ADD2 .Screen/addr DEO2 ( x* y* ; s/addr<-body )
#0010 ADD2 .Screen/y DEO2 ( x* ; s/y<-y+16 )
#0008 SUB2 .Screen/x DEO2 ( ; s/x<-x-8 )
#36 .Screen/auto DEO ( ; s/auto<-0x36 )
#80 .Screen/sprite DEOk DEOk DEO JMP2r ( ; draw 4x3 tiles )
@draw-face ( x* y* addr* -> )
.Screen/addr DEO2
.Screen/y DEO2
.Screen/x DEO2
#16 .Screen/auto DEO
#80 .Screen/sprite DEOk DEO JMP2r
@draw-about-content ( -> )
draw-box
draw-logo
#0078 #0038 #1d draw-xyc
#0078 #0040 #2c draw-xyc
#0078 #0048 #3b draw-xyc
#0060 #0038 #80 draw-bear
#0060 #0038 ;sprites #00c0 ADD2 draw-face
#00a8 #0038 #90 draw-bear
#0090 #0038 ;sprites #0100 ADD2 draw-face
#0038 #0070 ;line1 print-str
#0040 #0078 ;line2 print-str
#0048 #0080 ;line3 print-str
#0070 #0094 resume-button-addr draw-button
POP2 POP2 JMP2r
@line1 "klondike 20 "solitaire 00
@line2 "version 20 "1 20 "by 20 "d_m 00
@line3 "august 20 "6 20 "2024 00
@print-str ( x* y* s* -> )
STH2 .Screen/y DEO2 ( x* [s*] )
.Screen/x DEO2 STH2r ( s* )
#01 .Screen/auto DEO ( s* )
&loop LDAk #1f GTH ?{ POP2 JMP2r } ( s* )
LDAk load-ch #00 .Screen/sprite DEO ( s* )
INC2 !&loop ( s+1* )
@load-ch ( c^ -> )
#00 SWP #30 SFT2 ;font ADD2 .Screen/addr DEO2 JMP2r
@draw-xyc ( x* y* c^ -> )
STH .Screen/y DEO2 .Screen/x DEO2 STHr !draw-c
@draw-bear-head ( x* y* tint^ -> )
STH ;sprites .Screen/addr DEO2 ( x* y* [tint^] ; s/addr<-head )
.Screen/y DEO2 ( x* [tint^] ; s/y<- )
STHkr #10 AND #00 EQU ?&norm ( x* [tint^] )
#fff0 ADD2 ( x+16 [tint^] )
&norm .Screen/x DEO2 ( [tint^] ; s/x<- )
#16 .Screen/auto DEO ( [tint^] ; s/auto<-0x16 )
STHr .Screen/sprite DEOk DEO JMP2r ( ; draw 2x2 tiles )
@draw-bear ( x* y* tint^ -> )
STH OVR2 OVR2 STHkr draw-bear-head ( x* y* [tint^] )
;sprites #0140 ADD2 .Screen/addr DEO2 ( x* y* [tint^] ; s/addr<-body )
#0010 ADD2 .Screen/y DEO2 ( x* [tint^] ; s/y<-y+16 )
#0008 SUB2 .Screen/x DEO2 ( [tint^] ; s/x<-x-8 )
#36 .Screen/auto DEO ( [tint^] ; s/auto<-0x36 )
STHr .Screen/sprite DEOk DEOk DEO JMP2r ( ; draw 4x3 tiles )
@draw-button ( x* y* addr* -> )
.Screen/addr DEO2
@ -318,7 +419,7 @@
JMP2r
@draw-decorations ( -> )
#00e8 #0098 ;sprites !draw-bear
#00e8 #0098 #80 !draw-bear
@draw-stock ( -> )
.stock LDZk #00 EQU ?&empty ( stock^ )
@ -530,14 +631,29 @@
.frame LDZk INC SWP STZ ( ; increment frame counter )
BRK
@on-refresh-bear ( -> )
.about LDZ #00 EQU ?{ JMP2r }
@load-bear-frame ( -> )
.frame LDZ
DUP #e8 NEQ ?{ POP ;sprites #0040 ADD2 !&update }
DUP #f0 NEQ ?{ POP ;sprites #0080 ADD2 !&update }
DUP #f8 NEQ ?{ POP ;sprites #0040 ADD2 !&update }
DUP #00 NEQ ?{ POP ;sprites !&update }
POP JMP2r
DUP #e8 NEQ ?{ POP ;sprites #0040 ADD2 JMP2r }
DUP #f0 NEQ ?{ POP ;sprites #0080 ADD2 JMP2r }
DUP #f8 NEQ ?{ POP ;sprites #0040 ADD2 JMP2r }
DUP #00 NEQ ?{ POP ;sprites JMP2r }
POP #0000 JMP2r
@draw-bear-eyes ( addr* x* y* -> )
#16 .Screen/auto DEO
.Screen/y DEO2
.Screen/x DEO2
.Screen/addr DEO2
#80 .Screen/sprite DEO JMP2r
@on-refresh-about-bears
load-bear-frame ORAk ?{ POP2 JMP2r }
DUP2 #0060 #0038 draw-bear-eyes
#0090 #0038 !draw-bear-eyes
@on-refresh-bear ( -> )
.about LDZ ?on-refresh-about-bears
load-bear-frame ORAk ?&update POP2 JMP2r
&update .Screen/addr DEO2 ( ; s/addr<-addr )
#0098 .Screen/y DEO2 ( ; s/x<-0x98 )
#00e8 .Screen/x DEO2 ( ; s/y<-0xe8 )
@ -615,7 +731,7 @@
.Mouse/state DEI ( state^ )
.prev/mouse-state LDZ #ff EOR AND ( down^ )
#01 AND ?&ok JMP2r &ok
.about LDZ #00 EQU ?{ !close-about } ( TODO: check for buttons )
.about LDZ ?on-click-down-about
maybe-select-button ?&skip
maybe-select-stock ?&skip
maybe-select-waste ?&found
@ -625,6 +741,15 @@
&found clear-prev-mouse !draw-curr-hold
&skip JMP2r
@on-click-down-about ( -> )
.Mouse/y DEI2
DUP2 #0094 LTH2 ?&no
DUP2 #009c GTH2 ?&no
POP2 .Mouse/x DEI2
DUP2 #0070 LTH2 ?&no
DUP2 #0090 LTH2 ?close-about
&no POP2 JMP2r
@distance ( a* b* -> max[a,b]-min[a,b]* )
GTH2k JMP SWP2 SUB2 JMP2r
@ -1018,6 +1143,12 @@
3f 3b 39 38 38 38 fe 6c 20 22 21 20 20 20 a4 48
00 80 c0 e0 70 38 fe 6c 00 00 00 80 40 20 a4 48
@corner 00 00 00 1f 1f 18 18 18
@vert 18 18 18 18 18 18 18 18
@horiz 00 00 00 ff ff 00 00 00
@font ~ascii.tal
@saw ff ee dd cc bb aa 99 88 77 66 55 44 33 22 11 00
@triangle 80 ff 80 00