![]() |
Routines |
| Prev: 55433 | Up: Map | Next: 55556 |
|
Used by the routine at Dispatch_Handlers.
Animates the 19-byte records at *ReferenceMovingObjects.
|
||||
|
Walk the moving-object list.
|
||||
| Handler_MovingObjects | 55444 | LD IX,(25642) | Point IX at the moving-object list. | |
|
Skip inactive objects and expired timers.
|
||||
| Handler_MovingObjects_Loop | 55448 | LD A,(IX+0) | Jump to Handler_MovingObjects_Done if the terminator 255 is reached. | |
| 55451 | CP 255 | |||
| 55453 | JR Z,Handler_MovingObjects_Done | Jump to Handler_MovingObjects_Next if this object is inactive. | ||
| 55455 | BIT 7,A | |||
| 55457 | JR NZ,Handler_MovingObjects_Next | Deactivate the object if its timer is zero. | ||
| 55459 | XOR A | |||
| 55460 | CP (IX+1) | |||
| 55463 | JR NZ,Handler_MovingObjects_Draw | |||
| 55465 | SET 7,(IX+0) | Jump to Handler_MovingObjects_Next. | ||
| 55469 | JR Handler_MovingObjects_Next | |||
|
Set the font and clip window.
|
||||
| Handler_MovingObjects_Draw | 55471 | LD HL,31856 | Use Buffer_ActiveFont, or Graphics_TileFont when the stored font ID differs. | |
| 55474 | CP (IX+18) | |||
| 55477 | JR Z,Handler_MovingObjects_Font | |||
| 55479 | LD HL,36976 | |||
| Handler_MovingObjects_Font | 55482 | LD (23606),HL | Write HL to *CHARS. | |
| 55485 | LD C,(IX+16) | Write the object's clip window to *ClipWindow. | ||
| 55488 | LD B,(IX+17) | |||
| 55491 | LD (25625),BC | |||
| 55495 | CALL JumpTable_AdvanceEntity | Call JumpTable_AdvanceEntity. | ||
|
Test the moving edge against the stored limit.
|
||||
| 55498 | LD A,(IX+9) | Compare the moving edge against the stored limit. | ||
| 55501 | OR A | |||
| 55502 | LD A,B | |||
| 55503 | JR NZ,Handler_MovingObjects_LimitHit | |||
| 55505 | LD A,C | Jump to Handler_MovingObjects_Update if they differ. | ||
| Handler_MovingObjects_LimitHit | 55506 | CP (IX+14) | ||
| 55509 | JR NZ,Handler_MovingObjects_Update | |||
|
Reverse at the stored limit.
|
||||
| 55511 | CALL Reverse_Direction | Call Reverse_Direction. | ||
| 55514 | LD A,(IX+14) | Swap the two limit bytes. | ||
| 55517 | LD B,(IX+15) | |||
| 55520 | LD (IX+15),A | |||
| 55523 | LD (IX+14),B | |||
| 55526 | CALL JumpTable_AdvanceEntity | Call JumpTable_AdvanceEntity. | ||
|
Store, move, draw and erase the object.
|
||||
| Handler_MovingObjects_Update | 55529 | CALL JumpTable_StorePosition | Call JumpTable_StorePosition. | |
| 55532 | CALL JumpTable_MoveEntity | Call JumpTable_MoveEntity. | ||
| 55535 | CALL JumpTable_DrawEntity | Call JumpTable_DrawEntity. | ||
| 55538 | CALL JumpTable_EraseEntity | Call JumpTable_EraseEntity. | ||
|
Advance to the next moving object.
|
||||
| Handler_MovingObjects_Next | 55541 | LD DE,19 | IX+=0019. | |
| 55544 | ADD IX,DE | |||
| 55546 | JR Handler_MovingObjects_Loop | Jump to Handler_MovingObjects_Loop. | ||
|
Restore the default clip window.
|
||||
| Handler_MovingObjects_Done | 55548 | LD BC,536 | Write 536 to *ClipWindow. | |
| 55551 | LD (25625),BC | |||
| 55555 | RET | Return. | ||
| Prev: 55433 | Up: Map | Next: 55556 |