Routines |
Prev: 37854 | Up: Map | Next: 37959 |
Used by the routine at CheckTwoPairs.
|
||||
Check if there is a pair.
|
||||
CheckPair | 37906 | CALL Handler_Pair | Call Handler_Pair. | |
37909 | JR NZ,37959 | Jump to 37959 if there are no pair matches. | ||
There is a pair! Process it.
|
||||
37911 | CALL CalculateCard | Call CalculateCard. | ||
37914 | LD (38044),A | Write A to *TableHandEvaluation_BaseCard. | ||
Record this hand "type".
|
||||
37917 | LD A,2 | Write "Pair" to *TableHandEvaluation_Type. | ||
37919 | LD (38043),A | |||
Starting from "Ace High" work backwards through all the cards.
|
||||
37922 | LD B,13 | Set a counter in B of the number of possible values of cards there are in one suit. | ||
37924 | LD DE,38046 | DE=TableHandEvaluation_HighCard_1. | ||
37927 | LD HL,38220 | HL=Table_CardDuplicates_Ace. | ||
FindSinglesNearYou_Loop | 37930 | LD A,(HL) | Jump to WriteSingleCardValue if this entry in the duplicates table is equal to 1. | |
37931 | CP 1 | |||
37933 | JR Z,WriteSingleCardValue | |||
Move to the next card.
|
||||
FindSinglesNearYou_Next | 37935 | DEC HL | Decrease the card duplicate table pointer by one. | |
37936 | DJNZ FindSinglesNearYou_Loop | Decrease the card counter by one and loop back to FindSinglesNearYou_Loop until the counter is zero. | ||
37938 | LD A,(38044) | A=*TableHandEvaluation_BaseCard. | ||
37941 | CALL CalculateSuit | Call CalculateSuit. | ||
37944 | LD (38045),A | Write A to *TableHandEvaluation_BaseCardSuit. | ||
37947 | RET | Return. | ||
Convert the current position in the duplicates table into a card value and write it to the hand evaluation pointer.
|
||||
WriteSingleCardValue | 37948 | PUSH HL | Stash the duplicates table and hand evaluation pointers on the stack. | |
37949 | PUSH DE | |||
37950 | CALL CalculateCard | Call CalculateCard to convert the duplicates table pointer position into a card value. | ||
37953 | POP DE | Restore the hand evaluation and duplicates table pointers from the stack. | ||
37954 | POP HL | |||
37955 | LD (DE),A | Write the card value to the hand evaluation table. | ||
37956 | INC DE | Increment the hand evaluation table pointer by one. | ||
37957 | JR FindSinglesNearYou_Next | Jump to FindSinglesNearYou_Next. |
Prev: 37854 | Up: Map | Next: 37959 |