Prev: E217 Up: Map Next: E33A
E313: Print Hand
Used by the routines at PlayGame and Handler_Showdown.
Input
IX Pointer to either the players hand or the girls hand
PrintHand E313 PUSH IX Stash IX on the stack.
E315 PUSH IX Copy the hand pointer to HL using the stack.
E317 POP HL
Starting from the first card.
E318 LD A,$01 Write 01 to *CardPosition.
E31A LD ($E81F),A
Loop round each card in turn and print it to the screen.
PrintHand_Loop E31D PUSH HL Stash the hand pointer on the stack.
E31E LD A,(HL) Fetch the card "value" and store it in A.
E31F CALL CheckCardType Call CheckCardType (which will print the card in position to the screen).
E322 POP HL Restore the hand pointer from the stack.
E323 INC HL Increment the hand pointer by one to point to the next card.
Have all cards been printed yet? There are 05 in a hand.
E324 LD A,($E81F) Jump to PrintHand_Finish if *CardPosition is equal to 05.
E327 CP $05
E329 JR Z,PrintHand_Finish
E32B INC A Increment the card position and update *CardPosition count, as on the loop, we'll be looking at the next card.
E32C LD ($E81F),A
E32F JR PrintHand_Loop Jump to PrintHand_Loop.
Housekeeping; restore the CHARS value and the hand pointer to return.
PrintHand_Finish E331 LD HL,$F3C9 Write F3C9 (CustomFont) to *CHARS.
E334 LD ($5C36),HL
E337 POP IX Restore the original value of IX from the stack.
E339 RET Return.
Prev: E217 Up: Map Next: E33A