Prev: 30078 Up: Map Next: 30267
30122: Print Game Display
game-display
Used by the routine at GameInitialisation.
PrintGameDisplay 30122 CALL ClearScreen Call ClearScreen.
30125 LD A,5 Write 5 to *Lives.
30127 LD (30777),A
Set the attributes for the "ground".
30130 LD H,90 H=90.
30132 LD B,64 B=64 (counter; two full rows).
GameDisplay_GreenBarLoop 30134 LD (HL),4 Write 4 (INK: GREEN, PAPER: BLACK ) to *HL.
30136 INC L Increment L by one.
30137 DJNZ GameDisplay_GreenBarLoop Decrease counter by one and loop back to GameDisplay_GreenBarLoop until counter is zero.
Draw the "ground".
30139 LD C,4 C=4 (counter; how many times to write the byte).
30141 LD HL,20480 HL=20480 (screen buffer location).
DrawGround_Loop 30144 LD B,64 B=64 (counter; two full rows).
DrawGround_WriteLoop 30146 LD (HL),85 Write 85 to *HL.
30148 INC L Increment L by one.
30149 DJNZ DrawGround_WriteLoop Decrease counter by one and loop back to DrawGround_WriteLoop until counter is zero.
30151 INC H Increment H by two.
30152 INC H
30153 LD L,0 L=0.
30155 DEC C Decrease C by one.
30156 JR NZ,DrawGround_Loop Jump to DrawGround_Loop until C is zero.
30158 LD C,3 C=3.
30160 LD HL,23105 HL=23105 (attribute buffer location).
PrintGameDisplay_0 30163 LD B,4 B=4.
PrintGameDisplay_1 30165 LD (HL),7 Write 7 (INK: WHITE, PAPER: BLACK ) to *HL.
30167 INC L Increment L by one.
30168 DJNZ PrintGameDisplay_1 Decrease counter by one and loop back to PrintGameDisplay_1 until counter is zero.
30170 LD A,L A=L.
30171 ADD A,28 A+=28.
30173 LD L,A L=A.
30174 DEC C Decrease C by one.
30175 JR NZ,PrintGameDisplay_0 Jump to PrintGameDisplay_0 until C is zero.
30177 LD L,192 L=192.
30179 LD B,32 B=32.
PrintGameDisplay_2 30181 LD (HL),7 Write 7 (INK: WHITE, PAPER: BLACK ) to *HL.
30183 INC L Increment L by one.
30184 DJNZ PrintGameDisplay_2 Decrease counter by one and loop back to PrintGameDisplay_2 until counter is zero.
Handles printing "MPH, FUEL, RPM" (bike stats) to the display.
30186 LD C,3 C=3 (counter; three strings).
30188 LD HL,50144 HL=Messaging_MPH.
30191 EXX Switch to the shadow registers.
30192 LD DE,20545 DE'=20545 (screen buffer location).
30195 EXX Switch back to the normal registers.
GameDisplay_StatsLoop 30196 LD B,4 B=4 (counter; number of characters in each string).
30198 CALL Print_Loop Call Print_Loop.
At the end of each string there are two more bytes which build the up/ down arrow shown above "TARGET". This is hidden by the attributes until it's shown in-game by setting the appropriate attribute values.
30201 LD A,(HL) A=*HL.
30202 EXX Switch to the shadow registers.
30203 LD L,A L'=A.
30204 LD A,E E'+=14.
30205 ADD A,14
30207 LD E,A
30208 CALL PrintGraphic Call PrintGraphic.
30211 INC L Increment L by one.
30212 EXX Switch back to the normal registers.
30213 CALL PrintGraphic Call PrintGraphic.
30216 INC L Increment L by one.
30217 EXX Switch to the shadow registers.
30218 LD A,E E'+=12.
30219 ADD A,12
30221 LD E,A
30222 EXX Switch back to the normal registers.
30223 DEC C Decrease C by one.
30224 JR NZ,GameDisplay_StatsLoop Jump to GameDisplay_StatsLoop until C is zero.
Set the screen buffer position.
30226 EXX Switch to the shadow registers.
30227 LD E,192 E'=192.
30229 EXX Switch back to the normal registers.
30230 LD B,6 B=6 (counter; number of characters in the "SCORE-" string).
30232 CALL Print_Loop Call Print_Loop.
Set the screen buffer position.
30235 EXX Switch to the shadow registers.
30236 LD E,212 E'=212.
30238 EXX Switch back to the normal registers.
30239 LD B,7 B=7 (counter; number of characters in the "TARGET-" string).
30241 CALL Print_Loop Call Print_Loop.
30244 LD HL,0 Write 0000 to *Score.
30247 LD (30788),HL
30250 CALL 29740 Call 29740.
30253 LD HL,(30792) HL=*30792.
30256 EXX Switch to the shadow registers.
30257 LD DE,20955 DE'=20955 (screen buffer location).
30260 EXX Switch back to the normal registers.
30261 CALL 29748 Call 29748.
30264 JP InitialiseNewGame Jump to InitialiseNewGame.
Prev: 30078 Up: Map Next: 30267