Prev: 51439 Up: Map Next: 51593
51497: Process Object Display Logic
Prepares the room or object named for the picture, and skips it when the record is not marked for display.
Set object pointers.
ProcessObjectDisplayLogic 51497 CALL SetObjectPointers Call SetObjectPointers to point at this object's records.
51500 LD A,(41012) Jump to ProcessObjectDisplayLogic_SavedCharacterMove if the room display parameter is at least 254.
51503 CP 254
51505 JR NC,ProcessObjectDisplayLogic_SavedCharacterMove
51507 LD IX,(40983) Read the current character record.
51511 BIT 6,(IX+5) Jump to ProcessObjectDisplayLogic_Next if the special-description flag is clear.
51515 JR Z,ProcessObjectDisplayLogic_Next
No matching handler?
51517 XOR A Jump ahead to ProcessObjectDisplayLogic_Next if CalculateHandlerOffset finds no handler.
51518 CALL CalculateHandlerOffset
51521 JR NC,ProcessObjectDisplayLogic_Next
51523 LD A,(41011) Read the saved character and call SearchTwoByteTable to search the two-byte table.
51526 CALL SearchTwoByteTable
51529 CP 255 Jump ahead to ProcessObjectDisplayLogic_MovedMarker if the entry is not the end marker.
51531 JR NZ,ProcessObjectDisplayLogic_MovedMarker
ProcessObjectDisplayLogic_Next 51533 LD A,(40975) Jump to ProcessObjectDisplayLogic_SavedCharacterMove if the display mode is below 7.
51536 CP 7
51538 JR C,ProcessObjectDisplayLogic_SavedCharacterMove
51540 LD IX,(40979) Call CalculateHandlerOffset to calculate handler offset.
51544 LD A,(41011)
51547 CALL CalculateHandlerOffset
51550 JR NC,ProcessObjectDisplayLogic_SavedCharacterMove Jump ahead to ProcessObjectDisplayLogic_SavedCharacterMove if CalculateHandlerOffset finds no handler.
ProcessObjectDisplayLogic_MovedMarker 51552 LD A,(IX+1) Read the moved marker.
51555 LD E,A
51556 LD D,0
51558 LD HL,43633 Use the lookup table: object display data at Table_ObjectDisplayData.
51561 DEC DE Index the word table at Table_ObjectDisplayData and draw that record from ProcessObjectDisplayEntry.
51562 ADD HL,DE
51563 ADD HL,DE
51564 LD E,(HL)
51565 INC HL
51566 LD D,(HL)
51567 EX DE,HL
51568 JR ProcessObjectDisplayEntry
Read the saved character, then use the display records at 40760 as the character record, then check for the end marker.
ProcessObjectDisplayLogic_SavedCharacterMove 51570 LD A,(41011) Call SearchThreeByteTable to search three-byte length table.
51573 LD IX,40760
51577 CALL SearchThreeByteTable
51580 CP 255 Return zero through ParseInputNumber_ReturnZero if the entry is the end marker.
51582 JP Z,ParseInputNumber_ReturnZero
51585 LD L,(IX+1) Read the display-record pointer and draw it from ProcessObjectDisplayEntry.
51588 LD H,(IX+2)
51591 JR ProcessObjectDisplayEntry
Prev: 51439 Up: Map Next: 51593