![]() |
Routines |
| Prev: A7F5 | Up: Map | Next: A83A |
|
Used by the routine at Controller_NameSelect.
|
||||
|
Action "user has pressed "up":
|
||||
| Handler_NameSelect_Up | A80C | LD A,(HL) | A=the current letter. | |
|
Special handling for "space" as it's out of sequence with the other lettering.
|
||||
| A80D | CP $20 | Jump to NameSelect_BackTo_A if A is currently 20 (ASCII "space"). | ||
| A80F | JR Z,NameSelect_BackTo_A | |||
| A811 | CP $5A | Jump to NameSelect_Space if A is currently 5A (ASCII "Z"). | ||
| A813 | JR Z,NameSelect_Space | |||
|
We're within the upper and lower boundaries, so move "up" a letter.
|
||||
| A815 | INC A | Increment A by one. | ||
| A816 | JR Handler_NameSelect_Write | Jump to Handler_NameSelect_Write. | ||
|
Action "user has pressed "down":
|
||||
| Handler_NameSelect_Down | A818 | LD A,(HL) | A=the current letter. | |
|
Special handling for "space" as it's out of sequence with the other lettering.
|
||||
| A819 | CP $20 | Jump to NameSelect_BackTo_Z if A is currently 20 (ASCII "space"). | ||
| A81B | JR Z,NameSelect_BackTo_Z | |||
| A81D | CP $41 | Jump to NameSelect_Space if A is currently 41 (ASCII "A"). | ||
| A81F | JR Z,NameSelect_Space | |||
|
We're within the upper and lower boundaries, so move "down" a letter.
|
||||
| A821 | DEC A | Decrease A by one. | ||
| A822 | 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 | A824 | LD A,"A" | A=41 (ASCII "A"). | |
| A826 | JR Handler_NameSelect_Write | Jump to Handler_NameSelect_Write. | ||
| NameSelect_Space | A828 | LD A," " | A=20 (ASCII "space"). | |
| A82A | 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 | A82C | LD A,"Z" | A=5A (ASCII "Z"). | |
| Handler_NameSelect_Write | A82E | LD (HL),A | Write A to *HL. | |
| A82F | PUSH HL | Stash HL on the stack. | ||
| A830 | LD HL,$AB8A | HL=Game_Flags. | ||
| A833 | CALL $A83A | Call A83A. | ||
| A836 | POP HL | Restore HL from the stack. | ||
| A837 | JP Controller_NameSelect_0 | Jump to Controller_NameSelect_0. | ||
| Prev: A7F5 | Up: Map | Next: A83A |