diff --git a/constants/gfx_constants.asm b/constants/gfx_constants.asm index 16f3b9855..ff470ff40 100644 --- a/constants/gfx_constants.asm +++ b/constants/gfx_constants.asm @@ -39,6 +39,7 @@ DEF REDRAW_ROW EQU 2 const BIT_PARTY_MENU_HP_BAR ; 0 const BIT_DOUBLE_SPACED_MENU ; 1 const BIT_SINGLE_SPACED_LINES ; 2 + const BIT_PAGE_CHAR_IS_NEXT ; 3 ; tile list ids ; TileIDListPointerTable indexes (see data/tilemaps.asm) diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 926910fcc..919de01cf 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -2820,7 +2820,10 @@ SelectMenuItem_CursorDown: jp SelectMenuItem Func_3d4f5: - bit 3, a +IF DEF(_DEBUG) + ASSERT BIT_START == BIT_TRAINER_BATTLE +ENDC + bit BIT_TRAINER_BATTLE, a ld a, $0 jr nz, .asm_3d4fd ld a, $1 diff --git a/engine/debug/debug_menu.asm b/engine/debug/debug_menu.asm index ae4a328b2..b2efb940c 100644 --- a/engine/debug/debug_menu.asm +++ b/engine/debug/debug_menu.asm @@ -1558,7 +1558,7 @@ Func_ff295: call Func_ff2f3 pop de ld a, d - set 7, a + set BIT_HAS_CHANGED_BOXES, a ld [wCurrentBoxNum], a push de call Func_ff2d1 @@ -1566,7 +1566,7 @@ Func_ff295: call Func_ff2f3 ld a, [wLetterPrintingDelayFlags] push af - ld a, 1 + ld a, 1 << BIT_FAST_TEXT_DELAY ld [wLetterPrintingDelayFlags], a callfar SaveSAVtoSRAM pop af diff --git a/engine/gfx/animated_objects.asm b/engine/gfx/animated_objects.asm index 208a2f859..0a71f59d5 100644 --- a/engine/gfx/animated_objects.asm +++ b/engine/gfx/animated_objects.asm @@ -227,7 +227,7 @@ GetCurrentAnimatedObjectTileYCoordinate: push hl ld a, [hl] ld hl, wCurAnimatedObjectOAMAttributes - bit 6, [hl] + bit OAM_Y_FLIP, [hl] jr z, .no_flip add $8 xor $ff @@ -240,7 +240,7 @@ GetCurrentAnimatedObjectTileXCoordinate: push hl ld a, [hl] ld hl, wCurAnimatedObjectOAMAttributes - bit 5, [hl] + bit OAM_X_FLIP, [hl] jr z, .no_flip add $8 xor $ff @@ -254,14 +254,14 @@ SetCurrentAnimatedObjectOAMAttributes: ld b, a ld a, [hl] xor b - and $e0 + and OAM_HFLIP | OAM_VFLIP | OAM_BEHIND_BG ld b, a ld a, [hl] - and $10 + and OAM_OBP1 or b - bit 4, a + bit OAM_OBP_NUM, a ret z - or $4 + or OAM_HIGH_PALS ret GetCurrentAnimatedObjectOAMDataPointer: diff --git a/engine/menus/pokedex.asm b/engine/menus/pokedex.asm index f4637cd06..88a057dfd 100644 --- a/engine/menus/pokedex.asm +++ b/engine/menus/pokedex.asm @@ -683,11 +683,11 @@ Pokedex_PrepareDexEntryForPrinting: ld h, a bccoord 1, 1 ldh a, [hUILayoutFlags] - set 3, a + set BIT_PAGE_CHAR_IS_NEXT, a ldh [hUILayoutFlags], a call Pokedex_PrintFlavorTextAtBC ldh a, [hUILayoutFlags] - res 3, a + res BIT_PAGE_CHAR_IS_NEXT, a ldh [hUILayoutFlags], a ret diff --git a/home/overworld.asm b/home/overworld.asm index f9aaa089b..2b32eb165 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -1233,7 +1233,7 @@ CollisionCheckOnLand:: ldh [hTextID], a call IsSpriteInFrontOfPlayer ; check for sprite collisions again? when does the above check fail to detect a sprite collision? jr nc, .asm_0a5c - res 7, [hl] + res BIT_FACE_PLAYER, [hl] ldh a, [hTextID] and a ; was there a sprite collision? jr z, .asm_0a5c diff --git a/home/text.asm b/home/text.asm index d6baf35c8..9bc7f3cff 100644 --- a/home/text.asm +++ b/home/text.asm @@ -244,7 +244,7 @@ Paragraph:: PageChar:: ldh a, [hUILayoutFlags] - bit 3, a + bit BIT_PAGE_CHAR_IS_NEXT, a jr z, .pageChar ld a, "" jp PlaceNextChar.NotTerminator diff --git a/scripts/VermilionCity_2.asm b/scripts/VermilionCity_2.asm index 8b0126599..c6cd94785 100644 --- a/scripts/VermilionCity_2.asm +++ b/scripts/VermilionCity_2.asm @@ -2,7 +2,7 @@ VermilionCityPrintOfficerJennyText:: CheckEvent EVENT_GOT_SQUIRTLE_FROM_OFFICER_JENNY jr nz, .asm_f1a69 ld a, [wBeatGymFlags] - bit 2, a ; THUNDERBADGE + bit BIT_THUNDERBADGE, a jr nz, .asm_f1a24 ld hl, OfficerJennyText1 call PrintText