summaryrefslogtreecommitdiff
path: root/engine/menu/start_sub_menus.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/menu/start_sub_menus.asm')
-rwxr-xr-xengine/menu/start_sub_menus.asm57
1 files changed, 37 insertions, 20 deletions
diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm
index 9ae6cbe5..fc553d93 100755
--- a/engine/menu/start_sub_menus.asm
+++ b/engine/menu/start_sub_menus.asm
@@ -34,7 +34,7 @@ StartMenu_Pokemon:
ld [wTextBoxID],a
call DisplayTextBoxID ; display pokemon menu options
ld hl,wFieldMoves
- lb bc, $02, $0c ; max menu item ID, top menu item Y
+ lb bc, 2, 12 ; max menu item ID, top menu item Y
ld e,5
.adjustMenuVariablesLoop
dec e
@@ -129,7 +129,7 @@ StartMenu_Pokemon:
dw .dig
dw .teleport
dw .softboiled
-.fly
+.fly ; 11d1b (4:5d1b)
bit 2,a ; does the player have the Thunder Badge?
jp z,.newBadgeRequired
call CheckIfInOutsideMap
@@ -144,12 +144,15 @@ StartMenu_Pokemon:
call ChooseFlyDestination
ld a,[wd732]
bit 3,a ; did the player decide to fly?
- jp nz,.goBackToMap
+ jr nz,.asm_5d4c
call LoadFontTilePatterns
ld hl,wd72e
set 1,[hl]
jp StartMenu_Pokemon
-.cut
+.asm_5d4c
+ call Func_1510
+ jp .goBackToMap
+.cut ; 11d52 (4:5d52)
bit 1,a ; does the player have the Cascade Badge?
jp z,.newBadgeRequired
predef UsedCut
@@ -157,7 +160,7 @@ StartMenu_Pokemon:
and a
jp z,.loop
jp CloseTextDisplay
-.surf
+.surf ; 11d66 (4:5d66)
bit 4,a ; does the player have the Soul Badge?
jp z,.newBadgeRequired
callba IsSurfingAllowed
@@ -165,22 +168,35 @@ StartMenu_Pokemon:
bit 1,[hl]
res 1,[hl]
jp z,.loop
+ ld a, [wcf91]
+ cp PIKACHU ; is this surfing pikachu?
+ jr z, .surfingPikachu
+ ld a, $1
+ jr .continue
+.surfingPikachu
+ ld a, $2
+.continue
+ ld [wd473], a
ld a,SURFBOARD
ld [wcf91],a
ld [wPseudoItemID],a
call UseItem
ld a,[wActionResultOrTookBattleTurn]
and a
- jp z,.loop
+ jr z,.reloadNormalSprite
call GBPalWhiteOutWithDelay3
jp .goBackToMap
-.strength
+.reloadNormalSprite
+ xor a
+ ld [wd473], a
+ jp .loop
+.strength ; 11dab (4:5dab)
bit 3,a ; does the player have the Rainbow Badge?
jp z,.newBadgeRequired
predef PrintStrengthTxt
call GBPalWhiteOutWithDelay3
jp .goBackToMap
-.flash
+.flash ; 11dbb (4:5dbb)
bit 0,a ; does the player have the Boulder Badge?
jp z,.newBadgeRequired
xor a
@@ -192,7 +208,7 @@ StartMenu_Pokemon:
.flashLightsAreaText
TX_FAR _FlashLightsAreaText
db "@"
-.dig
+.dig ; 11dd5 (4:5dd5)
ld a,ESCAPE_ROPE
ld [wcf91],a
ld [wPseudoItemID],a
@@ -202,7 +218,7 @@ StartMenu_Pokemon:
jp z,.loop
call GBPalWhiteOutWithDelay3
jp .goBackToMap
-.teleport
+.teleport ; 11ded (4:5ded)
call CheckIfInOutsideMap
jr z,.canTeleport
ld a,[wWhichPokemon]
@@ -217,12 +233,13 @@ StartMenu_Pokemon:
ld hl,wd732
set 3,[hl]
set 6,[hl]
+ call Func_1510
ld hl,wd72e
set 1,[hl]
res 4,[hl]
ld c,60
call DelayFrames
- call GBPalWhiteOutWithDelay3 ; zero all three palettes and wait 3 V-blanks
+ call GBPalWhiteOutWithDelay3 ; zero all three palettes and wait 3 frames
jp .goBackToMap
.warpToLastPokemonCenterText
TX_FAR _WarpToLastPokemonCenterText
@@ -233,7 +250,7 @@ StartMenu_Pokemon:
.cannotFlyHereText
TX_FAR _CannotFlyHereText
db "@"
-.softboiled
+.softboiled ; 11e35 (4:5e35)
ld hl,wPartyMon1MaxHP
ld a,[wWhichPokemon]
ld bc,wPartyMon2 - wPartyMon1
@@ -307,11 +324,10 @@ StartMenu_Item:
call PrintText
jr .exitMenu
.notInCableClubRoom
- ld bc,wNumBagItems
ld hl,wListPointer
- ld a,c
- ld [hli],a
- ld [hl],b ; store item bag pointer in wListPointer (for DisplayListMenuID)
+ ld [hl], wNumBagItems & $ff
+ inc hl
+ ld [hl], wNumBagItems / $100 ; store item bag pointer in wListPointer (for DisplayListMenuID)
xor a
ld [wPrintItemPrices],a
ld a,ITEMLISTMENU
@@ -515,10 +531,11 @@ StartMenu_TrainerInfo:
call LoadScreenTilesFromBuffer2 ; restore saved screen
call RunDefaultPaletteCommand
call ReloadMapData
+ callba DrawStartMenu ; XXX what difference does this make?
call LoadGBPal
pop af
ld [hTilesetType],a
- jp RedisplayStartMenu
+ jp RedisplayStartMenu_DoNotDrawStartMenu
; loads tile patterns and draws everything except for gym leader faces / badges
DrawTrainerInfo:
@@ -552,7 +569,7 @@ DrawTrainerInfo:
ld de,vChars2 + $200
ld bc,$0400
ld a,$03
- call FarCopyData2
+ call FarCopyData
ld hl,TextBoxGraphics
ld de,$00d0
add hl,de ; hl = colon tile pattern
@@ -560,7 +577,7 @@ DrawTrainerInfo:
ld bc,$0010
ld a,$04
push bc
- call FarCopyData2
+ call FarCopyData
pop bc
ld hl,TrainerInfoTextBoxTileGraphics + $80 ; background tile pattern
ld de,vChars1 + $570
@@ -612,7 +629,7 @@ DrawTrainerInfo:
TrainerInfo_FarCopyData:
ld a,BANK(TrainerInfoTextBoxTileGraphics)
- jp FarCopyData2
+ jp FarCopyData
TrainerInfo_NameMoneyTimeText:
db "NAME/"