Prev: 55444 Up: Map Next: 55734
55556: Handler: Room Sixteen
Used by the routine at Dispatch_Handlers.
Special actor for room 22.
Handler_RoomSixteen 55556 LD A,(25762) Return if *CurrentRoom is not 22.
55559 CP 22
55561 RET NZ IX=SpecialActor.
55562 LD IX,25677
55566 LD BC,1309 Write 1309 to *ClipWindow_MinimumColumn.
55569 LD (25627),BC
55573 BIT 7,(IX+0) Jump to Handler_RoomSixteen_Draw if the actor is already active.
55577 JR Z,Handler_RoomSixteen_Draw Jump to Handler_RoomSixteen_Column if the player row is 7 20 or 17.
55579 LD A,(25765)
55582 CP 7
55584 JR Z,Handler_RoomSixteen_Column
55586 CP 20 Jump to Handler_RoomSixteen_Done.
55588 JR Z,Handler_RoomSixteen_Column
55590 CP 17
55592 JP NZ,Handler_RoomSixteen_Done
Handler_RoomSixteen_Column 55595 LD A,(25764) Jump to Handler_RoomSixteen_Done unless the player column is 15-22.
55598 CP 23
55600 JP NC,Handler_RoomSixteen_Done
55603 CP 15 Return to Handler_RoomSixteen_Done unless JumpTable_GetRandomNumber is less than 220.
55605 JR C,Handler_RoomSixteen_Done
55607 CALL JumpTable_GetRandomNumber
55610 CP 220 Call JumpTable_SpawnEntity with sprite 230.
55612 JR NC,Handler_RoomSixteen_Done
55614 LD A,230
55616 LD L,71
55618 LD DE,257 Jump to Handler_RoomSixteen_Right if JumpTable_GetRandomNumber is 128 or higher.
55621 CALL JumpTable_SpawnEntity
55624 CALL JumpTable_GetRandomNumber Write the left-moving frame into the actor.
55627 CP 128
55629 JR NC,Handler_RoomSixteen_Right
55631 LD (IX+0),30
55635 LD (IX+10),30
55639 LD (IX+8),251 Jump to Handler_RoomSixteen_Sound.
55643 JR Handler_RoomSixteen_Sound
Handler_RoomSixteen_Right 55645 LD (IX+0),5 Write the right-moving frame into the actor.
55649 LD (IX+10),5
55653 LD (IX+8),5
Play a short beep.
Handler_RoomSixteen_Sound 55657 LD B,255 B=255.
55659 LD D,50 D=50.
55661 CALL Play_Click Call Play_Click.
55664 LD A,(25765) Jump to Handler_RoomSixteen_RowLow if the player row is 20.
55667 CP 20
55669 JR Z,Handler_RoomSixteen_RowLow
55671 CP 17 Jump to Handler_RoomSixteen_RowHigh if the player row is 17.
55673 JR Z,Handler_RoomSixteen_RowHigh
55675 CALL JumpTable_GetRandomNumber Jump to Handler_RoomSixteen_RowHigh if JumpTable_GetRandomNumber is 128 or higher.
55678 CP 128
55680 JR NC,Handler_RoomSixteen_RowHigh
Handler_RoomSixteen_RowLow 55682 LD (IX+1),19 Write row 19 into the actor.
55686 LD (IX+11),19
55690 JR Handler_RoomSixteen_Draw Jump to Handler_RoomSixteen_Draw.
Handler_RoomSixteen_RowHigh 55692 LD (IX+1),16 Write row 16 into the actor.
55696 LD (IX+11),16
Handler_RoomSixteen_Draw 55700 CALL JumpTable_AdvanceEntity Call JumpTable_AdvanceEntity.
55703 CALL JumpTable_StorePosition Call JumpTable_StorePosition.
55706 CALL JumpTable_MoveEntity Call JumpTable_MoveEntity.
55709 CALL JumpTable_DrawEntity Call JumpTable_DrawEntity.
55712 CALL JumpTable_EraseEntity Call JumpTable_EraseEntity.
55715 LD A,(IX+0) Deactivate the actor once column 35 is passed.
55718 CP 35
55720 JR C,Handler_RoomSixteen_Done
55722 LD (IX+0),128
Handler_RoomSixteen_Done 55726 LD BC,289 Write 289 to *ClipWindow_MinimumColumn.
55729 LD (25627),BC
55733 RET Return.
Prev: 55444 Up: Map Next: 55734