Prev: 42997 Up: Map Next: 43066
43020: Handler: Player Name Selection
Used by the routine at Controller_NameSelect.
Action "user has pressed "up":
Handler_NameSelect_Up 43020 LD A,(HL) A=the current letter.
Special handling for "space" as it's out of sequence with the other lettering.
43021 CP 32 Jump to NameSelect_BackTo_A if A is currently 32 (ASCII "space").
43023 JR Z,NameSelect_BackTo_A
43025 CP 90 Jump to NameSelect_Space if A is currently 90 (ASCII "Z").
43027 JR Z,NameSelect_Space
We're within the upper and lower boundaries, so move "up" a letter.
43029 INC A Increment A by one.
43030 JR Handler_NameSelect_Write Jump to Handler_NameSelect_Write.
Action "user has pressed "down":
Handler_NameSelect_Down 43032 LD A,(HL) A=the current letter.
Special handling for "space" as it's out of sequence with the other lettering.
43033 CP 32 Jump to NameSelect_BackTo_Z if A is currently 32 (ASCII "space").
43035 JR Z,NameSelect_BackTo_Z
43037 CP 65 Jump to NameSelect_Space if A is currently 65 (ASCII "A").
43039 JR Z,NameSelect_Space
We're within the upper and lower boundaries, so move "down" a letter.
43041 DEC A Decrease A by one.
43042 JR Handler_NameSelect_Write Jump to Handler_NameSelect_Write.
The upper boundrary has been reached, so cycle back to the letter "A".
NameSelect_BackTo_A 43044 LD A,"A" A=65 (ASCII "A").
43046 JR Handler_NameSelect_Write Jump to Handler_NameSelect_Write.
NameSelect_Space 43048 LD A," " A=32 (ASCII "space").
43050 JR Handler_NameSelect_Write Jump to Handler_NameSelect_Write.
The lower boundrary has been reached, so cycle back to the letter "Z".
NameSelect_BackTo_Z 43052 LD A,"Z" A=90 (ASCII "Z").
Handler_NameSelect_Write 43054 LD (HL),A Write A to *HL.
43055 PUSH HL Stash HL on the stack.
43056 LD HL,43914 HL=Game_Flags.
43059 CALL 43066 Call 43066.
43062 POP HL Restore HL from the stack.
43063 JP Controller_NameSelect_0 Jump to Controller_NameSelect_0.
Prev: 42997 Up: Map Next: 43066