Prev: 9A85 Up: Map Next: 9ACD
9AA0: Turn: Use A Special Object
Used by the routines at Turn_WakeAnAnimal and Turn_GateTheMessage.
Uses a special object. It scans the seven-byte records until the id is FF and looks that id up in the table.
Turn_UseASpecialObject 9AA0 PUSH IY Call TableFindASpecialObject to find the special-object record.
9AA2 PUSH IX
9AA4 CALL TableFindASpecialObject
9AA7 CP $FF Jump to Turn_UseASpecialObject_RestoreTheSpecialObject if the termination character was reached.
9AA9 JR Z,Turn_UseASpecialObject_RestoreTheSpecialObject
9AAB LD L,(IY+$04) Read the low byte of the table pointer on this special-object record.
9AAE LD H,(IY+$05) Read the high byte of that table pointer.
9AB1 PUSH HL Point IX at the table named by this special entry.
9AB2 POP IX
9AB4 LD A,B Use the result again.
9AB5 CALL IndexIdTable Call IndexIdTable to look this id up in the table.
9AB8 CP $FF Jump to Turn_UseASpecialObject_RestoreTheSpecialObject if the termination character was reached.
9ABA JR Z,Turn_UseASpecialObject_RestoreTheSpecialObject
9ABC LD L,(IX+$01) Store the address IndexIdTable found into bytes 2 and 3 of this special-object record.
9ABF LD H,(IX+$02)
9AC2 LD (IY+$02),L
9AC5 LD (IY+$03),H
Turn_UseASpecialObject_RestoreTheSpecialObject 9AC8 POP IX Restore IX and IY from the stack.
9ACA POP IY
9ACC RET Return.
Prev: 9A85 Up: Map Next: 9ACD