diff options
author | Rangi <35663410+Rangi42@users.noreply.github.com> | 2020-07-07 19:48:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-07 19:48:22 -0400 |
commit | 9571c550b6a0dcb3a4f54513c881661a87271024 (patch) | |
tree | d73507228a57e4f3cece2fb93fe7df3a9439553f /engine/menus | |
parent | c480632d5494d04f7f5f0298a31877a2293b564e (diff) | |
parent | bbf2f51a02b2544f1bef32a5868503b474ae2fef (diff) |
Merge pull request #263 from Rangi42/master
Syncing style with pokecrystal
Diffstat (limited to 'engine/menus')
-rw-r--r-- | engine/menus/display_text_id_init.asm | 19 | ||||
-rw-r--r-- | engine/menus/draw_badges.asm | 4 | ||||
-rw-r--r-- | engine/menus/draw_start_menu.asm | 6 | ||||
-rwxr-xr-x | engine/menus/league_pc.asm | 20 | ||||
-rwxr-xr-x | engine/menus/main_menu.asm | 96 | ||||
-rwxr-xr-x | engine/menus/naming_screen.asm | 38 | ||||
-rwxr-xr-x | engine/menus/party_menu.asm | 26 | ||||
-rwxr-xr-x | engine/menus/pc.asm | 20 | ||||
-rwxr-xr-x | engine/menus/players_pc.asm | 4 | ||||
-rwxr-xr-x | engine/menus/pokedex.asm | 104 | ||||
-rwxr-xr-x | engine/menus/save.asm | 30 | ||||
-rwxr-xr-x | engine/menus/start_sub_menus.asm | 96 | ||||
-rw-r--r-- | engine/menus/swap_items.asm | 8 | ||||
-rw-r--r-- | engine/menus/text_box.asm | 20 |
14 files changed, 246 insertions, 245 deletions
diff --git a/engine/menus/display_text_id_init.asm b/engine/menus/display_text_id_init.asm index c02e5bbc..6ce76e7f 100644 --- a/engine/menus/display_text_id_init.asm +++ b/engine/menus/display_text_id_init.asm @@ -5,7 +5,7 @@ DisplayTextIDInit:: ld a, [wAutoTextBoxDrawingControl] bit 0, a jr nz, .skipDrawingTextBoxBorder - ld a, [hSpriteIndexOrTextID] ; text ID (or sprite ID) + ldh a, [hSpriteIndexOrTextID] ; text ID (or sprite ID) and a jr nz, .notStartMenu ; if text ID is 0 (i.e. the start menu) @@ -13,18 +13,18 @@ DisplayTextIDInit:: ; below this, so this seems unnecessary. CheckEvent EVENT_GOT_POKEDEX ; start menu with pokedex - coord hl, 10, 0 + hlcoord 10, 0 ld b, $0e ld c, $08 jr nz, .drawTextBoxBorder ; start menu without pokedex - coord hl, 10, 0 + hlcoord 10, 0 ld b, $0c ld c, $08 jr .drawTextBoxBorder ; if text ID is not 0 (i.e. not the start menu) then do a standard dialogue text box .notStartMenu - coord hl, 0, 12 + hlcoord 0, 12 ld b, $04 ld c, $12 .drawTextBoxBorder @@ -38,16 +38,17 @@ DisplayTextIDInit:: jr nz, .skipMovingSprites call UpdateSprites .skipMovingSprites -; loop to copy C1X9 (direction the sprite is facing) to C2X9 for each sprite +; loop to copy [x#SPRITESTATEDATA1_FACINGDIRECTION] to +; [x#SPRITESTATEDATA2_ORIGFACINGDIRECTION] for each non-player sprite ; this is done because when you talk to an NPC, they turn to look your way ; the original direction they were facing must be restored after the dialogue is over ld hl, wSprite01StateData1FacingDirection ld c, $0f ld de, $10 .spriteFacingDirectionCopyLoop - ld a, [hl] + ld a, [hl] ; x#SPRITESTATEDATA1_FACINGDIRECTION inc h - ld [hl], a + ld [hl], a ; [x#SPRITESTATEDATA2_ORIGFACINGDIRECTION] dec h add hl, de dec c @@ -71,8 +72,8 @@ DisplayTextIDInit:: ld b, $9c ; window background address call CopyScreenTileBufferToVRAM ; transfer background in WRAM to VRAM xor a - ld [hWY], a ; put the window on the screen + ldh [hWY], a ; put the window on the screen call LoadFontTilePatterns ld a, $01 - ld [hAutoBGTransferEnabled], a ; enable continuous WRAM to VRAM transfer each V-blank + ldh [hAutoBGTransferEnabled], a ; enable continuous WRAM to VRAM transfer each V-blank ret diff --git a/engine/menus/draw_badges.asm b/engine/menus/draw_badges.asm index 1888e32f..a74497c1 100644 --- a/engine/menus/draw_badges.asm +++ b/engine/menus/draw_badges.asm @@ -43,11 +43,11 @@ DrawBadges: ld [hli], a ld [hl], $60 ; First name - coord hl, 2, 11 + hlcoord 2, 11 ld de, wTempObtainedBadgesBooleans call .DrawBadgeRow - coord hl, 2, 14 + hlcoord 2, 14 ld de, wTempObtainedBadgesBooleans + 4 ; call .DrawBadgeRow ; ret diff --git a/engine/menus/draw_start_menu.asm b/engine/menus/draw_start_menu.asm index 21e444e9..00d385bc 100644 --- a/engine/menus/draw_start_menu.asm +++ b/engine/menus/draw_start_menu.asm @@ -2,12 +2,12 @@ DrawStartMenu:: CheckEvent EVENT_GOT_POKEDEX ; menu with pokedex - coord hl, 10, 0 + hlcoord 10, 0 ld b, $0e ld c, $08 jr nz, .drawTextBoxBorder ; shorter menu if the player doesn't have the pokedex - coord hl, 10, 0 + hlcoord 10, 0 ld b, $0c ld c, $08 .drawTextBoxBorder @@ -25,7 +25,7 @@ DrawStartMenu:: ld [wMenuWatchMovingOutOfBounds], a ld hl, wd730 set 6, [hl] ; no pauses between printing each letter - coord hl, 12, 2 + hlcoord 12, 2 CheckEvent EVENT_GOT_POKEDEX ; case for not having pokedex ld a, $06 diff --git a/engine/menus/league_pc.asm b/engine/menus/league_pc.asm index c07c6bc1..f2107c49 100755 --- a/engine/menus/league_pc.asm +++ b/engine/menus/league_pc.asm @@ -6,10 +6,10 @@ PKMNLeaguePC: push hl ld a, [wUpdateSpritesEnabled] push af - ld a, [hTilesetType] + ldh a, [hTilesetType] push af xor a - ld [hTilesetType], a + ldh [hTilesetType], a ld [wSpriteFlipped], a ld [wUpdateSpritesEnabled], a ld [wHoFTeamIndex2], a @@ -29,7 +29,7 @@ PKMNLeaguePC: push bc ld a, [wHoFTeamIndex2] ld [wHoFTeamIndex], a - callba LoadHallOfFameTeams + farcall LoadHallOfFameTeams call LeaguePCShowTeam pop bc jr c, .doneShowingTeams @@ -40,7 +40,7 @@ PKMNLeaguePC: jr nz, .loop .doneShowingTeams pop af - ld [hTilesetType], a + ldh [hTilesetType], a pop af ld [wUpdateSpritesEnabled], a pop hl @@ -56,7 +56,7 @@ LeaguePCShowTeam: push bc call LeaguePCShowMon call WaitForTextScrollButtonPress - ld a, [hJoyHeld] + ldh a, [hJoyHeld] bit 1, a jr nz, .exit ld hl, wHallOfFame + HOF_MON @@ -95,22 +95,22 @@ LeaguePCShowMon: ld b, SET_PAL_POKEMON_WHOLE_SCREEN ld c, 0 call RunPaletteCommand - coord hl, 12, 5 + hlcoord 12, 5 call GetMonHeader call LoadFrontSpriteByMonIndex call GBPalNormal - coord hl, 0, 13 + hlcoord 0, 13 ld b, 2 ld c, $12 call TextBoxBorder - coord hl, 1, 15 + hlcoord 1, 15 ld de, HallOfFameNoText call PlaceString - coord hl, 16, 15 + hlcoord 16, 15 ld de, wHoFTeamNo lb bc, 1, 3 call PrintNumber - jpba HoFDisplayMonInfo + farjp HoFDisplayMonInfo HallOfFameNoText: db "HALL OF FAME No @" diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm index 43289ce8..d2776240 100755 --- a/engine/menus/main_menu.asm +++ b/engine/menus/main_menu.asm @@ -33,20 +33,20 @@ MainMenu: cp 1 jr z, .noSaveFile ; there's a save file - coord hl, 0, 0 + hlcoord 0, 0 ld b, 6 ld c, 13 call TextBoxBorder - coord hl, 2, 2 + hlcoord 2, 2 ld de, ContinueText call PlaceString jr .next2 .noSaveFile - coord hl, 0, 0 + hlcoord 0, 0 ld b, 4 ld c, 13 call TextBoxBorder - coord hl, 2, 2 + hlcoord 2, 2 ld de, NewGameText call PlaceString .next2 @@ -94,11 +94,11 @@ MainMenu: set 5, [hl] .inputLoop xor a - ld [hJoyPressed], a - ld [hJoyReleased], a - ld [hJoyHeld], a + ldh [hJoyPressed], a + ldh [hJoyReleased], a + ldh [hJoyHeld], a call Joypad - ld a, [hJoyHeld] + ldh a, [hJoyHeld] bit 0, a jr nz, .pressedA bit 1, a @@ -141,12 +141,12 @@ LinkMenu: call SaveScreenTilesToBuffer1 ld hl, WhereWouldYouLikeText call PrintText - coord hl, 5, 5 + hlcoord 5, 5 ld b, $6 ld c, $d call TextBoxBorder call UpdateSprites - coord hl, 7, 7 + hlcoord 7, 7 ld de, CableClubOptionsText call PlaceString xor a @@ -205,7 +205,7 @@ LinkMenu: jr z, .useEnemyMenuSelection ; if the enemy pressed A or B but the player didn't, use the enemy's selection ; the enemy and the player both pressed A or B ; The gameboy that is clocking the connection wins. - ld a, [hSerialConnectionStatus] + ldh a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK jr z, .doneChoosingMenuSelection .useEnemyMenuSelection @@ -214,13 +214,13 @@ LinkMenu: and $3 ld [wCurrentMenuItem], a .doneChoosingMenuSelection - ld a, [hSerialConnectionStatus] + ldh a, [hSerialConnectionStatus] cp USING_INTERNAL_CLOCK jr nz, .skipStartingTransfer call DelayFrame call DelayFrame ld a, START_TRANSFER_INTERNAL_CLOCK - ld [rSC], a + ldh [rSC], a .skipStartingTransfer ld b, $7f ld c, $7f @@ -240,11 +240,11 @@ LinkMenu: ld c, d .updateCursorPosition ld a, b - Coorda 6, 7 + ldcoord_a 6, 7 ld a, c - Coorda 6, 9 + ldcoord_a 6, 9 ld a, d - Coorda 6, 11 + ldcoord_a 6, 11 ld c, 40 call DelayFrames call LoadScreenTilesFromBuffer1 @@ -314,9 +314,9 @@ StartNewGame: ; enter map after using a special warp or loading the game from the main menu SpecialEnterMap:: xor a - ld [hJoyPressed], a - ld [hJoyHeld], a - ld [hJoy5], a + ldh [hJoyPressed], a + ldh [hJoyHeld], a + ldh [hJoy5], a ld [wd72d], a ld hl, wd732 set 0, [hl] ; count play time @@ -344,51 +344,51 @@ CableClubOptionsText: DisplayContinueGameInfo: xor a - ld [hAutoBGTransferEnabled], a - coord hl, 4, 7 + ldh [hAutoBGTransferEnabled], a + hlcoord 4, 7 ld b, 8 ld c, 14 call TextBoxBorder - coord hl, 5, 9 + hlcoord 5, 9 ld de, SaveScreenInfoText call PlaceString - coord hl, 12, 9 + hlcoord 12, 9 ld de, wPlayerName call PlaceString - coord hl, 17, 11 + hlcoord 17, 11 call PrintNumBadges - coord hl, 16, 13 + hlcoord 16, 13 call PrintNumOwnedMons - coord hl, 13, 15 + hlcoord 13, 15 call PrintPlayTime ld a, 1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ld c, 30 jp DelayFrames PrintSaveScreenText: xor a - ld [hAutoBGTransferEnabled], a - coord hl, 4, 0 + ldh [hAutoBGTransferEnabled], a + hlcoord 4, 0 ld b, $8 ld c, $e call TextBoxBorder call LoadTextBoxTilePatterns call UpdateSprites - coord hl, 5, 2 + hlcoord 5, 2 ld de, SaveScreenInfoText call PlaceString - coord hl, 12, 2 + hlcoord 12, 2 ld de, wPlayerName call PlaceString - coord hl, 17, 4 + hlcoord 17, 4 call PrintNumBadges - coord hl, 16, 6 + hlcoord 16, 6 call PrintNumOwnedMons - coord hl, 13, 8 + hlcoord 13, 8 call PrintPlayTime ld a, $1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ld c, 30 jp DelayFrames @@ -429,28 +429,28 @@ SaveScreenInfoText: next "TIME@" DisplayOptionMenu: - coord hl, 0, 0 + hlcoord 0, 0 ld b, 3 ld c, 18 call TextBoxBorder - coord hl, 0, 5 + hlcoord 0, 5 ld b, 3 ld c, 18 call TextBoxBorder - coord hl, 0, 10 + hlcoord 0, 10 ld b, 3 ld c, 18 call TextBoxBorder - coord hl, 1, 1 + hlcoord 1, 1 ld de, TextSpeedOptionText call PlaceString - coord hl, 1, 6 + hlcoord 1, 6 ld de, BattleAnimationOptionText call PlaceString - coord hl, 1, 11 + hlcoord 1, 11 ld de, BattleStyleOptionText call PlaceString - coord hl, 2, 16 + hlcoord 2, 16 ld de, OptionMenuCancelText call PlaceString xor a @@ -465,14 +465,14 @@ DisplayOptionMenu: ld a, [wOptionsTextSpeedCursorX] ; text speed cursor X coordinate ld [wTopMenuItemX], a ld a, $01 - ld [hAutoBGTransferEnabled], a ; enable auto background transfer + ldh [hAutoBGTransferEnabled], a ; enable auto background transfer call Delay3 .loop call PlaceMenuCursor call SetOptionsFromCursorPositions .getJoypadStateLoop call JoypadLowSensitivity - ld a, [hJoy5] + ldh a, [hJoy5] ld b, a and A_BUTTON | B_BUTTON | START | D_RIGHT | D_LEFT | D_UP | D_DOWN ; any key besides select pressed? jr z, .getJoypadStateLoop @@ -644,7 +644,7 @@ SetCursorPositionsFromOptions: dec hl ld a, [hl] ld [wOptionsTextSpeedCursorX], a ; text speed cursor X coordinate - coord hl, 0, 3 + hlcoord 0, 3 call .placeUnfilledRightArrow sla c ld a, 1 ; On @@ -652,7 +652,7 @@ SetCursorPositionsFromOptions: ld a, 10 ; Off .storeBattleAnimationCursorX ld [wOptionsBattleAnimCursorX], a ; battle animation cursor X coordinate - coord hl, 0, 8 + hlcoord 0, 8 call .placeUnfilledRightArrow sla c ld a, 1 @@ -660,10 +660,10 @@ SetCursorPositionsFromOptions: ld a, 10 .storeBattleStyleCursorX ld [wOptionsBattleStyleCursorX], a ; battle style cursor X coordinate - coord hl, 0, 13 + hlcoord 0, 13 call .placeUnfilledRightArrow ; cursor in front of Cancel - coord hl, 0, 16 + hlcoord 0, 16 ld a, 1 .placeUnfilledRightArrow ld e, a diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index a84609c9..8ca2ec9b 100755 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -4,7 +4,7 @@ AskName: push hl ld a, [wIsInBattle] dec a - coord hl, 0, 0 + hlcoord 0, 0 ld b, 4 ld c, 11 call z, ClearScreenArea ; only if in wild battle @@ -13,7 +13,7 @@ AskName: call GetMonName ld hl, DoYouWantToNicknameText call PrintText - coord hl, 14, 7 + hlcoord 14, 7 lb bc, 8, 15 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -92,8 +92,8 @@ DisplayNamingScreen: call RunPaletteCommand call LoadHpBarAndStatusTilePatterns call LoadEDTile - callba LoadMonPartySpriteGfx - coord hl, 0, 4 + farcall LoadMonPartySpriteGfx + hlcoord 0, 4 ld b, 9 ld c, 18 call TextBoxBorder @@ -128,11 +128,11 @@ DisplayNamingScreen: .inputLoop ld a, [wCurrentMenuItem] push af - callba AnimatePartyMon_ForceSpeed1 + farcall AnimatePartyMon_ForceSpeed1 pop af ld [wCurrentMenuItem], a call JoypadLowSensitivity - ld a, [hJoyPressed] + ldh a, [hJoyPressed] and a jr z, .inputLoop ld hl, .namingScreenButtonFunctions @@ -172,7 +172,7 @@ DisplayNamingScreen: ld a, [wIsInBattle] and a jp z, LoadTextBoxTilePatterns - jpab LoadHudTilePatterns + jpfar LoadHudTilePatterns .namingScreenButtonFunctions dw .dPadReturnPoint @@ -325,7 +325,7 @@ DisplayNamingScreen: LoadEDTile: ld de, ED_Tile - ld hl, vFont + $700 + ld hl, vFont tile $70 ld bc, (ED_TileEnd - ED_Tile) / $8 ; to fix the graphical bug on poor emulators ;lb bc, BANK(ED_Tile), (ED_TileEnd - ED_Tile) / $8 @@ -337,14 +337,14 @@ ED_TileEnd: PrintAlphabet: xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ld a, [wAlphabetCase] and a ld de, LowerCaseAlphabet jr nz, .lowercase ld de, UpperCaseAlphabet .lowercase - coord hl, 2, 5 + hlcoord 2, 5 lb bc, 5, 9 ; 5 rows, 9 columns .outerLoop push bc @@ -362,7 +362,7 @@ PrintAlphabet: jr nz, .outerLoop call PlaceString ld a, $1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a jp Delay3 INCLUDE "data/text/alphabets.asm" @@ -371,13 +371,13 @@ PrintNicknameAndUnderscores: call CalcStringLength ld a, c ld [wNamingScreenNameLength], a - coord hl, 10, 2 + hlcoord 10, 2 lb bc, 1, 10 call ClearScreenArea - coord hl, 10, 2 + hlcoord 10, 2 ld de, wcf4b call PlaceString - coord hl, 10, 3 + hlcoord 10, 3 ld a, [wNamingScreenType] cp NAME_MON_SCREEN jr nc, .pokemon1 @@ -416,7 +416,7 @@ PrintNicknameAndUnderscores: .emptySpacesRemaining ld c, a ld b, $0 - coord hl, 10, 3 + hlcoord 10, 3 add hl, bc ld [hl], $77 ; raised underscore tile id ret @@ -450,7 +450,7 @@ CalcStringLength: jr .loop PrintNamingText: - coord hl, 0, 1 + hlcoord 0, 1 ld a, [wNamingScreenType] ld de, YourTextString and a @@ -461,16 +461,16 @@ PrintNamingText: ld a, [wcf91] ld [wMonPartySpriteSpecies], a push af - callba WriteMonPartySpriteOAMBySpecies + farcall WriteMonPartySpriteOAMBySpecies pop af ld [wd11e], a call GetMonName - coord hl, 4, 1 + hlcoord 4, 1 call PlaceString ld hl, $1 add hl, bc ld [hl], $c9 - coord hl, 1, 3 + hlcoord 1, 3 ld de, NicknameTextString jr .placeString .notNickname diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm index f63a3cf0..14216b64 100755 --- a/engine/menus/party_menu.asm +++ b/engine/menus/party_menu.asm @@ -19,22 +19,22 @@ ; f8: leveled up DrawPartyMenu_:: xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a call ClearScreen call UpdateSprites - callba LoadMonPartySpriteGfxWithLCDDisabled ; load pokemon icon graphics + farcall LoadMonPartySpriteGfxWithLCDDisabled ; load pokemon icon graphics RedrawPartyMenu_:: ld a, [wPartyMenuTypeOrMessageID] cp SWAP_MONS_PARTY_MENU jp z, .printMessage call ErasePartyMenuCursors - callba InitPartyMenuBlkPacket - coord hl, 3, 0 + farcall InitPartyMenuBlkPacket + hlcoord 3, 0 ld de, wPartySpecies xor a ld c, a - ld [hPartyMonIndex], a + ldh [hPartyMonIndex], a ld [wWhichPartyMenuHPBar], a .loop ld a, [de] @@ -49,11 +49,11 @@ RedrawPartyMenu_:: call GetPartyMonName pop hl call PlaceString ; print the pokemon's name - callba WriteMonPartySpriteOAMByPartyIndex ; place the appropriate pokemon icon - ld a, [hPartyMonIndex] + farcall WriteMonPartySpriteOAMByPartyIndex ; place the appropriate pokemon icon + ldh a, [hPartyMonIndex] ld [wWhichPokemon], a inc a - ld [hPartyMonIndex], a + ldh [hPartyMonIndex], a call LoadMonData pop hl push hl @@ -88,14 +88,14 @@ RedrawPartyMenu_:: pop hl push hl ld bc, SCREEN_WIDTH + 1 ; down 1 row and right 1 column - ld a, [hFlagsFFF6] + ldh a, [hFlagsFFF6] set 0, a - ld [hFlagsFFF6], a + ldh [hFlagsFFF6], a add hl, bc predef DrawHP2 ; draw HP bar and prints current / max HP - ld a, [hFlagsFFF6] + ldh a, [hFlagsFFF6] res 0, a - ld [hFlagsFFF6], a + ldh [hFlagsFFF6], a call SetPartyMenuHPBarColor ; color the HP bar (on SGB) pop hl jr .printLevel @@ -213,7 +213,7 @@ RedrawPartyMenu_:: pop af ld [hl], a ld a, 1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a call Delay3 jp GBPalNormal .printItemUseMessage diff --git a/engine/menus/pc.asm b/engine/menus/pc.asm index f296ad61..4c340e7b 100755 --- a/engine/menus/pc.asm +++ b/engine/menus/pc.asm @@ -10,7 +10,7 @@ ActivatePC:: call LoadScreenTilesFromBuffer2 call Delay3 PCMainMenu: - callba DisplayPCMainMenu + farcall DisplayPCMainMenu ld hl, wFlags_0xcd60 set 5, [hl] call HandleMenuInput @@ -56,19 +56,19 @@ PCMainMenu: call WaitForSoundToFinish ld hl, AccessedMyPCText call PrintText - callba PlayerPC + farcall PlayerPC jr ReloadMainMenu OaksPC: ld a, SFX_ENTER_PC call PlaySound call WaitForSoundToFinish - callba OpenOaksPC + farcall OpenOaksPC jr ReloadMainMenu PKMNLeague: ld a, SFX_ENTER_PC call PlaySound call WaitForSoundToFinish - callba PKMNLeaguePC + farcall PKMNLeaguePC jr ReloadMainMenu BillsPC: ld a, SFX_ENTER_PC @@ -82,7 +82,7 @@ BillsPC: ld hl, AccessedBillsPCText .printText call PrintText - callba BillsPC_ + farcall BillsPC_ ReloadMainMenu: xor a ld [wDoNotWaitForButtonPressAfterDisplayingText], a @@ -117,10 +117,10 @@ AccessedMyPCText: ; removes one of the specified item ID [hItemToRemoveID] from bag (if existent) RemoveItemByID:: ld hl, wBagItems - ld a, [hItemToRemoveID] + ldh a, [hItemToRemoveID] ld b, a xor a - ld [hItemToRemoveIndex], a + ldh [hItemToRemoveIndex], a .loop ld a, [hli] cp -1 ; reached terminator? @@ -128,14 +128,14 @@ RemoveItemByID:: cp b jr z, .foundItem inc hl - ld a, [hItemToRemoveIndex] + ldh a, [hItemToRemoveIndex] inc a - ld [hItemToRemoveIndex], a + ldh [hItemToRemoveIndex], a jr .loop .foundItem ld a, $1 ld [wItemQuantity], a - ld a, [hItemToRemoveIndex] + ldh a, [hItemToRemoveIndex] ld [wWhichPokemon], a ld hl, wNumBagItems jp RemoveItemFromInventory diff --git a/engine/menus/players_pc.asm b/engine/menus/players_pc.asm index ebaacd52..5461be51 100755 --- a/engine/menus/players_pc.asm +++ b/engine/menus/players_pc.asm @@ -22,12 +22,12 @@ PlayerPCMenu: ld hl, wFlags_0xcd60 set 5, [hl] call LoadScreenTilesFromBuffer2 - coord hl, 0, 0 + hlcoord 0, 0 ld b, $8 ld c, $e call TextBoxBorder call UpdateSprites - coord hl, 2, 2 + hlcoord 2, 2 ld de, PlayersPCMenuEntries call PlaceString ld hl, wTopMenuItemY diff --git a/engine/menus/pokedex.asm b/engine/menus/pokedex.asm index 542ef873..53719712 100755 --- a/engine/menus/pokedex.asm +++ b/engine/menus/pokedex.asm @@ -10,11 +10,11 @@ ShowPokedexMenu: ld [wLastMenuItem], a inc a ld [wd11e], a - ld [hJoy7], a + ldh [hJoy7], a .setUpGraphics ld b, SET_PAL_GENERIC call RunPaletteCommand - callab LoadPokedexTilePatterns + callfar LoadPokedexTilePatterns .doPokemonListMenu ld hl, wTopMenuItemY ld a, 3 @@ -35,7 +35,7 @@ ShowPokedexMenu: ld [wMenuWatchMovingOutOfBounds], a ld [wCurrentMenuItem], a ld [wLastMenuItem], a - ld [hJoy7], a + ldh [hJoy7], a ld [wWastedByteCD3A], a ld [wOverrideSimulatedJoypadStatesMask], a pop af @@ -119,7 +119,7 @@ HandlePokedexSideMenu: pop af ld [wCurrentMenuItem], a push bc - coord hl, 0, 3 + hlcoord 0, 3 ld de, 20 lb bc, " ", 13 call DrawTileLine ; cover up the menu cursor in the pokemon list @@ -128,7 +128,7 @@ HandlePokedexSideMenu: .buttonBPressed push bc - coord hl, 15, 10 + hlcoord 15, 10 ld de, 20 lb bc, " ", 7 call DrawTileLine ; cover up the menu cursor in the side menu @@ -156,45 +156,45 @@ HandlePokedexSideMenu: ; sets carry flag if player presses A, unsets carry flag if player presses B HandlePokedexListMenu: xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ; draw the horizontal line separating the seen and owned amounts from the menu - coord hl, 15, 8 + hlcoord 15, 8 ld a, "─" ld [hli], a ld [hli], a ld [hli], a ld [hli], a ld [hli], a - coord hl, 14, 0 + hlcoord 14, 0 ld [hl], $71 ; vertical line tile - coord hl, 14, 1 + hlcoord 14, 1 call DrawPokedexVerticalLine - coord hl, 14, 9 + hlcoord 14, 9 call DrawPokedexVerticalLine ld hl, wPokedexSeen ld b, wPokedexSeenEnd - wPokedexSeen call CountSetBits ld de, wNumSetBits - coord hl, 16, 3 + hlcoord 16, 3 lb bc, 1, 3 call PrintNumber ; print number of seen pokemon ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits ld de, wNumSetBits - coord hl, 16, 6 + hlcoord 16, 6 lb bc, 1, 3 call PrintNumber ; print number of owned pokemon - coord hl, 16, 2 + hlcoord 16, 2 ld de, PokedexSeenText call PlaceString - coord hl, 16, 5 + hlcoord 16, 5 ld de, PokedexOwnText call PlaceString - coord hl, 1, 1 + hlcoord 1, 1 ld de, PokedexContentsText call PlaceString - coord hl, 16, 10 + hlcoord 16, 10 ld de, PokedexMenuItemsText call PlaceString ; find the highest pokedex number among the pokemon the player has seen @@ -216,11 +216,11 @@ HandlePokedexListMenu: ld [wDexMaxSeenMon], a .loop xor a - ld [hAutoBGTransferEnabled], a - coord hl, 4, 2 + ldh [hAutoBGTransferEnabled], a + hlcoord 4, 2 lb bc, 14, 10 call ClearScreenArea - coord hl, 1, 3 + hlcoord 1, 3 ld a, [wListScrollOffset] ld [wd11e], a ld d, 7 @@ -280,7 +280,7 @@ HandlePokedexListMenu: dec d jr nz, .printPokemonLoop ld a, 01 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a call Delay3 call GBPalNormal call HandleMenuInput @@ -393,14 +393,14 @@ ShowPokedexData: call GBPalWhiteOutWithDelay3 call ClearScreen call UpdateSprites - callab LoadPokedexTilePatterns ; load pokedex tiles + callfar LoadPokedexTilePatterns ; load pokedex tiles ; function to display pokedex data from inside the pokedex ShowPokedexDataInternal: ld hl, wd72c set 1, [hl] ld a, $33 ; 3/7 volume - ld [rNR50], a + ldh [rNR50], a call GBPalWhiteOut ; zero all palettes call ClearScreen ld a, [wd11e] ; pokemon ID @@ -410,48 +410,48 @@ ShowPokedexDataInternal: call RunPaletteCommand pop af ld [wd11e], a - ld a, [hTilesetType] + ldh a, [hTilesetType] push af xor a - ld [hTilesetType], a + ldh [hTilesetType], a - coord hl, 0, 0 + hlcoord 0, 0 ld de, 1 lb bc, $64, SCREEN_WIDTH call DrawTileLine ; draw top border - coord hl, 0, 17 + hlcoord 0, 17 ld b, $6f call DrawTileLine ; draw bottom border - coord hl, 0, 1 + hlcoord 0, 1 ld de, 20 lb bc, $66, $10 call DrawTileLine ; draw left border - coord hl, 19, 1 + hlcoord 19, 1 ld b, $67 call DrawTileLine ; draw right border ld a, $63 ; upper left corner tile - Coorda 0, 0 + ldcoord_a 0, 0 ld a, $65 ; upper right corner tile - Coorda 19, 0 + ldcoord_a 19, 0 ld a, $6c ; lower left corner tile - Coorda 0, 17 + ldcoord_a 0, 17 ld a, $6e ; lower right corner tile - Coorda 19, 17 + ldcoord_a 19, 17 - coord hl, 0, 9 + hlcoord 0, 9 ld de, PokedexDataDividerLine call PlaceString ; draw horizontal divider line - coord hl, 9, 6 + hlcoord 9, 6 ld de, HeightWeightText call PlaceString call GetMonName - coord hl, 9, 2 + hlcoord 9, 2 call PlaceString ld hl, PokedexEntryPointers @@ -465,7 +465,7 @@ ShowPokedexDataInternal: ld e, a ld d, [hl] ; de = address of pokedex entry - coord hl, 9, 4 + hlcoord 9, 4 call PlaceString ; print species name ld h, b @@ -475,7 +475,7 @@ ShowPokedexDataInternal: push af call IndexToPokedex - coord hl, 2, 8 + hlcoord 2, 8 ld a, "№" ld [hli], a ld a, "<DOT>" @@ -500,7 +500,7 @@ ShowPokedexDataInternal: call Delay3 call GBPalNormal call GetMonHeader ; load pokemon picture location - coord hl, 1, 1 + hlcoord 1, 1 call LoadFlippedFrontSpriteByMonIndex ; draw pokemon picture ld a, [wcf91] call PlayCry ; play pokemon cry @@ -515,14 +515,14 @@ ShowPokedexDataInternal: jp z, .waitForButtonPress ; if the pokemon has not been owned, don't print the height, weight, or description inc de ; de = address of feet (height) ld a, [de] ; reads feet, but a is overwritten without being used - coord hl, 12, 6 + hlcoord 12, 6 lb bc, 1, 2 call PrintNumber ; print feet (height) ld a, "′" ld [hl], a inc de inc de ; de = address of inches (height) - coord hl, 15, 6 + hlcoord 15, 6 lb bc, LEADING_ZEROES | 1, 2 call PrintNumber ; print inches (height) ld a, "″" @@ -544,13 +544,13 @@ ShowPokedexDataInternal: ld a, [de] ; a = lower byte of weight ld [hl], a ; store lower byte of weight in [hDexWeight + 1] ld de, hDexWeight - coord hl, 11, 8 + hlcoord 11, 8 lb bc, 2, 5 ; 2 bytes, 5 digits call PrintNumber ; print weight - coord hl, 14, 8 - ld a, [hDexWeight + 1] + hlcoord 14, 8 + ldh a, [hDexWeight + 1] sub 10 - ld a, [hDexWeight] + ldh a, [hDexWeight] sbc 0 jr nc, .next ld [hl], "0" ; if the weight is less than 10, put a 0 before the decimal point @@ -560,24 +560,24 @@ ShowPokedexDataInternal: ld [hld], a ; make space for the decimal point by moving the last digit forward one tile ld [hl], "<DOT>" ; decimal point tile pop af - ld [hDexWeight + 1], a ; restore original value of [hDexWeight + 1] + ldh [hDexWeight + 1], a ; restore original value of [hDexWeight + 1] pop af - ld [hDexWeight], a ; restore original value of [hDexWeight] + ldh [hDexWeight], a ; restore original value of [hDexWeight] pop hl inc hl ; hl = address of pokedex description text - coord bc, 1, 11 + bccoord 1, 11 ld a, %10 - ld [hClearLetterPrintingDelayFlags], a + ldh [hClearLetterPrintingDelayFlags], a call TextCommandProcessor ; print pokedex description text xor a - ld [hClearLetterPrintingDelayFlags], a + ldh [hClearLetterPrintingDelayFlags], a .waitForButtonPress call JoypadLowSensitivity - ld a, [hJoy5] + ldh a, [hJoy5] and A_BUTTON | B_BUTTON jr z, .waitForButtonPress pop af - ld [hTilesetType], a + ldh [hTilesetType], a call GBPalWhiteOut call ClearScreen call RunDefaultPaletteCommand @@ -586,7 +586,7 @@ ShowPokedexDataInternal: ld hl, wd72c res 1, [hl] ld a, $77 ; max volume - ld [rNR50], a + ldh [rNR50], a ret HeightWeightText: diff --git a/engine/menus/save.asm b/engine/menus/save.asm index 462e0eea..45fed8a6 100755 --- a/engine/menus/save.asm +++ b/engine/menus/save.asm @@ -70,7 +70,7 @@ LoadSAV0: ld bc, wSpriteDataEnd - wSpriteDataStart call CopyData ld a, [sTilesetType] - ld [hTilesetType], a + ldh [hTilesetType], a ld hl, sCurBoxData ld de, wBoxDataStart ld bc, wBoxDataEnd - wBoxDataStart @@ -138,7 +138,7 @@ LoadSAVIgnoreBadCheckSum: jp LoadSAV2 SaveSAV: - callba PrintSaveScreenText + farcall PrintSaveScreenText ld hl, WouldYouLikeToSaveText call SaveSAVConfirm and a ;|0 = Yes|1 = No| @@ -154,10 +154,10 @@ SaveSAV: ret nz .save call SaveSAVtoSRAM - coord hl, 1, 13 + hlcoord 1, 13 lb bc, 4, 18 call ClearScreenArea - coord hl, 1, 14 + hlcoord 1, 14 ld de, NowSavingString call PlaceString ld c, 120 @@ -175,7 +175,7 @@ NowSavingString: SaveSAVConfirm: call PrintText - coord hl, 0, 7 + hlcoord 0, 7 lb bc, 8, 1 ld a, TWO_OPTION_MENU ld [wTextBoxID], a @@ -217,7 +217,7 @@ SaveSAVtoSRAM0: ld de, sCurBoxData ld bc, wBoxDataEnd - wBoxDataStart call CopyData - ld a, [hTilesetType] + ldh a, [hTilesetType] ld [sTilesetType], a ld hl, sPlayerName ld bc, sMainDataCheckSum - sPlayerName @@ -420,7 +420,7 @@ CopyBoxToOrFromSRAM: DisplayChangeBoxMenu: xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ld a, A_BUTTON | B_BUTTON ld [wMenuWatchedKeys], a ld a, 11 @@ -435,20 +435,20 @@ DisplayChangeBoxMenu: and $7f ld [wCurrentMenuItem], a ld [wLastMenuItem], a - coord hl, 0, 0 + hlcoord 0, 0 ld b, 2 ld c, 9 call TextBoxBorder ld hl, ChooseABoxText call PrintText - coord hl, 11, 0 + hlcoord 11, 0 ld b, 12 ld c, 7 call TextBoxBorder ld hl, hFlagsFFF6 set 2, [hl] ld de, BoxNames - coord hl, 13, 1 + hlcoord 13, 1 call PlaceString ld hl, hFlagsFFF6 res 2, [hl] @@ -457,19 +457,19 @@ DisplayChangeBoxMenu: cp 9 jr c, .singleDigitBoxNum sub 9 - coord hl, 8, 2 + hlcoord 8, 2 ld [hl], "1" add "0" jr .next .singleDigitBoxNum add "1" .next - Coorda 9, 2 - coord hl, 1, 2 + ldcoord_a 9, 2 + hlcoord 1, 2 ld de, BoxNoText call PlaceString call GetMonCountsForAllBoxes - coord hl, 18, 1 + hlcoord 18, 1 ld de, wBoxMonCounts ld bc, SCREEN_WIDTH ld a, $c @@ -486,7 +486,7 @@ DisplayChangeBoxMenu: dec a jr nz, .loop ld a, 1 - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a ret ChooseABoxText: diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm index 5182ae79..a845592f 100755 --- a/engine/menus/start_sub_menus.asm +++ b/engine/menus/start_sub_menus.asm @@ -50,7 +50,7 @@ StartMenu_Pokemon:: ld hl, wTopMenuItemY ld a, c ld [hli], a ; top menu item Y - ld a, [hFieldMoveMonMenuTopMenuItemX] + ldh a, [hFieldMoveMonMenuTopMenuItemX] ld [hli], a ; top menu item X xor a ld [hli], a ; current menu item ID @@ -160,7 +160,7 @@ StartMenu_Pokemon:: .surf bit 4, a ; does the player have the Soul Badge? jp z, .newBadgeRequired - callba IsSurfingAllowed + farcall IsSurfingAllowed ld hl, wd728 bit 1, [hl] res 1, [hl] @@ -239,21 +239,21 @@ StartMenu_Pokemon:: ld bc, wPartyMon2 - wPartyMon1 call AddNTimes ld a, [hli] - ld [hDividend], a + ldh [hDividend], a ld a, [hl] - ld [hDividend + 1], a + ldh [hDividend + 1], a ld a, 5 - ld [hDivisor], a + ldh [hDivisor], a ld b, 2 ; number of bytes call Divide ld bc, wPartyMon1HP - wPartyMon1MaxHP add hl, bc ld a, [hld] ld b, a - ld a, [hQuotient + 3] + ldh a, [hQuotient + 3] sub b ld b, [hl] - ld a, [hQuotient + 2] + ldh a, [hQuotient + 2] sbc b jp nc, .notHealthyEnough ld a, [wPartyAndBillsPCSavedMenuItem] @@ -285,7 +285,7 @@ StartMenu_Pokemon:: ; writes a blank tile to all possible menu cursor positions on the party menu ErasePartyMenuCursors:: - coord hl, 0, 1 + hlcoord 0, 1 ld bc, 2 * 20 ; menu cursor positions are 2 rows apart ld a, 6 ; 6 menu cursor positions .loop @@ -330,10 +330,10 @@ StartMenu_Item:: .choseItem ; erase menu cursor (blank each tile in front of an item name) ld a, " " - Coorda 5, 4 - Coorda 5, 6 - Coorda 5, 8 - Coorda 5, 10 + ldcoord_a 5, 4 + ldcoord_a 5, 6 + ldcoord_a 5, 8 + ldcoord_a 5, 10 call PlaceUnfilledArrowMenuCursor xor a ld [wMenuItemToSwap], a @@ -454,10 +454,10 @@ StartMenu_TrainerInfo:: call GBPalWhiteOut call ClearScreen call UpdateSprites - ld a, [hTilesetType] + ldh a, [hTilesetType] push af xor a - ld [hTilesetType], a + ldh [hTilesetType], a call DrawTrainerInfo predef DrawBadges ; draw badges ld b, SET_PAL_TRAINER_CARD @@ -471,7 +471,7 @@ StartMenu_TrainerInfo:: call ReloadMapData call LoadGBPal pop af - ld [hTilesetType], a + ldh [hTilesetType], a jp RedisplayStartMenu ; loads tile patterns and draws everything except for gym leader faces / badges @@ -480,44 +480,44 @@ DrawTrainerInfo: lb bc, BANK(RedPicFront), $01 predef DisplayPicCenteredOrUpperRight call DisableLCD - coord hl, 0, 2 + hlcoord 0, 2 ld a, " " call TrainerInfo_DrawVerticalLine - coord hl, 1, 2 + hlcoord 1, 2 call TrainerInfo_DrawVerticalLine - ld hl, vChars2 + $70 - ld de, vChars2 - ld bc, $70 * 4 + ld hl, vChars2 tile $07 + ld de, vChars2 tile $00 + ld bc, $1c tiles call CopyData ld hl, TrainerInfoTextBoxTileGraphics ; trainer info text box tile patterns - ld de, vChars2 + $770 - ld bc, $80 + ld de, vChars2 tile $77 + ld bc, 8 tiles push bc call TrainerInfo_FarCopyData ld hl, BlankLeaderNames - ld de, vChars2 + $600 - ld bc, $170 + ld de, vChars2 tile $60 + ld bc, $17 tiles call TrainerInfo_FarCopyData pop bc ld hl, BadgeNumbersTileGraphics ; badge number tile patterns - ld de, vChars1 + $580 + ld de, vChars1 tile $58 call TrainerInfo_FarCopyData ld hl, GymLeaderFaceAndBadgeTileGraphics ; gym leader face and badge tile patterns - ld de, vChars2 + $200 - ld bc, $400 - ld a, $03 + ld de, vChars2 tile $20 + ld bc, 8 * 8 tiles + ld a, BANK(GymLeaderFaceAndBadgeTileGraphics) call FarCopyData2 ld hl, TextBoxGraphics - ld de, $d0 + ld de, 13 tiles add hl, de ; hl = colon tile pattern - ld de, vChars1 + $560 - ld bc, $10 - ld a, $04 + ld de, vChars1 tile $56 + ld bc, 1 tiles + ld a, BANK(TextBoxGraphics) push bc call FarCopyData2 pop bc - ld hl, TrainerInfoTextBoxTileGraphics + $80 ; background tile pattern - ld de, vChars1 + $570 + ld hl, TrainerInfoTextBoxTileGraphics tile 8 ; background tile pattern + ld de, vChars1 tile $57 call TrainerInfo_FarCopyData call EnableLCD ld hl, wTrainerInfoTextBoxWidthPlus1 @@ -526,7 +526,7 @@ DrawTrainerInfo: dec a ld [hli], a ld [hl], 1 - coord hl, 0, 0 + hlcoord 0, 0 call TrainerInfo_DrawTextBox ld hl, wTrainerInfoTextBoxWidthPlus1 ld a, 16 + 1 @@ -534,27 +534,27 @@ DrawTrainerInfo: dec a ld [hli], a ld [hl], 3 - coord hl, 1, 10 + hlcoord 1, 10 call TrainerInfo_DrawTextBox - coord hl, 0, 10 + hlcoord 0, 10 ld a, $d7 call TrainerInfo_DrawVerticalLine - coord hl, 19, 10 + hlcoord 19, 10 call TrainerInfo_DrawVerticalLine - coord hl, 6, 9 + hlcoord 6, 9 ld de, TrainerInfo_BadgesText call PlaceString - coord hl, 2, 2 + hlcoord 2, 2 ld de, TrainerInfo_NameMoneyTimeText call PlaceString - coord hl, 7, 2 + hlcoord 7, 2 ld de, wPlayerName call PlaceString - coord hl, 8, 4 + hlcoord 8, 4 ld de, wPlayerMoney ld c, $e3 call PrintBCDNumber - coord hl, 9, 6 + hlcoord 9, 6 ld de, wPlayTimeHours ; hours lb bc, LEFT_ALIGN | 1, 3 call PrintNumber @@ -648,10 +648,10 @@ StartMenu_SaveReset:: StartMenu_Option:: xor a - ld [hAutoBGTransferEnabled], a + ldh [hAutoBGTransferEnabled], a call ClearScreen call UpdateSprites - callab DisplayOptionMenu + callfar DisplayOptionMenu call LoadScreenTilesFromBuffer2 ; restore saved screen call LoadTextBoxTilePatterns call UpdateSprites @@ -667,7 +667,7 @@ SwitchPartyMon:: SwitchPartyMon_ClearGfx: push af - coord hl, 0, 0 + hlcoord 0, 0 ld bc, SCREEN_WIDTH * 2 call AddNTimes ld c, SCREEN_WIDTH * 2 @@ -737,10 +737,10 @@ SwitchPartyMon_InitVarOrSwapData: inc d .noCarry2 ld a, [hl] - ld [hSwapTemp], a + ldh [hSwapTemp], a ld a, [de] ld [hl], a - ld a, [hSwapTemp] + ldh a, [hSwapTemp] ld [de], a ld hl, wPartyMons ld bc, wPartyMon2 - wPartyMon1 diff --git a/engine/menus/swap_items.asm b/engine/menus/swap_items.asm index 8b793ea1..2d506ce2 100644 --- a/engine/menus/swap_items.asm +++ b/engine/menus/swap_items.asm @@ -77,18 +77,18 @@ HandleItemListSwapping:: cp b jr z, .swapSameItemType .swapDifferentItems - ld [hSwapItemID], a ; save second item ID + ldh [hSwapItemID], a ; save second item ID ld a, [hld] - ld [hSwapItemQuantity], a ; save second item quantity + ldh [hSwapItemQuantity], a ; save second item quantity ld a, [de] ld [hli], a ; put first item ID in second item slot inc de ld a, [de] ld [hl], a ; put first item quantity in second item slot - ld a, [hSwapItemQuantity] + ldh a, [hSwapItemQuantity] ld [de], a ; put second item quantity in first item slot dec de - ld a, [hSwapItemID] + ldh a, [hSwapItemID] ld [de], a ; put second item ID in first item slot xor a ld [wMenuItemToSwap], a ; 0 means no item is currently being swapped diff --git a/engine/menus/text_box.asm b/engine/menus/text_box.asm index e3de41b4..2e69c5a4 100644 --- a/engine/menus/text_box.asm +++ b/engine/menus/text_box.asm @@ -111,7 +111,7 @@ GetTextBoxIDText: ; hl = address of upper left corner of text box GetAddressOfScreenCoords: push bc - coord hl, 0, 0 + hlcoord 0, 0 ld bc, 20 .loop ; loop to add d rows to the base address ld a, d @@ -274,11 +274,11 @@ DisplayMoneyBox: ld a, MONEY_BOX_TEMPLATE ld [wTextBoxID], a call DisplayTextBoxID - coord hl, 13, 1 + hlcoord 13, 1 ld b, 1 ld c, 6 call ClearScreenArea - coord hl, 12, 1 + hlcoord 12, 1 ld de, wPlayerMoney ld c, $a3 call PrintBCDNumber @@ -578,14 +578,14 @@ DisplayFieldMoveMonMenu: jr nz, .fieldMovesExist ; no field moves - coord hl, 11, 11 + hlcoord 11, 11 ld b, 5 ld c, 7 call TextBoxBorder call UpdateSprites ld a, 12 - ld [hFieldMoveMonMenuTopMenuItemX], a - coord hl, 13, 12 + ldh [hFieldMoveMonMenuTopMenuItemX], a + hlcoord 13, 12 ld de, PokemonMenuEntries jp PlaceString @@ -594,7 +594,7 @@ DisplayFieldMoveMonMenu: ; Calculate the text box position and dimensions based on the leftmost X coord ; of the field move names before adjusting for the number of field moves. - coord hl, 0, 11 + hlcoord 0, 11 ld a, [wFieldMovesLeftmostXCoord] dec a ld e, a @@ -625,7 +625,7 @@ DisplayFieldMoveMonMenu: call UpdateSprites ; Calculate the position of the first field move name to print. - coord hl, 0, 12 + hlcoord 0, 12 ld a, [wFieldMovesLeftmostXCoord] inc a ld e, a @@ -673,8 +673,8 @@ DisplayFieldMoveMonMenu: .donePrintingNames pop hl ld a, [wFieldMovesLeftmostXCoord] - ld [hFieldMoveMonMenuTopMenuItemX], a - coord hl, 0, 12 + ldh [hFieldMoveMonMenuTopMenuItemX], a + hlcoord 0, 12 ld a, [wFieldMovesLeftmostXCoord] inc a ld e, a |