Prev: BD69 Up: Map Next: BDC2
BD7E: Calculate Object Pointer Offset
Used by the routines at RecordResultCharacterScript and ReadActionFlags.
Points HL at byte 18 of the record, or at the object display link when bit 7 is set.
CalculateObjectPointerOffset BD7E PUSH IY Point HL at byte 18 of the record (IY+18).
BD80 POP HL
BD81 LD DE,$0018
BD84 ADD HL,DE
BD85 BIT 7,(IY+$19) Jump to CalculateObjectPointerOffset_Next if a marker on the schedule entry is clear.
BD89 JR Z,CalculateObjectPointerOffset_Next
BD8B LD HL,$9FF6 Take the object display link.
CalculateObjectPointerOffset_Next BD8E BIT 6,(IY+$19) Jump to CalculateObjectPointerOffset_DisplayDataPointer if a marker on the schedule entry is clear.
BD92 JR Z,CalculateObjectPointerOffset_DisplayDataPointer
BD94 LD HL,$9FFC Take the alternate display link.
CalculateObjectPointerOffset_DisplayDataPointer BD97 LD DE,$B172 Copy 06 bytes from the display data at DisplayDataPointer.
BD9A LD BC,$0006
BD9D LDIR
BD9F PUSH IY Point HL at byte 08 of the record (IY+08).
BDA1 POP HL
BDA2 LD DE,$0008
BDA5 ADD HL,DE
BDA6 LD DE,$B178 Take the display mode flag.
BDA9 LD BC,$0006 Copy 06 bytes and read IY+00 into L.
BDAC LDIR
BDAE LD L,(IY+$00)
BDB1 LD A,(IY+$01) Keep the low nibble of IY+01 in H.
BDB4 AND $0F
BDB6 LD H,A
BDB7 LD ($BA17),HL Record the display pointer.
BDBA PUSH IY Call PointObjectListRoom to store the character record.
BDBC CALL PointObjectListRoom
BDBF POP IY
BDC1 RET Return.
Prev: BD69 Up: Map Next: BDC2