fix stack bug
This commit is contained in:
parent
04dad1e6da
commit
cf790de191
19
kodiak.tal
19
kodiak.tal
|
@ -9,6 +9,9 @@
|
|||
( * sometimes movement feels stutter-y )
|
||||
( * automatically keeping @auto up-to-date is arguably better than recalculating )
|
||||
|
||||
( BUGS )
|
||||
( * reshuffle affects the stack )
|
||||
|
||||
|00 @System [ &vect $2 &expansion $2 &title $2 &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 ]
|
||||
|
@ -89,7 +92,7 @@
|
|||
#0231 #0580 ;triangle #0004 #75 .Audio3 setup-audio
|
||||
#011f #00b0 ;noise #0200 #44 .Audio4 setup-audio
|
||||
|
||||
start-audio
|
||||
( start-audio )
|
||||
reset BRK
|
||||
|
||||
@setup-audio ( adsr* sample* slen* dur* vol^ dev^ -> )
|
||||
|
@ -182,7 +185,8 @@
|
|||
draw-waste
|
||||
draw-foundation
|
||||
draw-tableau
|
||||
!draw-curr-mouse
|
||||
draw-curr-mouse
|
||||
JMP2r
|
||||
|
||||
@initialize ( start^ count^ -> )
|
||||
OVR ADD SWP STH2 #00 ( 0^ [lim=start+count^ start^] )
|
||||
|
@ -284,6 +288,7 @@
|
|||
#00 !maybe-draw-c ( )
|
||||
|
||||
@draw-waste ( -> )
|
||||
#010e DEO
|
||||
#001c ,&x STR2 ( ; x0<-28 )
|
||||
.waste #18 OVR ADD SWP ( waste+24^ waste^ )
|
||||
&loop LDZk DUP ?&ok !&done ( lim^ zp^ c^ )
|
||||
|
@ -293,7 +298,7 @@
|
|||
DUP #80 AND ?&done ( lim^ zp^ c^ )
|
||||
draw-c ( lim^ zp^ ; draw c )
|
||||
,&x LDR2 #0008 ADD2 ,&x STR2 ( lim^ zp^ ; x<-x+8 )
|
||||
INC GTHk ?&loop ( lim^ zp+1^ )
|
||||
INC GTHk ?&loop POP2 JMP2r ( lim^ zp+1^ )
|
||||
&done POP POP2 JMP2r ( )
|
||||
|
||||
@draw-foundation ( -> )
|
||||
|
@ -331,7 +336,7 @@
|
|||
GTHk ?&loop ( lim^ pos+1^ )
|
||||
&done POP POP2 JMP2r ( )
|
||||
|
||||
@maybe-draw-c
|
||||
@maybe-draw-c ( card^ -> )
|
||||
DUP ?{ POP !draw-spot-down } !draw-c
|
||||
|
||||
( assumes x/y already set )
|
||||
|
@ -465,7 +470,7 @@
|
|||
.audio/pos STZ2 JMP2r ( )
|
||||
|
||||
@on-audio ( -> brk )
|
||||
#010e DEO
|
||||
( #010e DEO )
|
||||
.audio LDZ ?{ BRK } play-audio BRK
|
||||
|
||||
@on-refresh ( -> brk )
|
||||
|
@ -681,7 +686,7 @@
|
|||
@top-column ( i^ -> zp^ )
|
||||
bot-column #13 !find-top
|
||||
|
||||
@reshuffle-stock
|
||||
@reshuffle-stock ( -> )
|
||||
.waste DUP #18 find-top LITr -stock ( root^ src^ [dst^] )
|
||||
&loop LDZk #40 EOR STHkr STZ #00 OVR STZ ( root^ src^ [dst^] ; dst<-src, src<-0 )
|
||||
#01 SUB INCr GTHk #00 EQU ?&loop ( root^ src-1^ [dst+1^] )
|
||||
|
@ -699,7 +704,7 @@
|
|||
EQUk ?&done #01 SUB INCr ( root^ src-2^ [dst+2] )
|
||||
|
||||
LDZk #40 EOR STHkr STZ #00 OVR STZ ( root^ src-2^ [dst+2^] ; dst+2<-src-2, src-2<-0 )
|
||||
&done POP2 POPr JMP2r ( )
|
||||
&done POP2 POPr ( #010e DEO #0a18 DEO ) JMP2r ( )
|
||||
|
||||
@maybe-select-stock ( -> bool^ )
|
||||
.Mouse/x DEI2 #0008 LTH2 ?&no ( ; x<8 )
|
||||
|
|
Loading…
Reference in New Issue