Prev: 47617 Up: Map Next: 47763
47641: Enter Initials
Used by the routine at NewHighScore_Enter.
Asks the player for three initials. The turning controls change the letter, which cycles through the space and the letters A to Z, and the fire control for the first weapon accepts it.
Input
DE Address of the name
EnterInitials 47641 LD B,3 There are three letters.
47643 XOR A Clear the controls.
47644 LD (38437),A
47647 LD HL,20585 Point HL at the screen address of the first letter.
EnterInitials_Letter 47650 LD A,32 Start with a space.
EnterInitials_Read 47652 PUSH AF Save the letter.
47653 CALL ReadControls Read the controls using ReadControls.
47656 XOR A Clear the controls.
47657 LD (38437),A
47660 POP AF Restore the letter.
47661 BIT 4,C Jump to accept the letter if the fire control is being used.
47663 JR NZ,EnterInitials_Fire
47665 BIT 1,C Jump to go back a letter if the control to turn left is being used.
47667 JR NZ,EnterInitials_PreviousLetter
47669 BIT 0,C Jump to go on a letter if the control to turn right is being used.
47671 JR NZ,EnterInitials_NextLetter
47673 JR EnterInitials_Read Jump to read the controls again.
EnterInitials_PreviousLetter 47675 CALL NewHighScore_Return Make a sound using NewHighScore_Return.
47678 DEC A Go back a letter.
47679 CP 64 Jump if that is not the character before 65 ("A").
47681 JR NZ,EnterInitials_CheckSpace
47683 LD A,32 Use a space.
EnterInitials_CheckSpace 47685 CP 31 Jump if that is not the character before a space.
47687 JR NZ,EnterInitials_Show
47689 LD A,90 Use "Z".
EnterInitials_Show 47691 PUSH AF Save the letter.
47692 CALL PrintScreen Print the letter using PrintScreen.
47695 POP AF Restore the letter.
47696 DEC L Go back to the screen address of the letter.
47697 JR EnterInitials_Read Jump to read the controls again.
EnterInitials_NextLetter 47699 CALL NewHighScore_Return Make a sound using NewHighScore_Return.
47702 INC A Go on a letter.
47703 CP 91 Jump if that is not the character after "Z".
47705 JR NZ,EnterInitials_CheckAfterZ
47707 LD A,32 Use a space.
EnterInitials_CheckAfterZ 47709 CP 33 Jump if that is not the character after a space.
47711 JR NZ,EnterInitials_Show
47713 LD A,65 Use "A".
47715 JR EnterInitials_Show Jump to show the letter.
EnterInitials_Fire 47717 PUSH AF Save the letter.
47718 CALL ReadControls Read the controls using ReadControls.
47721 XOR A Clear the controls.
47722 LD (38437),A
47725 POP AF Restore the letter.
47726 BIT 4,C Jump back until the fire control is released.
47728 JR NZ,EnterInitials_Fire
47730 LD (DE),A Store the letter in the name.
47731 INC DE Move on to the next letter of the name.
47732 PUSH AF Save the letter...
47733 PUSH BC ...and the counter.
47734 CALL PrintScreen Print the letter using PrintScreen.
47737 INC L Leave a gap before the next letter.
47738 LD C,0 Make a sound using PlayNoiseSound_Counter.
47740 CALL PlayNoiseSound_Counter
47743 LD BC,0 Wait for 65536 iterations.
EnterInitials_Delay 47746 DEC BC Count down the delay.
47747 LD A,B Loop back until the count reaches zero.
47748 OR C
47749 JR NZ,EnterInitials_Delay
47751 POP BC Restore the counter...
47752 POP AF ...and the letter.
47753 DJNZ EnterInitials_Letter Loop back until all three letters have been entered.
47755 LD B,1 Use one pass of the delay...
47757 LD HL,0 ...with a count of 0...
47760 JP Delay ...and wait using Delay.
View the equivalent code in;
Prev: 47617 Up: Map Next: 47763