Prev: 94A2 Up: Map Next: 94B8
94AA: 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 94AA LD HL,$9540 HL=Table_CardDuplicates.
94AD LD B,$0D 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 04 of any card value, there are only 05 cards in one hand - so there can't be a second match.
Handler_FourOfAKind_Loop 94AF LD A,(HL) Return if *HL is equal to 04.
94B0 CP $04
94B2 RET Z
94B3 INC HL Increment HL by one.
94B4 DJNZ Handler_FourOfAKind_Loop Decrease counter by one and loop back to Handler_FourOfAKind_Loop until counter is zero.
94B6 INC B Increment B by one.
94B7 RET Return.
Prev: 94A2 Up: Map Next: 94B8