Prev: 98AE Up: Map Next: 993C
9906: Handler: The Block
Animate The Block, or clear the slot once it has moved off the screen in the direction it is travelling.
Input
IX Actor slot
Handler_Block 9906 LD H,(IX+$03) Fetch the high byte of the world X.
9909 LD L,(IX+$02) Fetch the low byte of the world X.
990C LD DE,($607A) Fetch Jetman_Position.
9910 AND A Subtract the scroll position.
9911 SBC HL,DE
9913 BIT 7,(IX+$05) Jump to Handler_Block_StillOnScreen if the horizontal speed is negative.
9917 JR NZ,Handler_Block_StillOnScreen
9919 LD A,H Fetch the high byte of the gap.
991A AND %00011111 Keep only bits 0-4.
991C CP $01 Jump to Handler_Block_ClearType if the alien has left the screen.
991E JR Z,Handler_Block_ClearType
Select the animation frame for The Block.
Handler_Block_Animation 9920 INC (IX+$11) Increase the animation timer.
9923 LD A,(IX+$11) Fetch the animation timer.
9926 AND %00000111 Keep only bits 0-2.
Sprite IDs begin at 88 ("The Block: Frame 1").
9928 ADD A,$88 Add 88 for these frames.
992A LD (IX+$00),A Write it to the actor type.
992D JP PlaceSpawnedAlien_Age Jump to PlaceSpawnedAlien_Age.
When The Block is moving left, test whether it has left the left edge.
Handler_Block_StillOnScreen 9930 LD A,H Fetch the high byte of the gap.
9931 OR %11100000 Set bits 5-7.
9933 CP $FE Jump to Handler_Block_Animation if the alien has not left the left edge.
9935 JR NZ,Handler_Block_Animation
This entry point is used by the routine at PlaceSpawnedAlien.
Handler_Block_ClearType 9937 LD (IX+$00),$00 Write 00 to the actor type.
993B RET Return.
Prev: 98AE Up: Map Next: 993C