diff options
| author | edave64 <edave64@users.noreply.github.com> | 2025-04-02 16:49:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-02 10:49:15 -0400 |
| commit | e1b7b8af0a431f4624fc668a58b535a8be438d72 (patch) | |
| tree | abc59fa45c0a302d7ad45e161f7bb7061533c6aa /engine/items | |
| parent | Remove GSC-only Stadium data handling from make_patch.c (diff) | |
| download | pokeyellow-e1b7b8af0a431f4624fc668a58b535a8be438d72.tar.gz pokeyellow-e1b7b8af0a431f4624fc668a58b535a8be438d72.tar.xz pokeyellow-e1b7b8af0a431f4624fc668a58b535a8be438d72.zip | |
Use constants for PP masks instead of magic numbers (#504)
Diffstat (limited to 'engine/items')
| -rw-r--r-- | engine/items/item_effects.asm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 162e79a7..98f1b066 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -2058,7 +2058,7 @@ ItemUsePPRestore: cp MAX_ETHER jr z, .fullyRestorePP ld a, [hl] ; move PP - and %00111111 ; lower 6 bit bits store current PP + and PP_MASK cp b ; does current PP equal max PP? ret z ; if so, return add 10 ; increase current PP by 10 @@ -2071,7 +2071,7 @@ ItemUsePPRestore: ld b, a .storeNewAmount ld a, [hl] ; move PP - and %11000000 ; PP Up counter bits + and PP_UP_MASK add b ld [hl], a ret @@ -2403,7 +2403,7 @@ RestoreBonusPP: jr nz, .nextMove .skipMenuItemIDCheck ld a, [hl] - and %11000000 ; have any PP Ups been used? + and PP_UP_MASK call nz, AddBonusPP ; if so, add bonus PP .nextMove inc hl @@ -2509,7 +2509,7 @@ GetMaxPP: .addPPOffset add hl, bc ld a, [hl] ; a = current PP - and %11000000 ; get PP Up count + and PP_UP_MASK pop bc or b ; place normal max PP in 6 lower bits of a ASSERT wMoveData + MOVE_PP + 1 == wPPUpCountAndMaxPP @@ -2521,7 +2521,7 @@ GetMaxPP: ld [wUsingPPUp], a call AddBonusPP ; add bonus PP from PP Ups ld a, [hl] - and %00111111 ; mask out the PP Up count + and PP_MASK ld [wMaxPP], a ; store max PP ret |
