diff options
Diffstat (limited to 'engine/menu')
-rw-r--r-- | engine/menu/bills_pc.asm | 62 | ||||
-rwxr-xr-x | engine/menu/diploma.asm | 6 | ||||
-rwxr-xr-x | engine/menu/league_pc.asm | 10 | ||||
-rwxr-xr-x | engine/menu/main_menu.asm | 62 | ||||
-rwxr-xr-x | engine/menu/naming_screen.asm | 52 | ||||
-rwxr-xr-x | engine/menu/oaks_pc.asm | 15 | ||||
-rwxr-xr-x | engine/menu/party_menu.asm | 46 | ||||
-rwxr-xr-x | engine/menu/pc.asm | 34 | ||||
-rwxr-xr-x | engine/menu/players_pc.asm | 42 | ||||
-rwxr-xr-x | engine/menu/pokedex.asm | 81 | ||||
-rwxr-xr-x | engine/menu/prize_menu.asm | 102 | ||||
-rwxr-xr-x | engine/menu/start_menu.asm | 6 | ||||
-rwxr-xr-x | engine/menu/start_sub_menus.asm | 52 | ||||
-rwxr-xr-x | engine/menu/status_screen.asm | 63 | ||||
-rwxr-xr-x | engine/menu/vending_machine.asm | 29 |
15 files changed, 340 insertions, 322 deletions
diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm index 09dc73fe..8b3313b6 100644 --- a/engine/menu/bills_pc.asm +++ b/engine/menu/bills_pc.asm @@ -1,4 +1,4 @@ -DisplayPCMainMenu:: ; 213c8 (8:53c8) +DisplayPCMainMenu:: xor a ld [H_AUTOBGTRANSFERENABLED], a call SaveScreenTilesToBuffer2 @@ -92,7 +92,7 @@ OaksPCText: db "PC DE CHEN@" PKMNLeaguePCText: db "LIGUE ", $4a, "@" LogOffPCText: db "DECONNEXION@" -BillsPC_:: ; 0x214c2 +BillsPC_:: ld hl, wd730 set 6, [hl] xor a @@ -111,7 +111,7 @@ BillsPC_:: ; 0x214c2 ld hl, SwitchOnText call PrintText -BillsPCMenu: ; 214e8 (8:54e8) +BillsPCMenu: ld a, [wParentMenuItem] ld [wCurrentMenuItem], a ld hl, vChars2 + $780 @@ -185,7 +185,7 @@ BillsPCMenu: ; 214e8 (8:54e8) cp $3 jp z, BillsPCChangeBox ; change box -ExitBillsPC: ; 21588 (8:5588) +ExitBillsPC: ld a, [wFlags_0xcd60] bit 3, a ; accessing Bill's PC through another PC? jr nz, .next @@ -204,7 +204,7 @@ ExitBillsPC: ; 21588 (8:5588) res 6, [hl] ret -BillsPCDeposit: ; 215ac (8:55ac) +BillsPCDeposit: ld a, [wPartyCount] dec a jr nz, .partyLargeEnough @@ -248,12 +248,12 @@ BillsPCDeposit: ; 215ac (8:55ac) add "1" .next ld [hli], a - ld [hl], $50 + ld [hl], "@" ld hl, MonWasStoredText call PrintText jp BillsPCMenu -BillsPCWithdraw: ; 21618 (8:5618) +BillsPCWithdraw: ld a, [wNumInBox] and a jr nz, .boxNotEmpty @@ -290,7 +290,7 @@ BillsPCWithdraw: ; 21618 (8:5618) call PrintText jp BillsPCMenu -BillsPCRelease: ; 21673 (8:5673) +BillsPCRelease: ld a, [wNumInBox] and a jr nz, .loop @@ -317,11 +317,11 @@ BillsPCRelease: ; 21673 (8:5673) call PrintText jp BillsPCMenu -BillsPCChangeBox: ; 216b3 (8:56b3) +BillsPCChangeBox: callba ChangeBox jp BillsPCMenu -DisplayMonListMenu: ; 216be (8:56be) +DisplayMonListMenu: ld a, l ld [wListPointer], a ld a, h @@ -338,7 +338,7 @@ DisplayMonListMenu: ; 216be (8:56be) ld [wPartyAndBillsPCSavedMenuItem], a ret -BillsPCMenuText: ; 216e1 (8:56e1) +BillsPCMenuText: db "RETIRER ", $4a next "STOCKER ", $4a next "RELACHER ", $4a @@ -346,10 +346,10 @@ BillsPCMenuText: ; 216e1 (8:56e1) next "SALUT!" db "@" -BoxNoPCText: ; 21713 (8:5713) +BoxNoPCText: db "BOITE@" -KnowsHMMove:: ; 2171b (8:571b) +KnowsHMMove:: ; returns whether mon with party index [wWhichPokemon] knows an HM move ld hl, wPartyMon1Moves ld bc, wPartyMon2 - wPartyMon1 @@ -376,7 +376,7 @@ KnowsHMMove:: ; 2171b (8:571b) and a ret -HMMoveArray: ; 21745 (8:5745) +HMMoveArray: db CUT db FLY db SURF @@ -384,7 +384,7 @@ HMMoveArray: ; 21745 (8:5745) db FLASH db -1 -DisplayDepositWithdrawMenu: ; 2174b (8:574b) +DisplayDepositWithdrawMenu: coord hl, 9, 10 ld b, 6 ld c, 9 @@ -457,55 +457,55 @@ StatsCancelPCText: db "STATS" next "RETOUR@" -SwitchOnText: ; 0x217e9 +SwitchOnText: TX_FAR _SwitchOnText db "@" -WhatText: ; 0x217ee +WhatText: TX_FAR _WhatText db "@" -DepositWhichMonText: ; 0x217f3 +DepositWhichMonText: TX_FAR _DepositWhichMonText db "@" -MonWasStoredText: ; 0x217f8 +MonWasStoredText: TX_FAR _MonWasStoredText db "@" -CantDepositLastMonText: ; 0x217fd +CantDepositLastMonText: TX_FAR _CantDepositLastMonText db "@" -BoxFullText: ; 0x21802 +BoxFullText: TX_FAR _BoxFullText db "@" -MonIsTakenOutText: ; 0x21807 +MonIsTakenOutText: TX_FAR _MonIsTakenOutText db "@" -NoMonText: ; 0x2180c +NoMonText: TX_FAR _NoMonText db "@" -CantTakeMonText: ; 0x21811 +CantTakeMonText: TX_FAR _CantTakeMonText db "@" -ReleaseWhichMonText: ; 0x21816 +ReleaseWhichMonText: TX_FAR _ReleaseWhichMonText db "@" -OnceReleasedText: ; 0x2181b +OnceReleasedText: TX_FAR _OnceReleasedText db "@" -MonWasReleasedText: ; 0x21820 +MonWasReleasedText: TX_FAR _MonWasReleasedText db "@" -CableClubLeftGameboy:: ; 5824 (8:5825) +CableClubLeftGameboy:: ld a, [hSerialConnectionStatus] cp USING_EXTERNAL_CLOCK ret z @@ -522,7 +522,7 @@ CableClubLeftGameboy:: ; 5824 (8:5825) call EnableAutoTextBoxDrawing tx_pre_jump JustAMomentText -CableClubRightGameboy:: ; 5845 (8:5845) +CableClubRightGameboy:: ld a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK ret z @@ -539,7 +539,7 @@ CableClubRightGameboy:: ; 5845 (8:5845) call EnableAutoTextBoxDrawing tx_pre_jump JustAMomentText -JustAMomentText:: ; 21865 (8:5865) +JustAMomentText:: TX_FAR _JustAMomentText db "@" @@ -549,6 +549,6 @@ JustAMomentText:: ; 21865 (8:5865) call EnableAutoTextBoxDrawing tx_pre_jump OpenBillsPCText -OpenBillsPCText:: ; 21878 (8:5878) +OpenBillsPCText:: db $FD ; FuncTX_BillsPC diff --git a/engine/menu/diploma.asm b/engine/menu/diploma.asm index e18f7d55..4fc02ff8 100755 --- a/engine/menu/diploma.asm +++ b/engine/menu/diploma.asm @@ -1,4 +1,4 @@ -DisplayDiploma: ; 566e2 (15:66e2) +DisplayDiploma: call SaveScreenTilesToBuffer2 call GBPalWhiteOutWithDelay3 call ClearScreen @@ -69,7 +69,7 @@ DisplayDiploma: ; 566e2 (15:66e2) call Delay3 jp GBPalNormal -UnusedPlayerNameLengthFunc: ; 56777 (15:6777) +UnusedPlayerNameLengthFunc: ; Unused function that does a calculation involving the length of the player's ; name. ld hl, wPlayerName @@ -81,7 +81,7 @@ UnusedPlayerNameLengthFunc: ; 56777 (15:6777) dec c jr .loop -DiplomaTextPointersAndCoords: ; 56784 (15:6784) +DiplomaTextPointersAndCoords: dw DiplomaText dwCoord 5, 2 dw DiplomaPlayer diff --git a/engine/menu/league_pc.asm b/engine/menu/league_pc.asm index 2c88e137..826d9512 100755 --- a/engine/menu/league_pc.asm +++ b/engine/menu/league_pc.asm @@ -1,4 +1,4 @@ -PKMNLeaguePC: ; 0x7657e +PKMNLeaguePC: ld hl, AccessedHoFPCText call PrintText ld hl, wd730 @@ -50,7 +50,7 @@ PKMNLeaguePC: ; 0x7657e call RunDefaultPaletteCommand jp GBPalNormal -LeaguePCShowTeam: ; 765e5 (1d:65e5) +LeaguePCShowTeam: ld c, PARTY_LENGTH .loop push bc @@ -77,7 +77,7 @@ LeaguePCShowTeam: ; 765e5 (1d:65e5) scf ret -LeaguePCShowMon: ; 76610 (1d:6610) +LeaguePCShowMon: call GBPalWhiteOutWithDelay3 call ClearScreen ld hl, wHallOfFame @@ -112,9 +112,9 @@ LeaguePCShowMon: ; 76610 (1d:6610) call PrintNumber jpba HoFDisplayMonInfo -HallOfFameNoText: ; 76670 (1d:6670) +HallOfFameNoText: db " CELEBRITE No. @" -AccessedHoFPCText: ; 76683 (1d:6683) +AccessedHoFPCText: TX_FAR _AccessedHoFPCText db "@" diff --git a/engine/menu/main_menu.asm b/engine/menu/main_menu.asm index bdfec5d7..75a00486 100755 --- a/engine/menu/main_menu.asm +++ b/engine/menu/main_menu.asm @@ -1,4 +1,4 @@ -MainMenu: ; 5af2 (1:5af2) +MainMenu: ; Check save file call InitOptions xor a @@ -124,14 +124,14 @@ MainMenu: ; 5af2 (1:5af2) call SpecialWarpIn jp SpecialEnterMap -InitOptions: ; 5bff (1:5bff) +InitOptions: ld a,1 ; no delay ld [wLetterPrintingDelayFlags],a ld a,3 ; medium speed ld [wOptions],a ret -LinkMenu: ; 5c0a (1:5c0a) +LinkMenu: xor a ld [wLetterPrintingDelayFlags], a ld hl, wd72e @@ -292,19 +292,19 @@ LinkMenu: ; 5c0a (1:5c0a) res 6, [hl] ret -WhereWouldYouLikeText: ; 5d43 (1:5d43) +WhereWouldYouLikeText: TX_FAR _WhereWouldYouLikeText db "@" -PleaseWaitText: ; 5d48 (1:5d48) +PleaseWaitText: TX_FAR _PleaseWaitText db "@" -LinkCanceledText: ; 5d4d (1:5d4d) +LinkCanceledText: TX_FAR _LinkCanceledText db "@" -StartNewGame: ; 5d52 (1:5d52) +StartNewGame: ld hl, wd732 res 1, [hl] call OakSpeech @@ -312,7 +312,7 @@ StartNewGame: ; 5d52 (1:5d52) call DelayFrames ; enter map after using a special warp or loading the game from the main menu -SpecialEnterMap: ; 5d5f (1:5d5f) +SpecialEnterMap: xor a ld [hJoyPressed], a ld [hJoyHeld], a @@ -328,19 +328,19 @@ SpecialEnterMap: ; 5d5f (1:5d5f) ret nz jp EnterMap -ContinueText: ; 5d7e (1:5d7e) +ContinueText: db "CONTINUER", $4e -NewGameText: ; 5d87 (1:5d87) - db "NOUVEAU JEU", $4e - db "OPTIONS@" +NewGameText: + db "NOUVEAU JEU" + next "OPTIONS@" -CableClubOptionsText: ; 5d97 (1:5d97) - db "CENTRE TROC", $4e - db "COLISEE", $4e - db "RETOUR@" +CableClubOptionsText: + db "CENTRE TROC" + next "COLISEE" + next "RETOUR@" -DisplayContinueGameInfo: ; 5db5 (1:5db5) +DisplayContinueGameInfo: xor a ld [H_AUTOBGTRANSFERENABLED], a coord hl, 4, 7 @@ -364,7 +364,7 @@ DisplayContinueGameInfo: ; 5db5 (1:5db5) ld c, 30 jp DelayFrames -PrintSaveScreenText: ; 5def (1:5def) +PrintSaveScreenText: xor a ld [H_AUTOBGTRANSFERENABLED], a coord hl, 4, 0 @@ -390,7 +390,7 @@ PrintSaveScreenText: ; 5def (1:5def) ld c, 30 jp DelayFrames -PrintNumBadges: ; 5e2f (1:5e2f) +PrintNumBadges: push hl ld hl, wObtainedBadges ld b, $1 @@ -400,7 +400,7 @@ PrintNumBadges: ; 5e2f (1:5e2f) lb bc, 1, 2 jp PrintNumber -PrintNumOwnedMons: ; 5e42 (1:5e42) +PrintNumOwnedMons: push hl ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned @@ -410,7 +410,7 @@ PrintNumOwnedMons: ; 5e42 (1:5e42) lb bc, 1, 3 jp PrintNumber -PrintPlayTime: ; 5e55 (1:5e55) +PrintPlayTime: ld de, wPlayTimeHours lb bc, 1, 3 call PrintNumber @@ -420,13 +420,13 @@ PrintPlayTime: ; 5e55 (1:5e55) lb bc, LEADING_ZEROES | 1, 2 jp PrintNumber -SaveScreenInfoText: ; 5e6a (1:5e6a) +SaveScreenInfoText: db "JOUEUR" next "BADGES " next "#DEX " next "TEMPS@" -DisplayOptionMenu: ; 5e8a (1:5e8a) +DisplayOptionMenu: coord hl, 0, 0 ld b,3 ld c,18 @@ -578,23 +578,23 @@ DisplayOptionMenu: ; 5e8a (1:5e8a) ld [wOptionsTextSpeedCursorX],a ; text speed cursor X coordinate jp .eraseOldMenuCursor -TextSpeedOptionText: ; 6058 (1:6058) +TextSpeedOptionText: db "VIT. TEXTE" next " 3 2 1 @" -BattleAnimationOptionText: ; 5fde (1:5fde) +BattleAnimationOptionText: db "ANIMATION COMBAT" next " OUI NON@" -BattleStyleOptionText: ; 5ffd (1:5ffd) +BattleStyleOptionText: db "STYLE COMBAT" next " CHOIX DEFINI@" -OptionMenuCancelText: ; 6018 (1:6018) +OptionMenuCancelText: db "RETOUR@" ; sets the options variable according to the current placement of the menu cursors in the options menu -SetOptionsFromCursorPositions: ; 601f (1:601f) +SetOptionsFromCursorPositions: ld hl,TextSpeedOptionData ld a,[wOptionsTextSpeedCursorX] ; text speed cursor X coordinate ld c,a @@ -630,7 +630,7 @@ SetOptionsFromCursorPositions: ; 601f (1:601f) ret ; reads the options variable and places menu cursors in the correct positions within the options menu -SetCursorPositionsFromOptions: ; 604c (1:604c) +SetCursorPositionsFromOptions: ld hl,TextSpeedOptionData + 1 ld a,[wOptions] ld c,a @@ -674,14 +674,14 @@ SetCursorPositionsFromOptions: ; 604c (1:604c) ; Format: ; 00: X coordinate of menu cursor ; 01: delay after printing a letter (in frames) -TextSpeedOptionData: ; 6096 (1:6096) +TextSpeedOptionData: db 14,5 ; Slow db 7,3 ; Medium db 1,1 ; Fast db 7 ; default X coordinate (Medium) db $ff ; terminator -CheckForPlayerNameInSRAM: ; 609e (1:609e) +CheckForPlayerNameInSRAM: ; Check if the player name data in SRAM has a string terminator character ; (indicating that a name may have been saved there) and return whether it does ; in carry. diff --git a/engine/menu/naming_screen.asm b/engine/menu/naming_screen.asm index 4597b794..7835be97 100755 --- a/engine/menu/naming_screen.asm +++ b/engine/menu/naming_screen.asm @@ -1,4 +1,4 @@ -AskName: ; 64eb (1:64eb) +AskName: call SaveScreenTilesToBuffer1 call GetPredefRegisters push hl @@ -7,7 +7,7 @@ AskName: ; 64eb (1:64eb) coord hl, 0, 0 ld b, 4 ld c, 11 - call z, ClearScreenArea ; only if in wild batle + call z, ClearScreenArea ; only if in wild battle ld a, [wcf91] ld [wd11e], a call GetMonName @@ -40,7 +40,7 @@ AskName: ; 64eb (1:64eb) pop af ld [wUpdateSpritesEnabled], a ld a, [wcf50] - cp $50 + cp "@" ret nz .declinedNickname ld d, h @@ -49,11 +49,11 @@ AskName: ; 64eb (1:64eb) ld bc, NAME_LENGTH jp CopyData -DoYouWantToNicknameText: ; 0x6557 +DoYouWantToNicknameText: TX_FAR _DoYouWantToNicknameText db "@" -DisplayNameRaterScreen: ; 655c (1:655c) +DisplayNameRaterScreen: ld hl, wBuffer xor a ld [wUpdateSpritesEnabled], a @@ -81,7 +81,7 @@ DisplayNameRaterScreen: ; 655c (1:655c) scf ret -DisplayNamingScreen: ; 6596 (1:6596) +DisplayNamingScreen: push hl ld hl, wd730 set 6, [hl] @@ -108,7 +108,7 @@ DisplayNamingScreen: ; 6596 (1:6596) ld [wMenuWatchedKeys], a ld a, 7 ld [wMaxMenuItem], a - ld a, $50 + ld a, "@" ld [wcf50], a xor a ld hl, wNamingScreenSubmitName @@ -153,7 +153,7 @@ DisplayNamingScreen: ; 6596 (1:6596) ld h, [hl] ld l, a push de - jp [hl] + jp hl .submitNickname pop de @@ -259,7 +259,7 @@ DisplayNamingScreen: ; 6596 (1:6596) .addLetter ld a, [wNamingScreenLetter] ld [hli], a - ld [hl], $50 + ld [hl], "@" ld a, SFX_PRESS_AB call PlaySound ret @@ -323,7 +323,7 @@ DisplayNamingScreen: ; 6596 (1:6596) ld [wTopMenuItemX], a jp EraseMenuCursor -LoadEDTile: ; 67f6 (1:67f6) +LoadEDTile: call DisableLCD ld de, vFont + $700 ld hl, ED_Tile @@ -334,11 +334,11 @@ LoadEDTile: ; 67f6 (1:67f6) call FarCopyDataDouble jp EnableLCD -ED_Tile: ; 6767 (1:6767) +ED_Tile: INCBIN "gfx/ED_tile.1bpp" ED_TileEnd: -PrintAlphabet: ; 676f (1:676f) +PrintAlphabet: xor a ld [H_AUTOBGTRANSFERENABLED], a ld a, [wAlphabetCase] @@ -368,13 +368,13 @@ PrintAlphabet: ; 676f (1:676f) ld [H_AUTOBGTRANSFERENABLED], a jp Delay3 -LowerCaseAlphabet: ; 6841 (1:6841) - db "abcdefghijklmnopqrstuvwxyz ×():;[]",$e1,$e2,"-?!♂♀/",$f2,",¥MAJUSCULES@" +LowerCaseAlphabet: + db "abcdefghijklmnopqrstuvwxyz ×():;[]",$e1,$e2,"-?!♂♀/⠄,¥MAJUSCULES@" -UpperCaseAlphabet: ; 6879 (1:6879) - db "ABCDEFGHIJKLMNOPQRSTUVWXYZ ×():;[]",$e1,$e2,"-?!♂♀/",$f2,",¥minuscules@" +UpperCaseAlphabet: + db "ABCDEFGHIJKLMNOPQRSTUVWXYZ ×():;[]",$e1,$e2,"-?!♂♀/⠄,¥minuscules@" -PrintNicknameAndUnderscores: ; 68b1 (1:68b1) +PrintNicknameAndUnderscores: call CalcStringLength ld a, c ld [wNamingScreenNameLength], a @@ -428,7 +428,7 @@ PrintNicknameAndUnderscores: ; 68b1 (1:68b1) ld [hl], $77 ; raised underscore tile id ret -DakutensAndHandakutens: ; 6871 (1:6871) +DakutensAndHandakutens: push de call CalcStringLength dec hl @@ -442,7 +442,7 @@ DakutensAndHandakutens: ; 6871 (1:6871) ld [wNamingScreenLetter], a ret -Dakutens: ; 6885 (1:6885) +Dakutens: db "かが", "きぎ", "くぐ", "けげ", "こご" db "さざ", "しじ", "すず", "せぜ", "そぞ" db "ただ", "ちぢ", "つづ", "てで", "とど" @@ -453,13 +453,13 @@ Dakutens: ; 6885 (1:6885) db "ハバ", "ヒビ", "フブ", "へべ", "ホボ" db $ff -Handakutens: ; 68d6 (1:68d6) +Handakutens: db "はぱ", "ひぴ", "ふぷ", "へぺ", "ほぽ" db "ハパ", "ヒピ", "フプ", "へぺ", "ホポ" db $ff ; calculates the length of the string at wcf50 and stores it in c -CalcStringLength: ; 68eb (1:68eb) +CalcStringLength: ld hl, wcf50 ld c, $0 .loop @@ -470,7 +470,7 @@ CalcStringLength: ; 68eb (1:68eb) inc c jr .loop -PrintNamingText: ; 699b (1:699b) +PrintNamingText: coord hl, 0, 1 ld a, [wNamingScreenType] ld de, YourTextString @@ -495,14 +495,14 @@ PrintNamingText: ; 699b (1:699b) .placeString jp PlaceString -YourTextString: ; 693f (1:693f) +YourTextString: db "VOTRE NOM?@" -RivalsTextString: ; 6945 (1:6945) +RivalsTextString: db "NOM DU RIVAL?@" -NameTextString: ; 694d (1:694d) +NameTextString: db "NOM?@" -NicknameTextString: ; 6953 (1:6953) +NicknameTextString: db "SURNOM?@" diff --git a/engine/menu/oaks_pc.asm b/engine/menu/oaks_pc.asm index 7ff03c46..03c9b8f1 100755 --- a/engine/menu/oaks_pc.asm +++ b/engine/menu/oaks_pc.asm @@ -1,4 +1,4 @@ -OpenOaksPC: ; 1e915 (7:6915) +OpenOaksPC: call SaveScreenTilesToBuffer2 ld hl, AccessedOaksPCText call PrintText @@ -7,21 +7,22 @@ OpenOaksPC: ; 1e915 (7:6915) call YesNoChoice ld a, [wCurrentMenuItem] and a - jr nz, .asm_1e932 + jr nz, .closePC predef DisplayDexRating -.asm_1e932 +.closePC ld hl, ClosedOaksPCText call PrintText jp LoadScreenTilesFromBuffer2 -GetDexRatedText: ; 1e93b (7:693b) +GetDexRatedText: TX_FAR _GetDexRatedText db "@" -ClosedOaksPCText: ; 1e940 (7:6940) +ClosedOaksPCText: TX_FAR _ClosedOaksPCText - db $0d,"@" + TX_WAIT + db "@" -AccessedOaksPCText: ; 1e946 (7:6946) +AccessedOaksPCText: TX_FAR _AccessedOaksPCText db "@" diff --git a/engine/menu/party_menu.asm b/engine/menu/party_menu.asm index f3e1a138..a35524ed 100755 --- a/engine/menu/party_menu.asm +++ b/engine/menu/party_menu.asm @@ -17,14 +17,14 @@ ; f6: health returned ; f7: revitalized ; f8: leveled up -DrawPartyMenu_: ; 12cd2 (4:6cd2) +DrawPartyMenu_: xor a ld [H_AUTOBGTRANSFERENABLED],a call ClearScreen call UpdateSprites callba LoadMonPartySpriteGfxWithLCDDisabled ; load pokemon icon graphics -RedrawPartyMenu_: ; 12ce3 (4:6ce3) +RedrawPartyMenu_: ld a,[wPartyMenuTypeOrMessageID] cp a,SWAP_MONS_PARTY_MENU jp z,.printMessage @@ -70,7 +70,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) dec hl dec hl dec hl - ld a,$EC ; unfilled right arrow menu cursor + ld a,"▷" ; unfilled right arrow menu cursor ld [hli],a ; place the cursor inc hl inc hl @@ -87,7 +87,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) call PrintStatusCondition pop hl push hl - ld bc,20 + 1 ; down 1 row and right 1 column + ld bc,SCREEN_WIDTH + 1 ; down 1 row and right 1 column ld a,[hFlags_0xFFF6] set 0,a ld [hFlags_0xFFF6],a @@ -234,7 +234,7 @@ RedrawPartyMenu_: ; 12ce3 (4:6ce3) call PrintText jr .done -PartyMenuItemUseMessagePointers: ; 12e61 (4:6e61) +PartyMenuItemUseMessagePointers: dw AntidoteText dw BurnHealText dw IceHealText @@ -245,7 +245,7 @@ PartyMenuItemUseMessagePointers: ; 12e61 (4:6e61) dw ReviveText dw RareCandyText -PartyMenuMessagePointers: ; 12e73 (4:6e73) +PartyMenuMessagePointers: dw PartyMenuNormalText dw PartyMenuItemUseText dw PartyMenuBattleText @@ -253,65 +253,65 @@ PartyMenuMessagePointers: ; 12e73 (4:6e73) dw PartyMenuSwapMonText dw PartyMenuItemUseText -PartyMenuNormalText: ; 12e7f (4:6e7f) +PartyMenuNormalText: TX_FAR _PartyMenuNormalText db "@" -PartyMenuItemUseText: ; 12e84 (4:6e84) +PartyMenuItemUseText: TX_FAR _PartyMenuItemUseText db "@" -PartyMenuBattleText: ; 12e89 (4:6e89) +PartyMenuBattleText: TX_FAR _PartyMenuBattleText db "@" -PartyMenuUseTMText: ; 12e8e (4:6e8e) +PartyMenuUseTMText: TX_FAR _PartyMenuUseTMText db "@" -PartyMenuSwapMonText: ; 12e93 (4:6e93) +PartyMenuSwapMonText: TX_FAR _PartyMenuSwapMonText db "@" -PotionText: ; 12e98 (4:6e98) +PotionText: TX_FAR _PotionText db "@" -AntidoteText: ; 12e9d (4:6e9d) +AntidoteText: TX_FAR _AntidoteText db "@" -ParlyzHealText: ; 12ea2 (4:6ea2) +ParlyzHealText: TX_FAR _ParlyzHealText db "@" -BurnHealText: ; 12ea7 (4:6ea7) +BurnHealText: TX_FAR _BurnHealText db "@" -IceHealText: ; 12eac (4:6eac) +IceHealText: TX_FAR _IceHealText db "@" -AwakeningText: ; 12eb1 (4:6eb1) +AwakeningText: TX_FAR _AwakeningText db "@" -FullHealText: ; 12eb6 (4:6eb6) +FullHealText: TX_FAR _FullHealText db "@" -ReviveText: ; 12ebb (4:6ebb) +ReviveText: TX_FAR _ReviveText db "@" -RareCandyText: ; 12ec0 (4:6ec0) +RareCandyText: TX_FAR _RareCandyText - db $0B - db $06 + TX_SFX_ITEM_1 ; probably supposed to play SFX_LEVEL_UP but the wrong music bank is loaded + TX_BLINK db "@" -SetPartyMenuHPBarColor: ; 12ec7 (4:6ec7) +SetPartyMenuHPBarColor: ld hl, wPartyMenuHPBarColors ld a, [wWhichPartyMenuHPBar] ld c, a diff --git a/engine/menu/pc.asm b/engine/menu/pc.asm index 78b35b95..c9e2cf08 100755 --- a/engine/menu/pc.asm +++ b/engine/menu/pc.asm @@ -1,4 +1,4 @@ -ActivatePC: ; 17e2c (5:7e2c) +ActivatePC: call SaveScreenTilesToBuffer2 ld a, SFX_TURN_ON_PC call PlaySound @@ -9,7 +9,7 @@ ActivatePC: ; 17e2c (5:7e2c) set 3, [hl] call LoadScreenTilesFromBuffer2 call Delay3 -PCMainMenu: ; 17e48 (5:7e48) +PCMainMenu: callba DisplayPCMainMenu ld hl, wFlags_0xcd60 set 5, [hl] @@ -58,19 +58,19 @@ PCMainMenu: ; 17e48 (5:7e48) call PrintText callba PlayerPC jr ReloadMainMenu -OaksPC: ; 17ec0 (5:7ec0) +OaksPC: ld a, SFX_ENTER_PC call PlaySound call WaitForSoundToFinish callba OpenOaksPC jr ReloadMainMenu -PKMNLeague: ; 17ed2 (5:7ed2) +PKMNLeague: ld a, SFX_ENTER_PC call PlaySound call WaitForSoundToFinish callba PKMNLeaguePC jr ReloadMainMenu -BillsPC: ; 17ee4 (5:7ee4) +BillsPC: ld a, SFX_ENTER_PC call PlaySound call WaitForSoundToFinish @@ -83,13 +83,13 @@ BillsPC: ; 17ee4 (5:7ee4) .printText call PrintText callba BillsPC_ -ReloadMainMenu: ; 17f06 (5:7f06) +ReloadMainMenu: xor a ld [wDoNotWaitForButtonPressAfterDisplayingText], a call ReloadMapData call UpdateSprites jp PCMainMenu -LogOff: ; 17f13 (5:7f13) +LogOff: ld a, SFX_TURN_OFF_PC call PlaySound call WaitForSoundToFinish @@ -98,41 +98,41 @@ LogOff: ; 17f13 (5:7f13) res 5, [hl] ret -TurnedOnPC1Text: ; 17f23 (5:7f23) +TurnedOnPC1Text: TX_FAR _TurnedOnPC1Text db "@" -AccessedBillsPCText: ; 17f28 (5:7f28) +AccessedBillsPCText: TX_FAR _AccessedBillsPCText db "@" -AccessedSomeonesPCText: ; 17f2d (5:7f2d) +AccessedSomeonesPCText: TX_FAR _AccessedSomeonesPCText db "@" -AccessedMyPCText: ; 17f32 (5:7f32) +AccessedMyPCText: TX_FAR _AccessedMyPCText db "@" ; removes one of the specified item ID [hItemToRemoveID] from bag (if existent) -RemoveItemByID: ; 17f37 (5:7f37) +RemoveItemByID: ld hl, wBagItems ld a, [hItemToRemoveID] ld b, a xor a ld [hItemToRemoveIndex], a -.asm_17f40 +.loop ld a, [hli] - cp $ff + cp -1 ; reached terminator? ret z cp b - jr z, .asm_17f4f + jr z, .foundItem inc hl ld a, [hItemToRemoveIndex] inc a ld [hItemToRemoveIndex], a - jr .asm_17f40 -.asm_17f4f + jr .loop +.foundItem ld a, $1 ld [wItemQuantity], a ld a, [hItemToRemoveIndex] diff --git a/engine/menu/players_pc.asm b/engine/menu/players_pc.asm index a9d61a74..fc1e2bef 100755 --- a/engine/menu/players_pc.asm +++ b/engine/menu/players_pc.asm @@ -1,4 +1,4 @@ -PlayerPC: ; 78e6 (1:78e6) +PlayerPC: ld a, ITEM_NAME ld [wNameListType], a call SaveScreenTilesToBuffer1 @@ -16,7 +16,7 @@ PlayerPC: ; 78e6 (1:78e6) ld hl, wd730 set 6, [hl] -PlayerPCMenu: ; 790c (1:790c) +PlayerPCMenu: ld a, [wParentMenuItem] ld [wCurrentMenuItem], a ld hl, wFlags_0xcd60 @@ -62,7 +62,7 @@ PlayerPCMenu: ; 790c (1:790c) dec a jp z, PlayerPCToss -ExitPlayerPC: ; 796d (1:796d) +ExitPlayerPC: ld a, [wFlags_0xcd60] bit 3, a ; accessing player's PC through another PC? jr nz, .next @@ -83,7 +83,7 @@ ExitPlayerPC: ; 796d (1:796d) ld [wDoNotWaitForButtonPressAfterDisplayingText], a ret -PlayerPCDeposit: ; 7995 (1:7995) +PlayerPCDeposit: xor a ld [wCurrentMenuItem], a ld [wListScrollOffset], a @@ -137,7 +137,7 @@ PlayerPCDeposit: ; 7995 (1:7995) call PrintText jp .loop -PlayerPCWithdraw: ; 7a12 (1:7a12) +PlayerPCWithdraw: xor a ld [wCurrentMenuItem], a ld [wListScrollOffset], a @@ -191,7 +191,7 @@ PlayerPCWithdraw: ; 7a12 (1:7a12) call PrintText jp .loop -PlayerPCToss: ; 7a8f (1:7a8f) +PlayerPCToss: xor a ld [wCurrentMenuItem], a ld [wListScrollOffset], a @@ -240,64 +240,64 @@ PlayerPCToss: ; 7a8f (1:7a8f) call TossItem ; disallows tossing key items jp .loop -PlayersPCMenuEntries: ; 7b5f (1:7b5f) +PlayersPCMenuEntries: db "RETIRER OBJET" next "STOCKER OBJET" next "JETER OBJET" next "DECONNEXION@" -TurnedOnPC2Text: ; 7b22 (1:7b22) +TurnedOnPC2Text: TX_FAR _TurnedOnPC2Text db "@" -WhatDoYouWantText: ; 7b27 (1:7b27) +WhatDoYouWantText: TX_FAR _WhatDoYouWantText db "@" -WhatToDepositText: ; 7b2c (1:7b2c) +WhatToDepositText: TX_FAR _WhatToDepositText db "@" -DepositHowManyText: ; 7b31 (1:7b31) +DepositHowManyText: TX_FAR _DepositHowManyText db "@" -ItemWasStoredText: ; 7b36 (1:7b36) +ItemWasStoredText: TX_FAR _ItemWasStoredText db "@" -NothingToDepositText: ; 7b3b (1:7b3b) +NothingToDepositText: TX_FAR _NothingToDepositText db "@" -NoRoomToStoreText: ; 7b40 (1:7b40) +NoRoomToStoreText: TX_FAR _NoRoomToStoreText db "@" -WhatToWithdrawText: ; 7b45 (1:7b45) +WhatToWithdrawText: TX_FAR _WhatToWithdrawText db "@" -WithdrawHowManyText: ; 7b4a (1:7b4a) +WithdrawHowManyText: TX_FAR _WithdrawHowManyText db "@" -WithdrewItemText: ; 7b4f (1:7b4f) +WithdrewItemText: TX_FAR _WithdrewItemText db "@" -NothingStoredText: ; 7b54 (1:7b54) +NothingStoredText: TX_FAR _NothingStoredText db "@" -CantCarryMoreText: ; 7b59 (1:7b59) +CantCarryMoreText: TX_FAR _CantCarryMoreText db "@" -WhatToTossText: ; 7b5e (1:7b5e) +WhatToTossText: TX_FAR _WhatToTossText db "@" -TossHowManyText: ; 7b63 (1:7b63) +TossHowManyText: TX_FAR _TossHowManyText db "@" diff --git a/engine/menu/pokedex.asm b/engine/menu/pokedex.asm index adf0eb62..546203f6 100755 --- a/engine/menu/pokedex.asm +++ b/engine/menu/pokedex.asm @@ -1,4 +1,4 @@ -ShowPokedexMenu: ; 40000 (10:4000) +ShowPokedexMenu: call GBPalWhiteOut call ClearScreen call UpdateSprites @@ -57,7 +57,7 @@ ShowPokedexMenu: ; 40000 (10:4000) ; 00: showed pokemon data or area ; 01: the player chose Quit ; 02: the pokemon has not been seen yet or the player pressed the B button -HandlePokedexSideMenu: ; 4006d (10:406d) +HandlePokedexSideMenu: call PlaceUnfilledArrowMenuCursor ld a,[wCurrentMenuItem] push af @@ -125,6 +125,7 @@ HandlePokedexSideMenu: ; 4006d (10:406d) call DrawTileLine ; cover up the menu cursor in the pokemon list pop bc ret + .buttonBPressed push bc coord hl, 15, 10 @@ -133,16 +134,19 @@ HandlePokedexSideMenu: ; 4006d (10:406d) call DrawTileLine ; cover up the menu cursor in the side menu pop bc jr .exitSideMenu + .choseData call ShowPokedexDataInternal ld b,0 jr .exitSideMenu + ; play pokemon cry .choseCry ld a,[wd11e] call GetCryData call PlaySound jr .handleMenuInput + .choseArea predef LoadTownMap_Nest ; display pokemon areas ld b,0 @@ -150,12 +154,12 @@ HandlePokedexSideMenu: ; 4006d (10:406d) ; handles the list of pokemon on the left of the pokedex screen ; sets carry flag if player presses A, unsets carry flag if player presses B -HandlePokedexListMenu: ; 40111 (10:4111) +HandlePokedexListMenu: xor a ld [H_AUTOBGTRANSFERENABLED],a ; draw the horizontal line separating the seen and owned amounts from the menu coord hl, 15, 8 - ld a,$7a ; horizontal line tile + ld a,"─" ld [hli],a ld [hli],a ld [hli],a @@ -206,6 +210,7 @@ HandlePokedexListMenu: ; 40111 (10:4111) dec c jr nz,.maxSeenPokemonInnerLoop jr .maxSeenPokemonLoop + .storeMaxSeenPokemon ld a,b ld [wDexMaxSeenMon],a @@ -267,7 +272,7 @@ HandlePokedexListMenu: ; 40111 (10:4111) inc hl call PlaceString pop hl - ld bc,2 * 20 + ld bc,2 * SCREEN_WIDTH add hl,bc pop de pop af @@ -342,9 +347,9 @@ HandlePokedexListMenu: ; 40111 (10:4111) and a ret -DrawPokedexVerticalLine: ; 4028e (10:428e) +DrawPokedexVerticalLine: ld c,9 ; height of line - ld de,20 ; width of screen + ld de,SCREEN_WIDTH ld a,$71 ; vertical line tile .loop ld [hl],a @@ -354,16 +359,16 @@ DrawPokedexVerticalLine: ; 4028e (10:428e) jr nz,.loop ret -PokedexSeenText: ; 4029d (10:429d) +PokedexSeenText: db "VUS@" -PokedexOwnText: ; 402a2 (10:42a2) +PokedexOwnText: db "PRIS@" -PokedexContentsText: ; 402a6 (10:42a6) +PokedexContentsText: db "SOMMAIRE@" -PokedexMenuItemsText: ; 402af (10:42af) +PokedexMenuItemsText: db "INFO" next "CRI" next "ZONE" @@ -373,7 +378,7 @@ PokedexMenuItemsText: ; 402af (10:42af) ; INPUT: ; [wd11e] = pokedex number ; hl = address of bit field -IsPokemonBitSet: ; 402c2 (10:42c2) +IsPokemonBitSet: ld a,[wd11e] dec a ld c,a @@ -384,14 +389,14 @@ IsPokemonBitSet: ; 402c2 (10:42c2) ret ; function to display pokedex data from outside the pokedex -ShowPokedexData: ; 402d1 (10:42d1) +ShowPokedexData: call GBPalWhiteOutWithDelay3 call ClearScreen call UpdateSprites callab LoadPokedexTilePatterns ; load pokedex tiles ; function to display pokedex data from inside the pokedex -ShowPokedexDataInternal: ; 402e2 (10:42e2) +ShowPokedexDataInternal: ld hl,wd72c set 1,[hl] ld a,$33 ; 3/7 volume @@ -409,20 +414,25 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) push af xor a ld [hTilesetType],a + coord hl, 0, 0 ld de,1 lb bc, $64, SCREEN_WIDTH call DrawTileLine ; draw top border + coord hl, 0, 17 ld b, $6f call DrawTileLine ; draw bottom border + coord hl, 0, 1 ld de,20 lb bc, $66, $10 call DrawTileLine ; draw left border + coord hl, 19, 1 ld b,$67 call DrawTileLine ; draw right border + ld a,$63 ; upper left corner tile Coorda 0, 0 ld a,$65 ; upper right corner tile @@ -431,15 +441,19 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) Coorda 0, 17 ld a,$6e ; lower right corner tile Coorda 19, 17 + coord hl, 0, 9 ld de,PokedexDataDividerLine call PlaceString ; draw horizontal divider line + coord hl, 9, 6 ld de,HeightWeightText call PlaceString + call GetMonName coord hl, 9, 2 call PlaceString + ld hl,PokedexEntryPointers ld a,[wd11e] dec a @@ -450,22 +464,26 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) ld a,[hli] ld e,a ld d,[hl] ; de = address of pokedex entry + coord hl, 9, 4 call PlaceString ; print species name + ld h,b ld l,c push de ld a,[wd11e] push af call IndexToPokedex + coord hl, 2, 8 ld a, "№" ld [hli],a - ld a,$f2 + ld a,"⠄" ld [hli],a ld de,wd11e lb bc, LEADING_ZEROES | 1, 3 call PrintNumber ; print pokedex number + ld hl,wPokedexOwned call IsPokemonBitSet pop af @@ -473,10 +491,12 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) ld a,[wcf91] ld [wd0b5],a pop de + push af push bc push de push hl + call Delay3 call GBPalNormal call GetMonHeader ; load pokemon picture location @@ -484,10 +504,12 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) call LoadFlippedFrontSpriteByMonIndex ; draw pokemon picture ld a,[wcf91] call PlayCry ; play pokemon cry + pop hl pop de pop bc pop af + ld a,c and a jp z,.waitForButtonPress ; if the pokemon has not been owned, don't print the height, weight, or description @@ -511,16 +533,6 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) inc de inc de ; de = address of inches (height) push de -; coord hl, 15, 6 -; lb bc, LEADING_ZEROES | 1, 2 -; call PrintNumber ; print inches (height) -; ld a,$61 ; inches symbol tile (two ticks) -; ld [hl],a -; now print the weight (note that weight is stored in tenths of pounds internally) -; inc de -; inc de -; inc de ; de = address of upper byte of weight -; push de ; put weight in big-endian order at hDexWeight ld hl,hDexWeight ld a,[hl] ; save existing value of [hDexWeight] @@ -547,7 +559,7 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) inc hl ld a,[hli] ld [hld],a ; make space for the decimal point by moving the last digit forward one tile - ld [hl],$f2 ; decimal point tile + ld [hl],"⠄" ; decimal point tile pop af ld [hDexWeight + 1],a ; restore original value of [hDexWeight + 1] pop af @@ -578,20 +590,21 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2) ld [rNR50],a ret -HeightWeightText: ; 40448 (10:4448) - db "TAI ???",$60,$4e,"PDS ???",$61,$62,"@" +HeightWeightText: + db "TAI ???",$60 + next "PDS ???",$61,$62,"@" ; XXX does anything point to this? -PokeText: ; 4045d (10:445d) +PokeText: db "#@" ; horizontal line that divides the pokedex text description from the rest of the data -PokedexDataDividerLine: ; 4045f (10:445f) +PokedexDataDividerLine: db $68,$69,$6B,$69,$6B db $69,$6B,$69,$6B,$6B db $6B,$6B,$69,$6B,$69 db $6B,$69,$6B,$69,$6A - db $50 + db "@" ; draws a line of tiles ; INPUT: @@ -599,7 +612,7 @@ PokedexDataDividerLine: ; 4045f (10:445f) ; c = number of tile ID's to write ; de = amount to destination address after each tile (1 for horizontal, 20 for vertical) ; hl = destination address -DrawTileLine: ; 40474 (10:4474) +DrawTileLine: push bc push de .loop @@ -613,7 +626,7 @@ DrawTileLine: ; 40474 (10:4474) INCLUDE "data/pokedex_entries.asm" -PokedexToIndex: ; 40ff9 (10:4ff9) +PokedexToIndex: ; converts the Pokédex number at wd11e to an index push bc push hl @@ -634,7 +647,7 @@ PokedexToIndex: ; 40ff9 (10:4ff9) pop bc ret -IndexToPokedex: ; 41010 (10:5010) +IndexToPokedex: ; converts the indexédex number at wd11e to a Pokédex number push bc push hl diff --git a/engine/menu/prize_menu.asm b/engine/menu/prize_menu.asm index 3bc64701..4fbb739f 100755 --- a/engine/menu/prize_menu.asm +++ b/engine/menu/prize_menu.asm @@ -1,4 +1,4 @@ -CeladonPrizeMenu: ; 5271b (14:671b) +CeladonPrizeMenu: ld b,COIN_CASE call IsItemInBag jr nz,.havingCoinCase @@ -23,8 +23,8 @@ CeladonPrizeMenu: ; 5271b (14:671b) ld [wTopMenuItemX],a call PrintPrizePrice coord hl, 0, 2 - ld b,$08 - ld c,$10 + ld b, 8 + ld c, 16 call TextBoxBorder call GetPrizeMenuId call UpdateSprites @@ -32,30 +32,30 @@ CeladonPrizeMenu: ; 5271b (14:671b) call PrintText call HandleMenuInput ; menu choice handler bit 1,a ; keypress = B (Cancel) - jr nz,.NoChoice + jr nz, .noChoice ld a,[wCurrentMenuItem] - cp a,$03 ; "NO,THANKS" choice - jr z,.NoChoice + cp 3 ; "NO,THANKS" choice + jr z, .noChoice call HandlePrizeChoice -.NoChoice +.noChoice ld hl,wd730 res 6,[hl] ret -RequireCoinCaseTextPtr: ; 5277e (14:677e) +RequireCoinCaseTextPtr: TX_FAR _RequireCoinCaseText - db $0D + TX_WAIT db "@" -ExchangeCoinsForPrizesTextPtr: ; 52784 (14:6784) +ExchangeCoinsForPrizesTextPtr: TX_FAR _ExchangeCoinsForPrizesText db "@" -WhichPrizeTextPtr: ; 52789 (14:6789) +WhichPrizeTextPtr: TX_FAR _WhichPrizeText db "@" -GetPrizeMenuId: ; 5278e (14:678e) +GetPrizeMenuId: ; determine which one among the three ; prize-texts has been selected ; using the text ID (stored in [hSpriteIndexOrTextID]) @@ -65,7 +65,7 @@ GetPrizeMenuId: ; 5278e (14:678e) ; (distinguishing between Pokemon names ; and Items (specifically TMs) names) ld a,[hSpriteIndexOrTextID] - sub a,3 ; prize-texts' id are 3, 4 and 5 + sub 3 ; prize-texts' id are 3, 4 and 5 ld [wWhichPrizeWindow],a ; prize-texts' id (relative, i.e. 0, 1 or 2) add a add a @@ -88,7 +88,7 @@ GetPrizeMenuId: ; 5278e (14:678e) ld bc,6 call CopyData ld a,[wWhichPrizeWindow] - cp a,$02 ;is TM_menu? + cp 2 ;is TM_menu? jr nz,.putMonName ld a,[wPrize1] ld [wd11e],a @@ -138,7 +138,7 @@ GetPrizeMenuId: ; 5278e (14:678e) call PrintBCDNumber ld de,wPrize2Price coord hl, 13, 7 - ld c,(%1 << 7 | 2) + ld c,(1 << 7 | 2) call PrintBCDNumber ld de,wPrize3Price coord hl, 13, 9 @@ -147,17 +147,17 @@ GetPrizeMenuId: ; 5278e (14:678e) INCLUDE "data/prizes.asm" -PrintPrizePrice: ; 5287a (14:687a) +PrintPrizePrice: coord hl, 11, 0 - ld b,$01 - ld c,$07 + ld b, 1 + ld c, 7 call TextBoxBorder call UpdateSprites coord hl, 12, 0 - ld de,.CoinText + ld de, .CoinString call PlaceString coord hl, 13, 1 - ld de,.SixSpacesText + ld de, .SixSpacesString call PlaceString coord hl, 13, 1 ld de,wPlayerCoins @@ -165,13 +165,13 @@ PrintPrizePrice: ; 5287a (14:687a) call PrintBCDNumber ret -.CoinText +.CoinString: db "JETONS@" -.SixSpacesText +.SixSpacesString: db " @" -LoadCoinsToSubtract: ; 528b1 (14:68b1) +LoadCoinsToSubtract: ld a,[wWhichPrize] add a ld d,0 @@ -186,7 +186,7 @@ LoadCoinsToSubtract: ; 528b1 (14:68b1) ld [hCoins + 1],a ret -HandlePrizeChoice: ; 528c6 (14:68c6) +HandlePrizeChoice: ld a,[wCurrentMenuItem] ld [wWhichPrize],a ld d,0 @@ -196,33 +196,33 @@ HandlePrizeChoice: ; 528c6 (14:68c6) ld a,[hl] ld [wd11e],a ld a,[wWhichPrizeWindow] - cp a,$02 ; is prize a TM? - jr nz,.GetMonName + cp 2 ; is prize a TM? + jr nz, .getMonName call GetItemName - jr .GivePrize -.GetMonName + jr .givePrize +.getMonName call GetMonName -.GivePrize +.givePrize ld hl,SoYouWantPrizeTextPtr call PrintText call YesNoChoice ld a,[wCurrentMenuItem] ; yes/no answer (Y=0, N=1) and a - jr nz,.PrintOhFineThen + jr nz, .printOhFineThen call LoadCoinsToSubtract call HasEnoughCoins - jr c,.NotEnoughCoins + jr c, .notEnoughCoins ld a,[wWhichPrizeWindow] - cp a,$02 - jr nz,.GiveMon + cp $02 + jr nz, .giveMon ld a,[wd11e] ld b,a ld a,1 ld c,a call GiveItem - jr nc,.BagFull - jr .SubtractCoins -.GiveMon + jr nc, .bagFull + jr .subtractCoins +.giveMon ld a,[wd11e] ld [wcf91],a push af @@ -243,52 +243,52 @@ HandlePrizeChoice: ; 528c6 (14:68c6) ; were full), return without subtracting coins. ret nc -.SubtractCoins +.subtractCoins call LoadCoinsToSubtract ld hl,hCoins + 1 ld de,wPlayerCoins + 1 ld c,$02 ; how many bytes predef SubBCDPredef jp PrintPrizePrice -.BagFull +.bagFull ld hl,PrizeRoomBagIsFullTextPtr jp PrintText -.NotEnoughCoins +.notEnoughCoins ld hl,SorryNeedMoreCoinsText jp PrintText -.PrintOhFineThen +.printOhFineThen ld hl,OhFineThenTextPtr jp PrintText -UnknownData52951: ; 52951 (14:6951) +UnknownPrizeData: ; XXX what's this? db $00,$01,$00,$01,$00,$01,$00,$00,$01 -HereYouGoTextPtr: ; 5295a (14:695a) +HereYouGoTextPtr: TX_FAR _HereYouGoText - db $0D + TX_WAIT db "@" -SoYouWantPrizeTextPtr: ; 52960 (14:6960) +SoYouWantPrizeTextPtr: TX_FAR _SoYouWantPrizeText db "@" -SorryNeedMoreCoinsText: ; 52965 (14:6965) +SorryNeedMoreCoinsText: TX_FAR _SorryNeedMoreCoinsText - db $0D + TX_WAIT db "@" -PrizeRoomBagIsFullTextPtr: ; 5296b (14:696b) +PrizeRoomBagIsFullTextPtr: TX_FAR _OopsYouDontHaveEnoughRoomText - db $0D + TX_WAIT db "@" -OhFineThenTextPtr: ; 52971 (14:6971) +OhFineThenTextPtr: TX_FAR _OhFineThenText - db $0D ; wait keypress (A/B) without blink + TX_WAIT db "@" -GetPrizeMonLevel: ; 52977 (14:6977) +GetPrizeMonLevel: ld a,[wcf91] ld b,a ld hl,PrizeMonLevelDictionary diff --git a/engine/menu/start_menu.asm b/engine/menu/start_menu.asm index 3c48e6ed..029d8c01 100755 --- a/engine/menu/start_menu.asm +++ b/engine/menu/start_menu.asm @@ -1,4 +1,4 @@ -DisplayStartMenu:: ; 2acd (0:2acd) +DisplayStartMenu:: ld a,BANK(StartMenu_Pokedex) ld [H_LOADEDROMBANK],a ld [MBC1RomBank],a @@ -7,7 +7,7 @@ DisplayStartMenu:: ; 2acd (0:2acd) ld a, SFX_START_MENU call PlaySound -RedisplayStartMenu:: ; 2adf (0:2adf) +RedisplayStartMenu:: callba DrawStartMenu callba PrintSafariZoneSteps ; print Safari Zone info, if in Safari Zone call UpdateSprites @@ -76,7 +76,7 @@ RedisplayStartMenu:: ; 2adf (0:2adf) jp z,StartMenu_Option ; EXIT falls through to here -CloseStartMenu:: ; 2b70 (0:2b70) +CloseStartMenu:: call Joypad ld a,[hJoyPressed] bit 0,a ; was A button newly pressed? diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm index 435d3356..dd7f8083 100755 --- a/engine/menu/start_sub_menus.asm +++ b/engine/menu/start_sub_menus.asm @@ -1,4 +1,4 @@ -StartMenu_Pokedex: ; 13095 (4:7095) +StartMenu_Pokedex: predef ShowPokedexMenu call LoadScreenTilesFromBuffer2 ; restore saved screen call Delay3 @@ -6,7 +6,7 @@ StartMenu_Pokedex: ; 13095 (4:7095) call UpdateSprites jp RedisplayStartMenu -StartMenu_Pokemon: ; 130a9 (4:70a9) +StartMenu_Pokemon: ld a,[wPartyCount] and a jp z,RedisplayStartMenu @@ -34,7 +34,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) 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 @@ -222,7 +222,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) res 4,[hl] ld c,60 call DelayFrames - call GBPalWhiteOutWithDelay3 ; zero all three palettes and wait 3 V-blanks + call GBPalWhiteOutWithDelay3 jp .goBackToMap .warpToLastPokemonCenterText TX_FAR _WarpToLastPokemonCenterText @@ -284,7 +284,7 @@ StartMenu_Pokemon: ; 130a9 (4:70a9) db "@" ; writes a blank tile to all possible menu cursor positions on the party menu -ErasePartyMenuCursors: ; 132ed (4:72ed) +ErasePartyMenuCursors: coord hl, 0, 1 ld bc,2 * 20 ; menu cursor positions are 2 rows apart ld a,6 ; 6 menu cursor positions @@ -295,11 +295,11 @@ ErasePartyMenuCursors: ; 132ed (4:72ed) jr nz,.loop ret -ItemMenuLoop: ; 132fc (4:72fc) +ItemMenuLoop: call LoadScreenTilesFromBuffer2DisableBGTransfer ; restore saved screen call RunDefaultPaletteCommand -StartMenu_Item: ; 13302 (4:7302) +StartMenu_Item: ld a,[wLinkState] dec a ; is the player in the Colosseum or Trade Centre? jr nz,.notInCableClubRoom @@ -438,16 +438,16 @@ StartMenu_Item: ; 13302 (4:7302) .tossZeroItems jp ItemMenuLoop -CannotUseItemsHereText: ; 1342a (4:742a) +CannotUseItemsHereText: TX_FAR _CannotUseItemsHereText db "@" -CannotGetOffHereText: ; 1342f (4:742f) +CannotGetOffHereText: TX_FAR _CannotGetOffHereText db "@" ; items which bring up the party menu when used -UsableItems_PartyMenu: ; 13434 (4:7434) +UsableItems_PartyMenu: db MOON_STONE db ANTIDOTE db BURN_HEAL @@ -487,7 +487,7 @@ UsableItems_PartyMenu: ; 13434 (4:7434) db $ff ; items which close the item menu when used -UsableItems_CloseMenu: ; 13459 (4:7459) +UsableItems_CloseMenu: db ESCAPE_ROPE db ITEMFINDER db POKE_FLUTE @@ -496,7 +496,7 @@ UsableItems_CloseMenu: ; 13459 (4:7459) db SUPER_ROD db $ff -StartMenu_TrainerInfo: ; 13460 (4:7460) +StartMenu_TrainerInfo: call GBPalWhiteOut call ClearScreen call UpdateSprites @@ -521,7 +521,7 @@ StartMenu_TrainerInfo: ; 13460 (4:7460) jp RedisplayStartMenu ; loads tile patterns and draws everything except for gym leader faces / badges -DrawTrainerInfo: ; 1349a (4:749a) +DrawTrainerInfo: ld de,RedPicFront lb bc, BANK(RedPicFront), $01 predef DisplayPicCenteredOrUpperRight @@ -611,17 +611,17 @@ DrawTrainerInfo: ; 1349a (4:749a) lb bc, LEADING_ZEROES | 1, 2 jp PrintNumber -TrainerInfo_FarCopyData: ; 1357f (4:757f) +TrainerInfo_FarCopyData: ld a,BANK(TrainerInfoTextBoxTileGraphics) jp FarCopyData2 -TrainerInfo_NameMoneyTimeText: ; 13584 (4:7594) +TrainerInfo_NameMoneyTimeText: db "NOM/" next "ARG./" next "TEMPS/@" ; $76 is a circle tile -TrainerInfo_BadgesText: ; 13597 (4:7597) +TrainerInfo_BadgesText: db $76,"BADGES",$76,"@" ; draws a text box on the trainer info screen @@ -631,7 +631,7 @@ TrainerInfo_BadgesText: ; 13597 (4:7597) ; [wTrainerInfoTextBoxWidthPlus1] = width ; [wTrainerInfoTextBoxWidth] = width - 1 ; [wTrainerInfoTextBoxNextRowOffset] = distance from the end of a text box row to the start of the next -TrainerInfo_DrawTextBox: ; 135a0 (4:75a0) +TrainerInfo_DrawTextBox: ld a,$79 ; upper left corner tile ID lb de, $7a, $7b ; top edge and upper right corner tile ID's call TrainerInfo_DrawHorizontalEdge ; draw top edge @@ -650,7 +650,7 @@ TrainerInfo_DrawTextBox: ; 135a0 (4:75a0) ld a,$7d ; lower left corner tile ID lb de,$77, $7e ; bottom edge and lower right corner tile ID's -TrainerInfo_DrawHorizontalEdge: ; 135c3 (4:75c3) +TrainerInfo_DrawHorizontalEdge: ld [hli],a ; place left corner tile ld a,[wTrainerInfoTextBoxWidth] ld c,a @@ -663,7 +663,7 @@ TrainerInfo_DrawHorizontalEdge: ; 135c3 (4:75c3) ld [hl],a ; place right corner tile ret -TrainerInfo_NextTextBoxRow: ; 135d0 (4:75d0) +TrainerInfo_NextTextBoxRow: ld a,[wTrainerInfoTextBoxNextRowOffset] ; distance to the start of the next row .loop inc hl @@ -675,8 +675,8 @@ TrainerInfo_NextTextBoxRow: ; 135d0 (4:75d0) ; INPUT: ; hl = address of top tile in the line ; a = tile ID -TrainerInfo_DrawVerticalLine: ; 135d8 (4:75d8) - ld de,20 +TrainerInfo_DrawVerticalLine: + ld de,SCREEN_WIDTH ld c,8 .loop ld [hl],a @@ -685,7 +685,7 @@ TrainerInfo_DrawVerticalLine: ; 135d8 (4:75d8) jr nz,.loop ret -StartMenu_SaveReset: ; 135e3 (4:75e3) +StartMenu_SaveReset: ld a,[wd72e] bit 6,a ; is the player using the link feature? jp nz,Init @@ -693,7 +693,7 @@ StartMenu_SaveReset: ; 135e3 (4:75e3) call LoadScreenTilesFromBuffer2 ; restore saved screen jp HoldTextDisplayOpen -StartMenu_Option: ; 135f6 (4:75f6) +StartMenu_Option: xor a ld [H_AUTOBGTRANSFERENABLED],a call ClearScreen @@ -704,7 +704,7 @@ StartMenu_Option: ; 135f6 (4:75f6) call UpdateSprites jp RedisplayStartMenu -SwitchPartyMon: ; 13613 (4:7613) +SwitchPartyMon: call SwitchPartyMon_InitVarOrSwapData ; swap data ld a, [wSwappedMenuItem] call SwitchPartyMon_ClearGfx @@ -712,7 +712,7 @@ SwitchPartyMon: ; 13613 (4:7613) call SwitchPartyMon_ClearGfx jp RedrawPartyMenu_ -SwitchPartyMon_ClearGfx: ; 13625 (4:7625) +SwitchPartyMon_ClearGfx: push af coord hl, 0, 0 ld bc, SCREEN_WIDTH * 2 @@ -738,7 +738,7 @@ SwitchPartyMon_ClearGfx: ; 13625 (4:7625) ld a, SFX_SWAP jp PlaySound -SwitchPartyMon_InitVarOrSwapData: ; 13653 (4:7653) +SwitchPartyMon_InitVarOrSwapData: ; This is used to initialise [wMenuItemToSwap] and to actually swap the data. ld a, [wMenuItemToSwap] and a ; has [wMenuItemToSwap] been initialised yet? diff --git a/engine/menu/status_screen.asm b/engine/menu/status_screen.asm index c529b9e5..c07dcf64 100755 --- a/engine/menu/status_screen.asm +++ b/engine/menu/status_screen.asm @@ -1,15 +1,15 @@ -DrawHP: ; 128ef (4:68ef) +DrawHP: ; Draws the HP bar in the stats screen call GetPredefRegisters ld a, $1 jr DrawHP_ -DrawHP2: ; 128f6 (4:68f6) +DrawHP2: ; Draws the HP bar in the party screen call GetPredefRegisters ld a, $2 -DrawHP_: ; 128fb (4:68fb) +DrawHP_: ld [wHPBarType], a push hl ld a, [wLoadedMonHP] @@ -63,7 +63,7 @@ DrawHP_: ; 128fb (4:68fb) ; Predef 0x37 -StatusScreen: ; 12953 (4:6953) +StatusScreen: call LoadMonData ld a, [wMonDataLocation] cp BOX_DATA @@ -110,7 +110,7 @@ StatusScreen: ; 12953 (4:6953) call DrawLineBox ; Draws the box around name, HP and status ld de, -6 add hl, de - ld [hl], $f2 ; . after No ("." is a different one) + ld [hl], "⠄" ; . after No ("." is a different one) dec hl ld [hl], "№" coord hl, 19, 9 @@ -192,38 +192,39 @@ StatusScreen: ; 12953 (4:6953) ld a, [wWhichPokemon] jp SkipFixedLengthTextEntries -OTPointers: ; 12a95 (4:6a95) +OTPointers: dw wPartyMonOT dw wEnemyMonOT dw wBoxMonOT dw wDayCareMonOT -NamePointers2: ; 12a9d (4:6a9d) +NamePointers2: dw wPartyMonNicks dw wEnemyMonNicks dw wBoxMonNicks dw wDayCareMonName -Type1Text: ; 12aa5 (4:6aa5) +Type1Text: db "TYPE1/", $4e -Type2Text: ; 12aac (4:6aac) +Type2Text: db "TYPE2/", $4e -IDNoText: ; 12ab3 (4:6ab3) - db $73, "№", "/", $4e +IDNoText: + db $73, "№/", $4e -OTText: ; 12ab7 (4:6ab7) - db "OT/", $4e, "@" +OTText: + db "OT/" + next "@" -StatusText: ; 12abc (4:6abc) +StatusText: db "STATUS/@" -OKText: ; 12ac4 (4:6ac4) +OKText: db "OK@" ; Draws a line starting from hl high b and wide c -DrawLineBox: ; 0x12ac7 +DrawLineBox: ld de, SCREEN_WIDTH ; New line .PrintVerticalLine ld [hl], $78 ; │ @@ -240,25 +241,25 @@ DrawLineBox: ; 0x12ac7 ld [hl], $6f ; ← (halfarrow ending) ret -PTile: ; 12adc (4:6adc) ; This is a single 1bpp "P" tile +PTile: ; This is a single 1bpp "P" tile INCBIN "gfx/p_tile.1bpp" PTileEnd: -PrintStatsBox: ; 12ae4 (4:6ae4) +PrintStatsBox: ld a, d and a ; a is 0 from the status screen jr nz, .DifferentBox coord hl, 0, 8 - ld b, $8 - ld c, $8 + ld b, 8 + ld c, 8 call TextBoxBorder ; Draws the box coord hl, 1, 9 ; Start printing stats from here ld bc, $0019 ; Number offset jr .PrintStats .DifferentBox coord hl, 9, 2 - ld b, $8 - ld c, $9 + ld b, 8 + ld c, 9 call TextBoxBorder coord hl, 11, 3 ld bc, $0018 @@ -279,7 +280,7 @@ PrintStatsBox: ; 12ae4 (4:6ae4) call PrintStat ld de, wLoadedMonSpecial jp PrintNumber -PrintStat +PrintStat: push hl call PrintNumber pop hl @@ -287,13 +288,13 @@ PrintStat add hl, de ret -StatsText: ; 12b3a (4:6b3a) +StatsText: db "FOR" next "DEF" next "VIT" next "SPE@" -StatusScreen2: ; 12b57 (4:6b57) +StatusScreen2: ld a, [hTilesetType] push af xor a @@ -335,11 +336,11 @@ StatusScreen2: ; 12b57 (4:6b57) ld c, a ld a, "-" call StatusScreen_PrintPP ; Fill the rest with -- -.InitPP ; 12bbb +.InitPP ld hl, wLoadedMonMoves coord de, 14, 10 ld b, 0 -.PrintPP ; 12bc3 +.PrintPP ld a, [hli] and a jr z, .PPDone @@ -435,7 +436,7 @@ StatusScreen2: ; 12b57 (4:6b57) call GBPalWhiteOut jp ClearScreen -CalcExpToLevelUp: ; 12c86 (4:6c86) +CalcExpToLevelUp: ld a, [wLoadedMonLevel] cp MAX_LEVEL jr z, .atMaxLevel @@ -461,16 +462,16 @@ CalcExpToLevelUp: ; 12c86 (4:6c86) ld [hl], a ret -StatusScreenExpText: ; 12caf (4:6caf) +StatusScreenExpText: db "PTS EXP." next "PROCH.NIV.@" -StatusScreen_ClearName: ; 12cc3 (4:6cc3) +StatusScreen_ClearName: ld bc, 10 ld a, " " jp FillMemory -StatusScreen_PrintPP: ; 12ccb (4:6ccb) +StatusScreen_PrintPP: ; print PP or -- c times, going down two rows each time ld [hli], a ld [hld], a diff --git a/engine/menu/vending_machine.asm b/engine/menu/vending_machine.asm index 9a17705f..dc6267c4 100755 --- a/engine/menu/vending_machine.asm +++ b/engine/menu/vending_machine.asm @@ -1,4 +1,4 @@ -VendingMachineMenu: ; 74ee0 (1d:4ee0) +VendingMachineMenu: ld hl, VendingMachineText1 call PrintText ld a, MONEY_BOX @@ -80,39 +80,39 @@ VendingMachineMenu: ; 74ee0 (1d:4ee0) ld hl, VendingMachineText7 jp PrintText -VendingMachineText1: ; 74f99 (1d:4f99) +VendingMachineText1: TX_FAR _VendingMachineText1 db "@" -DrinkText: ; 74f9e (1d:4f9e) +DrinkText: db "EAU FRAICHE" next "SODA COOL" next "LIMONADE" next "RETOUR@" -DrinkPriceText: ; 74fc3 (1d:4fc3) +DrinkPriceText: db "200¥" next "300¥" next "350¥" next "@" -VendingMachineText4: ; 74fd3 (1d:4fd3) +VendingMachineText4: TX_FAR _VendingMachineText4 db "@" -VendingMachineText5: ; 74fd8 (1d:4fd8) +VendingMachineText5: TX_FAR _VendingMachineText5 db "@" -VendingMachineText6: ; 74fdd (1d:4fdd) +VendingMachineText6: TX_FAR _VendingMachineText6 db "@" -VendingMachineText7: ; 74fe2 (1d:4fe2) +VendingMachineText7: TX_FAR _VendingMachineText7 db "@" -LoadVendingMachineItem: ; 74fe7 (1d:4fe7) +LoadVendingMachineItem: ld hl, VendingPrices ld a, [wCurrentMenuItem] add a @@ -130,7 +130,10 @@ LoadVendingMachineItem: ; 74fe7 (1d:4fe7) ld [hVendingMachinePrice + 2], a ret -VendingPrices: ; 75000 (1d:5000) - db FRESH_WATER,$00,$02,$00 - db SODA_POP, $00,$03,$00 - db LEMONADE, $00,$03,$50 +VendingPrices: + db FRESH_WATER + money 200 + db SODA_POP + money 300 + db LEMONADE + money 350 |