Prev: 38050 Up: Map Next: 38072
38058: Handler: Four Of A Kind
Populated by CountDuplicates.
Used by the routine at CalculateHand.
Table_CardDuplicates holds counts of duplicate values of cards, this routine specifically looks for four-of-a-kind matches.
Handler_FourOfAKind 38058 LD HL,38208 HL=Table_CardDuplicates.
38061 LD B,13 Set a counter in B of the number of possible values of cards there are in one suit.
There's no need to check any further if there's a match, as if there are 4 of any card value, there are only 5 cards in one hand - so there can't be a second match.
Handler_FourOfAKind_Loop 38063 LD A,(HL) Return if *HL is equal to 4.
38064 CP 4
38066 RET Z
38067 INC HL Increment HL by one.
38068 DJNZ Handler_FourOfAKind_Loop Decrease counter by one and loop back to Handler_FourOfAKind_Loop until counter is zero.
38070 INC B Increment B by one.
38071 RET Return.
Prev: 38050 Up: Map Next: 38072