Prev: C302 Up: Map Next: C35D
C323: Show Game Over Screen
Used by the routine at LoseLife.
Shows the screen for the end of the game, with the percentage of the quest that has been done. Once the tune has played and there has been a pause, the game starts again from the menu.
The game over screen
show-game-over
Show the game over screen.
ShowGameOverScreen C323 CALL ClearScreenBuffer Call ClearScreenBuffer to clear the buffer.
C326 LD A,$46 Set the attribute in A to bright yellow ink on a black paper.
C328 CALL FillAttributes Call FillAttributes to set all the attributes to it.
C32B CALL PrintBorder Call PrintBorder to draw the frame.
C32E LD DE,$C35D Take the colours of the lines, GameOverColours.
C331 EXX Switch to the shadow registers.
C332 LD HL,$C360 Take the positions of the lines, GameOverPositions.
C335 LD DE,$C366 Take the text of the lines, GameOverText.
C338 LD B,$03 Set a counter in BC' of three lines.
C33A CALL DisplayMenu_Next Call DisplayMenu_Next to draw the lines of text.
Print the percentage of the quest that was done.
C33D CALL PrintQuestPercentage Call PrintQuestPercentage to print the percentage of the quest that was done.
C340 XOR A Write 00 to BorderDrawnFlag, so that the frame will be drawn next time.
C341 LD ($A734),A
C344 CALL UpdateScreen Call UpdateScreen to copy the buffer to the screen.
Play the game over tune.
C347 LD DE,$D853 Take the game over tune, GameOverTune.
C34A CALL PlayMusic Call PlayMusic to play it.
Wait for a time.
C34D LD B,$40 Set a counter in B of 40 loops.
ShowGameOverScreen_Wait C34F LD HL,$2000 Set a counter in HL of 2000.
ShowGameOverScreen_Count C352 DEC HL Decrease the counter.
C353 LD A,H Fetch the high byte of it.
C354 OR L Combine it with the low byte.
C355 JR NZ,ShowGameOverScreen_Count Jump to ShowGameOverScreen_Count until the delay has run out.
C357 DJNZ ShowGameOverScreen_Wait Repeat the delay for each of the remaining passes.
Throw away the return address, and start again.
C359 POP HL Take the return address off the stack.
C35A JP RunGame_Restart Jump to RunGame_Restart to start the game again.
Prev: C302 Up: Map Next: C35D