Prev: 36169 Up: Map Next: 36418
36170: Play Game
Used by the routine at InitialiseNewGame.
Reset both the player and girls hands. Note that 255 is used to signify "draw a new card".
PlayGame 36170 LD HL,38599 HL=PlayersHand.
36173 LD B,10 Set a counter of 10 for all cards in both hands (i.e. two hands at 5 cards each).
ResetHand_Loop 36175 LD (HL),255 Mark card slot with 255 to signify that this card should be redrawn.
36177 INC HL Increment card slot pointer by one.
36178 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.
36180 LD A,32 Write INK: BLACK, PAPER: GREEN to *ATTR_P.
36182 LD (23693),A
36185 LD B,6 Clear the bottom 6 lines using CL_LINE.
36187 CALL 3652
36190 XOR A Write 0 to;
36191 LD (38580),A
36194 LD (23659),A
36197 INC A Write 1 to *TurnCounter.
36198 LD (38584),A
36201 INC A Write 2 to *InteractionCounter.
36202 LD (36441),A
Print "DROP", "HOLD" and "RAISE".
36205 LD HL,37652 HL=Messaging_Drop.
36208 CALL 6269 Call OUT_LINE2.
36211 LD A,2 Write 2 to *DF_SZ.
36213 LD (23659),A
36216 LD BC,1824 Set screen co-ordinates to 1824.
36219 CALL 3554 Call 3554 (CL_SET) to turn the co-ordinates into a screen buffer location.
36222 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.
36225 LD B,5 B=5.
PrintCursorLoop 36227 LD HL,37645 HL=Messaging_Cursor.
36230 CALL 6269 Call OUT_LINE2.
36233 DJNZ PrintCursorLoop Decrease counter by one and loop back to PrintCursorLoop until counter is zero.
Blank out 7 lines of the display.
36235 LD HL,22880 HL=22880 (attribute buffer location).
36238 LD B,224 B=224.
Blank_Loop 36240 LD (HL),0 Write INK: BLACK, PAPER: BLACK to *HL.
36242 INC HL Increment HL by one.
36243 DJNZ Blank_Loop Decrease counter by one and loop back to Blank_Loop until counter is zero.
Make the girl buy in.
36245 LD A,10 A=10.
36247 CALL GirlAddToPot Call GirlAddToPot.
Make the player buy in.
36250 LD A,B Write B (also 10) to *CurrentRaiseValue.
36251 LD (38583),A
36254 CALL PlayerAddToPot Call PlayerAddToPot.
Reset *CurrentRaiseValue for the display.
36257 XOR A Write 0 to *CurrentRaiseValue.
36258 LD (38583),A
36261 CALL ResetDeck Call ResetDeck.
Initiate girls hand.
36264 LD IX,38604 IX=GirlsHand.
36268 CALL DrawCards Call DrawCards.
36271 CALL CountDuplicates Call CountDuplicates.
36274 LD A,(39140) Set A to *CurrentGirl+1 and set a counter in B to *CurrentGirl.
36277 LD B,A
36278 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 36279 PUSH BC Stash the girl count on the stack.
36280 CALL GirlMarkCards Call GirlMarkCards.
36283 CALL DrawCards Call DrawCards.
36286 CALL CountDuplicates Call CountDuplicates.
36289 POP BC Restore the girl count from the stack.
36290 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.
36292 LD BC,7 Copy BC=0007 bytes of data from TableHandEvaluation_Type to Table_GirlEvaluation.
36295 LD HL,38043
36298 LD DE,38592
36301 LDIR
36303 CALL PrintStats Call PrintStats.
Initiate players hand.
36306 LD IX,38599 IX=PlayersHand.
36310 CALL DrawCards Call DrawCards.
36313 CALL PrintHand Call PrintHand.
36316 CALL MarkCards Call MarkCards.
36319 CALL DrawCards Call DrawCards.
36322 CALL PrintHand Call PrintHand.
36325 CALL CountDuplicates Call CountDuplicates.
Stash the evaluation table at Table_PlayerEvaluation.
36328 LD BC,7 Copy BC=0007 bytes of data from TableHandEvaluation_Type to Table_PlayerEvaluation.
36331 LD HL,38043
36334 LD DE,38585
36337 LDIR
36339 CALL PrintStats Call PrintStats.
36342 LD A,1 Write 1 to *36419.
36344 LD (36419),A
36347 LD A,(36418) Flip bit 0 of *TurnFlag and write it back to *TurnFlag.
36350 XOR %00000001
36352 LD (36418),A
36355 JR Z,PlayersTurn Jump to PlayersTurn if *TurnFlag is 0 (players turn).
Messaging options:
ID Message
1 message-13-00
GirlsTurn 36357 LD A,13 Call Messaging_Girl using message block 13.
36359 CALL Messaging_Girl
36362 CALL GirlArtificialIntelligence Call GirlArtificialIntelligence.
36365 PUSH AF Stash AF on the stack.
36366 CALL PrintStats Call PrintStats.
36369 POP AF Restore AF from the stack.
36370 OR A Jump to PlayerWonRound if the girl has "dropped".
36371 JP Z,PlayerWonRound
36374 CP 3 Call Handler_Showdown if the game is in "showdown" mode.
36376 CALL Z,Handler_Showdown
36379 XOR A Write 0 to *36419.
36380 LD (36419),A
36383 CALL CheckShowdown Call CheckShowdown.
Messaging options:
ID Message
1 message-12-00
PlayersTurn 36386 LD A,12 Call Messaging_Girl using message block 12.
36388 CALL Messaging_Girl
36391 CALL PrintStats Call PrintStats.
36394 CALL InGameControls Call InGameControls.
36397 OR A Jump to GirlWonRound if the player has dropped.
36398 JP Z,GirlWonRound
36401 CP 3 Call Handler_Showdown if the game is in "showdown" mode.
36403 CALL Z,Handler_Showdown
36406 XOR A Write 0 to *36419.
36407 LD (36419),A
36410 CALL CheckShowdown Call CheckShowdown.
36413 CALL PrintStats Call PrintStats.
36416 JR GirlsTurn Jump to GirlsTurn.
Prev: 36169 Up: Map Next: 36418