Prev: 57879 Up: Map Next: 58170
58131: Print Hand
Used by the routines at PlayGame and Handler_Showdown.
Input
IX Pointer to either the players hand or the girls hand
PrintHand 58131 PUSH IX Stash IX on the stack.
58133 PUSH IX Copy the hand pointer to HL using the stack.
58135 POP HL
Starting from the first card.
58136 LD A,1 Write 1 to *CardPosition.
58138 LD (59423),A
Loop round each card in turn and print it to the screen.
PrintHand_Loop 58141 PUSH HL Stash the hand pointer on the stack.
58142 LD A,(HL) Fetch the card "value" and store it in A.
58143 CALL CheckCardType Call CheckCardType (which will print the card in position to the screen).
58146 POP HL Restore the hand pointer from the stack.
58147 INC HL Increment the hand pointer by one to point to the next card.
Have all cards been printed yet? There are 5 in a hand.
58148 LD A,(59423) Jump to PrintHand_Finish if *CardPosition is equal to 5.
58151 CP 5
58153 JR Z,PrintHand_Finish
58155 INC A Increment the card position and update *CardPosition count, as on the loop, we'll be looking at the next card.
58156 LD (59423),A
58159 JR PrintHand_Loop Jump to PrintHand_Loop.
Housekeeping; restore the CHARS value and the hand pointer to return.
PrintHand_Finish 58161 LD HL,62409 Write 62409 (CustomFont) to *CHARS.
58164 LD (23606),HL
58167 POP IX Restore the original value of IX from the stack.
58169 RET Return.
Prev: 57879 Up: Map Next: 58170