Prev: E5C1 Up: Map Next: E619
E5C3: Look Up The Current Object
Looks up the character id at Table_Timetable and compares that object's attribute with the current character record. A non-zero return means the script step succeeded.
Run by CA64 after the display record at E5C1, from the show-message command at E781.
LookUpCurrentObject E5C3 LD A,($9860) Take the character id at Table_Timetable and call FetchObjectDataPointer to look that object up.
E5C6 CALL FetchObjectDataPointer
E5C9 LD A,(IX+$0F) Read byte 0F of this record and point IX at the character record at CurrentCharacterData.
E5CC LD IX,($A017)
E5D0 CP (IX+$0F) Compare it with the character record, take the character being processed, and jump to LookUpCurrentObject_ZeroThrough.
E5D3 LD A,($A036)
E5D6 JR LookUpCurrentObject_ZeroThrough
E5D8 DEFB $47,$07,$DF,$E5 Display record read by ProcessDisplayRecord: flags 47 value 07 handler E5DF.
Run by CA64 after the display record at E5D8.
E5DC OR %00000001 Reset the zero flag.
E5DE RET Return.
E5DF LD IX,($A013) Point IX at the current object and read byte 0F.
E5E3 LD A,(IX+$0F)
E5E6 LD IX,($A015) Read the secondary pointer.
E5EA CP (IX+$0F) Compare A with byte 0F of the record at A015 and read the room graphics parameter.
E5ED LD A,($A035)
LookUpCurrentObject_ZeroThrough E5F0 JP NZ,ParseInputNumber_ReturnZero Return zero through ParseInputNumber_ReturnZero when that comparison did not match.
E5F3 LD HL,$A034 Go to ParseInputNumber_ReturnZero if A matches the room display parameter at RoomDisplayParameter.
E5F6 CP (HL)
E5F7 JP Z,ParseInputNumber_ReturnZero
E5FA OR %00000001 Reset the zero flag.
E5FC RET Return.
E5FD DEFB $47,$00,$04,$E6 Display record read by ProcessDisplayRecord: flags 47 value 00 handler E604.
Run by CA64 after the display record at E5FD.
E601 OR %00000001 Reset the zero flag.
E603 RET Return.
Reached through the display record at E5FD, dispatched by DispatchLookedUpHandlerThird.
E604 LD A,($A036) Read the character being processed.
E607 CALL GetObjectLocation Call GetObjectLocation to get that character's location.
E60A EX AF,AF' Keep the location.
E60B LD B,A
E60C LD A,($A034) Read the room display parameter.
E60F CALL GetObjectLocation Call GetObjectLocation to get the object's location.
E612 EX AF,AF' Compare the two locations.
E613 CP B
E614 LD A,($A036) Read the character again and jump back to LookUpCurrentObject_ZeroThrough.
E617 JR LookUpCurrentObject_ZeroThrough
Prev: E5C1 Up: Map Next: E619