Prev: 39458 Up: Map Next: 39589
39499: Win Round
Used by the routine at MainLoop.
Shows the message that is used when every sector has been activated and plays the victory tune. The robot then starts a new round on a fresh map with two more lives, up to a maximum of nine.
WinRound 39499 LD A,71 Use bright white on black as the attribute.
39501 CALL ClearPlayWindowWithAttributes Clear the play window using ClearPlayWindowWithAttributes.
39504 LD DE,39792 Point DE' at the attributes of the five lines of text (see VictoryMessage_Attributes).
39507 EXX Switch to the shadow registers, as PrintTextList expects the attributes there.
39508 LD HL,39797 Point HL at VictoryMessage_Coordinates.
39511 LD DE,39807 Point DE at VictoryMessage_Text.
39514 LD B,5 There are five lines to print.
39516 CALL PrintTextList Print them using PrintTextList.
This entry point is used by the routine at EndRound.
The game comes here when the player has activated eight sectors and destroyed the last one.
WinRound_Tune 39519 LD DE,49831 Point DE at the tune that is played when the round is won.
39522 CALL PlayMusic Play it using PlayMusic.
39525 CALL DrawGameScreen Reset the map and the screen for a new round using DrawGameScreen.
39528 LD HL,38539 Point HL at Lives.
39531 LD A,(HL) Fetch the number of lives.
39532 ADD A,2 Add two lives.
39534 CP 9 Jump if the total is below 9.
39536 JR C,WinRound_StoreLives
39538 LD A,9 Otherwise limit it to nine lives.
WinRound_StoreLives 39540 LD (HL),A Store the number of lives.
39541 LD HL,38433 Point HL at the variables that describe the state of the previous round.
39544 LD BC,105 There are 105 bytes to clear.
39547 CALL FillMemory Zero them using FillMemory.
39550 LD HL,38544 Point HL at Entities.
39553 LD BC,304 The first 19 entities are cleared. The rest are templates for the map.
39556 CALL FillMemory Zero them using FillMemory.
39559 LD A,71 Use bright white on black as the attribute.
39561 CALL ClearPlayWindowWithAttributes Clear the play window using ClearPlayWindowWithAttributes.
39564 CALL SetRobotFacing Set the number of the sprite shown when the robot is starting using SetRobotFacing.
39567 CALL StartRobot Put the robot back at the start using StartRobot.
39570 XOR A Set the displayed battery level to zero, so that the bar fills up from the left.
39571 LD (38460),A
39574 CALL DrawSectorMap Colour the cells of the sector map using DrawSectorMap.
39577 CALL DrawPanel Draw the panel using DrawPanel.
39580 CALL PrintScore Print the score using PrintScore.
39583 CALL PrintHiScore Print the hi-score using PrintHiScore.
39586 JP StartRound Start the round using StartRound.
Prev: 39458 Up: Map Next: 39589