Prev: D894 Up: Map Next: D9B6
D904: Handler: Room Sixteen
Used by the routine at Dispatch_Handlers.
Special actor for room 16.
Handler_RoomSixteen D904 LD A,($64A2) Return if *CurrentRoom is not 16.
D907 CP $16
D909 RET NZ IX=SpecialActor.
D90A LD IX,$644D
D90E LD BC,$051D Write 051D to *ClipWindow_MinimumColumn.
D911 LD ($641B),BC
D915 BIT 7,(IX+$00) Jump to Handler_RoomSixteen_Draw if the actor is already active.
D919 JR Z,Handler_RoomSixteen_Draw Jump to Handler_RoomSixteen_Column if the player row is 07 14 or 11.
D91B LD A,($64A5)
D91E CP $07
D920 JR Z,Handler_RoomSixteen_Column
D922 CP $14 Jump to Handler_RoomSixteen_Done.
D924 JR Z,Handler_RoomSixteen_Column
D926 CP $11
D928 JP NZ,Handler_RoomSixteen_Done
Handler_RoomSixteen_Column D92B LD A,($64A4) Jump to Handler_RoomSixteen_Done unless the player column is 0F-16.
D92E CP $17
D930 JP NC,Handler_RoomSixteen_Done
D933 CP $0F Return to Handler_RoomSixteen_Done unless JumpTable_GetRandomNumber is less than DC.
D935 JR C,Handler_RoomSixteen_Done
D937 CALL JumpTable_GetRandomNumber
D93A CP $DC Call JumpTable_SpawnEntity with sprite E6.
D93C JR NC,Handler_RoomSixteen_Done
D93E LD A,$E6
D940 LD L,$47
D942 LD DE,$0101 Jump to Handler_RoomSixteen_Right if JumpTable_GetRandomNumber is 80 or higher.
D945 CALL JumpTable_SpawnEntity
D948 CALL JumpTable_GetRandomNumber Write the left-moving frame into the actor.
D94B CP $80
D94D JR NC,Handler_RoomSixteen_Right
D94F LD (IX+$00),$1E
D953 LD (IX+$0A),$1E
D957 LD (IX+$08),$FB Jump to Handler_RoomSixteen_Sound.
D95B JR Handler_RoomSixteen_Sound
Handler_RoomSixteen_Right D95D LD (IX+$00),$05 Write the right-moving frame into the actor.
D961 LD (IX+$0A),$05
D965 LD (IX+$08),$05
Play a short beep.
Handler_RoomSixteen_Sound D969 LD B,$FF B=FF.
D96B LD D,$32 D=32.
D96D CALL Play_Click Call Play_Click.
D970 LD A,($64A5) Jump to Handler_RoomSixteen_RowLow if the player row is 14.
D973 CP $14
D975 JR Z,Handler_RoomSixteen_RowLow
D977 CP $11 Jump to Handler_RoomSixteen_RowHigh if the player row is 11.
D979 JR Z,Handler_RoomSixteen_RowHigh
D97B CALL JumpTable_GetRandomNumber Jump to Handler_RoomSixteen_RowHigh if JumpTable_GetRandomNumber is 80 or higher.
D97E CP $80
D980 JR NC,Handler_RoomSixteen_RowHigh
Handler_RoomSixteen_RowLow D982 LD (IX+$01),$13 Write row 13 into the actor.
D986 LD (IX+$0B),$13
D98A JR Handler_RoomSixteen_Draw Jump to Handler_RoomSixteen_Draw.
Handler_RoomSixteen_RowHigh D98C LD (IX+$01),$10 Write row 10 into the actor.
D990 LD (IX+$0B),$10
Handler_RoomSixteen_Draw D994 CALL JumpTable_AdvanceEntity Call JumpTable_AdvanceEntity.
D997 CALL JumpTable_StorePosition Call JumpTable_StorePosition.
D99A CALL JumpTable_MoveEntity Call JumpTable_MoveEntity.
D99D CALL JumpTable_DrawEntity Call JumpTable_DrawEntity.
D9A0 CALL JumpTable_EraseEntity Call JumpTable_EraseEntity.
D9A3 LD A,(IX+$00) Deactivate the actor once column 23 is passed.
D9A6 CP $23
D9A8 JR C,Handler_RoomSixteen_Done
D9AA LD (IX+$00),$80
Handler_RoomSixteen_Done D9AE LD BC,$0121 Write 0121 to *ClipWindow_MinimumColumn.
D9B1 LD ($641B),BC
D9B5 RET Return.
Prev: D894 Up: Map Next: D9B6