@@ -214,7 +214,7 @@ DATA colorThemeMap() = $B4,$88, $84,$08, $22,$28, $04,$08,' NTSC
214214DATA = $A4 ,$78 , $74 ,$08 , $12 ,$18 , $04 ,$08 ' PAL
215215colorTheme =-1
216216
217- gameversion =2
217+ gameversion =3
218218serverEndpoint$=" "
219219query$=" "
220220' Read server endpoint stored from Lobby
322322 if QUERY$[1 ,1 ]<>" ?"
323323 @tableSelection
324324 else
325- tablenumber =1
325+ ' tablenumber=1
326326 for i =1 to len (QUERY $)
327327 if QUERY$[i,1 ]=" ="
328328 TableID$(TableNumber )=QUERY $[i +1 ,5 ]
@@ -453,7 +453,7 @@ PROC TitleScreen
453453 @POS 37 ,25 :@Print &" V0" : @PrintVAL gameversion
454454 @POS 5 ,25 :@Print &" H-HELP C-COLOR N-NAME Q-QUIT"
455455 @DrawBufferEnd
456- @ShowScreen
456+ ' @ShowScreen
457457 Repeat
458458 GET K
459459 if K =67 then @CycleColorTheme
@@ -482,7 +482,7 @@ PROC TableSelection
482482 @ResetScreen
483483 @DrawTableSelection
484484 @DrawBufferEnd
485- @ShowScreen
485+ ' @ShowScreen
486486 JSON$=" /tables"
487487 @CallFujiNet
488488 @NInputInit UNIT, &responseBuffer
@@ -519,7 +519,7 @@ PROC TableSelection
519519 next a
520520
521521 @DrawBufferEnd
522- @ShowScreen
522+ ' @ShowScreen
523523
524524 @POS 6 ,22 : @Print & " PRESS A TABLE NUMBER TO JOIN"
525525 @POS 1 ,25 :@Print &" H-HELP C-COLOR N-NAME Q-QUIT R-REFRESH"
@@ -581,12 +581,15 @@ PROC ReadKeyPresses
581581 Elif K =198
582582 @GoodBeep
583583 @DisplayHelpDialog
584- Elif K =213
584+ @DrawGameState
585+ Elif K =213 ' Leave Table confirm
585586 @GoodBeep
586587 @AskSure 1
587- Elif K =208
588+ @DrawGameState
589+ Elif K =208 ' Quit Game confrim
588590 @GoodBeep
589591 @AskSure 2
592+ @DrawGameState
590593 ENDIF
591594ENDPROC
592595
@@ -677,7 +680,7 @@ PROC ShowResults
677680 @DrawPlayersResults
678681 @POS 7 ,25 :@Print &" PRESS ANY KEY TO CONTINUE"
679682 @DrawBufferEnd
680- @ShowScreen
683+ ' @ShowScreen
681684 GET K
682685 move$=" R"
683686 @PlayMove
@@ -696,7 +699,7 @@ PROC ShowGameOver
696699 @DrawFinalResults
697700 @POS 7 ,25 :@Print &" PRESS ANY KEY TO CONTINUE"
698701 @DrawBufferEnd
699- @ShowScreen
702+ ' @ShowScreen
700703 GET K
701704 move$=" G"
702705 @PlayMove
@@ -716,7 +719,7 @@ PROC AskSure _type
716719 INC Y:@PrintAt x,y , &" Y: YES"
717720 INC Y:@PrintAt x,y , &" N: NO"
718721 @DrawBufferEnd
719- @ShowScreen
722+ ' @ShowScreen
720723 do
721724 GET K
722725 if K =89 ' Y - yes quit
@@ -782,9 +785,13 @@ PROC DisplayHelpDialog
782785 INC Y
783786 INC Y:@PrintAt x,y , &" C: TABLE COLOR"
784787 INC Y
785- INC Y:@PrintAt x,y , &" L: LEAVE TABLE"
786- INC Y
787- INC Y:@PrintAt x,y , &" N: CHANGE NAME"
788+ if GameStatus (tablenumber )<>0
789+ INC Y:@PrintAt x,y , &" E: LEAVE TABLE"
790+ INC Y
791+ EndIF
792+ if GameStatus (tablenumber )=0
793+ INC Y:@PrintAt x,y , &" N: CHANGE NAME"
794+ EndIF
788795 INC Y
789796 INC Y:@PrintAt x,y , &" RETURN: RETURN"
790797
@@ -796,11 +803,10 @@ PROC DisplayHelpDialog
796803 K =0
797804 Elif k =72 ' H - how to play
798805 @ViewHowToPlay
799- ' @DisplayHelpDialog
800- Elif K =78 ' N - change name
806+ Elif K =78 and GameStatus (tablenumber )=0 ' N - change name
801807 @SetPlayerName
802808 @DisplayHelpDialog
803- Elif K =76 ' L - leave table
809+ Elif K =69 and GameStatus ( tablenumber )<> 0 ' E - leave table
804810 @AskSure 1
805811 @DisplayHelpDialog
806812 Elif K =81 ' Q - Quiting program
@@ -845,7 +851,7 @@ PROC ViewHowToPlay
845851 inc y:@PrintAt 9 ,y , &" YOU CAN RETURN A TOKEN"
846852 inc y:@PrintAt 7 ,25 , &" PRESS ANY KEY FOR NEXT PAGE"
847853 @DrawBufferEnd
848- @ShowScreen
854+ ' @ShowScreen
849855 GET K
850856 @EnableDoubleBuffer
851857 @ResetScreen
@@ -877,10 +883,8 @@ PROC ViewHowToPlay
877883 inc y:@PrintAt 1 ,y , &" POINTS WINS"
878884 inc y:@PrintAt 7 ,25 , &" PRESS ANY KEY TO RETURN"
879885 @DrawBufferEnd
880- @ShowScreen
886+ ' @ShowScreen
881887 GET K
882-
883-
884888ENDPROC
885889
886890Proc LeaveGame
@@ -1091,7 +1095,6 @@ Proc DrawCardFromDeck _endX _endY _card
10911095 @DrawCard dx,dy ,card
10921096 endif
10931097 until dx =endx and dy =endy
1094- ' @POS 19,13: @PrintVal Drawdeck
10951098 @UpdateScreenBuffer
10961099 sound
10971100ENDPROC
@@ -1161,7 +1164,7 @@ PROC DrawGameState
11611164 @DrawCard 17 ,9 ,8 ' Draw Deck
11621165 ' @DrawCard 20,9,0 ' Discard Pile
11631166 @DrawBufferEnd
1164- @ShowScreen
1167+ ' @ShowScreen
11651168 exit
11661169 ENDIF
11671170 if Drawdeck >0
@@ -1174,7 +1177,7 @@ PROC DrawGameState
11741177 DrawDeck =56
11751178 @POS 19 ,13 : @PrintVal Drawdeck
11761179 @DrawBufferEnd
1177- @ShowScreen
1180+ ' @ShowScreen
11781181 @DealCards
11791182 @EnableDoubleBuffer
11801183 Endif
@@ -1190,7 +1193,7 @@ PROC DrawGameState
11901193 @POS 7 ,24 : @Print &" WAITING FOR OTHERS TO PLAY"
11911194 ENDIF
11921195 @DrawBufferEnd
1193- @ShowScreen
1196+ ' @ShowScreen
11941197ENDPROC
11951198
11961199PROC DrawMainPlayerHand _Index
@@ -1617,7 +1620,6 @@ PROC NInput __NI_stringPointer
16171620ENDPROC
16181621
16191622PROC QuitGame
1620- @LeaveGame
16211623 ' Enable FujiNet Config to take over D1:
16221624 SIO $70 , 1 , $D9 , $00 , 0 , $09 , 0 , 1 ,0
16231625 ' Reboot via assembly: JMP $E477
@@ -1705,6 +1707,8 @@ PROC InitScreen
17051707 ' Disable accidental break key press
17061708 poke 16 ,64 :poke 53774 ,64
17071709
1710+ @ShowScreen
1711+
17081712ENDPROC
17091713
17101714PROC CycleColorTheme
0 commit comments