mirror of https://git.phial.org/d6/kodiak.git
Compare commits
8 Commits
f90a867631
...
84b38e160f
Author | SHA1 | Date |
---|---|---|
d_m | 84b38e160f | |
d_m | 9f4dfdeca9 | |
d_m | d65ffccf7c | |
d_m | dfb9e960bf | |
d_m | 56d8141bbd | |
d_m | 1adb09817c | |
d_m | 9196a3795b | |
d_m | e6f26332e0 |
22
README.md
22
README.md
|
@ -2,32 +2,25 @@
|
|||
|
||||
*Kodiak* is an implementation of [Klondike Solitaire](https://en.wikipedia.org/wiki/Klondike_(solitaire)) for the[Uxn/Varvara ecosystem](https://100r.co/site/uxn.html) virtual machine.
|
||||
|
||||
![screenshot of initial solitaire deal](start.png)
|
||||
![screenshot of splash screen](about.png)
|
||||
|
||||
## controls
|
||||
|
||||
- Use the mouse to move the pointer
|
||||
- Click to pick up cards; release to drop them
|
||||
- Press *Esc* to restart the game
|
||||
- Press *Return* to print internal game state
|
||||
- Press *Space* to automatically move "safe" cards to the foundation
|
||||
|
||||
## details
|
||||
|
||||
Currently *Kodiak* is very limited:
|
||||
Currently *Kodiak* is somewhat limited:
|
||||
|
||||
- Can't move cards from the foundation
|
||||
- Must manually move every card
|
||||
- No undo functionality
|
||||
- No scoring or timing
|
||||
- No music or animations
|
||||
- No splash screen
|
||||
- No on-screen buttons to restart or quit
|
||||
- No options
|
||||
|
||||
Future releases may relax some or all of these constraints.
|
||||
|
||||
![screenshot of solitarire mid-game](game1.png)
|
||||
![screenshot of starting solitarire deal](start.png)
|
||||
|
||||
## building and running
|
||||
|
||||
|
@ -46,13 +39,6 @@ $ uxnemu kodiak.rom
|
|||
|
||||
## infrequently-asked questions
|
||||
|
||||
**Is dragging cards buggy?**
|
||||
|
||||
Previous versions of the game had you click once to pick up a card and
|
||||
pick up again to release. This doesn't work very well with touch
|
||||
screens so it was changed to a more normal click to hold, release to
|
||||
drop.
|
||||
|
||||
**Is this harder than other solitaire games?**
|
||||
|
||||
Probably, yes. In addition to not having an "undo" feature, Kodiak
|
||||
|
@ -82,6 +68,6 @@ Probably not, but maybe.
|
|||
|
||||
I am considering adding support for [Sawayama Solitaire](https://zachtronics.fandom.com/wiki/Sawayama_Solitaire). Depending on how that goes I may add support for other variants as well.
|
||||
|
||||
![another screenshot of solitaire](game2.png)
|
||||
![screenshot of solitaire mid-game](game1.png)
|
||||
|
||||
Kodiak was built by [d_m](http://plastic-idolatry.com/erik), 2023-2024
|
||||
|
|
|
@ -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
|
BIN
buttons.chr
BIN
buttons.chr
Binary file not shown.
BIN
game1.png
BIN
game1.png
Binary file not shown.
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.2 KiB |
BIN
kodiak.chr
BIN
kodiak.chr
Binary file not shown.
BIN
kodiak.rom
BIN
kodiak.rom
Binary file not shown.
346
kodiak.tal
346
kodiak.tal
|
@ -1,15 +1,14 @@
|
|||
( kodiak.tal )
|
||||
|
||||
( TODO )
|
||||
( * title screen, which is also about screen )
|
||||
( * move cards back from foundation? )
|
||||
( * display message on win )
|
||||
( * make bear react to moving cards )
|
||||
( * buttons, stock flash when clicked )
|
||||
( * save game file? stats? )
|
||||
( * sometimes movement feels stutter-y )
|
||||
( * card sounds? )
|
||||
( * automatically keeping @auto up-to-date is arguably better than recalculating )
|
||||
|
||||
|00 @System [ &vect $2 &expansion $2 &title $2 &metadata $2 &r $2 &g $2 &b $2 ]
|
||||
|00 @System [ &vect $2 &expansion $2 &wst $1 &rst $1 &metadata $2 &r $2 &g $2 &b $2 ]
|
||||
|10 @Console [ &vect $2 &r $1 &exec $2 &mode $1 &dead $1 &exit $1 &w $1 ]
|
||||
|20 @Screen [ &vect $2 &w $2 &h $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &px $1 &sprite $1 ]
|
||||
|30 @Audio1 [ &vect $2 &pos $2 &out $1 &dur $2 &pad $1 &adsr $2 &len $2 &addr $2 &vol $1 &pitch $1 ]
|
||||
|
@ -60,10 +59,13 @@
|
|||
&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 )
|
||||
|
||||
|0100
|
||||
( metadata )
|
||||
;metadata .System/metadata DEO2
|
||||
|
||||
( colors: gold, white, red, black )
|
||||
#bd82 .System/r DEO2
|
||||
|
@ -90,8 +92,26 @@
|
|||
#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 ) &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
|
||||
00
|
||||
|
||||
@icon-24x24
|
||||
00 00 03 02 00 01 01 01 03 07 07 07 03 03 06 06
|
||||
00 00 00 00 00 c3 c3 c3 00 81 81 ff ff ff bd bd
|
||||
00 00 c0 40 00 80 80 8e c0 e0 e0 e0 c0 c0 60 6e
|
||||
00 00 00 00 00 00 00 00 07 07 07 03 03 01 00 00
|
||||
( tbc... )
|
||||
|
||||
@setup-audio ( adsr* sample* slen* dur* vol^ dev^ -> )
|
||||
STHk #0e ORA DEO ( [dev^] ; <-vol )
|
||||
STHkr #0a ORA DEO2 ( [dev^] ; <-slen )
|
||||
|
@ -115,9 +135,15 @@
|
|||
|
||||
shuffle-stock
|
||||
deal-tableau
|
||||
( TODO: clear foreground )
|
||||
draw
|
||||
auto-move
|
||||
clear-fg
|
||||
|
||||
.about LDZ ?draw-about
|
||||
draw !auto-move
|
||||
|
||||
@clear-fg ( -> )
|
||||
#0000 .Screen/x DEO2
|
||||
#0000 .Screen/y DEO2
|
||||
#c0 .Screen/px DEO
|
||||
JMP2r
|
||||
|
||||
@quit ( -> brk )
|
||||
|
@ -170,6 +196,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
|
||||
|
@ -228,20 +255,145 @@
|
|||
#00 OVR STZ ( s^ ; s<-0 )
|
||||
#01 SUB JMP2r ( s-1^ )
|
||||
|
||||
@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 )
|
||||
@open-about ( -> )
|
||||
#ff .about STZ draw-about !draw-mouse
|
||||
|
||||
@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 )
|
||||
@close-about ( -> )
|
||||
#00 .about STZ draw !auto-move
|
||||
|
||||
@resume-button-addr ( -> addr* )
|
||||
.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
|
||||
|
||||
@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
|
||||
|
||||
@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-logo ( -> )
|
||||
#0054 .Screen/x DEO2
|
||||
#0020 .Screen/y DEO2
|
||||
;logo .Screen/addr DEO2
|
||||
#a6 .Screen/auto DEO
|
||||
#80 .Screen/sprite DEOk DEO
|
||||
JMP2r
|
||||
|
||||
@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
|
||||
|
@ -266,7 +418,7 @@
|
|||
JMP2r
|
||||
|
||||
@draw-decorations ( -> )
|
||||
#00e8 #0098 ;sprites !draw-bear
|
||||
#00e8 #0098 #80 !draw-bear
|
||||
|
||||
@draw-stock ( -> )
|
||||
.stock LDZk #00 EQU ?&empty ( stock^ )
|
||||
|
@ -303,11 +455,17 @@
|
|||
&loop ( lim^ zp^ )
|
||||
#0008 .Screen/x DEO2 ( lim^ zp^ ; x<-8 )
|
||||
LIT2 [ &y $2 ] .Screen/y DEO2 ( lim^ zp^ ; y<- )
|
||||
LDZk maybe-draw-c ( lim^ zp^ ; draw )
|
||||
LDZk draw-foundation-c ( lim^ zp^ ; draw )
|
||||
,&y LDR2 #0020 ADD2 ,&y STR2 ( lim^ zp^ ; y<-y+32 )
|
||||
INC GTHk ?&loop ( lim^ zp+1^ )
|
||||
POP2 JMP2r ( )
|
||||
|
||||
@draw-foundation-c ( c^ -> )
|
||||
DUP #80 AND #00 EQU ?maybe-draw-c
|
||||
#7f AND DUP #0f AND #01 GTH ?&under-card
|
||||
POP #00 !maybe-draw-c
|
||||
&under-card #ff ADD !maybe-draw-c
|
||||
|
||||
@draw-tableau
|
||||
#0700 &loop DUP draw-column INC GTHk ?&loop POP2 JMP2r
|
||||
|
||||
|
@ -478,13 +636,29 @@
|
|||
.frame LDZk INC SWP STZ ( ; increment frame counter )
|
||||
BRK
|
||||
|
||||
@on-refresh-bear ( -> )
|
||||
@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 )
|
||||
|
@ -555,21 +729,32 @@
|
|||
.Mouse/y DEI2 DUP2 .prev/mouse-y STZ2 .Screen/y DEO2
|
||||
.dragging LDZ ?&skip
|
||||
;cursor .Screen/addr DEO2
|
||||
#43 .Screen/sprite DEO &skip JMP2r
|
||||
.about LDZ ?{ #43 .Screen/sprite DEO !&skip } #41 .Screen/sprite DEO
|
||||
&skip JMP2r
|
||||
|
||||
@on-click-down ( -> )
|
||||
.Mouse/state DEI ( state^ )
|
||||
.prev/mouse-state LDZ #ff EOR AND ( down^ )
|
||||
#01 AND ?&ok JMP2r &ok
|
||||
.about LDZ ?on-click-down-about
|
||||
maybe-select-button ?&skip
|
||||
maybe-select-stock ?&skip
|
||||
maybe-select-waste ?&found
|
||||
( TODO: maybe-select-foundation )
|
||||
maybe-select-foundation ?&found
|
||||
maybe-select-tableau ?&found
|
||||
( not found, end drag ) .dragging #05 !initialize
|
||||
&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
|
||||
|
||||
|
@ -587,9 +772,9 @@
|
|||
DUP .tableau SUB #13 DIVk MUL SUB ( z^ (z-tab)%19^ )
|
||||
?&from-non-empty-col ( z^ )
|
||||
&zero #00 SWP STZ JMP2r
|
||||
&from-foundation LDZ #0f #01 GTH ?&above-ace !&zero
|
||||
&from-foundation LDZ #0f AND #01 GTH ?&above-ace !&zero
|
||||
&from-non-empty-col #00 OVR STZ #01 SUB LDZk #bf AND SWP STZ JMP2r
|
||||
&above-ace LDZk #01 SUB SWP STZ JMP2r
|
||||
&above-ace LDZk #7f AND #01 SUB SWP STZ JMP2r
|
||||
|
||||
@valid-card-foundation ( below^ above^ -> bool^ )
|
||||
DUP2 #0f0f AND2 #0001 EQU2 ?&aces ( below^ above^ )
|
||||
|
@ -723,6 +908,22 @@
|
|||
.Mouse/x DEI2 SUB2 .dragging/x STZ2
|
||||
#01 .dragging STZ JMP2r ( )
|
||||
|
||||
@maybe-select-foundation ( -> bool^ )
|
||||
.Mouse/x DEI2 #0008 LTH2 ?&no1 ( )
|
||||
.Mouse/x DEI2 #0017 GTH2 ?&no1 ( )
|
||||
.foundation #04 OVR ADD SWP ( lim^ zp^ )
|
||||
LIT2r 0030 ( lim^ zp^ [y*] )
|
||||
&loop
|
||||
.Mouse/y DEI2 STH2kr LTH2 ?&no2
|
||||
LIT2r 0018 ADD2r
|
||||
.Mouse/y DEI2 STH2kr LTH2 ?&yes
|
||||
LIT2r 0008 ADD2r
|
||||
INC GTHk ?&loop
|
||||
&no2 POP2r POP2
|
||||
&no1 #00 JMP2r
|
||||
&yes #0008 STH2r #0018 SUB2 ( lim^ zp^ x* y* )
|
||||
ROT2 NIP DUP start-drag draw #01 JMP2r
|
||||
|
||||
@maybe-select-waste ( -> bool^ )
|
||||
.Mouse/y DEI2 #0008 LTH2 ?&no1 ( )
|
||||
.Mouse/y DEI2 #0020 GTH2 ?&no1 ( )
|
||||
|
@ -793,15 +994,15 @@
|
|||
&restart POP2 reset #01 JMP2r
|
||||
&quit POP2 quit #01 JMP2r
|
||||
&audio POP2 toggle-audio #01 JMP2r
|
||||
&about POP2 #010e DEO #01 JMP2r
|
||||
&about POP2 open-about #01 JMP2r
|
||||
|
||||
@game-won ( -> bool^ )
|
||||
.foundation #04 OVR ADD SWP ( lim^ start^ )
|
||||
&loop ( lim^ pos^ )
|
||||
.foundation #04 OVR ADD SWP ( lim^ start^ )
|
||||
&loop ( lim^ pos^ )
|
||||
LDZk #0f AND #0d NEQ ?&no ( lim^ pos^ )
|
||||
INC GTHk ?&loop ( lim^ pos+1^ )
|
||||
POP2 #01 JMP2r ( 1^ )
|
||||
&no POP2 #00 JMP2r ( 0^ )
|
||||
INC GTHk ?&loop ( lim^ pos+1^ )
|
||||
POP2 #01 JMP2r ( 1^ )
|
||||
&no POP2 #00 JMP2r ( 0^ )
|
||||
|
||||
@toggle-audio ( -> )
|
||||
.audio LDZ ?&disable
|
||||
|
@ -826,21 +1027,22 @@
|
|||
GTH JMP2r ( min-face+3>face^ )
|
||||
|
||||
@auto-move-col ( col^ -> ok^ )
|
||||
DUP top-column LDZ ( col^ card^ )
|
||||
DUP check-auto ?&ok !&done ( col^ card^ )
|
||||
&ok auto-dest STH top-column ( src^ [dst^] )
|
||||
STHr start-move ( )
|
||||
( LDZk STHr STZ remove-card ) #01 JMP2r ( 1^ )
|
||||
&done POP2 #00 JMP2r ( 0^ )
|
||||
DUP top-column LDZ ( col^ card^ )
|
||||
DUP check-auto ?&ok !&done ( col^ card^ )
|
||||
&ok auto-dest STH top-column ( src^ [dst^] )
|
||||
STHr start-move ( )
|
||||
#01 JMP2r ( 1^ )
|
||||
&done POP2 #00 JMP2r ( 0^ )
|
||||
|
||||
@auto-dest ( card^ -> dst^ )
|
||||
DUP #0f AND #01 EQU ?&aces ( card^ )
|
||||
#30 AND STH ( [suit^] )
|
||||
.foundation #04 OVR ADD SWP ( lim^ start^ [suit^] )
|
||||
&loop LDZk #30 AND STHkr EQU ?&ok ( lim^ zp^ [suit^] )
|
||||
INC GTHk ?&loop ( lim^ zp+1^ [suit^] )
|
||||
&ok POPr NIP JMP2r ( zp^ )
|
||||
&aces ( card^ )
|
||||
DUP #0f AND #01 EQU ?&aces ( card^ )
|
||||
#30 AND STH ( [suit^] )
|
||||
.foundation #04 OVR ADD SWP ( lim^ start^ [suit^] )
|
||||
&loop LDZk #00 EQU ?&skip ( lim^ zp^ [suit^] )
|
||||
LDZk #30 AND STHkr EQU ?&ok ( lim^ zp^ [suit^] )
|
||||
&skip INC GTHk ?&loop ( lim^ zp+1^ [suit^] )
|
||||
&ok POPr NIP JMP2r ( zp^ )
|
||||
&aces ( card^ )
|
||||
POP .foundation #04 OVR ADD SWP ( lim^ start^ )
|
||||
&loop2 LDZk ?&next NIP JMP2r ( zp^ )
|
||||
&next INC GTHk ?&loop2 ( lim^ zp+1^ )
|
||||
|
@ -927,6 +1129,48 @@
|
|||
ff ff ff ff ff ff ff ff ff 37 ea a2 aa 2a ff ff
|
||||
fe ff ff ff ff ff ff fe fe 59 ab a9 ab a9 ff fe
|
||||
|
||||
@start-button
|
||||
7f ff ff ff ff ff ff 7f 7f fe fd fe ff fc ff 7f
|
||||
ff ff ff ff ff ff ff ff ff 23 f6 76 b6 76 ff ff
|
||||
ff ff ff ff ff ff ff ff ff 66 ab 27 ab ab ff ff
|
||||
fe ff ff ff ff ff ff fe fe 3f 7f 7f 7f 7f ff fe
|
||||
|
||||
@resume-button
|
||||
7f ff ff ff ff ff ff 7f 7f e7 ea e6 ea eb ff 7f
|
||||
ff ff ff ff ff ff ff ff ff 31 ef 33 fd 23 ff ff
|
||||
ff ff ff ff ff ff ff ff ff 5a 55 55 55 15 ff ff
|
||||
fe ff ff ff ff ff ff fe fe e7 5f 47 5f 67 ff fe
|
||||
|
||||
@logo
|
||||
6c fe 38 38 38 39 3b 7f 48 a4 20 20 20 21 22 40
|
||||
6c fe 38 70 e0 c0 80 00 48 a4 20 40 80 00 00 00
|
||||
00 07 1c 38 38 38 38 7c 00 04 10 20 20 20 20 40
|
||||
00 c0 70 38 38 38 38 7c 00 00 40 20 20 20 20 40
|
||||
60 ff 3c 38 38 38 38 7c 40 a8 20 20 20 20 20 40
|
||||
00 c0 e0 70 38 38 38 7c 00 00 80 40 20 20 20 40
|
||||
6c fe 38 38 38 38 38 7c 48 a4 20 20 20 20 20 40
|
||||
0e 1b 07 0e 1c 1c f8 7f 08 12 04 08 10 10 a0 40
|
||||
e0 b0 c0 e0 70 70 3e fc 80 20 00 80 40 40 24 00
|
||||
6c fe 38 38 38 39 3b 7f 48 a4 20 20 20 21 22 40
|
||||
6c fe 38 70 e0 c0 80 00 48 a4 20 40 80 00 00 00
|
||||
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
|
||||
38 38 38 38 38 1c 07 00 20 20 20 20 20 10 04 00
|
||||
38 38 38 38 38 70 c0 00 20 20 20 20 20 40 00 00
|
||||
38 38 38 38 38 3c ff 60 20 20 20 20 20 20 a8 40
|
||||
38 38 38 38 70 e0 c0 00 20 20 20 20 40 80 00 00
|
||||
38 38 38 38 38 38 fe 6c 20 20 20 20 20 20 a4 48
|
||||
f8 38 38 38 38 38 fe 6c a0 20 20 20 20 20 a4 48
|
||||
3e 38 38 38 38 38 fe 6c 24 20 20 20 20 20 a4 48
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue