2014-05-22 22:13:20 +00:00
|
|
|
StartMenu_Pokedex: ; 13095 (4:7095)
|
2014-06-16 20:57:26 +00:00
|
|
|
predef ShowPokedexMenu
|
2014-05-22 22:13:20 +00:00
|
|
|
call LoadScreenTilesFromBuffer2 ; restore saved screen
|
|
|
|
call Delay3
|
|
|
|
call LoadGBPal
|
|
|
|
call UpdateSprites
|
|
|
|
jp RedisplayStartMenu
|
|
|
|
|
|
|
|
StartMenu_Pokemon: ; 130a9 (4:70a9)
|
2014-06-14 11:12:40 +00:00
|
|
|
ld a,[wPartyCount]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jp z,RedisplayStartMenu
|
|
|
|
xor a
|
2014-08-09 05:39:13 +00:00
|
|
|
ld [wMenuItemToSwap],a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd07d],a
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [wUpdateSpritesEnabled],a
|
2014-05-22 22:13:20 +00:00
|
|
|
call DisplayPartyMenu
|
|
|
|
jr .checkIfPokemonChosen
|
|
|
|
.loop
|
|
|
|
xor a
|
2014-08-09 05:39:13 +00:00
|
|
|
ld [wMenuItemToSwap],a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd07d],a
|
2014-05-22 22:13:20 +00:00
|
|
|
call GoBackToPartyMenu
|
|
|
|
.checkIfPokemonChosen
|
|
|
|
jr nc,.chosePokemon
|
|
|
|
.exitMenu
|
|
|
|
call GBPalWhiteOutWithDelay3
|
2014-09-10 03:55:19 +00:00
|
|
|
call RestoreScreenTilesAndReloadTilePatterns
|
2014-05-22 22:13:20 +00:00
|
|
|
call LoadGBPal
|
|
|
|
jp RedisplayStartMenu
|
|
|
|
.chosePokemon
|
|
|
|
call SaveScreenTilesToBuffer1 ; save screen
|
|
|
|
ld a,$04
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd125],a
|
2014-05-22 22:13:20 +00:00
|
|
|
call DisplayTextBoxID ; display pokemon menu options
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl,wWhichTrade
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc,$020c ; max menu item ID, top menu item Y
|
|
|
|
ld e,5
|
|
|
|
.adjustMenuVariablesLoop
|
|
|
|
dec e
|
|
|
|
jr z,.storeMenuVariables
|
|
|
|
ld a,[hli]
|
|
|
|
and a
|
|
|
|
jr z,.storeMenuVariables
|
|
|
|
inc b
|
|
|
|
dec c
|
|
|
|
dec c
|
|
|
|
jr .adjustMenuVariablesLoop
|
|
|
|
.storeMenuVariables
|
|
|
|
ld hl,wTopMenuItemY
|
|
|
|
ld a,c
|
|
|
|
ld [hli],a ; top menu item Y
|
|
|
|
ld a,[$fff7]
|
|
|
|
ld [hli],a ; top menu item X
|
|
|
|
xor a
|
|
|
|
ld [hli],a ; current menu item ID
|
|
|
|
inc hl
|
|
|
|
ld a,b
|
|
|
|
ld [hli],a ; max menu item ID
|
|
|
|
ld a,%00000011 ; A button, B button
|
|
|
|
ld [hli],a ; menu watched keys
|
|
|
|
xor a
|
|
|
|
ld [hl],a
|
|
|
|
call HandleMenuInput
|
|
|
|
push af
|
|
|
|
call LoadScreenTilesFromBuffer1 ; restore saved screen
|
|
|
|
pop af
|
|
|
|
bit 1,a ; was the B button pressed?
|
|
|
|
jp nz,.loop
|
|
|
|
; if the B button wasn't pressed
|
|
|
|
ld a,[wMaxMenuItem]
|
|
|
|
ld b,a
|
|
|
|
ld a,[wCurrentMenuItem] ; menu selection
|
|
|
|
cp b
|
|
|
|
jp z,.exitMenu ; if the player chose Cancel
|
|
|
|
dec b
|
|
|
|
cp b
|
|
|
|
jr z,.choseSwitch
|
|
|
|
dec b
|
|
|
|
cp b
|
|
|
|
jp z,.choseStats
|
|
|
|
ld c,a
|
|
|
|
ld b,0
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl,wWhichTrade
|
2014-05-22 22:13:20 +00:00
|
|
|
add hl,bc
|
|
|
|
jp .choseOutOfBattleMove
|
|
|
|
.choseSwitch
|
2014-06-14 11:12:40 +00:00
|
|
|
ld a,[wPartyCount]
|
2014-05-22 22:13:20 +00:00
|
|
|
cp a,2 ; is there more than one pokemon in the party?
|
|
|
|
jp c,StartMenu_Pokemon ; if not, no switching
|
|
|
|
call SwitchPartyMon_Stats
|
|
|
|
ld a,$04 ; swap pokemon positions menu
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd07d],a
|
2014-05-22 22:13:20 +00:00
|
|
|
call GoBackToPartyMenu
|
|
|
|
jp .checkIfPokemonChosen
|
|
|
|
.choseStats
|
2014-05-23 22:34:35 +00:00
|
|
|
call ClearSprites
|
2014-05-22 22:13:20 +00:00
|
|
|
xor a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcc49],a
|
2014-06-16 20:57:26 +00:00
|
|
|
predef StatusScreen
|
|
|
|
predef StatusScreen2
|
2014-05-22 22:13:20 +00:00
|
|
|
call ReloadMapData
|
|
|
|
jp StartMenu_Pokemon
|
|
|
|
.choseOutOfBattleMove
|
|
|
|
push hl
|
|
|
|
ld a,[wWhichPokemon]
|
2014-06-14 11:12:40 +00:00
|
|
|
ld hl,wPartyMonNicks
|
2014-05-22 22:13:20 +00:00
|
|
|
call GetPartyMonName
|
|
|
|
pop hl
|
|
|
|
ld a,[hl]
|
|
|
|
dec a
|
|
|
|
add a
|
|
|
|
ld b,0
|
|
|
|
ld c,a
|
|
|
|
ld hl,.outOfBattleMovePointers
|
|
|
|
add hl,bc
|
|
|
|
ld a,[hli]
|
|
|
|
ld h,[hl]
|
|
|
|
ld l,a
|
|
|
|
ld a,[W_OBTAINEDBADGES] ; badges obtained
|
|
|
|
jp [hl]
|
|
|
|
.outOfBattleMovePointers
|
|
|
|
dw .cut
|
|
|
|
dw .fly
|
|
|
|
dw .surf
|
|
|
|
dw .surf
|
|
|
|
dw .strength
|
|
|
|
dw .flash
|
|
|
|
dw .dig
|
|
|
|
dw .teleport
|
|
|
|
dw .softboiled
|
|
|
|
.fly
|
|
|
|
bit 2,a ; does the player have the Thunder Badge?
|
|
|
|
jp z,.newBadgeRequired
|
|
|
|
call CheckIfInOutsideMap
|
|
|
|
jr z,.canFly
|
|
|
|
ld a,[wWhichPokemon]
|
2014-06-14 11:12:40 +00:00
|
|
|
ld hl,wPartyMonNicks
|
2014-05-22 22:13:20 +00:00
|
|
|
call GetPartyMonName
|
|
|
|
ld hl,.cannotFlyHereText
|
|
|
|
call PrintText
|
|
|
|
jp .loop
|
|
|
|
.canFly
|
|
|
|
call ChooseFlyDestination
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wd732]
|
2014-05-22 22:13:20 +00:00
|
|
|
bit 3,a ; did the player decide to fly?
|
|
|
|
jp nz,.goBackToMap
|
|
|
|
call LoadFontTilePatterns
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl,wd72e
|
2014-05-22 22:13:20 +00:00
|
|
|
set 1,[hl]
|
|
|
|
jp StartMenu_Pokemon
|
|
|
|
.cut
|
|
|
|
bit 1,a ; does the player have the Cascade Badge?
|
|
|
|
jp z,.newBadgeRequired
|
2014-06-16 20:57:26 +00:00
|
|
|
predef UsedCut
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wcd6a]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jp z,.loop
|
|
|
|
jp CloseTextDisplay
|
|
|
|
.surf
|
|
|
|
bit 4,a ; does the player have the Soul Badge?
|
|
|
|
jp z,.newBadgeRequired
|
|
|
|
callba CheckForForcedBikeSurf
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl,wd728
|
2014-05-22 22:13:20 +00:00
|
|
|
bit 1,[hl]
|
|
|
|
res 1,[hl]
|
|
|
|
jp z,.loop
|
|
|
|
ld a,SURFBOARD
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcf91],a
|
|
|
|
ld [wd152],a
|
2014-05-22 22:13:20 +00:00
|
|
|
call UseItem
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wcd6a]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jp z,.loop
|
|
|
|
call GBPalWhiteOutWithDelay3
|
|
|
|
jp .goBackToMap
|
|
|
|
.strength
|
|
|
|
bit 3,a ; does the player have the Rainbow Badge?
|
|
|
|
jp z,.newBadgeRequired
|
2014-06-16 20:57:26 +00:00
|
|
|
predef PrintStrengthTxt
|
2014-05-22 22:13:20 +00:00
|
|
|
call GBPalWhiteOutWithDelay3
|
|
|
|
jp .goBackToMap
|
|
|
|
.flash
|
|
|
|
bit 0,a ; does the player have the Boulder Badge?
|
|
|
|
jp z,.newBadgeRequired
|
|
|
|
xor a
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [wMapPalOffset],a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld hl,.flashLightsAreaText
|
|
|
|
call PrintText
|
|
|
|
call GBPalWhiteOutWithDelay3
|
|
|
|
jp .goBackToMap
|
|
|
|
.flashLightsAreaText
|
|
|
|
TX_FAR _FlashLightsAreaText
|
|
|
|
db "@"
|
|
|
|
.dig
|
|
|
|
ld a,ESCAPE_ROPE
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcf91],a
|
|
|
|
ld [wd152],a
|
2014-05-22 22:13:20 +00:00
|
|
|
call UseItem
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wcd6a]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jp z,.loop
|
|
|
|
call GBPalWhiteOutWithDelay3
|
|
|
|
jp .goBackToMap
|
|
|
|
.teleport
|
|
|
|
call CheckIfInOutsideMap
|
|
|
|
jr z,.canTeleport
|
|
|
|
ld a,[wWhichPokemon]
|
2014-06-14 11:12:40 +00:00
|
|
|
ld hl,wPartyMonNicks
|
2014-05-22 22:13:20 +00:00
|
|
|
call GetPartyMonName
|
|
|
|
ld hl,.cannotUseTeleportNowText
|
|
|
|
call PrintText
|
|
|
|
jp .loop
|
|
|
|
.canTeleport
|
|
|
|
ld hl,.warpToLastPokemonCenterText
|
|
|
|
call PrintText
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl,wd732
|
2014-05-22 22:13:20 +00:00
|
|
|
set 3,[hl]
|
|
|
|
set 6,[hl]
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl,wd72e
|
2014-05-22 22:13:20 +00:00
|
|
|
set 1,[hl]
|
|
|
|
res 4,[hl]
|
|
|
|
ld c,60
|
|
|
|
call DelayFrames
|
|
|
|
call GBPalWhiteOutWithDelay3 ; zero all three palettes and wait 3 V-blanks
|
|
|
|
jp .goBackToMap
|
|
|
|
.warpToLastPokemonCenterText
|
|
|
|
TX_FAR _WarpToLastPokemonCenterText
|
|
|
|
db "@"
|
|
|
|
.cannotUseTeleportNowText
|
|
|
|
TX_FAR _CannotUseTeleportNowText
|
|
|
|
db "@"
|
|
|
|
.cannotFlyHereText
|
|
|
|
TX_FAR _CannotFlyHereText
|
|
|
|
db "@"
|
|
|
|
.softboiled
|
2014-06-14 11:12:40 +00:00
|
|
|
ld hl,wPartyMon1MaxHP
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a,[wWhichPokemon]
|
2014-06-14 11:12:40 +00:00
|
|
|
ld bc,wPartyMon2 - wPartyMon1
|
2014-05-22 22:13:20 +00:00
|
|
|
call AddNTimes
|
|
|
|
ld a,[hli]
|
|
|
|
ld [H_DIVIDEND],a
|
|
|
|
ld a,[hl]
|
|
|
|
ld [H_DIVIDEND + 1],a
|
|
|
|
ld a,5
|
|
|
|
ld [H_DIVISOR],a
|
|
|
|
ld b,2 ; number of bytes
|
|
|
|
call Divide
|
2014-06-14 11:12:40 +00:00
|
|
|
ld bc,wPartyMon1HP - wPartyMon1MaxHP
|
2014-05-22 22:13:20 +00:00
|
|
|
add hl,bc
|
|
|
|
ld a,[hld]
|
|
|
|
ld b,a
|
|
|
|
ld a,[H_QUOTIENT + 3]
|
|
|
|
sub b
|
|
|
|
ld b,[hl]
|
|
|
|
ld a,[H_QUOTIENT + 2]
|
|
|
|
sbc b
|
|
|
|
jp nc,.notHealthyEnough
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wcc2b]
|
2014-05-22 22:13:20 +00:00
|
|
|
push af
|
|
|
|
ld a,POTION
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcf91],a
|
|
|
|
ld [wd152],a
|
2014-05-22 22:13:20 +00:00
|
|
|
call UseItem
|
|
|
|
pop af
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcc2b],a
|
2014-05-22 22:13:20 +00:00
|
|
|
jp .loop
|
|
|
|
.notHealthyEnough ; if current HP is less than 1/5 of max HP
|
|
|
|
ld hl,.notHealthyEnoughText
|
|
|
|
call PrintText
|
|
|
|
jp .loop
|
|
|
|
.notHealthyEnoughText
|
|
|
|
TX_FAR _NotHealthyEnoughText
|
|
|
|
db "@"
|
|
|
|
.goBackToMap
|
2014-09-10 03:55:19 +00:00
|
|
|
call RestoreScreenTilesAndReloadTilePatterns
|
2014-05-22 22:13:20 +00:00
|
|
|
jp CloseTextDisplay
|
|
|
|
.newBadgeRequired
|
|
|
|
ld hl,.newBadgeRequiredText
|
|
|
|
call PrintText
|
|
|
|
jp .loop
|
|
|
|
.newBadgeRequiredText
|
|
|
|
TX_FAR _NewBadgeRequiredText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
; writes a blank tile to all possible menu cursor positions on the party menu
|
|
|
|
ErasePartyMenuCursors: ; 132ed (4:72ed)
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 0, 1
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc,2 * 20 ; menu cursor positions are 2 rows apart
|
|
|
|
ld a,6 ; 6 menu cursor positions
|
|
|
|
.loop
|
|
|
|
ld [hl]," "
|
|
|
|
add hl,bc
|
|
|
|
dec a
|
|
|
|
jr nz,.loop
|
|
|
|
ret
|
|
|
|
|
|
|
|
ItemMenuLoop: ; 132fc (4:72fc)
|
|
|
|
call LoadScreenTilesFromBuffer2DisableBGTransfer ; restore saved screen
|
|
|
|
call GoPAL_SET_CF1C
|
|
|
|
|
|
|
|
StartMenu_Item: ; 13302 (4:7302)
|
|
|
|
ld a,[W_ISLINKBATTLE]
|
|
|
|
dec a
|
|
|
|
jr nz,.notInLinkBattle
|
|
|
|
ld hl,CannotUseItemsHereText
|
|
|
|
call PrintText
|
|
|
|
jr .exitMenu
|
|
|
|
.notInLinkBattle
|
|
|
|
ld bc,wNumBagItems
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl,wcf8b
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a,c
|
|
|
|
ld [hli],a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [hl],b ; store item bag pointer at wcf8b (for DisplayListMenuID)
|
2014-05-22 22:13:20 +00:00
|
|
|
xor a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcf93],a
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a,ITEMLISTMENU
|
|
|
|
ld [wListMenuID],a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wcc2c]
|
2014-05-22 22:13:20 +00:00
|
|
|
ld [wCurrentMenuItem],a
|
|
|
|
call DisplayListMenuID
|
|
|
|
ld a,[wCurrentMenuItem]
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wcc2c],a
|
2014-05-22 22:13:20 +00:00
|
|
|
jr nc,.choseItem
|
|
|
|
.exitMenu
|
|
|
|
call LoadScreenTilesFromBuffer2 ; restore saved screen
|
|
|
|
call LoadTextBoxTilePatterns
|
|
|
|
call UpdateSprites ; move sprites
|
|
|
|
jp RedisplayStartMenu
|
|
|
|
.choseItem
|
|
|
|
; erase menu cursor (blank each tile in front of an item name)
|
|
|
|
ld a," "
|
2014-06-25 20:58:27 +00:00
|
|
|
Coorda 5, 4
|
|
|
|
Coorda 5, 6
|
|
|
|
Coorda 5, 8
|
|
|
|
Coorda 5, 10
|
2014-05-22 22:13:20 +00:00
|
|
|
call PlaceUnfilledArrowMenuCursor
|
|
|
|
xor a
|
2014-08-09 05:39:13 +00:00
|
|
|
ld [wMenuItemToSwap],a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wcf91]
|
2014-05-22 22:13:20 +00:00
|
|
|
cp a,BICYCLE
|
|
|
|
jp z,.useOrTossItem
|
|
|
|
.notBicycle1
|
|
|
|
ld a,$06 ; use/toss menu
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd125],a
|
2014-05-22 22:13:20 +00:00
|
|
|
call DisplayTextBoxID
|
|
|
|
ld hl,wTopMenuItemY
|
|
|
|
ld a,11
|
|
|
|
ld [hli],a ; top menu item Y
|
|
|
|
ld a,14
|
|
|
|
ld [hli],a ; top menu item X
|
|
|
|
xor a
|
|
|
|
ld [hli],a ; current menu item ID
|
|
|
|
inc hl
|
|
|
|
inc a ; a = 1
|
|
|
|
ld [hli],a ; max menu item ID
|
|
|
|
ld a,%00000011 ; A button, B button
|
|
|
|
ld [hli],a ; menu watched keys
|
|
|
|
xor a
|
|
|
|
ld [hl],a ; old menu item id
|
|
|
|
call HandleMenuInput
|
|
|
|
call PlaceUnfilledArrowMenuCursor
|
|
|
|
bit 1,a ; was the B button pressed?
|
|
|
|
jr z,.useOrTossItem
|
|
|
|
jp ItemMenuLoop
|
|
|
|
.useOrTossItem ; if the player made the choice to use or toss the item
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wcf91]
|
|
|
|
ld [wd11e],a
|
2014-05-22 22:13:20 +00:00
|
|
|
call GetItemName
|
2014-05-26 21:04:56 +00:00
|
|
|
call CopyStringToCF4B ; copy name to wcf4b
|
|
|
|
ld a,[wcf91]
|
2014-05-22 22:13:20 +00:00
|
|
|
cp a,BICYCLE
|
|
|
|
jr nz,.notBicycle2
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wd732]
|
2014-05-22 22:13:20 +00:00
|
|
|
bit 5,a
|
|
|
|
jr z,.useItem_closeMenu
|
|
|
|
ld hl,CannotGetOffHereText
|
|
|
|
call PrintText
|
|
|
|
jp ItemMenuLoop
|
|
|
|
.notBicycle2
|
|
|
|
ld a,[wCurrentMenuItem]
|
|
|
|
and a
|
|
|
|
jr nz,.tossItem
|
|
|
|
.useItem
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd152],a
|
|
|
|
ld a,[wcf91]
|
2014-05-22 22:13:20 +00:00
|
|
|
cp a,HM_01
|
|
|
|
jr nc,.useItem_partyMenu
|
|
|
|
ld hl,UsableItems_CloseMenu
|
|
|
|
ld de,1
|
|
|
|
call IsInArray
|
|
|
|
jr c,.useItem_closeMenu
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wcf91]
|
2014-05-22 22:13:20 +00:00
|
|
|
ld hl,UsableItems_PartyMenu
|
|
|
|
ld de,1
|
|
|
|
call IsInArray
|
|
|
|
jr c,.useItem_partyMenu
|
|
|
|
call UseItem
|
|
|
|
jp ItemMenuLoop
|
|
|
|
.useItem_closeMenu
|
|
|
|
xor a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd152],a
|
2014-05-22 22:13:20 +00:00
|
|
|
call UseItem
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wcd6a]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jp z,ItemMenuLoop
|
|
|
|
jp CloseStartMenu
|
|
|
|
.useItem_partyMenu
|
2014-09-13 07:50:56 +00:00
|
|
|
ld a,[wUpdateSpritesEnabled]
|
2014-05-22 22:13:20 +00:00
|
|
|
push af
|
|
|
|
call UseItem
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wcd6a]
|
2014-05-22 22:13:20 +00:00
|
|
|
cp a,$02
|
|
|
|
jp z,.partyMenuNotDisplayed
|
|
|
|
call GBPalWhiteOutWithDelay3
|
2014-09-10 03:55:19 +00:00
|
|
|
call RestoreScreenTilesAndReloadTilePatterns
|
2014-05-22 22:13:20 +00:00
|
|
|
pop af
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [wUpdateSpritesEnabled],a
|
2014-05-22 22:13:20 +00:00
|
|
|
jp StartMenu_Item
|
|
|
|
.partyMenuNotDisplayed
|
|
|
|
pop af
|
2014-09-13 07:50:56 +00:00
|
|
|
ld [wUpdateSpritesEnabled],a
|
2014-05-22 22:13:20 +00:00
|
|
|
jp ItemMenuLoop
|
|
|
|
.tossItem
|
|
|
|
call IsKeyItem
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wd124]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jr nz,.skipAskingQuantity
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wcf91]
|
2014-05-22 22:13:20 +00:00
|
|
|
call IsItemHM
|
|
|
|
jr c,.skipAskingQuantity
|
|
|
|
call DisplayChooseQuantityMenu
|
|
|
|
inc a
|
|
|
|
jr z,.tossZeroItems
|
|
|
|
.skipAskingQuantity
|
|
|
|
ld hl,wNumBagItems
|
|
|
|
call TossItem
|
|
|
|
.tossZeroItems
|
|
|
|
jp ItemMenuLoop
|
|
|
|
|
|
|
|
CannotUseItemsHereText: ; 1342a (4:742a)
|
|
|
|
TX_FAR _CannotUseItemsHereText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
CannotGetOffHereText: ; 1342f (4:742f)
|
|
|
|
TX_FAR _CannotGetOffHereText
|
|
|
|
db "@"
|
|
|
|
|
|
|
|
; items which bring up the party menu when used
|
|
|
|
UsableItems_PartyMenu: ; 13434 (4:7434)
|
|
|
|
db MOON_STONE
|
|
|
|
db ANTIDOTE
|
|
|
|
db BURN_HEAL
|
|
|
|
db ICE_HEAL
|
|
|
|
db AWAKENING
|
|
|
|
db PARLYZ_HEAL
|
|
|
|
db FULL_RESTORE
|
|
|
|
db MAX_POTION
|
|
|
|
db HYPER_POTION
|
|
|
|
db SUPER_POTION
|
|
|
|
db POTION
|
|
|
|
db FIRE_STONE
|
|
|
|
db THUNDER_STONE
|
|
|
|
db WATER_STONE
|
|
|
|
db HP_UP
|
|
|
|
db PROTEIN
|
|
|
|
db IRON
|
|
|
|
db CARBOS
|
|
|
|
db CALCIUM
|
|
|
|
db RARE_CANDY
|
|
|
|
db LEAF_STONE
|
|
|
|
db FULL_HEAL
|
|
|
|
db REVIVE
|
|
|
|
db MAX_REVIVE
|
|
|
|
db FRESH_WATER
|
|
|
|
db SODA_POP
|
|
|
|
db LEMONADE
|
|
|
|
db X_ATTACK
|
|
|
|
db X_DEFEND
|
|
|
|
db X_SPEED
|
|
|
|
db X_SPECIAL
|
|
|
|
db PP_UP
|
|
|
|
db ETHER
|
|
|
|
db MAX_ETHER
|
|
|
|
db ELIXER
|
|
|
|
db MAX_ELIXER
|
|
|
|
db $ff
|
|
|
|
|
|
|
|
; items which close the item menu when used
|
|
|
|
UsableItems_CloseMenu: ; 13459 (4:7459)
|
|
|
|
db ESCAPE_ROPE
|
|
|
|
db ITEMFINDER
|
|
|
|
db POKE_FLUTE
|
|
|
|
db OLD_ROD
|
|
|
|
db GOOD_ROD
|
|
|
|
db SUPER_ROD
|
|
|
|
db $ff
|
|
|
|
|
|
|
|
StartMenu_TrainerInfo: ; 13460 (4:7460)
|
|
|
|
call GBPalWhiteOut
|
|
|
|
call ClearScreen
|
|
|
|
call UpdateSprites ; move sprites
|
2014-09-14 18:29:18 +00:00
|
|
|
ld a,[hTilesetType]
|
2014-05-22 22:13:20 +00:00
|
|
|
push af
|
|
|
|
xor a
|
2014-09-14 18:29:18 +00:00
|
|
|
ld [hTilesetType],a
|
2014-05-22 22:13:20 +00:00
|
|
|
call DrawTrainerInfo
|
2014-06-16 20:57:26 +00:00
|
|
|
predef DrawBadges ; draw badges
|
2014-05-22 22:13:20 +00:00
|
|
|
ld b,$0d
|
|
|
|
call GoPAL_SET
|
|
|
|
call GBPalNormal
|
|
|
|
call WaitForTextScrollButtonPress ; wait for button press
|
|
|
|
call GBPalWhiteOut
|
|
|
|
call LoadFontTilePatterns
|
|
|
|
call LoadScreenTilesFromBuffer2 ; restore saved screen
|
|
|
|
call GoPAL_SET_CF1C
|
|
|
|
call ReloadMapData
|
|
|
|
call LoadGBPal
|
|
|
|
pop af
|
2014-09-14 18:29:18 +00:00
|
|
|
ld [hTilesetType],a
|
2014-05-22 22:13:20 +00:00
|
|
|
jp RedisplayStartMenu
|
|
|
|
|
|
|
|
; loads tile patterns and draws everything except for gym leader faces / badges
|
|
|
|
DrawTrainerInfo: ; 1349a (4:749a)
|
|
|
|
ld de,RedPicFront
|
|
|
|
ld bc,(BANK(RedPicFront) << 8) | $01
|
2014-06-16 20:57:26 +00:00
|
|
|
predef Predef3B
|
2014-05-22 22:13:20 +00:00
|
|
|
call DisableLCD
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 0, 2
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a," "
|
|
|
|
call TrainerInfo_DrawVerticalLine
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 1, 2
|
2014-05-22 22:13:20 +00:00
|
|
|
call TrainerInfo_DrawVerticalLine
|
2014-05-29 08:31:46 +00:00
|
|
|
ld hl,vChars2 + $70
|
|
|
|
ld de,vChars2
|
|
|
|
ld bc,$70 * 4
|
2014-05-22 22:13:20 +00:00
|
|
|
call CopyData
|
|
|
|
ld hl,TrainerInfoTextBoxTileGraphics ; $7b98 ; trainer info text box tile patterns
|
2014-05-29 08:31:46 +00:00
|
|
|
ld de,vChars2 + $770
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc,$0080
|
|
|
|
push bc
|
|
|
|
call TrainerInfo_FarCopyData
|
|
|
|
ld hl,BlankLeaderNames ; $7c28
|
2014-05-29 08:31:46 +00:00
|
|
|
ld de,vChars2 + $600
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc,$0170
|
|
|
|
call TrainerInfo_FarCopyData
|
|
|
|
pop bc
|
|
|
|
ld hl,BadgeNumbersTileGraphics ; $7d98 ; badge number tile patterns
|
2014-05-29 08:31:46 +00:00
|
|
|
ld de,vChars1 + $580
|
2014-05-22 22:13:20 +00:00
|
|
|
call TrainerInfo_FarCopyData
|
|
|
|
ld hl,GymLeaderFaceAndBadgeTileGraphics ; $6a9e ; gym leader face and badge tile patterns
|
2014-05-29 08:31:46 +00:00
|
|
|
ld de,vChars2 + $200
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc,$0400
|
|
|
|
ld a,$03
|
|
|
|
call FarCopyData2
|
|
|
|
ld hl,TextBoxGraphics ; $6288
|
|
|
|
ld de,$00d0
|
|
|
|
add hl,de ; hl = colon tile pattern
|
2014-05-29 08:31:46 +00:00
|
|
|
ld de,vChars1 + $560
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc,$0010
|
|
|
|
ld a,$04
|
|
|
|
push bc
|
|
|
|
call FarCopyData2
|
|
|
|
pop bc
|
|
|
|
ld hl,TrainerInfoTextBoxTileGraphics + $80 ; $7c18 ; background tile pattern
|
2014-05-29 08:31:46 +00:00
|
|
|
ld de,vChars1 + $570
|
2014-05-22 22:13:20 +00:00
|
|
|
call TrainerInfo_FarCopyData
|
|
|
|
call EnableLCD
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl,wWhichTrade
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a,18 + 1
|
|
|
|
ld [hli],a
|
|
|
|
dec a
|
|
|
|
ld [hli],a
|
|
|
|
ld [hl],1
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 0, 0
|
2014-05-22 22:13:20 +00:00
|
|
|
call TrainerInfo_DrawTextBox
|
2014-05-26 21:04:56 +00:00
|
|
|
ld hl,wWhichTrade
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a,16 + 1
|
|
|
|
ld [hli],a
|
|
|
|
dec a
|
|
|
|
ld [hli],a
|
|
|
|
ld [hl],3
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 1, 10
|
2014-05-22 22:13:20 +00:00
|
|
|
call TrainerInfo_DrawTextBox
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 0, 10
|
2014-05-22 22:13:20 +00:00
|
|
|
ld a,$d7
|
|
|
|
call TrainerInfo_DrawVerticalLine
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 19, 10
|
2014-05-22 22:13:20 +00:00
|
|
|
call TrainerInfo_DrawVerticalLine
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 6, 9
|
2014-05-22 22:13:20 +00:00
|
|
|
ld de,TrainerInfo_BadgesText
|
|
|
|
call PlaceString
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 2, 2
|
2014-05-22 22:13:20 +00:00
|
|
|
ld de,TrainerInfo_NameMoneyTimeText
|
|
|
|
call PlaceString
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 7, 2
|
2014-06-14 11:12:40 +00:00
|
|
|
ld de,wPlayerName
|
2014-05-22 22:13:20 +00:00
|
|
|
call PlaceString
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 8, 4
|
2014-05-22 22:13:20 +00:00
|
|
|
ld de,wPlayerMoney
|
|
|
|
ld c,$e3
|
|
|
|
call PrintBCDNumber
|
2014-06-25 20:58:27 +00:00
|
|
|
hlCoord 9, 6
|
2014-05-26 21:04:56 +00:00
|
|
|
ld de,W_PLAYTIMEHOURS + 1 ; hours
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc,$4103
|
|
|
|
call PrintNumber
|
|
|
|
ld [hl],$d6 ; colon tile ID
|
|
|
|
inc hl
|
2014-05-26 21:04:56 +00:00
|
|
|
ld de,W_PLAYTIMEMINUTES + 1 ; minutes
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc,$8102
|
|
|
|
jp PrintNumber
|
|
|
|
|
|
|
|
TrainerInfo_FarCopyData: ; 1357f (4:757f)
|
|
|
|
ld a,$0b
|
|
|
|
jp FarCopyData2
|
|
|
|
|
|
|
|
TrainerInfo_NameMoneyTimeText: ; 13584 (4:7584)
|
|
|
|
db "NAME/"
|
|
|
|
next "MONEY/"
|
|
|
|
next "TIME/@"
|
|
|
|
|
|
|
|
; $76 is a circle tile
|
|
|
|
TrainerInfo_BadgesText: ; 13597 (4:7597)
|
|
|
|
db $76,"BADGES",$76,"@"
|
|
|
|
|
|
|
|
; draws a text box on the trainer info screen
|
|
|
|
; height is always 6
|
|
|
|
; INPUT:
|
|
|
|
; hl = destination address
|
2014-05-26 21:04:56 +00:00
|
|
|
; [wWhichTrade] = width + 1
|
|
|
|
; [wTrainerEngageDistance] = width
|
|
|
|
; [wTrainerFacingDirection] = distance from the end of a text box row to the start of the next
|
2014-05-22 22:13:20 +00:00
|
|
|
TrainerInfo_DrawTextBox: ; 135a0 (4:75a0)
|
|
|
|
ld a,$79 ; upper left corner tile ID
|
|
|
|
ld de,$7a7b ; top edge and upper right corner tile ID's
|
|
|
|
call TrainerInfo_DrawHorizontalEdge ; draw top edge
|
|
|
|
call TrainerInfo_NextTextBoxRow
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wWhichTrade] ; width of the text box plus one
|
2014-05-22 22:13:20 +00:00
|
|
|
ld e,a
|
|
|
|
ld d,0
|
|
|
|
ld c,6 ; height of the text box
|
|
|
|
.loop
|
|
|
|
ld [hl],$7c ; left edge tile ID
|
|
|
|
add hl,de
|
|
|
|
ld [hl],$78 ; right edge tile ID
|
|
|
|
call TrainerInfo_NextTextBoxRow
|
|
|
|
dec c
|
|
|
|
jr nz,.loop
|
|
|
|
ld a,$7d ; lower left corner tile ID
|
|
|
|
ld de,$777e ; bottom edge and lower right corner tile ID's
|
|
|
|
|
|
|
|
TrainerInfo_DrawHorizontalEdge: ; 135c3 (4:75c3)
|
|
|
|
ld [hli],a ; place left corner tile
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wTrainerEngageDistance] ; width of the text box
|
2014-05-22 22:13:20 +00:00
|
|
|
ld c,a
|
|
|
|
ld a,d
|
|
|
|
.loop
|
|
|
|
ld [hli],a ; place edge tile
|
|
|
|
dec c
|
|
|
|
jr nz,.loop
|
|
|
|
ld a,e
|
|
|
|
ld [hl],a ; place right corner tile
|
|
|
|
ret
|
|
|
|
|
|
|
|
TrainerInfo_NextTextBoxRow: ; 135d0 (4:75d0)
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wTrainerFacingDirection] ; distance to the start of the next row
|
2014-05-22 22:13:20 +00:00
|
|
|
.loop
|
|
|
|
inc hl
|
|
|
|
dec a
|
|
|
|
jr nz,.loop
|
|
|
|
ret
|
|
|
|
|
|
|
|
; draws a vertical line
|
|
|
|
; INPUT:
|
|
|
|
; hl = address of top tile in the line
|
|
|
|
; a = tile ID
|
|
|
|
TrainerInfo_DrawVerticalLine: ; 135d8 (4:75d8)
|
|
|
|
ld de,20
|
|
|
|
ld c,8
|
|
|
|
.loop
|
|
|
|
ld [hl],a
|
|
|
|
add hl,de
|
|
|
|
dec c
|
|
|
|
jr nz,.loop
|
|
|
|
ret
|
|
|
|
|
|
|
|
StartMenu_SaveReset: ; 135e3 (4:75e3)
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a,[wd72e]
|
2014-05-22 22:13:20 +00:00
|
|
|
bit 6,a ; is the player using the link feature?
|
2014-05-23 22:34:35 +00:00
|
|
|
jp nz,Init
|
2014-06-16 20:57:26 +00:00
|
|
|
predef SaveSAV ; save the game
|
2014-05-22 22:13:20 +00:00
|
|
|
call LoadScreenTilesFromBuffer2 ; restore saved screen
|
|
|
|
jp HoldTextDisplayOpen
|
|
|
|
|
|
|
|
StartMenu_Option: ; 135f6 (4:75f6)
|
|
|
|
xor a
|
|
|
|
ld [H_AUTOBGTRANSFERENABLED],a
|
|
|
|
call ClearScreen
|
|
|
|
call UpdateSprites
|
|
|
|
callab DisplayOptionMenu
|
|
|
|
call LoadScreenTilesFromBuffer2 ; restore saved screen
|
|
|
|
call LoadTextBoxTilePatterns
|
|
|
|
call UpdateSprites
|
|
|
|
jp RedisplayStartMenu
|
|
|
|
|
|
|
|
SwitchPartyMon: ; 13613 (4:7613)
|
|
|
|
call SwitchPartyMon_Stats
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wWhichTrade] ; wWhichTrade
|
2014-05-22 22:13:20 +00:00
|
|
|
call SwitchPartyMon_OAM
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
2014-05-22 22:13:20 +00:00
|
|
|
call SwitchPartyMon_OAM
|
|
|
|
jp RedrawPartyMenu_
|
|
|
|
|
|
|
|
SwitchPartyMon_OAM: ; 13625 (4:7625)
|
|
|
|
push af
|
|
|
|
ld hl, wTileMap
|
|
|
|
ld bc, $28
|
|
|
|
call AddNTimes
|
|
|
|
ld c, $28
|
|
|
|
ld a, $7f
|
|
|
|
.asm_13633
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_13633
|
|
|
|
pop af
|
|
|
|
ld hl, wOAMBuffer
|
|
|
|
ld bc, $10
|
|
|
|
call AddNTimes
|
|
|
|
ld de, $4
|
|
|
|
ld c, e
|
|
|
|
.asm_13645
|
|
|
|
ld [hl], $a0
|
|
|
|
add hl, de
|
|
|
|
dec c
|
|
|
|
jr nz, .asm_13645
|
|
|
|
call WaitForSoundToFinish
|
|
|
|
ld a, (SFX_02_58 - SFX_Headers_02) / 3
|
|
|
|
jp PlaySound
|
|
|
|
|
|
|
|
SwitchPartyMon_Stats: ; 13653 (4:7653)
|
2014-08-09 05:39:13 +00:00
|
|
|
ld a, [wMenuItemToSwap]
|
2014-05-22 22:13:20 +00:00
|
|
|
and a
|
|
|
|
jr nz, .asm_13661
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wWhichPokemon] ; wWhichPokemon
|
2014-05-22 22:13:20 +00:00
|
|
|
inc a
|
2014-08-09 05:39:13 +00:00
|
|
|
ld [wMenuItemToSwap], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ret
|
|
|
|
.asm_13661
|
|
|
|
xor a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd07d], a
|
2014-08-09 05:39:13 +00:00
|
|
|
ld a, [wMenuItemToSwap]
|
2014-05-22 22:13:20 +00:00
|
|
|
dec a
|
|
|
|
ld b, a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
|
|
|
ld [wWhichTrade], a ; wWhichTrade
|
2014-05-22 22:13:20 +00:00
|
|
|
cp b
|
|
|
|
jr nz, .asm_1367b
|
|
|
|
xor a
|
2014-08-09 05:39:13 +00:00
|
|
|
ld [wMenuItemToSwap], a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd07d], a
|
2014-05-22 22:13:20 +00:00
|
|
|
ret
|
|
|
|
.asm_1367b
|
|
|
|
ld a, b
|
2014-08-09 05:39:13 +00:00
|
|
|
ld [wMenuItemToSwap], a
|
2014-05-22 22:13:20 +00:00
|
|
|
push hl
|
|
|
|
push de
|
2014-06-14 11:12:40 +00:00
|
|
|
ld hl, wPartySpecies
|
2014-05-22 22:13:20 +00:00
|
|
|
ld d, h
|
|
|
|
ld e, l
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
2014-05-22 22:13:20 +00:00
|
|
|
add l
|
|
|
|
ld l, a
|
|
|
|
jr nc, .asm_1368e
|
|
|
|
inc h
|
|
|
|
.asm_1368e
|
2014-08-09 05:39:13 +00:00
|
|
|
ld a, [wMenuItemToSwap]
|
2014-05-22 22:13:20 +00:00
|
|
|
add e
|
|
|
|
ld e, a
|
|
|
|
jr nc, .asm_13696
|
|
|
|
inc d
|
|
|
|
.asm_13696
|
|
|
|
ld a, [hl]
|
|
|
|
ld [H_DIVIDEND], a ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
|
|
|
|
ld a, [de]
|
|
|
|
ld [hl], a
|
|
|
|
ld a, [H_DIVIDEND] ; $ff95 (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT)
|
|
|
|
ld [de], a
|
2014-06-14 11:12:40 +00:00
|
|
|
ld hl, wPartyMons
|
|
|
|
ld bc, wPartyMon2 - wPartyMon1
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
2014-05-22 22:13:20 +00:00
|
|
|
call AddNTimes
|
|
|
|
push hl
|
2014-09-10 03:55:19 +00:00
|
|
|
ld de, wSwitchPartyMonTempBuffer
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc, $2c
|
|
|
|
call CopyData
|
2014-06-14 11:12:40 +00:00
|
|
|
ld hl, wPartyMons
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc, $2c
|
2014-08-09 05:39:13 +00:00
|
|
|
ld a, [wMenuItemToSwap]
|
2014-05-22 22:13:20 +00:00
|
|
|
call AddNTimes
|
|
|
|
pop de
|
|
|
|
push hl
|
|
|
|
ld bc, $2c
|
|
|
|
call CopyData
|
|
|
|
pop de
|
2014-09-10 03:55:19 +00:00
|
|
|
ld hl, wSwitchPartyMonTempBuffer
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc, $2c
|
|
|
|
call CopyData
|
2014-06-14 11:12:40 +00:00
|
|
|
ld hl, wPartyMonOT ; wd273
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
2014-05-22 22:13:20 +00:00
|
|
|
call SkipFixedLengthTextEntries
|
|
|
|
push hl
|
2014-09-10 03:55:19 +00:00
|
|
|
ld de, wSwitchPartyMonTempBuffer
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc, $b
|
|
|
|
call CopyData
|
2014-06-14 11:12:40 +00:00
|
|
|
ld hl, wPartyMonOT ; wd273
|
2014-08-09 05:39:13 +00:00
|
|
|
ld a, [wMenuItemToSwap]
|
2014-05-22 22:13:20 +00:00
|
|
|
call SkipFixedLengthTextEntries
|
|
|
|
pop de
|
|
|
|
push hl
|
|
|
|
ld bc, $b
|
|
|
|
call CopyData
|
|
|
|
pop de
|
2014-09-10 03:55:19 +00:00
|
|
|
ld hl, wSwitchPartyMonTempBuffer
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc, $b
|
|
|
|
call CopyData
|
2014-06-14 11:12:40 +00:00
|
|
|
ld hl, wPartyMonNicks ; wPartyMonNicks
|
2014-05-26 21:04:56 +00:00
|
|
|
ld a, [wCurrentMenuItem] ; wCurrentMenuItem
|
2014-05-22 22:13:20 +00:00
|
|
|
call SkipFixedLengthTextEntries
|
|
|
|
push hl
|
2014-09-10 03:55:19 +00:00
|
|
|
ld de, wSwitchPartyMonTempBuffer
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc, $b
|
|
|
|
call CopyData
|
2014-06-14 11:12:40 +00:00
|
|
|
ld hl, wPartyMonNicks ; wPartyMonNicks
|
2014-08-09 05:39:13 +00:00
|
|
|
ld a, [wMenuItemToSwap]
|
2014-05-22 22:13:20 +00:00
|
|
|
call SkipFixedLengthTextEntries
|
|
|
|
pop de
|
|
|
|
push hl
|
|
|
|
ld bc, $b
|
|
|
|
call CopyData
|
|
|
|
pop de
|
2014-09-10 03:55:19 +00:00
|
|
|
ld hl, wSwitchPartyMonTempBuffer
|
2014-05-22 22:13:20 +00:00
|
|
|
ld bc, $b
|
|
|
|
call CopyData
|
2014-08-09 05:39:13 +00:00
|
|
|
ld a, [wMenuItemToSwap]
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wWhichTrade], a ; wWhichTrade
|
2014-05-22 22:13:20 +00:00
|
|
|
xor a
|
2014-08-09 05:39:13 +00:00
|
|
|
ld [wMenuItemToSwap], a
|
2014-05-26 21:04:56 +00:00
|
|
|
ld [wd07d], a
|
2014-05-22 22:13:20 +00:00
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|