Use halt more efficiently in 2DMenus, Board Menu, and text printing (#2) (#11)

This commit is contained in:
xCrystal 2024-04-04 12:21:02 +02:00
parent c115386f38
commit eb13b2bd77
4 changed files with 9 additions and 4 deletions

View File

@ -214,6 +214,7 @@ ApplyBoardMenuSpritePalette:
ret ret
GetBoardMenuSelection: GetBoardMenuSelection:
call DelayFrame
call JoyTextDelay call JoyTextDelay
call GetMenuJoypad call GetMenuJoypad
bit A_BUTTON_F, a bit A_BUTTON_F, a

View File

@ -218,6 +218,7 @@ endr
PromptPlayerToChooseBranchDirection: PromptPlayerToChooseBranchDirection:
; sample a dpad press or SELECT button ; sample a dpad press or SELECT button
call DelayFrame
ld hl, wTempSpaceBranchStruct ld hl, wTempSpaceBranchStruct
call GetJoypad call GetJoypad
ldh a, [hJoyPressed] ldh a, [hJoyPressed]

View File

@ -233,7 +233,7 @@ MenuJoypadLoop:
.loop .loop
call Move2DMenuCursor call Move2DMenuCursor
call .BGMap_OAM call .BGMap_OAM
call Do2DMenuJoypad call Do2DMenuJoypad.loop
jr nc, .done jr nc, .done
call _2DMenuInterpretJoypad call _2DMenuInterpretJoypad
jr c, .done jr c, .done
@ -262,13 +262,14 @@ MenuJoypadLoop:
ret ret
Do2DMenuJoypad: Do2DMenuJoypad:
call DelayFrame
.loop .loop
call UpdateTimeSensitivePals call UpdateTimeSensitivePals
call Menu_WasButtonPressed call Menu_WasButtonPressed
ret c ret c
ld a, [w2DMenuFlags1] ld a, [w2DMenuFlags1]
bit 7, a bit 7, a
jr z, .loop jr z, Do2DMenuJoypad
and a and a
ret ret

View File

@ -70,7 +70,9 @@ PrintLetterDelay::
.wait .wait
ldh a, [hTextDelayFrames] ldh a, [hTextDelayFrames]
and a and a
jr nz, .checkjoypad jr z, .end
call DelayFrame
jr .checkjoypad
.end .end
pop af pop af