Routines |
Prev: 38081 | Up: Map | Next: 38106 |
Used by the routines at CheckStraight and Handler_StraightFlush.
|
||||
Handler_Straight | 38087 | LD HL,38207 | HL=38207 (e.g. Table_CardDuplicates-1). | |
Keep looping through the duplicate values until we find a card which the player has only one of.
|
||||
FindFirstCard_Loop | 38090 | INC HL | Increment HL by one. | |
38091 | LD A,(HL) | Jump to FindFirstCard_Loop if *HL is not equal to 1. | ||
38092 | CP 1 | |||
38094 | JR NZ,FindFirstCard_Loop | |||
We've found the first card, so check if there's a sequence from here.
|
||||
38096 | LD B,5 | Set a counter in B we want to check all 5 cards. | ||
If it's a genuine straight, then the count for all five cards will be 1.
|
||||
Handler_Straight_Loop | 38098 | LD A,(HL) | Return if the duplicate count is anything other than 1. | |
38099 | CP 1 | |||
38101 | RET NZ | |||
38102 | INC HL | Increment HL by one. | ||
38103 | DJNZ Handler_Straight_Loop | Decrease the card counter by one and loop back to Handler_Straight_Loop until all 5 cards have been checked. | ||
38105 | RET | Return. |
Prev: 38081 | Up: Map | Next: 38106 |