Skip to content

Commit

Permalink
Consistently capitalize ASSERT directives (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 authored Jan 29, 2025
1 parent afb8990 commit ec37f61
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion data/moves/moves.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MACRO move
db \4 ; type
db \5 percent ; accuracy
db \6 ; pp
assert \6 <= 40, "PP must be 40 or less"
ASSERT \6 <= 40, "PP must be 40 or less"
ENDM

Moves:
Expand Down
4 changes: 2 additions & 2 deletions engine/battle/core.asm
Original file line number Diff line number Diff line change
Expand Up @@ -5157,7 +5157,7 @@ MetronomePickMove:
and a
jr z, .pickMoveLoop
cp STRUGGLE
assert NUM_ATTACKS == STRUGGLE ; random numbers greater than STRUGGLE are not moves
ASSERT NUM_ATTACKS == STRUGGLE ; random numbers greater than STRUGGLE are not moves
jr nc, .pickMoveLoop
cp METRONOME
jr z, .pickMoveLoop
Expand Down Expand Up @@ -6755,7 +6755,7 @@ HandleExplodingAnimation:
ret nz
ld a, ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT
ld [wAnimationType], a
assert ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT == MEGA_PUNCH
ASSERT ANIMATIONTYPE_SHAKE_SCREEN_HORIZONTALLY_LIGHT == MEGA_PUNCH
; ld a, MEGA_PUNCH
; fallthrough
PlayMoveAnimation:
Expand Down
4 changes: 2 additions & 2 deletions engine/battle/effects.asm
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ FreezeBurnParalyzeEffect:
jr c, .regular_effectiveness
; extra effectiveness
ld b, 30 percent + 1
assert PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1
assert PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == FREEZE_SIDE_EFFECT2 - FREEZE_SIDE_EFFECT1
ASSERT PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1
ASSERT PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == FREEZE_SIDE_EFFECT2 - FREEZE_SIDE_EFFECT1
sub PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 ; treat extra effective as regular from now on
.regular_effectiveness
push af
Expand Down
2 changes: 1 addition & 1 deletion engine/events/poison.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ApplyOutOfBattlePoisonDamage:
ld a, [wStatusFlags5]
assert BIT_SCRIPTED_MOVEMENT_STATE == 7
ASSERT BIT_SCRIPTED_MOVEMENT_STATE == 7
add a ; overflows scripted movement state bit into carry flag
jp c, .noBlackOut ; no black out if joypad states are being simulated
ld a, [wPartyCount]
Expand Down
2 changes: 1 addition & 1 deletion engine/items/item_effects.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2512,7 +2512,7 @@ GetMaxPP:
and %11000000 ; get PP Up count
pop bc
or b ; place normal max PP in 6 lower bits of a
assert wMoveData + MOVE_PP + 1 == wPPUpCountAndMaxPP
ASSERT wMoveData + MOVE_PP + 1 == wPPUpCountAndMaxPP
ld h, d
ld l, e
inc hl ; hl = wPPUpCountAndMaxPP
Expand Down
2 changes: 1 addition & 1 deletion engine/items/town_map.asm
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ LoadTownMap_Fly::
ld [wDestinationMap], a
ld hl, wStatusFlags6
set BIT_FLY_WARP, [hl]
assert wStatusFlags6 + 1 == wStatusFlags7
ASSERT wStatusFlags6 + 1 == wStatusFlags7
inc hl
set BIT_USED_FLY, [hl]
.pressedB
Expand Down
14 changes: 7 additions & 7 deletions engine/menus/main_menu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -155,21 +155,21 @@ LinkMenu:
ld hl, wTopMenuItemY
ld a, 7
ld [hli], a
assert wTopMenuItemY + 1 == wTopMenuItemX
ASSERT wTopMenuItemY + 1 == wTopMenuItemX
ld a, 6
ld [hli], a
assert wTopMenuItemX + 1 == wCurrentMenuItem
ASSERT wTopMenuItemX + 1 == wCurrentMenuItem
xor a
ld [hli], a
inc hl
assert wCurrentMenuItem + 2 == wMaxMenuItem
ASSERT wCurrentMenuItem + 2 == wMaxMenuItem
ld a, 2
ld [hli], a
assert wMaxMenuItem + 1 == wMenuWatchedKeys
assert 2 + 1 == A_BUTTON | B_BUTTON
ASSERT wMaxMenuItem + 1 == wMenuWatchedKeys
ASSERT 2 + 1 == A_BUTTON | B_BUTTON
inc a
ld [hli], a
assert wMenuWatchedKeys + 1 == wLastMenuItem
ASSERT wMenuWatchedKeys + 1 == wLastMenuItem
xor a
ld [hl], a
.waitForInputLoop
Expand Down Expand Up @@ -468,7 +468,7 @@ DisplayOptionMenu:
xor a
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
assert BIT_FAST_TEXT_DELAY == 0
ASSERT BIT_FAST_TEXT_DELAY == 0
inc a ; 1 << BIT_FAST_TEXT_DELAY
ld [wLetterPrintingDelayFlags], a
ld [wOptionsCancelCursorX], a
Expand Down
2 changes: 1 addition & 1 deletion engine/movie/oak_speech/init_player_data.asm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ DEF START_MONEY EQU $3000

ld hl, wObtainedBadges
ld [hli], a
assert wObtainedBadges + 1 == wUnusedObtainedBadges
ASSERT wObtainedBadges + 1 == wUnusedObtainedBadges
ld [hl], a

ld hl, wPlayerCoins
Expand Down
4 changes: 2 additions & 2 deletions engine/movie/title.asm
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ PrepareTitleScreen::
ld [wLetterPrintingDelayFlags], a
ld hl, wStatusFlags6
ld [hli], a
assert wStatusFlags6 + 1 == wStatusFlags7
ASSERT wStatusFlags6 + 1 == wStatusFlags7
ld [hli], a
assert wStatusFlags7 + 1 == wElite4Flags
ASSERT wStatusFlags7 + 1 == wElite4Flags
ld [hl], a
ld a, BANK(Music_TitleScreen)
ld [wAudioROMBank], a
Expand Down
2 changes: 1 addition & 1 deletion engine/overworld/player_state.asm
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ CheckForBoulderCollisionWithSprites:
ld a, [hli]
ld b, a
ldh a, [hPlayerFacing]
assert BIT_FACING_DOWN == 0
ASSERT BIT_FACING_DOWN == 0
rrca
jr c, .pushingDown
; pushing up
Expand Down
2 changes: 1 addition & 1 deletion engine/pokemon/evos_moves.asm
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Evolution_PartyMonLoop: ; loop over party mons
RenameEvolvedMon:
; Renames the mon to its new, evolved form's standard name unless it had a
; nickname, in which case the nickname is kept.
assert wCurSpecies == wNameListIndex ; save+restore wCurSpecies while using wNameListIndex
ASSERT wCurSpecies == wNameListIndex ; save+restore wCurSpecies while using wNameListIndex
ld a, [wCurSpecies]
push af
ld a, [wMonHIndex]
Expand Down
2 changes: 1 addition & 1 deletion engine/slots/slot_machine.asm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PromptUserToPlaySlots:
call SaveScreenTilesToBuffer2
ld a, BANK(DisplayTextIDInit)
assert BANK(DisplayTextIDInit) == 1 << BIT_NO_AUTO_TEXT_BOX
ASSERT BANK(DisplayTextIDInit) == 1 << BIT_NO_AUTO_TEXT_BOX
ld [wAutoTextBoxDrawingControl], a ; 1 << BIT_NO_AUTO_TEXT_BOX
ld b, a ; BANK(DisplayTextIDInit)
ld hl, DisplayTextIDInit
Expand Down
4 changes: 2 additions & 2 deletions home/list_menu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ DisplayListMenuIDLoop::
and a ; PCPOKEMONLISTMENU?
jr z, .pokemonList
; if it's an item menu
assert wCurListMenuItem == wCurItem
ASSERT wCurListMenuItem == wCurItem
push hl
call GetItemPrice
pop hl
Expand All @@ -147,7 +147,7 @@ DisplayListMenuIDLoop::
call GetName
jr .storeChosenEntry
.pokemonList
assert wCurListMenuItem == wCurPartySpecies
ASSERT wCurListMenuItem == wCurPartySpecies
ld hl, wPartyCount
ld a, [wListPointer]
cp l ; is it a list of party pokemon or box pokemon?
Expand Down
2 changes: 1 addition & 1 deletion home/text_script.asm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; this function is used to display sign messages, sprite dialog, etc.
; INPUT: [hSpriteIndex] = sprite ID or [hTextID] = text ID
DisplayTextID::
assert hSpriteIndex == hTextID ; these are at the same memory location
ASSERT hSpriteIndex == hTextID ; these are at the same memory location
ldh a, [hLoadedROMBank]
push af
farcall DisplayTextIDInit ; initialization
Expand Down
2 changes: 1 addition & 1 deletion scripts/HallOfFame.asm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ HallOfFameResetEventsAndSaveScript:
ld [wLetterPrintingDelayFlags], a
ld hl, wStatusFlags7
res BIT_NO_MAP_MUSIC, [hl]
assert wStatusFlags7 + 1 == wElite4Flags
ASSERT wStatusFlags7 + 1 == wElite4Flags
inc hl
set BIT_UNUSED_BEAT_ELITE_4, [hl] ; unused
xor a ; SCRIPT_*_DEFAULT
Expand Down

0 comments on commit ec37f61

Please sign in to comment.