Prev: 39557 Up: Map Next: 39629
39584: 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 255 and looks that id up in the table.
Turn_UseASpecialObject 39584 PUSH IY Call TableFindASpecialObject to find the special-object record.
39586 PUSH IX
39588 CALL TableFindASpecialObject
39591 CP 255 Jump to Turn_UseASpecialObject_RestoreTheSpecialObject if the termination character was reached.
39593 JR Z,Turn_UseASpecialObject_RestoreTheSpecialObject
39595 LD L,(IY+4) Read the low byte of the table pointer on this special-object record.
39598 LD H,(IY+5) Read the high byte of that table pointer.
39601 PUSH HL Point IX at the table named by this special entry.
39602 POP IX
39604 LD A,B Use the result again.
39605 CALL IndexIdTable Call IndexIdTable to look this id up in the table.
39608 CP 255 Jump to Turn_UseASpecialObject_RestoreTheSpecialObject if the termination character was reached.
39610 JR Z,Turn_UseASpecialObject_RestoreTheSpecialObject
39612 LD L,(IX+1) Store the address IndexIdTable found into bytes 2 and 3 of this special-object record.
39615 LD H,(IX+2)
39618 LD (IY+2),L
39621 LD (IY+3),H
Turn_UseASpecialObject_RestoreTheSpecialObject 39624 POP IX Restore IX and IY from the stack.
39626 POP IY
39628 RET Return.
Prev: 39557 Up: Map Next: 39629