Prev: 49922 Up: Map Next: 50013
49955: 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 49955 CALL ClearScreenBuffer Call ClearScreenBuffer to clear the buffer.
49958 LD A,70 Set the attribute in A to bright yellow ink on a black paper.
49960 CALL FillAttributes Call FillAttributes to set all the attributes to it.
49963 CALL PrintBorder Call PrintBorder to draw the frame.
49966 LD DE,50013 Take the colours of the lines, GameOverColours.
49969 EXX Switch to the shadow registers.
49970 LD HL,50016 Take the positions of the lines, GameOverPositions.
49973 LD DE,50022 Take the text of the lines, GameOverText.
49976 LD B,3 Set a counter in BC' of three lines.
49978 CALL DisplayMenu_Next Call DisplayMenu_Next to draw the lines of text.
Print the percentage of the quest that was done.
49981 CALL PrintQuestPercentage Call PrintQuestPercentage to print the percentage of the quest that was done.
49984 XOR A Write 0 to BorderDrawnFlag, so that the frame will be drawn next time.
49985 LD (42804),A
49988 CALL UpdateScreen Call UpdateScreen to copy the buffer to the screen.
Play the game over tune.
49991 LD DE,55379 Take the game over tune, GameOverTune.
49994 CALL PlayMusic Call PlayMusic to play it.
Wait for a time.
49997 LD B,64 Set a counter in B of 64 loops.
ShowGameOverScreen_Wait 49999 LD HL,8192 Set a counter in HL of 8192.
ShowGameOverScreen_Count 50002 DEC HL Decrease the counter.
50003 LD A,H Fetch the high byte of it.
50004 OR L Combine it with the low byte.
50005 JR NZ,ShowGameOverScreen_Count Jump to ShowGameOverScreen_Count until the delay has run out.
50007 DJNZ ShowGameOverScreen_Wait Repeat the delay for each of the remaining passes.
Throw away the return address, and start again.
50009 POP HL Take the return address off the stack.
50010 JP RunGame_Restart Jump to RunGame_Restart to start the game again.
Prev: 49922 Up: Map Next: 50013