@@ 123,11 123,20 @@ BRK
@on-button ( -> )
- .Controller/button DEI #04 SFT
+ .Controller/button DEI
+ [ #01 ] !~ ,&no-a JCN
+ .table/selection LDZ #01 ;select JSR2 POP BRK
+ &no-a
+ [ #02 ] !~ ,&no-b JCN
+ ;run JSR2 POP BRK
+ &no-b
+ #04 SFT
[ #04 ] !~ ,&no-left JCN
- .table/selection LDZ #01 - #00 ;select JSR2 POP BRK &no-left
+ .table/selection LDZ #01 - #00 ;select JSR2 POP BRK
+ &no-left
[ #08 ] !~ ,&no-right JCN
- .table/selection LDZ INC #00 ;select JSR2 POP BRK &no-right
+ .table/selection LDZ INC #00 ;select JSR2 POP BRK
+ &no-right
POP
BRK
@@ 349,10 358,35 @@ RTN
DUP .table + LDZ ;pick-card JSR2
DUP ;flip-card JSR2
&no-use
+
4MOD .table/selection STZ
#01 ;draw-selection JSR2
POP
+ ( TODO; End deck )
+
+ ( TODO: End room )
+ ;count-table JSR2 #04 ,&no-room-complete JCN
+ &no-room-complete
+
+RTN
+
+@count-table ( -- count )
+
+ ( create counter ) LITr 00
+ #0400
+ &count
+ DUP .table + LDZ #36 ! ,&continue JCN
+ INCr
+ &continue
+ INC GTHk ,&count JCN
+ POP2
+ STHr
+
+RTN
+
+@run ( -- )
+
RTN
@play-error ( -- )