![]() |
Routines |
| Prev: B46F | Up: Map | Next: B548 |
|
Used by the routine at AA0A.
|
||||||||
| InitialiseOpponent | B517 | LD E,$06 | E=06. | |||||
| B519 | CALL $A875 | Call A875. | ||||||
| B51C | LD HL,$B484 | HL=Table_Opponent_BeerBellyBill. | ||||||
| B51F | LD DE,$0015 | Set the length of the opponent data in DE (0015 bytes). | ||||||
| B522 | LD C,A | C=the opponent ID. | ||||||
| B523 | AND A | Set a counter in B of the opponent ID. | ||||||
| B524 | LD B,A | |||||||
| B525 | JR Z,FoundOpponentData | Jump to FoundOpponentData if the opponent counter is zero. | ||||||
| FindOpponentData_Loop | B527 | ADD HL,DE | Move HL to the next opponent data block. | |||||
| B528 | DJNZ FindOpponentData_Loop | Decrease the opponent counter by one and loop back to FindOpponentData_Loop until the counter is zero. | ||||||
|
HL now points to the opponent data block.
|
||||||||
| FoundOpponentData | B52A | LD ($9B21),HL | Write the opponent data pointer to *QuarterFinals_OpponentData. | |||||
| InitialiseOpponent_0 | B52D | PUSH BC | Stash BC on the stack. | |||||
| B52E | LD E,$06 | E=06. | ||||||
| B530 | CALL $A875 | Call A875. | ||||||
| B533 | POP BC | Restore BC from the stack. | ||||||
| B534 | CP C | Jump to InitialiseOpponent_0 if A is equal to C. | ||||||
| B535 | JR Z,InitialiseOpponent_0 | |||||||
| B537 | LD HL,$B484 | HL=Table_Opponent_BeerBellyBill. | ||||||
| B53A | LD DE,$0015 | Set the length of the opponent data in DE (0015 bytes). | ||||||
| B53D | AND A | Set a counter in B of the opponent ID. | ||||||
| B53E | LD B,A | |||||||
| B53F | JR Z,InitialiseOpponent_2 | Jump to InitialiseOpponent_2 if the opponent counter is zero. | ||||||
| InitialiseOpponent_1 | B541 | ADD HL,DE | Move HL to the next opponent data block. | |||||
| B542 | DJNZ InitialiseOpponent_1 | Decrease the opponent counter by one and loop back to InitialiseOpponent_1 until the counter is zero. | ||||||
| InitialiseOpponent_2 | B544 | LD ($9B23),HL | Write HL to *SemiFinals_OpponentData. | |||||
| B547 | RET | Return. | ||||||
| Prev: B46F | Up: Map | Next: B548 |