diff options
author | luckytyphlosion <alan.rj.huang@gmail.com> | 2015-11-01 16:57:21 -0500 |
---|---|---|
committer | luckytyphlosion <alan.rj.huang@gmail.com> | 2015-11-01 16:57:21 -0500 |
commit | b5d907aede88eea92556b31ca48db36534ee21ed (patch) | |
tree | 11b865d66335e2b867b5e4ca962f8cf0f75e1bc7 | |
parent | f230c93da5d339e7ca8b58d3ffe0189c8d1217d0 (diff) |
Poke Mart and LearnMove code
-rwxr-xr-x | engine/learn_move.asm | 58 | ||||
-rwxr-xr-x | engine/overworld/pokemart.asm | 26 | ||||
-rwxr-xr-x | yellow/main.asm | 9 |
3 files changed, 60 insertions, 33 deletions
diff --git a/engine/learn_move.asm b/engine/learn_move.asm index ec087d0c..7022e3ea 100755 --- a/engine/learn_move.asm +++ b/engine/learn_move.asm @@ -1,4 +1,4 @@ -LearnMove: ; 6e43 (1:6e43) +LearnMove: ; 6bc8 (1:6bc8) call SaveScreenTilesToBuffer1 ld a, [wWhichPokemon] ld hl, wPartyMonNicks @@ -8,7 +8,7 @@ LearnMove: ; 6e43 (1:6e43) ld bc, NAME_LENGTH call CopyData -DontAbandonLearning: ; 6e5b (1:6e5b) +DontAbandonLearning: ; 6be0 (1:6be0) ld hl, wPartyMon1Moves ld bc, wPartyMon2Moves - wPartyMon1Moves ld a, [wWhichPokemon] @@ -73,7 +73,7 @@ DontAbandonLearning: ; 6e5b (1:6e5b) call CopyData jp PrintLearnedMove -AbandonLearning: ; 6eda (1:6eda) +AbandonLearning: ; 6c5f (1:6c5f) ld hl, AbandonLearningText call PrintText coord hl, 14, 7 @@ -89,13 +89,13 @@ AbandonLearning: ; 6eda (1:6eda) ld b, 0 ret -PrintLearnedMove: ; 6efe (1:6efe) +PrintLearnedMove: ; 6c83 (1:6c83) ld hl, LearnedMove1Text call PrintText ld b, 1 ret -TryingToLearn: ; 6f07 (1:6f07) +TryingToLearn: ; 6c8c (1:6c8c) push hl ld hl, TryingToLearnText call PrintText @@ -121,8 +121,7 @@ TryingToLearn: ; 6f07 (1:6f07) 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 @@ -183,42 +182,67 @@ TryingToLearn: ; 6f07 (1:6f07) scf ret -LearnedMove1Text: ; 6fb4 (1:6fb4) +LearnedMove1Text: ; 6d31 (1:6d31) TX_FAR _LearnedMove1Text db $b,6,"@" -WhichMoveToForgetText: ; 6fb4 (1:6fb4) +WhichMoveToForgetText: ; 6d38 (1:6d38) TX_FAR _WhichMoveToForgetText db "@" -AbandonLearningText: ; 6fb9 (1:6fb9) +AbandonLearningText: ; 6d3d (1:6d3d) TX_FAR _AbandonLearningText db "@" -DidNotLearnText: ; 6fbe (1:6fbe) +DidNotLearnText: ; 6d42 (1:6d42) TX_FAR _DidNotLearnText db "@" -TryingToLearnText: ; 6fc3 (1:6fc3) +TryingToLearnText: ; 6d47 (1:6d47) TX_FAR _TryingToLearnText db "@" -OneTwoAndText: ; 6fc8 (1:6fc8) +OneTwoAndText: ; 6d4c (1:6d4c) +; 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 -PoofText: ; 6fd7 (1:6fd7) +PoofText: ; 6d88 (1:6d88) TX_FAR _PoofText db $a -ForgotAndText: ; 6fdc (1:6fdc) +ForgotAndText: ; 6d8d (1:6d8d) TX_FAR _ForgotAndText db "@" -HMCantDeleteText: ; 6fe1 (1:6fe1) +HMCantDeleteText: ; 6d92 (1:6d92) TX_FAR _HMCantDeleteText db "@" diff --git a/engine/overworld/pokemart.asm b/engine/overworld/pokemart.asm index ae96c4a9..ca3f8991 100755 --- a/engine/overworld/pokemart.asm +++ b/engine/overworld/pokemart.asm @@ -1,4 +1,4 @@ -DisplayPokemartDialogue_: ; 6c20 (1:6c20) +DisplayPokemartDialogue_: ; 69a5 (1:69a5) ld a,[wListScrollOffset] ld [wSavedListScrollOffset],a call UpdateSprites @@ -85,7 +85,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) lb bc, 14, 1 ; location that PrintText always prints to, this is useless call PrintText coord hl, 14, 7 - lb bc, 08, 15 + lb bc, 8, 15 ld a,TWO_OPTION_MENU ld [wTextBoxID],a call DisplayTextBoxID ; yes/no menu @@ -227,46 +227,46 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20) ld [wListScrollOffset],a ret -PokemartBuyingGreetingText: ; 6e0c (1:6e0c) +PokemartBuyingGreetingText: ; 6b91 (1:6b91) TX_FAR _PokemartBuyingGreetingText db "@" -PokemartTellBuyPriceText: ; 6e11 (1:6e11) +PokemartTellBuyPriceText: ; 6b96 (1:6b96) TX_FAR _PokemartTellBuyPriceText db "@" -PokemartBoughtItemText: ; 6e16 (1:6e16) +PokemartBoughtItemText: ; 6b9b (1:6b9b) TX_FAR _PokemartBoughtItemText db "@" -PokemartNotEnoughMoneyText: ; 6e1b (1:6e1b) +PokemartNotEnoughMoneyText: ; 6ba0 (1:6ba0) TX_FAR _PokemartNotEnoughMoneyText db "@" -PokemartItemBagFullText: ; 6e20 (1:6e20) +PokemartItemBagFullText: ; 6ba5 (1:6ba5) TX_FAR _PokemartItemBagFullText db "@" -PokemonSellingGreetingText: ; 6e25 (1:6e25) +PokemonSellingGreetingText: ; 6baa (1:6baa) TX_FAR _PokemonSellingGreetingText db "@" -PokemartTellSellPriceText: ; 6e2a (1:6e2a) +PokemartTellSellPriceText: ; 6baf (1:6baf) TX_FAR _PokemartTellSellPriceText db "@" -PokemartItemBagEmptyText: ; 6e2f (1:6e2f) +PokemartItemBagEmptyText: ; 6bb4 (1:6bb4) TX_FAR _PokemartItemBagEmptyText db "@" -PokemartUnsellableItemText: ; 6e34 (1:6e34) +PokemartUnsellableItemText: ; 6bb9 (1:6bb9) TX_FAR _PokemartUnsellableItemText db "@" -PokemartThankYouText: ; 6e39 (1:6e39) +PokemartThankYouText: ; 6bbe (1:6bbe) TX_FAR _PokemartThankYouText db "@" -PokemartAnythingElseText: ; 6e3e (1:6e3e) +PokemartAnythingElseText: ; 6bc3 (1:6bc3) TX_FAR _PokemartAnythingElseText db "@" diff --git a/yellow/main.asm b/yellow/main.asm index ea9f83d6..5ceee28e 100755 --- a/yellow/main.asm +++ b/yellow/main.asm @@ -889,8 +889,9 @@ HandleItemListSwapping: ; 68c9 (1:68c9) pop hl jp DisplayListMenuIDLoop -DisplayPokemartDialogue_: ; 69a5 (1:69a5) - dr $69a5,$6d97 +INCLUDE "engine/overworld/pokemart.asm" + +INCLUDE "engine/learn_move.asm" DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97) dr $6d97,$6f0e DisplayTextIDInit: ; 6f0e (1:6f0e) @@ -3725,7 +3726,9 @@ CryData: ; 39462 (e:5462) TrainerPicAndMoneyPointers: ; 39893 (e:5893) dr $39893,$3997e TrainerNames: ; 3997e (e:597e) - dr $3997e,$39b54 + dr $3997e,$39b06 +FormatMovesString: ; 39b06 (e:5b06) + dr $39b06,$39b54 InitList: ; 39b54 (e:5b54) dr $39b54,$39bb6 ReadTrainer: ; 39bb6 (e:5bb6) |