diff options
| author | dannye <33dannye@gmail.com> | 2024-09-25 00:45:00 -0500 |
|---|---|---|
| committer | dannye <33dannye@gmail.com> | 2024-09-25 00:45:00 -0500 |
| commit | a02a98ee7ada1a658e28698484058be2796dc0df (patch) | |
| tree | 945986054565bd8b5212fc755415096050d1d3a8 /home/list_menu.asm | |
| parent | Use long option flags for rgbgfx, same as tools/gfx (diff) | |
| parent | Use `const_skip` (diff) | |
| download | pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.tar.gz pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.tar.xz pokeyellow-a02a98ee7ada1a658e28698484058be2796dc0df.zip | |
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'home/list_menu.asm')
| -rw-r--r-- | home/list_menu.asm | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/home/list_menu.asm b/home/list_menu.asm index 13bcec59..095cae27 100644 --- a/home/list_menu.asm +++ b/home/list_menu.asm @@ -15,8 +15,8 @@ DisplayListMenuID:: ld a, BANK(DisplayBattleMenu) .bankswitch call BankswitchHome - ld hl, wd730 - set 6, [hl] ; turn off letter printing delay + ld hl, wStatusFlags5 + set BIT_NO_TEXT_DELAY, [hl] xor a ld [wMenuItemToSwap], a ; 0 means no item is currently being swapped ld [wListCount], a @@ -124,28 +124,30 @@ DisplayListMenuIDLoop:: ld b, 0 add hl, bc ld a, [hl] - ld [wcf91], a + ld [wCurListMenuItem], a ld a, [wListMenuID] and a ; PCPOKEMONLISTMENU? jr z, .pokemonList +; if it's an item menu + assert wCurListMenuItem == wCurItem push hl call GetItemPrice pop hl ld a, [wListMenuID] cp ITEMLISTMENU jr nz, .skipGettingQuantity -; if it's an item menu inc hl ld a, [hl] ; a = item quantity ld [wMaxItemQuantity], a .skipGettingQuantity - ld a, [wcf91] - ld [wd0b5], a + ld a, [wCurItem] + ld [wNameListIndex], a ld a, BANK(ItemNames) ld [wPredefBank], a call GetName jr .storeChosenEntry .pokemonList + assert wCurListMenuItem == wCurPartySpecies ld hl, wPartyCount ld a, [wListPointer] cp l ; is it a list of party pokemon or box pokemon? @@ -156,7 +158,7 @@ DisplayListMenuIDLoop:: ld a, [wWhichPokemon] call GetPartyMonName .storeChosenEntry ; store the menu entry that the player chose and return - ld de, wcd6d + ld de, wNameBuffer call CopyToStringBuffer ld a, CHOSE_MENU_ITEM ld [wMenuExitMethod], a @@ -164,8 +166,8 @@ DisplayListMenuIDLoop:: ld [wChosenMenuItem], a xor a ldh [hJoy7], a ; joypad state update flag - ld hl, wd730 - res 6, [hl] ; turn on letter printing delay + ld hl, wStatusFlags5 + res BIT_NO_TEXT_DELAY, [hl] jp BankswitchBack .checkOtherKeys ; check B, SELECT, Up, and Down keys bit BIT_B_BUTTON, a @@ -323,8 +325,8 @@ ExitListMenu:: ld [wMenuWatchMovingOutOfBounds], a xor a ldh [hJoy7], a - ld hl, wd730 - res 6, [hl] + ld hl, wStatusFlags5 + res BIT_NO_TEXT_DELAY, [hl] call BankswitchBack xor a ld [wMenuItemToSwap], a ; 0 means no item is currently being swapped @@ -362,7 +364,7 @@ PrintListMenuEntries:: ld a, b ld [wWhichPokemon], a ld a, [de] - ld [wd11e], a + ld [wNamedObjectIndex], a cp $ff jp z, .printCancelMenuItem push bc @@ -410,8 +412,8 @@ PrintListMenuEntries:: push hl ld a, [de] ld de, ItemPrices - ld [wcf91], a - call GetItemPrice ; get price + ld [wCurItem], a + call GetItemPrice pop hl ld bc, SCREEN_WIDTH + 5 ; 1 row down and 5 columns right add hl, bc @@ -422,7 +424,7 @@ PrintListMenuEntries:: and a ; PCPOKEMONLISTMENU? jr nz, .skipPrintingPokemonLevel .printPokemonLevel - ld a, [wd11e] + ld a, [wNamedObjectIndex] push af push hl ld hl, wPartyCount @@ -455,7 +457,7 @@ PrintListMenuEntries:: add hl, bc call PrintLevel pop af - ld [wd11e], a + ld [wNamedObjectIndex], a .skipPrintingPokemonLevel pop hl pop de @@ -464,8 +466,8 @@ PrintListMenuEntries:: cp ITEMLISTMENU jr nz, .nextListEntry .printItemQuantity - ld a, [wd11e] - ld [wcf91], a + ld a, [wNamedObjectIndex] + ld [wCurItem], a call IsKeyItem ; check if item is unsellable ld a, [wIsKeyItem] and a ; is the item unsellable? @@ -475,18 +477,18 @@ PrintListMenuEntries:: add hl, bc ld a, "×" ld [hli], a - ld a, [wd11e] + ld a, [wNamedObjectIndex] push af ld a, [de] ld [wMaxItemQuantity], a push de - ld de, wd11e + ld de, wTempByteValue ld [de], a lb bc, 1, 2 call PrintNumber pop de pop af - ld [wd11e], a + ld [wNamedObjectIndex], a pop hl .skipPrintingItemQuantity inc de |
