Prev: 9ADB Up: Map Next: 9AEE
9ADC: Find an object's handler for an action
Searches the list of action handlers at the end of the object record at IX (after the header, the four word slots and its location bytes; see C00B) for action A, using 9D12. As with 9D12, the found/not-found sense is NZ/carry set = found, Z set = not found - the opposite of what the names Z and 'zero' suggest. Returns IX at the matching entry (or the list's $FF terminator).
Input
A Action
IX Object record
Output
F NZ or carry set if the object has its own handler for the action; Z set if not
9ADC PUSH DE Save DE for the caller
9ADD LD D,A D = the action we are looking for a handler for
9ADE LD A,(IX+$00) A = the number of locations this object has (1 for most things, 2 for a door)...
9AE1 ADD A,$10 ...plus 16, the size of the record's fixed part: this gives the offset, from the start of the record, to where its own list of action handlers begins
9AE3 LD E,A E = that offset
9AE4 LD A,D D = the action again...
9AE5 LD D,$00
9AE7 ADD IX,DE IX = the start of this object's own list of handlers
9AE9 CALL $9D12 Search that list for the action (see 9D12: NZ or carry set means found)
9AEC POP DE Restore the caller's DE
9AED RET
Prev: 9ADB Up: Map Next: 9AEE