Prev: 39587 Up: Map Next: 39760
39717: Measure Character Distance
Used by the routine at ReadRoomDisplayParameter.
Counts steps of five and records the room graphics parameter.
MeasureCharacterDistance 39717 LD A,(IX+2) Read the location.
39720 PUSH IX
39722 LD HL,0
MeasureCharacterDistance_Loop 39725 ADD HL,DE Jump back to MeasureCharacterDistance_Loop while at least 5 is still left.
39726 SUB 5
39728 JR NC,MeasureCharacterDistance_Loop
39730 EX DE,HL Call ScanObjects to scan objects.
39731 LD A,(41014)
39734 CALL ScanObjects
39737 JR Z,MeasureCharacterDistance_Next Go to MeasureCharacterDistance_Next if the object was not found.
39739 CALL ReadTextPointerLowByte Call ReadTextPointerLowByte to read the text pointer.
39742 AND A Subtract DE from the text pointer, then call StoreShiftedTextPointer to store the shifted text pointer.
39743 SBC HL,DE
39745 CALL StoreShiftedTextPointer
Find character script entry.
MeasureCharacterDistance_Next 39748 CALL FindCharacterScriptEntry Call FindCharacterScriptEntry to find this character's script entry.
39751 LD A,(IX+3) Record the room graphics parameter.
39754 LD (41013),A
39757 POP IX
39759 RET Return.
Prev: 39587 Up: Map Next: 39760