Prev: 9A4B Up: Map Next: 9AFA
9AA5: End Round
Used by the routines at MainLoop and LoseLife.
Used when every sector has either been destroyed or activated. It shows how many of each there are. If at least eight sectors have been activated then the player goes on to the next round, and otherwise the game is lost.
EndRound 9AA5 LD A,($9659) Fetch the number of sectors that have been destroyed.
9AA8 ADD A,$30 Convert it into a digit...
9AAA LD ($9B00),A ...and write it into the text of the message that shows it (see Message_SectorsDestroyed).
9AAD LD A,($9658) Fetch the number of sectors that have been activated.
9AB0 ADD A,$30 Convert it into a digit...
9AB2 LD ($9B13),A ...and write it into the text of the message that shows it (see Message_SectorsActivated).
9AB5 LD A,$47 Use bright white on black as the attribute.
9AB7 CALL ClearPlayWindowWithAttributes Clear the play window using ClearPlayWindowWithAttributes.
9ABA LD DE,$9AFA Point DE' at the attributes of the two lines of text (see RoundResult_Attributes).
9ABD EXX Switch to the shadow registers, as PrintTextList expects the attributes there.
9ABE LD HL,$9AFC Point HL at RoundResult_Coordinates.
9AC1 LD DE,$9B00 Point DE at Message_SectorsDestroyed.
9AC4 LD B,$02 There are two lines to print.
9AC6 CALL PrintTextList Print them using PrintTextList.
9AC9 LD A,($9658) Fetch the number of sectors that have been activated.
9ACC CP $08 Jump if at least eight sectors have been activated.
9ACE JR NC,EndRound_Continue
9AD0 LD DE,$9B28 Point DE' at the attributes of the last two lines of the defeat message.
9AD3 EXX Switch to the shadow registers.
9AD4 LD HL,$9B2E Point HL at DefeatMessage_Coordinates_LastLines.
9AD7 LD DE,$9B51 Point DE at DefeatMessage_TextFailed.
9ADA LD B,$02 There are two lines to print.
9ADC CALL PrintTextList Print them using PrintTextList.
9ADF LD DE,$C2E9 Point DE at GameLostTune.
9AE2 CALL PlayMusic Play it using PlayMusic.
9AE5 JP LoseGame_Wait Wait for a while and end the game using LoseGame_Wait.
The player has activated at least eight sectors.
EndRound_Continue 9AE8 LD DE,$9B73 Point DE' at the attributes of the last two lines of the victory message.
9AEB EXX Switch to the shadow registers.
9AEC LD HL,$9B7B Point HL at VictoryMessage_Coordinates_LastLines.
9AEF LD DE,$9BAC Point DE at VictoryMessage_TextContinue.
9AF2 LD B,$02 There are two lines to print.
9AF4 CALL PrintTextList Print them using PrintTextList.
9AF7 JP WinRound_Tune Play the victory tune and start the next round using WinRound_Tune.
Prev: 9A4B Up: Map Next: 9AFA