![]() |
Routines |
| Prev: 6AE4 | Up: Map | Next: 6B12 |
|
Used by the routine at HandlerPlayer.
Looks after the objects (07 slots from Object_1_State). DrawObjects sets bit 7 of the sprite ID of each object that is in view, so for each slot this clears that bit for objects still in view, erases the objects which are no longer in view and frees their slots. Empty slots just waste a little time.
|
||||
| HandlerObjects | 6AF5 | LD HL,$5E50 | Point HL at the first object (Object_1_State). | |
| 6AF8 | LD B,$07 | Set the object counter to 07. | ||
| CheckObjectActive | 6AFA | BIT 7,(HL) | If bit 7 is not set on the current objects sprite ID value, jump to EraseObject. | |
| 6AFC | JR Z,EraseObject | |||
| 6AFE | RES 7,(HL) | Reset bit 7 of the sprite ID. | ||
| 6B00 | JR NextObject | Jump to NextObject. | ||
|
This entry point is used by the routine at EraseObject.
An empty slot; spend some time so that the frame takes about as long as it does for a used one.
|
||||
| HandlerObjects_EmptySlot | 6B02 | PUSH HL | Stash HL on the stack. | |
| 6B03 | LD HL,$0118 | Set the delay counter to 0118. | ||
| ObjectPauseLoop | 6B06 | DEC HL | Decrease the delay counter by one. | |
| 6B07 | LD A,H | Loop back to ObjectPauseLoop until the delay counter is zero. | ||
| 6B08 | OR L | |||
| 6B09 | JR NZ,ObjectPauseLoop | |||
| 6B0B | POP HL | Restore HL from the stack. | ||
| NextObject | 6B0C | INC HL | Move on to the Y position of the object. | |
| 6B0D | INC HL | |||
|
This entry point is used by the routine at EraseObject.
|
||||
| NextObject_2 | 6B0E | INC HL | Move on to the next object. | |
| 6B0F | DJNZ CheckObjectActive | Decrease the object counter by one and loop back to CheckObjectActive until all 07 objects have been checked. | ||
| 6B11 | RET | Return. | ||
| Prev: 6AE4 | Up: Map | Next: 6B12 |