summaryrefslogtreecommitdiff
path: root/engine/learn_move.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/learn_move.asm')
-rwxr-xr-xengine/learn_move.asm42
1 files changed, 33 insertions, 9 deletions
diff --git a/engine/learn_move.asm b/engine/learn_move.asm
index 5fa6df08..dcaf4235 100755
--- a/engine/learn_move.asm
+++ b/engine/learn_move.asm
@@ -121,18 +121,17 @@ TryingToLearn:
ld hl, WhichMoveToForgetText
call PrintText
coord hl, 4, 7
- ld b, 4
- ld c, 14
+ lb bc, 4, 14
call TextBoxBorder
coord hl, 6, 8
ld de, wMovesString
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
set 2, a
- ld [hFlags_0xFFF6], a
+ ld [hFlags_0xFFFA], a
call PlaceString
- ld a, [hFlags_0xFFF6]
+ ld a, [hFlags_0xFFFA]
res 2, a
- ld [hFlags_0xFFF6], a
+ ld [hFlags_0xFFFA], a
ld hl, wTopMenuItemY
ld a, 8
ld [hli], a ; wTopMenuItemY
@@ -146,10 +145,10 @@ TryingToLearn:
ld a, A_BUTTON | B_BUTTON
ld [hli], a ; wMenuWatchedKeys
ld [hl], 0 ; wLastMenuItem
- ld hl, hFlags_0xFFF6
+ ld hl, hFlags_0xFFFA
set 1, [hl]
call HandleMenuInput
- ld hl, hFlags_0xFFF6
+ ld hl, hFlags_0xFFFA
res 1, [hl]
push af
call LoadScreenTilesFromBuffer1
@@ -204,11 +203,36 @@ TryingToLearnText:
db "@"
OneTwoAndText:
+; bugfix: In Red/Blue, the SFX_SWAP sound was played in the wrong bank, which played an incorrect sound
+; Yellow has fixed this by swapping to the correct bank
TX_FAR _OneTwoAndText
db $a
TX_ASM
+ push af
+ push bc
+ push de
+ push hl
+ ld a, $1
+ ld [wMuteAudioAndPauseMusic], a
+ call DelayFrame
+ ld a, [wAudioROMBank]
+ push af
+ ld a, BANK(SFX_Swap_1)
+ ld [wAudioROMBank], a
+ ld [wAudioSavedROMBank], a
+ call WaitForSoundToFinish
ld a, SFX_SWAP
- call PlaySoundWaitForCurrent
+ call PlaySound
+ call WaitForSoundToFinish
+ pop af
+ ld [wAudioROMBank], a
+ ld [wAudioSavedROMBank], a
+ xor a
+ ld [wMuteAudioAndPauseMusic], a
+ pop hl
+ pop de
+ pop bc
+ pop af
ld hl, PoofText
ret