![]() |
Routines |
| Prev: 926C | Up: Map | Next: 9286 |
|
Walks the three slots of the inventory looking for one that matches on both bytes: the sprite in E and the drawing mode -- which for a key is its colour -- in D. It starts at $5E32 rather than $5E30 because the first two bytes of a slot are the object's address; the sprite and the mode are the third and fourth, which is exactly what REMEMBER_CARRIED put there.
|
||||||||||||
| FIND_CARRIED | 9273 | LD B,$03 | Three slots, four bytes each, starting at the sprite byte of the first. | |||||||||
| 9275 | LD HL,$5E32 | |||||||||||
| FIND_CARRIED_0 | 9278 | LD A,(HL) | Wrong sprite: on to the next slot. | |||||||||
| 9279 | CP E | |||||||||||
| 927A | INC HL | |||||||||||
| 927B | JR NZ,FIND_CARRIED_1 | |||||||||||
| 927D | LD A,(HL) | Right sprite, right colour: found. | ||||||||||
| 927E | CP D | |||||||||||
| 927F | RET Z | |||||||||||
| FIND_CARRIED_1 | 9280 | INC HL | Step over the rest of the slot. | |||||||||
| 9281 | INC HL | |||||||||||
| 9282 | INC HL | |||||||||||
| 9283 | DJNZ FIND_CARRIED_0 | |||||||||||
| 9285 | RET | |||||||||||
| Prev: 926C | Up: Map | Next: 9286 |