Prev: 8D49 Up: Map Next: 8E42
8D4A: Play Game
Used by the routine at InitialiseNewGame.
Reset both the player and girls hands. Note that FF is used to signify "draw a new card".
PlayGame 8D4A LD HL,$96C7 HL=PlayersHand.
8D4D LD B,$0A Set a counter of 0A for all cards in both hands (i.e. two hands at 05 cards each).
ResetHand_Loop 8D4F LD (HL),$FF Mark card slot with FF to signify that this card should be redrawn.
8D51 INC HL Increment card slot pointer by one.
8D52 DJNZ ResetHand_Loop Decrease the card counter by one and loop back to ResetHand_Loop until both hands have been reset.
Prep the attributes for the final parts of printing the UI.
8D54 LD A,$20 Write INK: BLACK, PAPER: GREEN to *ATTR_P.
8D56 LD ($5C8D),A
8D59 LD B,$06 Clear the bottom 06 lines using CL_LINE.
8D5B CALL $0E44
8D5E XOR A Write 00 to;
8D5F LD ($96B4),A
8D62 LD ($5C6B),A
8D65 INC A Write 01 to *TurnCounter.
8D66 LD ($96B8),A
8D69 INC A Write 02 to *InteractionCounter.
8D6A LD ($8E59),A
Print "DROP", "HOLD" and "RAISE".
8D6D LD HL,$9314 HL=Messaging_Drop.
8D70 CALL $187D Call OUT_LINE2.
8D73 LD A,$02 Write 02 to *DF_SZ.
8D75 LD ($5C6B),A
8D78 LD BC,$0720 Set screen co-ordinates to 0720.
8D7B CALL $0DE2 Call 0DE2 (CL_SET) to turn the co-ordinates into a screen buffer location.
8D7E CALL DrawUserInterface Call DrawUserInterface.
Print "CURSOR" five times in a row to where it would display under each card in the players hand. The cursor movement just changes the colour-cycling attribute location, the text is always present.
8D81 LD B,$05 B=05.
PrintCursorLoop 8D83 LD HL,$930D HL=Messaging_Cursor.
8D86 CALL $187D Call OUT_LINE2.
8D89 DJNZ PrintCursorLoop Decrease counter by one and loop back to PrintCursorLoop until counter is zero.
Blank out 07 lines of the display.
8D8B LD HL,$5960 HL=5960 (attribute buffer location).
8D8E LD B,$E0 B=E0.
Blank_Loop 8D90 LD (HL),$00 Write INK: BLACK, PAPER: BLACK to *HL.
8D92 INC HL Increment HL by one.
8D93 DJNZ Blank_Loop Decrease counter by one and loop back to Blank_Loop until counter is zero.
Make the girl buy in.
8D95 LD A,$0A A=0A.
8D97 CALL GirlAddToPot Call GirlAddToPot.
Make the player buy in.
8D9A LD A,B Write B (also 0A) to *CurrentRaiseValue.
8D9B LD ($96B7),A
8D9E CALL PlayerAddToPot Call PlayerAddToPot.
Reset *CurrentRaiseValue for the display.
8DA1 XOR A Write 00 to *CurrentRaiseValue.
8DA2 LD ($96B7),A
8DA5 CALL ResetDeck Call ResetDeck.
Initiate girls hand.
8DA8 LD IX,$96CC IX=GirlsHand.
8DAC CALL DrawCards Call DrawCards.
8DAF CALL CountDuplicates Call CountDuplicates.
8DB2 LD A,($98E4) Set A to *CurrentGirl+01 and set a counter in B to *CurrentGirl.
8DB5 LD B,A
8DB6 INC A
The following loop is how the game makes each girl more difficult. Each girl is sequentially numbered, and here the game loops on that girls "number" in order to redraw that number of times. So difficulty is nothing to do with increasing the skill level, and the redraw is still down to chance - just the girl has more opportunity than the player to get a good hand.
Difficulty_Loop 8DB7 PUSH BC Stash the girl count on the stack.
8DB8 CALL GirlMarkCards Call GirlMarkCards.
8DBB CALL DrawCards Call DrawCards.
8DBE CALL CountDuplicates Call CountDuplicates.
8DC1 POP BC Restore the girl count from the stack.
8DC2 DJNZ Difficulty_Loop Decrease the girl counter by one and loop back to Difficulty_Loop until the counter is zero.
Stash the evaluation table at Table_GirlEvaluation.
8DC4 LD BC,$0007 Copy BC=0007 bytes of data from TableHandEvaluation_Type to Table_GirlEvaluation.
8DC7 LD HL,$949B
8DCA LD DE,$96C0
8DCD LDIR
8DCF CALL PrintStats Call PrintStats.
Initiate players hand.
8DD2 LD IX,$96C7 IX=PlayersHand.
8DD6 CALL DrawCards Call DrawCards.
8DD9 CALL PrintHand Call PrintHand.
8DDC CALL MarkCards Call MarkCards.
8DDF CALL DrawCards Call DrawCards.
8DE2 CALL PrintHand Call PrintHand.
8DE5 CALL CountDuplicates Call CountDuplicates.
Stash the evaluation table at Table_PlayerEvaluation.
8DE8 LD BC,$0007 Copy BC=0007 bytes of data from TableHandEvaluation_Type to Table_PlayerEvaluation.
8DEB LD HL,$949B
8DEE LD DE,$96B9
8DF1 LDIR
8DF3 CALL PrintStats Call PrintStats.
8DF6 LD A,$01 Write 01 to *8E43.
8DF8 LD ($8E43),A
8DFB LD A,($8E42) Flip bit 0 of *TurnFlag and write it back to *TurnFlag.
8DFE XOR %00000001
8E00 LD ($8E42),A
8E03 JR Z,PlayersTurn Jump to PlayersTurn if *TurnFlag is 00 (players turn).
Messaging options:
ID Message
01 message-13-00
GirlsTurn 8E05 LD A,$0D Call Messaging_Girl using message block 0D.
8E07 CALL Messaging_Girl
8E0A CALL GirlArtificialIntelligence Call GirlArtificialIntelligence.
8E0D PUSH AF Stash AF on the stack.
8E0E CALL PrintStats Call PrintStats.
8E11 POP AF Restore AF from the stack.
8E12 OR A Jump to PlayerWonRound if the girl has "dropped".
8E13 JP Z,PlayerWonRound
8E16 CP $03 Call Handler_Showdown if the game is in "showdown" mode.
8E18 CALL Z,Handler_Showdown
8E1B XOR A Write 00 to *8E43.
8E1C LD ($8E43),A
8E1F CALL CheckShowdown Call CheckShowdown.
Messaging options:
ID Message
01 message-12-00
PlayersTurn 8E22 LD A,$0C Call Messaging_Girl using message block 0C.
8E24 CALL Messaging_Girl
8E27 CALL PrintStats Call PrintStats.
8E2A CALL InGameControls Call InGameControls.
8E2D OR A Jump to GirlWonRound if the player has dropped.
8E2E JP Z,GirlWonRound
8E31 CP $03 Call Handler_Showdown if the game is in "showdown" mode.
8E33 CALL Z,Handler_Showdown
8E36 XOR A Write 00 to *8E43.
8E37 LD ($8E43),A
8E3A CALL CheckShowdown Call CheckShowdown.
8E3D CALL PrintStats Call PrintStats.
8E40 JR GirlsTurn Jump to GirlsTurn.
Prev: 8D49 Up: Map Next: 8E42