![]() |
Routines |
| Prev: CC0B | Up: Map | Next: CC29 |
|
Used by the routines at ProcessCharacterAction, DescribeObjectIfPresent, PlaceCharacter and RecordResultRoomDisplay.
Searches the timetable at Table_Timetable for the character id in A.
|
||||||||||||||||
|
Stash some registers so they don't get corrupted.
|
||||||||||||||||
| FindCharacter | CC0E | PUSH DE | Store the character ID in C, saving source and the count. | |||||||||||||
| CC0F | PUSH BC | |||||||||||||||
| CC10 | LD C,A | |||||||||||||||
| CC11 | LD DE,$0008 | Use the timetable at Table_Timetable. | ||||||||||||||
| CC14 | LD IY,$9860 | |||||||||||||||
| FindCharacter_Loop | CC18 | LD A,(IY+$00) | Fetch the current characters ID from the timetable pointer. | |||||||||||||
| CC1B | CP C | Go to FindCharacter_Return if this timetable entry is the wanted character. | ||||||||||||||
| CC1C | JR Z,FindCharacter_Return | |||||||||||||||
| CC1E | CP $FF | Go to FindCharacter_Return if it is FF. | ||||||||||||||
| CC20 | JR Z,FindCharacter_Return | |||||||||||||||
| CC22 | ADD IY,DE | Add 08 bytes to the timetable pointer to move to the next set of character data. | ||||||||||||||
| CC24 | JR FindCharacter_Loop | Go back for the next character pair. | ||||||||||||||
|
Return.
Return with some housekeeping.
|
||||||||||||||||
| FindCharacter_Return | CC26 | POP BC | Restore the saved count and the saved source from the stack. | |||||||||||||
| CC27 | POP DE | |||||||||||||||
| CC28 | RET | Return. | ||||||||||||||
| Prev: CC0B | Up: Map | Next: CC29 |