Prev: 53723 Up: Map Next: 53766
53724: Calculate Handler Offset
Used by the routine at ProcessObjectDisplayLogic.
Adds 15 to the record's flag byte and steps IX on by that many bytes.
CalculateHandlerOffset 53724 PUSH DE Read the record's flag byte and add 15 to the total.
53725 LD D,A
53726 LD A,(IX+0)
53729 ADD A,15
53731 LD E,A
53732 LD A,D Step to the next record.
53733 LD D,0
53735 ADD IX,DE
53737 POP DE
CalculateHandlerOffset_Loop 53738 CP (IX+0) Jump ahead to CalculateHandlerOffset_Next if this id matches the record's flag byte.
53741 JR Z,CalculateHandlerOffset_Next
53743 INC (IX+0) Jump to CalculateHandlerOffset_TestSignalStepFailed if this byte was the 255 end marker.
53746 JR Z,CalculateHandlerOffset_TestSignalStepFailed
53748 DEC (IX+0) Go to CalculateHandlerOffset_0 if stepping this byte down leaves zero.
53751 JR Z,CalculateHandlerOffset_0
53753 INC IX Skip this handler and try the next one.
53755 INC IX
53757 JR CalculateHandlerOffset_Loop
The condition holds, so the caller continues.
CalculateHandlerOffset_Next 53759 SCF Mark the condition as met.
53760 RET Return.
CalculateHandlerOffset_TestSignalStepFailed 53761 DEC (IX+0) Restore the end marker.
CalculateHandlerOffset_0 53764 XOR A Clear A.
53765 RET Return.
View the equivalent code in;
Prev: 53723 Up: Map Next: 53766