Prev: 48510 Up: Map Next: 48674
48578: Point The Object List At This Room
Used by the routine at CalculateObjectPointerOffset.
Points the object list at this room and remembers the character record in the display pointer.
Adjust object table for sum.
PointObjectListRoom 48578 CALL AdjustObjectTableForSum Call AdjustObjectTableForSum to point the object list at this room.
48581 LD (47635),IX Store this object pointer at 47635 and at 47635+2.
48585 LD (47637),IX
48589 LD DE,(47639) Read the display pointer and point HL at the character pairs at 39245.
48593 LD HL,39245
48596 LD B,1 Count 1.
PointObjectListRoom_Loop 48598 LD A,(HL) Read the next object-list byte.
48599 INC HL Advance through the object list.
48600 OR (HL) Merge the following object-list byte.
48601 DEC HL Step back one byte.
48602 RET Z Return when this object-list pair is empty.
48603 LD A,E Jump ahead to PointObjectListRoom_Next if the low byte differs from this object pair.
48604 CP (HL)
48605 JR NZ,PointObjectListRoom_Next
48607 INC HL Jump ahead to PointObjectListRoom_CountRecordResult if the high byte matches this object pair.
48608 LD A,D
48609 CP (HL)
48610 DEC HL
48611 JR Z,PointObjectListRoom_CountRecordResult
PointObjectListRoom_Next 48613 INC HL Step to the next object pair and go back to PointObjectListRoom_Loop.
48614 INC HL
48615 INC B
48616 JR PointObjectListRoom_Loop
Remember how many objects were listed and read the next one.
PointObjectListRoom_CountRecordResult 48618 LD A,B Record the display pointer.
48619 LD (47642),A
48622 LD A,2
48624 LD (41016),A Store it in the object attribute flag.
48627 CALL ReadCharacterRecordWord Call ReadCharacterRecordWord to read the next display object and return when the list has ended.
48630 CP 255
48632 RET Z
48633 LD (47641),A Call ReadCharacterRecordWord to read the character record from the display link.
48636 CALL ReadCharacterRecordWord
48639 CP 255 Jump to UseObjectDisplayLink_ConditionHoldsCaller when another display object follows.
48641 JR NZ,UseObjectDisplayLink_ConditionHoldsCaller
48643 LD A,(47641) Call UseObjectDisplayLink to copy the object's picture link.
48646 CALL UseObjectDisplayLink
48649 CALL ReadCharacterRecordValue Call ReadCharacterRecordValue to read the next saved object and return when that list has ended.
48652 CP 255
48654 RET Z
48655 LD (47643),A Call ReadCharacterRecordValue to read the character record from the saved value.
48658 CALL ReadCharacterRecordValue
48661 CP 255 Jump to UseObjectDisplayLink_ConditionHoldsCaller when another saved object follows.
48663 JR NZ,UseObjectDisplayLink_ConditionHoldsCaller
48665 LD A,(47643) Call UseObjectDisplayLink to copy the object's picture link.
48668 CALL UseObjectDisplayLink
48671 OR %00000001 Reset the zero flag.
48673 RET Return.
Prev: 48510 Up: Map Next: 48674