Routines |
Prev: 93DE | Up: Map | Next: 9447 |
Used by the routine at CheckTwoPairs.
|
||||
Check if there is a pair.
|
||||
CheckPair | 9412 | CALL Handler_Pair | Call Handler_Pair. | |
9415 | JR NZ,$9447 | Jump to 9447 if there are no pair matches. | ||
There is a pair! Process it.
|
||||
9417 | CALL CalculateCard | Call CalculateCard. | ||
941A | LD ($949C),A | Write A to *TableHandEvaluation_BaseCard. | ||
Record this hand "type".
|
||||
941D | LD A,$02 | Write "Pair" to *TableHandEvaluation_Type. | ||
941F | LD ($949B),A | |||
Starting from "Ace High" work backwards through all the cards.
|
||||
9422 | LD B,$0D | Set a counter in B of the number of possible values of cards there are in one suit. | ||
9424 | LD DE,$949E | DE=TableHandEvaluation_HighCard_1. | ||
9427 | LD HL,$954C | HL=Table_CardDuplicates_Ace. | ||
FindSinglesNearYou_Loop | 942A | LD A,(HL) | Jump to WriteSingleCardValue if this entry in the duplicates table is equal to 01. | |
942B | CP $01 | |||
942D | JR Z,WriteSingleCardValue | |||
Move to the next card.
|
||||
FindSinglesNearYou_Next | 942F | DEC HL | Decrease the card duplicate table pointer by one. | |
9430 | DJNZ FindSinglesNearYou_Loop | Decrease the card counter by one and loop back to FindSinglesNearYou_Loop until the counter is zero. | ||
9432 | LD A,($949C) | A=*TableHandEvaluation_BaseCard. | ||
9435 | CALL CalculateSuit | Call CalculateSuit. | ||
9438 | LD ($949D),A | Write A to *TableHandEvaluation_BaseCardSuit. | ||
943B | RET | Return. | ||
Convert the current position in the duplicates table into a card value and write it to the hand evaluation pointer.
|
||||
WriteSingleCardValue | 943C | PUSH HL | Stash the duplicates table and hand evaluation pointers on the stack. | |
943D | PUSH DE | |||
943E | CALL CalculateCard | Call CalculateCard to convert the duplicates table pointer position into a card value. | ||
9441 | POP DE | Restore the hand evaluation and duplicates table pointers from the stack. | ||
9442 | POP HL | |||
9443 | LD (DE),A | Write the card value to the hand evaluation table. | ||
9444 | INC DE | Increment the hand evaluation table pointer by one. | ||
9445 | JR FindSinglesNearYou_Next | Jump to FindSinglesNearYou_Next. |
Prev: 93DE | Up: Map | Next: 9447 |