Prev: 63824 Up: Map Next: 64376
64000: High Score Entry
Used by the routine at New_Game.
New_HighScore 64000 CALL HighScore
64003 JP HighScore_Input
HighScore 64006 LD DE,23424 Copies $40 bytes of data from HL to Print_TwoToneText_Alias.
64009 LD BC,64
64012 LDIR
64014 LD A,48 Writes "0" ($30 in ASCII) to HighScore_Text_Buffer.
64016 LD (64404),A
64019 CALL HighScore_Clear_Screen Call HighScore_Clear_Screen.
64022 LD HL,16448 Writes $4040 to 64496.
64025 LD (64496),HL
64028 PUSH IX
64030 CALL 64521 Call 64521.
64033 LD (64343),A
64036 POP IX
64038 CP 31
64040 LD A,1
64042 JP Z,New_HighScore_1
64045 LD HL,16384
64048 LD (64496),HL
64051 LD A,(64343)
64054 CALL HighScore_Position
64057 LD DE,25071
64060 PUSH DE
64061 EX DE,HL
64062 AND A
64063 SBC HL,DE
64065 PUSH HL
64066 POP BC
64067 POP HL
64068 LD DE,25087
64071 INC BC
64072 LDDR
64074 LD A,(64343)
64077 DEC A
64078 CALL 64511
64081 LD DE,25337
64084 PUSH DE
64085 EX DE,HL
64086 AND A
64087 SBC HL,DE
64089 PUSH HL
64090 POP BC
64091 POP HL
64092 LD DE,25343
64095 INC BC
64096 LDDR
64098 LD A,(64343)
64101 CALL 64511
64104 DEC HL
64105 EX DE,HL
64106 PUSH IX
64108 POP HL
64109 LD B,6
New_HighScore_0 64111 LD A,(HL)
64112 ADD A,48
64114 LD (DE),A
64115 DEC DE
64116 INC HL
64117 DJNZ New_HighScore_0
64119 LD HL,23488 Overwrites the text at Dueller_01 with spaces to "blank" it out ($12 characters).
64122 LD DE,23489
64125 LD BC,17
64128 LD (HL),32
64130 LDIR
64132 LD (HL),255 Set a string termination character ($FF) at the end of the string.
64134 CALL HighScore_Clear_Screen
64137 LD HL,64376 Points to HighScore_Title and sends it to Print_TwoToneText_Alias.
Value Ink Paper Bright
7 7 0 0
3 3 0 0
64140 LD DE,18434
64143 LD BC,1795
64146 CALL Print_TwoToneText_Alias
64149 CALL HighScore_Something
64152 CALL HighScore_Clear_Screen
64155 LD A,(64343)
64158 CALL HighScore_Position
64161 EX DE,HL
64162 LD HL,23488
64165 LD BC,16
64168 LDIR
64170 SUB 5
64172 JR NC,New_HighScore_3
64174 JR New_HighScore_2
New_HighScore_1 64176 LD HL,64437 Points to HighScore_Sub_Head and sends it to Print_TwoToneText_Alias.
Value Ink Paper Bright
7 7 0 0
6 6 0 0
64179 LD DE,16384
64182 LD BC,1798
64185 CALL Print_TwoToneText_Alias
New_HighScore_2 64188 XOR A
New_HighScore_3 64189 INC A
64190 LD B,10
New_HighScore_4 64192 PUSH BC
64193 PUSH AF
64194 CALL New_HighScore_5
64197 LD DE,64404
64200 CALL 64469
64203 POP AF
64204 POP BC
64205 INC A
64206 CP 31
64208 RET Z
64209 DJNZ New_HighScore_4
64211 RET
HighScore_Clear_Screen 64212 LD HL,16384 Clears the screen buffer by writing $00 to all 6912 memory locations.
64215 LD DE,16385
64218 LD BC,6911
64221 LD (HL),0
64223 LDIR
64225 RET
New_HighScore_5 64226 LD C,A
64227 LD HL,64404
64230 SUB 10
64232 JR C,New_HighScore_6
64234 LD (HL),49
64236 SUB 10
64238 JR C,New_HighScore_6
64240 LD (HL),50
64242 SUB 10
64244 JR C,New_HighScore_6
64246 LD (HL),51
64248 SUB 10
New_HighScore_6 64250 ADD A,10
64252 INC HL
64253 ADD A,48
64255 LD (HL),A
64256 LD A,C
64257 CALL HighScore_Position
64260 LD DE,64410
64263 LD BC,16
64266 LDIR
64268 INC DE
64269 INC DE
64270 INC DE
64271 INC DE
64272 CALL 64511
64275 LD BC,6
64278 LDIR
64280 RET
Works out where in the high score table to place the score.
HighScore_Position 64281 DEC A Using Highscore_Table_Name as a base, work out where to place the new score.
  • Decrease $1B by one...
  • Loads $1A as the low-order byte; HL=$001A
  • Times by $10; HL=$1A0
  • Add $6000=24992
64282 LD L,A
64283 LD H,0
64285 ADD HL,HL
64286 ADD HL,HL
64287 ADD HL,HL
64288 ADD HL,HL
64289 LD DE,24576
64292 ADD HL,DE
64293 RET Return.
HighScore_Something 64294 LD HL,23488 Stores Dueller_01 at 64341.
New_HighScore_7 64297 LD (64341),HL
64300 CALL 64498
64303 CALL HighScore_Input
64306 LD HL,(64341)
64309 CP 13
64311 RET Z
64312 CP 12
64314 JR Z,New_HighScore_9
64316 LD C,A
64317 LD A,L
64318 CP 209
64320 JR NC,New_HighScore_7
64322 LD A,C
64323 CP 32
64325 JR Z,New_HighScore_8
64327 CP 97
64329 JR C,New_HighScore_7
64331 CP 123
64333 JR NC,New_HighScore_7
64335 SUB 32
New_HighScore_8 64337 LD (HL),A
64338 INC HL
64339 JR New_HighScore_7
64341 DEFW 0 Cache.
64343 RRA
New_HighScore_9 64344 LD A,L
64345 CP 193
64347 JR C,New_HighScore_7
64349 DEC HL
64350 LD (HL),32
64352 JR New_HighScore_7
Returns a single keypress.
HighScore_Input 64354 LD HL,23560 Keep looping around until any input is detected. This is achieved by writing $00 to LAST_K and looping until it's non-zero.
64357 LD (HL),0
HighScore_Input_Loop 64359 HALT
64360 LD A,(HL)
64361 AND A
64362 JR Z,HighScore_Input_Loop
64364 PUSH AF Store it on the stack for now.
64365 LD DE,16 Makes a noise using the BEEP routine.
Pitch Duration
$00C0 $0010
64368 LD HL,192
64371 CALL 949
64374 POP AF Return with the keypress in A.
64375 RET
Prev: 63824 Up: Map Next: 64376