Prev: 54122 Up: Map Next: 54229
54171: Process Object Entry Alternate
Walks the objects in this room and describes each one that is here. Pointed at by 46311 and 46478.
ProcessObjectEntryAlternate 54171 PUSH IY Save the schedule entry, the source, the count and the character record.
54173 PUSH DE
54174 PUSH BC
54175 PUSH IX
54177 POP BC Copy the character record from IX into BC.
54178 LD DE,1 Take an offset of 0001.
Has the object count reached 106?
ProcessObjectEntryAlternate_Loop 54181 INC B Count one more, and go to ProcessObjectEntryAlternate_BringSavedCharacter with 255 if the count has reached 106.
54182 LD A,B
54183 CP 106
54185 LD A,255
54187 JR Z,ProcessObjectEntryAlternate_BringSavedCharacter
54189 LD A,B Take the count, then call FetchLocationDataPointer to look up this room.
54190 CALL FetchLocationDataPointer
54193 PUSH IX Step to the next schedule entry, then call CompareFollowingFields to compare location data.
54195 POP IY
54197 ADD IY,DE
54199 CALL CompareFollowingFields
54202 JR NZ,ProcessObjectEntryAlternate_Loop Jump back to ProcessObjectEntryAlternate_Loop while the room fields do not match.
54204 LD A,(41016) Jump ahead to ProcessObjectEntryAlternate_Next if the object attribute flag is not zero.
54207 AND A
54208 JR NZ,ProcessObjectEntryAlternate_Next
54210 PUSH BC Take the count and call FindObjectByFieldTwo to find an object by field two.
54211 LD A,B
54212 CALL FindObjectByFieldTwo
54215 POP BC
54216 CP 255 Jump back to ProcessObjectEntryAlternate_Loop if the entry is the end marker.
54218 JR Z,ProcessObjectEntryAlternate_Loop
ProcessObjectEntryAlternate_Next 54220 LD A,B Take the count.
ProcessObjectEntryAlternate_BringSavedCharacter 54221 PUSH BC Copy the object count from BC into IX.
54222 POP IX
54224 POP BC Restore the saved count, the saved source and the saved schedule entry from the stack.
54225 POP DE
54226 POP IY
54228 RET Return.
View the equivalent code in;
Prev: 54122 Up: Map Next: 54229