Skip to content

Commit

Permalink
Add some optimization notes for hackers
Browse files Browse the repository at this point in the history
  • Loading branch information
Sha0den committed Aug 14, 2024
1 parent a0521cd commit 0e1cd23
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/engine/input_name.asm
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ InputPlayerName:
call PlayerNamingScreen_ProcessInput
jr nc, .loop
; player selected the "End" button.
call FinalizeInputName
call FinalizeInputName ; can be jr (delete ret)
ret

.on_b_button
Expand Down Expand Up @@ -334,7 +334,7 @@ PlayerNamingScreen_CheckButtonState:
ld a, d
jr nz, .asm_696b
push hl
push bc
push bc ; unnecessary
push af
call PlayerNamingScreen_GetCharInfoFromPos
inc hl
Expand All @@ -346,7 +346,7 @@ PlayerNamingScreen_CheckButtonState:
dec a
ld d, a
pop af
pop bc
pop bc ; unnecessary
pop hl
sub d
cp $ff
Expand Down Expand Up @@ -376,7 +376,7 @@ PlayerNamingScreen_CheckButtonState:
ld a, d
jr nz, .asm_6990
push hl
push bc
push bc ; unnecessary
push af
call PlayerNamingScreen_GetCharInfoFromPos
inc hl
Expand All @@ -387,7 +387,7 @@ PlayerNamingScreen_CheckButtonState:
dec a
ld d, a
pop af
pop bc
pop bc ; unnecessary
pop hl
add d
.asm_6990
Expand Down Expand Up @@ -595,15 +595,15 @@ PlayerNamingScreen_ProcessInput:
or a
jr nz, .asm_6aac
ld a, $01
jp .asm_6ace
jp .asm_6ace ; can be jr
.asm_6aac
dec a
jr nz, .asm_6ab4
ld a, $02
jp .asm_6ace
jp .asm_6ace ; can be jr
.asm_6ab4
xor a
jp .asm_6ace
jp .asm_6ace ; can be jr
.asm_6ab8
cp $08
jr nz, .asm_6ad6
Expand Down Expand Up @@ -1060,7 +1060,7 @@ InputDeckName:

ld a, [hl]
or a
jr nz, .return
jr nz, .return ; can be ret nz

dec hl
ld [hl], TX_END
Expand All @@ -1084,7 +1084,7 @@ InputDeckName:
dec [hl]
call PrintDeckNameFromInput

jp .loop
jp .loop ; can be jr

; loads, to the first tile of v0Tiles0, the graphics for the
; blinking black square used in name input screens for inputting half width text.
Expand Down Expand Up @@ -1234,7 +1234,7 @@ DeckNamingScreen_CheckButtonState:
ld [wMenuInputSFX], a
ldh a, [hDPadHeld]
or a
jp z, .asm_6f73
jp z, .asm_6f73 ; can be jr
; detected any button press
ld b, a
ld a, [wNamingScreenKeyboardHeight]
Expand Down Expand Up @@ -1306,7 +1306,7 @@ DeckNamingScreen_CheckButtonState:
ld [wCheckMenuCursorBlinkCounter], a
ld a, $02
cp d
jp z, DeckNamingScreen_CheckButtonState
jp z, DeckNamingScreen_CheckButtonState ; can be jr
ld a, SFX_CURSOR
ld [wMenuInputSFX], a
.asm_6f73
Expand Down

0 comments on commit 0e1cd23

Please sign in to comment.