Prev: 29409 Up: Map Next: 29543
29454: Handler: Room 6
Handles room 6 logic (the starting screen). The current level in B controls which objects are initialised or activated on each pass, progressively setting up more objects as the level increases.
Levels Baddies
1 Spider
2 Cat, UFO
3 Spider, Cat, Helicopter
4 Spider, Cat, Helicopter, Plane
5+ Cat, Helicopter, Plane, Walking Paratrooper
Input
B Current level
Handler_Room06 29454 LD A,B Copy the current level into A.
Add the spider during levels 1 3 and 4.
29455 LD IX,56008 IX=Sprite02_3Wide_X_Position.
29459 PUSH AF Stash the current level on the stack.
29460 CP 1 Call Handler_Spider if this is level 1, 3 or 4.
29462 CALL Z,Handler_Spider
29465 CP 3
29467 CALL Z,Handler_Spider
29470 CP 4
29472 CALL Z,Handler_Spider
29475 POP AF Restore the current level from the stack.
Add a cat (return early if still in level 1).
29476 LD IX,56012 IX=Sprite03_3Wide_X_Position.
29480 CP 1 Return if this is level 1.
29482 RET Z
29483 PUSH AF Stash the current level on the stack.
29484 CALL Handler_Cat Call Handler_Cat.
29487 POP AF Restore the current level from the stack.
Add the UFO if level 2 or the helicopter for level 3 and above.
29488 LD IX,56016 IX=Sprite04_3Wide_X_Position.
29492 CP 2 Is this level 2?
29494 PUSH AF Stash the current level on the stack.
29495 CALL Z,Handler_UFO Call Handler_UFO if this is level 2.
29498 POP AF Restore the current level from the stack.
29499 RET Z Return if this was level 2.
29500 PUSH AF Stash the current level on the stack.
29501 CALL Handler_Helicopter Call Handler_Helicopter.
29504 POP AF Restore the current level from the stack.
29505 CP 3 Return if this is level 3.
29507 RET Z Return.
Add the fourth object (plane) during level 4.
29508 LD IX,56020 IX=Sprite05_3Wide_X_Position.
29512 PUSH AF Stash the current level on the stack.
29513 LD IY,29965 IY=Helicopter_State_Data_2.
29517 CP 4 Call Handler_Helicopter_Entry if this is level 4.
29519 CALL Z,Handler_Helicopter_Entry
29522 POP AF Restore the current level from the stack.
29523 CP 4 Return if this is level 4.
29525 RET Z Return.
Add the walking paratrooper from level 5 onwards.
29526 LD IX,56024 IX=Sprite06_3Wide_X_Position.
29530 PUSH AF Stash the current level on the stack.
29531 CALL Handler_Walking_Paratrooper Call Handler_Walking_Paratrooper.
29534 POP AF Restore the current level from the stack.
Update the fourth object (plane).
29535 LD IX,56020 IX=Sprite05_3Wide_X_Position.
29539 CALL Handler_Plane Call Handler_Plane.
29542 RET Return.
Prev: 29409 Up: Map Next: 29543