Prev: EEF1 Up: Map Next: EF48
EF1E: Initialize moving objects in all rooms
Used by the routine at C881.
This routine loops through every moving object's movement table, and sets its visible flag, so that everything is in play when the game begins.
EF1E LD HL,($69ED) Point HL at the moving objects buffer. (69E6 + 7 / 8)
EF21 INC HL Skip the first four bytes which hold the object IDs.
EF22 INC HL
EF23 INC HL
EF24 INC HL
EF25 LD B,$30 30 rooms to check.
EF27 PUSH BC Remember BC.
EF28 LD A,(HL) Get the first byte with the number of objects.
EF29 CALL $E9F8 Split the two 4-bit numbers into B and C.
EF2C LD A,B Put the combined total in D.
EF2D ADD A,C
EF2E LD D,A
EF2F INC HL Get the second byte with the number of objects.
EF30 LD A,(HL)
EF31 CALL $E9F8 Split the two 4-bit numbers into B and C.
EF34 LD A,B Put the combined total, plus the earlier total in B as the number of moving objects in this room.
EF35 ADD A,C
EF36 ADD A,D
EF37 LD B,A
EF38 LD DE,$0005 Move to the start of the movement table.
EF3B ADD HL,DE
EF3C RES 6,(HL) Set the sprite to be drawn.
EF3E LD DE,$0008 Move to the next movement entry.
EF41 ADD HL,DE
EF42 DJNZ $EF3C Loop while there are more objects to look at it.
EF44 POP BC Restore BC.
EF45 DJNZ $EF27 Loop back until all rooms have been checked.
EF47 RET
Prev: EEF1 Up: Map Next: EF48