Prev: 95BB Up: Map Next: 960C
95EF: Count Suits
Used by the routine at CountDuplicates.
Input
IX Pointer to either the player or girls hand
Output
A 00 for "no flush", 01 for "flush"
CountSuits 95EF PUSH IX Load the hand pointer into DE (using the stack).
95F1 POP DE
Only having all four suits present is meaningful.
95F2 LD B,$04 Set a counter in B for the number of cards left to check.
95F4 LD A,(DE) Fetch the primary card for comparison.
95F5 AND %11110000 Store the suit value in H.
95F7 LD H,A
Loop through the remaining 04 cards.
CountSuits_Loop 95F8 INC DE Move the pointer to the next card.
95F9 LD A,(DE) Fetch the card.
95FA AND %11110000 Store the suit value in A.
95FC CP H Jump to NotAFlush if the suits of the two cards differ.
95FD JR NZ,NotAFlush
95FF DJNZ CountSuits_Loop Decrease the suit counter by one and loop back to CountSuits_Loop until counter is zero.
All four suits are present in the hand! We have a flush.
9601 LD A,$01 A=01.
WriteFlushFlag 9603 LD ($954D),A Write A to *FlushFlag.
9606 JP CalculateHand Jump to CalculateHand.
This hand doesn't contain a flush.
NotAFlush 9609 XOR A A=00.
960A JR WriteFlushFlag Jump to WriteFlushFlag.
Prev: 95BB Up: Map Next: 960C