Prev: 30005 Up: Map Next: 30077
30031: Initialise New Game
Used by the routine at PrintGameDisplay.
InitialiseNewGame 30031 CALL PrintDemoMode Call PrintDemoMode.
"Spend" a life to continue, or move to Game Over.
SpendLife 30034 LD HL,30777 Decrease *Lives by one.
30037 DEC (HL)
Compare the players current lives with the maximum number of lives (4).
30038 LD C,(HL) C=*Lives.
30039 LD A,4 A=4 (the maximum number of lives).
30041 EXX Switch to the shadow registers.
30042 LD DE,20683 DE'=20683 (screen buffer location).
30045 EXX Switch back to the normal registers.
30046 SUB C A-=C.
30047 JR Z,TestGameOver Jump to TestGameOver if A is zero.
30049 ADD A,A B=A*2.
30050 LD B,A
InitialiseNewGame_0 30051 EXX Switch to the shadow registers.
30052 LD L,100 L=100.
30054 CALL PrintGraphic Call PrintGraphic.
30057 DJNZ InitialiseNewGame_0 Decrease counter by one and loop back to InitialiseNewGame_0 until counter is zero.
TestGameOver 30059 LD A,C Jump to GameOver if C is zero.
30060 AND A
30061 JR Z,GameOver
Display the bike graphic for each remaining life.
30063 LD B,C B=C (counter; current number of lives).
PrintLives 30064 EXX Switch to the shadow registers.
30065 LD L,156 L'=156.
Print the left side of the bike graphic.
30067 CALL PrintGraphic Call PrintGraphic.
30070 EXX Switch back to the normal registers.
Print the right side of the bike graphic.
30071 CALL PrintGraphic Call PrintGraphic.
30074 DJNZ PrintLives Decrease counter by one and loop back to PrintLives until counter is zero.
30076 RET Return.
Prev: 30005 Up: Map Next: 30077