Prev: 62068 Up: Map Next: 62270
62101: Handle Name Input
Countdown HallOfFame_Timer and read the controls while a name is being entered.
HallOfFame_Input 62101 LD HL,(24173) Fetch HallOfFame_Timer.
62104 DEC HL Decrease it by one.
62105 LD (24173),HL Write it back.
62108 LD A,L Jump to InsertHighScore if the timer is now zero.
62109 OR H
62110 JP Z,InsertHighScore
62113 CALL HandlerControls Call HandlerControls.
62116 BIT 4,A Jump to HallOfFame_Input_AcceptFire if fire is pressed.
62118 JP Z,HallOfFame_Input_AcceptFire
Only check Left and Right once every sixteen ticks.
62121 LD A,(24173) Fetch the low byte of HallOfFame_Timer.
62124 AND %00001111 Keep only bits 0-3.
62126 JP NZ,HallOfFame_Input_DrawLetter Jump to HallOfFame_Input_DrawLetter if the result is not zero.
Release the fire lock, then read Left and Right.
62129 XOR A Write 0 to HallOfFame_FireLock.
62130 LD (24176),A
62133 CALL HandlerControls Call HandlerControls.
62136 BIT 0,A Jump to HallOfFame_Input_StepForward if Right is pressed.
62138 JP Z,HallOfFame_Input_StepForward
62141 BIT 1,A Jump to HallOfFame_Input_StepBackward if Left is pressed.
62143 JP Z,HallOfFame_Input_StepBackward
Draw the current letter and restart the input wait.
HallOfFame_Input_DrawLetter 62146 LD A,(24175) Fetch HallOfFame_Index.
62149 LD HL,24184 HL=HallOfFame_Name.
62152 LD C,A Copy the index into C.
62153 LD B,0 Clear B.
62155 ADD HL,BC Point HL at the current letter.
62156 LD A,(HL) Fetch the letter.
62157 LD HL,(24181) Fetch HallOfFame_Pointer.
62160 CALL PrintScreen Call PrintScreen.
62163 JP StartNameEntry Jump to StartNameEntry.
Fire accepts the letter and advances the cursor.
HallOfFame_Input_AcceptFire 62166 LD A,(24176) Fetch HallOfFame_FireLock.
62169 AND A Jump to HallOfFame_Input_DrawLetter if fire is still locked.
62170 JP NZ,HallOfFame_Input_DrawLetter
62173 CALL SoundsDropItem Call SoundsDropItem.
62176 LD A,1 Write 1 to HallOfFame_FireLock.
62178 LD (24176),A
Advance to the next letter, finishing after three.
62181 LD A,(24175) Fetch HallOfFame_Index.
62184 INC A Increase the index by one.
62185 CP 3 Jump to InsertHighScore if all three letters are done.
62187 JP Z,InsertHighScore
62190 LD (24175),A Write the new index.
Move the screen pointer on to the next letter.
62193 LD HL,(24181) Fetch HallOfFame_Pointer.
62196 LD A,64 A=64 (unused).
62198 INC L Advance the screen pointer by two columns.
62199 INC L
62200 LD (24181),HL Write it back.
62203 JP HallOfFame_Input_DrawLetter Jump to HallOfFame_Input_DrawLetter.
Right steps the letter forward.
HallOfFame_Input_StepForward 62206 CALL SoundsTakeObject Call SoundsTakeObject.
Fetch the current letter and step it forward.
62209 LD A,(24175) Fetch HallOfFame_Index.
62212 LD C,A Copy the index into C.
62213 LD B,0 Clear B.
62215 LD HL,24184 HL=HallOfFame_Name.
62218 ADD HL,BC Point HL at the current letter.
62219 LD A,(HL) Fetch the letter.
62220 INC A Increase it by one.
Wrap the letter around: after "Z" comes a space, and after a space comes "A".
62221 CP 91 Jump to HallOfFame_Input_Space if it wrapped past "Z".
62223 JR Z,HallOfFame_Input_Space
62225 CP 33 Jump to HallOfFame_Input_WriteLetter if it is not "!".
62227 JP NZ,HallOfFame_Input_WriteLetter
62230 LD A,65 A=65.
HallOfFame_Input_WriteLetter 62232 LD (HL),A Write the letter.
62233 JP HallOfFame_Input_DrawLetter Jump to HallOfFame_Input_DrawLetter.
Left steps the letter backward.
HallOfFame_Input_StepBackward 62236 CALL SoundsTakeObject Call SoundsTakeObject.
Fetch the current letter and step it backward.
62239 LD A,(24175) Fetch HallOfFame_Index.
62242 LD C,A Copy the index into C.
62243 LD B,0 Clear B.
62245 LD HL,24184 HL=HallOfFame_Name.
62248 ADD HL,BC Point HL at the current letter.
62249 LD A,(HL) Fetch the letter.
62250 DEC A Decrease it by one.
Wrap the letter around: before "A" comes a space, and before a space comes "Z".
62251 CP 64 Jump to HallOfFame_Input_Space if it wrapped past "A".
62253 JR Z,HallOfFame_Input_Space
62255 CP 31 Jump to HallOfFame_Input_Loop if it is not 31.
62257 JP NZ,HallOfFame_Input_Loop
62260 LD A,90 A=90.
HallOfFame_Input_Loop 62262 LD (HL),A Write the letter.
62263 JP HallOfFame_Input_DrawLetter Jump to HallOfFame_Input_DrawLetter.
HallOfFame_Input_Space 62266 LD A,32 A=32.
62268 JR HallOfFame_Input_Loop Jump to HallOfFame_Input_Loop.
Prev: 62068 Up: Map Next: 62270