![]() |
Routines |
| Prev: 97BD | Up: Map | Next: 97FF |
|
Used by the routines at UpdateType19 and UpdateType14.
Counts down a timer for an object and, when it has expired, runs the behaviour code for its type from the table at BehaviourTable.
|
||||||||
| RunObjectBehaviour | 97DF | BIT 7,(IX+$16) | Jump to RunObjectBehaviour_Run if bit 7 of the third state byte of the object is set. | |||||
| 97E3 | JR NZ,RunObjectBehaviour_Run | |||||||
| 97E5 | DEC (IX+$15) | Count down the lifetime of the object. | ||||||
| 97E8 | RET NZ | Return if it has not run out. | ||||||
| 97E9 | LD A,($9BCC) | Fetch the second byte of the random seed. | ||||||
| 97EC | AND %00011111 | Keep five bits. | ||||||
| 97EE | INC A | Add one. | ||||||
| 97EF | LD (IX+$15),A | Restart the lifetime of the object. | ||||||
| RunObjectBehaviour_Run | 97F2 | LD A,(IX+$00) | Fetch the type of the object. | |||||
| 97F5 | SUB $13 | Subtract 13. | ||||||
| 97F7 | LD C,A | Copy it into C. | ||||||
| 97F8 | LD HL,$993B | Use the table at BehaviourTable. | ||||||
| 97FB | CALL GetTableEntry | Fetch the address of the code from the table. | ||||||
| 97FE | JP (HL) | Run it. | ||||||
| Prev: 97BD | Up: Map | Next: 97FF |