Prev: 993C Up: Map Next: 9A4B
9A22: Lose Game
Used by the routine at MainLoop.
Shows the message that is used when every sector has been destroyed, plays the defeat tune and then ends the game.
LoseGame 9A22 LD A,$47 Use bright white on black as the attribute.
9A24 CALL ClearPlayWindowWithAttributes Clear the play window using ClearPlayWindowWithAttributes.
9A27 LD DE,$9B26 Point DE' at the attributes of the four lines of text (see DefeatMessage_Attributes).
9A2A EXX Switch to the shadow registers, as PrintTextList expects the attributes there.
9A2B LD HL,$9B2A Point HL at DefeatMessage_Coordinates.
9A2E LD DE,$9B32 Point DE at DefeatMessage_Text.
9A31 LD B,$04 There are four lines to print.
9A33 CALL PrintTextList Print them using PrintTextList.
9A36 LD DE,$C2E9 Point DE at GameLostTune.
9A39 CALL PlayMusic Play it using PlayMusic.
This entry point is used by the routine at EndRound.
This entry point waits for a while and then ends the game.
LoseGame_Wait 9A3C LD HL,$0000 Set up a delay of 10000 iterations of the outer loop...
9A3F LD B,$00 ...using B as the second counter.
LoseGame_Delay 9A41 DEC H Count down.
9A42 LD A,L Loop back until the high byte has counted down to zero.
9A43 OR H
9A44 JR NZ,LoseGame_Delay
9A46 DJNZ LoseGame_Delay Loop back until B has counted down to zero too.
9A48 JP GameOver End the game using GameOver.
Prev: 993C Up: Map Next: 9A4B