Prev: 27364 Up: Map Next: 27410
27381: Handler: Objects
Used by the routine at HandlerPlayer.
Looks after the objects (7 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 27381 LD HL,24144 Point HL at the first object (Object_1_State).
27384 LD B,7 Set the object counter to 7.
CheckObjectActive 27386 BIT 7,(HL) If bit 7 is not set on the current objects sprite ID value, jump to EraseObject.
27388 JR Z,EraseObject
27390 RES 7,(HL) Reset bit 7 of the sprite ID.
27392 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 27394 PUSH HL Stash HL on the stack.
27395 LD HL,280 Set the delay counter to 0280.
ObjectPauseLoop 27398 DEC HL Decrease the delay counter by one.
27399 LD A,H Loop back to ObjectPauseLoop until the delay counter is zero.
27400 OR L
27401 JR NZ,ObjectPauseLoop
27403 POP HL Restore HL from the stack.
NextObject 27404 INC HL Move on to the Y position of the object.
27405 INC HL
This entry point is used by the routine at EraseObject.
NextObject_2 27406 INC HL Move on to the next object.
27407 DJNZ CheckObjectActive Decrease the object counter by one and loop back to CheckObjectActive until all 7 objects have been checked.
27409 RET Return.
Prev: 27364 Up: Map Next: 27410