Prev: 55556 Up: Map Next: 55829
55734: Handler: Room Seven
Used by the routine at Dispatch_Handlers.
Two balls in room 7 stored at SpecialActor.
Return unless this is room 7.
Handler_RoomSeven 55734 LD IX,25677 Point IX at SpecialActor.
55738 LD A,(25762) Return if *CurrentRoom is not 7.
55741 CP 7
55743 RET NZ
Clip drawing to a maximum row of 14.
55744 LD A,14 Write 14 to *ClipWindow_MaximumRow.
55746 LD (25626),A
55749 LD B,2 Set the ball count to 2.
Process each ball.
Handler_RoomSeven_Loop 55751 PUSH BC Stash the ball count on the stack.
Draw the ball if it is already active.
55752 LD A,(IX+0) Jump to Handler_RoomSeven_Move if this ball is already active.
55755 BIT 7,A
55757 JR Z,Handler_RoomSeven_Move
Spawn on a random roll.
55759 CALL JumpTable_GetRandomNumber Jump to Handler_RoomSeven_Next if the random number is 190 or higher.
55762 CP 190
55764 JR NC,Handler_RoomSeven_Next
sprite-e7
55766 AND %00001111 Keep only bits 0-3.
55768 ADD A,9 Spawn the ball at row 25 column 9-24 sprite 231, colour YELLOW (BRIGHT) and size 1 by 1.
55770 LD C,A
55771 LD B,25
55773 LD DE,257
55776 LD L,70
55778 LD A,231
55780 CALL JumpTable_SpawnEntity
55783 LD (IX+9),250 Write 250 as the vertical delta.
Hide the ball once it has reached row 12.
Handler_RoomSeven_Move 55787 LD A,(IX+1) Deactivate the ball if it has reached row 12.
55790 CP 12
55792 JR NZ,Handler_RoomSeven_Draw
55794 SET 7,(IX+0)
55798 JR Handler_RoomSeven_Next Jump to Handler_RoomSeven_Next.
Store, move, draw and erase the ball.
Handler_RoomSeven_Draw 55800 CALL JumpTable_AdvanceEntity Call JumpTable_AdvanceEntity.
55803 CALL JumpTable_StorePosition Call JumpTable_StorePosition.
55806 CALL JumpTable_MoveEntity Call JumpTable_MoveEntity.
55809 CALL JumpTable_DrawEntity Call JumpTable_DrawEntity.
55812 CALL JumpTable_EraseEntity Call JumpTable_EraseEntity.
Step to the next ball.
Handler_RoomSeven_Next 55815 POP BC Restore the ball count from the stack.
55816 LD DE,14 IX+=0014.
55819 ADD IX,DE
55821 DJNZ Handler_RoomSeven_Loop Decrease the ball count and loop back to Handler_RoomSeven_Loop.
Reset the clip maximum row.
55823 LD A,2 Write 2 to *ClipWindow_MaximumRow.
55825 LD (25626),A
55828 RET Return.
Prev: 55556 Up: Map Next: 55829