Prev: DE48 Up: Map Next: DEA4
DE60: Measure The Gap Between The Two Pointers
Used by the routine at DescribeObjectIfPresent.
Measures the gap between the object's description and the location text.
MeasureGapBetweenTwoPointers_Next DE60 PUSH HL Read the object's description.
DE61 PUSH DE
DE62 LD HL,($DDCD)
DE65 LD DE,($DDCB) Read the location text.
DE69 AND A Clear the carry before subtracting the two text pointers.
DE6A SBC HL,DE Subtract the two text pointers to measure the gap.
DE6C POP DE Restore the saved source and the saved pointer from the stack.
DE6D POP HL
DE6E RET Return.
DE6F DEFB $20,$10 Display record read by ProcessDisplayRecord: flags 20 value 10.
Run by CA64 after the display record at DE6F.
DE71 CALL PrintNewline Call PrintNewline to print a new line.
DE74 LD HL,$68AD Take the message, then call PrintTextAndHandleControlCharacters to print the message.
DE77 CALL PrintTextAndHandleControlCharacters
DE7A LD A,($A036) Call CountObjectsInLocation to count objects in location.
DE7D CALL CountObjectsInLocation
DE80 AND A See whether it is zero.
DE81 LD HL,$6900 Point at the text at 68E9+17 and go to MeasureGapBetweenTwoPointers_ResultLowByte to list the objects when the count is not zero.
DE84 JR NZ,MeasureGapBetweenTwoPointers_ResultLowByte
DE86 CALL PrintTextAndHandleControlCharacters Call PrintTextAndHandleControlCharacters to print the message.
DE89 OR $01
DE8B RET Return.
Store the result in the low byte of the count, then read the character attribute, then store the result in the count.
MeasureGapBetweenTwoPointers_ResultLowByte DE8C LD C,A Read the current character attribute.
DE8D LD A,($A00A)
DE90 LD B,A
DE91 LD A,($A036) Read the character being processed, then call PrintObjectListWithFormatting to list the objects and describe them.
DE94 CALL PrintObjectListWithFormatting
DE97 CALL PrintNewline Call PrintNewline to print a new line.
DE9A OR $01
DE9C RET Return.
DE9D DEFB $38,$10,$80,$21,$00,$00,$00 Display record read by ProcessDisplayRecord: flags 38 value 10 parameters 80 21 00 00 00.
Prev: DE48 Up: Map Next: DEA4