diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 77ed507fb9c..55fde7d3a2f 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -624,7 +624,8 @@ ParsePlayerAction: jr nz, .locked_in xor a ld [wMoveSelectionMenuType], a - inc a ; POUND + assert POUND == 1 + inc a ld [wFXAnimID], a call MoveSelectionScreen push af @@ -3826,7 +3827,8 @@ TryToRunAwayFromBattle: cp BATTLEACTION_FORFEIT ld a, DRAW jr z, .fled - dec a ; LOSE + assert DRAW - 1 == LOSE + dec a .fled ld b, a ld a, [wBattleResult] diff --git a/engine/battle_anims/functions.asm b/engine/battle_anims/functions.asm index 3cbca9ae60e..9b157ed95a2 100644 --- a/engine/battle_anims/functions.asm +++ b/engine/battle_anims/functions.asm @@ -1244,7 +1244,9 @@ BattleAnimFunc_Sing: ld hl, BATTLEANIMSTRUCT_PARAM add hl, bc ld a, BATTLE_ANIM_FRAMESET_MUSIC_NOTE_1 - add [hl] ; BATTLE_ANIM_FRAMESET_MUSIC_NOTE_2 BATTLE_ANIM_FRAMESET_MUSIC_NOTE_3 + assert BATTLE_ANIM_FRAMESET_MUSIC_NOTE_1 + 1 == BATTLE_ANIM_FRAMESET_MUSIC_NOTE_2 \ + && BATTLE_ANIM_FRAMESET_MUSIC_NOTE_2 + 1 == BATTLE_ANIM_FRAMESET_MUSIC_NOTE_3 + add [hl] call ReinitBattleAnimFrameset .one @@ -1510,15 +1512,15 @@ BattleAnimFunc_Clamp_Encore: ld hl, BATTLEANIMSTRUCT_VAR2 add hl, bc ld a, [hl] - inc a ; BATTLE_ANIM_FRAMESET_3B (Clamp Flipped) - ; BATTLE_ANIM_FRAMESET_A1 (Hands Flipped) + assert BATTLE_ANIM_FRAMESET_CLAMP + 1 == BATTLE_ANIM_FRAMESET_CLAMP_FLIPPED + assert BATTLE_ANIM_FRAMESET_ENCORE_HAND + 1 == BATTLE_ANIM_FRAMESET_ENCORE_HAND_FLIPPED + inc a jr .reinit .load_no_inc ld hl, BATTLEANIMSTRUCT_VAR2 add hl, bc - ld a, [hl] ; BATTLE_ANIM_FRAMESET_3A (Clamp) - ; BATTLE_ANIM_FRAMESET_A0 (Hands) + ld a, [hl] ; BATTLE_ANIM_FRAMESET_CLAMP or BATTLE_ANIM_FRAMESET_ENCORE_HAND .reinit call ReinitBattleAnimFrameset ld hl, BATTLEANIMSTRUCT_VAR1 @@ -1844,8 +1846,10 @@ BattleAnimFunc_Wrap: ld hl, BATTLEANIMSTRUCT_FRAMESET_ID add hl, bc ld a, [hl] - inc a ; BATTLE_ANIM_FRAMESET_BIND_2 - ; BATTLE_ANIM_FRAMESET_BIND_4 + assert BATTLE_ANIM_FRAMESET_BIND_1 + 1 == BATTLE_ANIM_FRAMESET_BIND_2 \ + && BATTLE_ANIM_FRAMESET_BIND_2 + 1 == BATTLE_ANIM_FRAMESET_BIND_3 \ + && BATTLE_ANIM_FRAMESET_BIND_3 + 1 == BATTLE_ANIM_FRAMESET_BIND_4 + inc a call ReinitBattleAnimFrameset call BattleAnim_IncAnonJumptableIndex ld hl, BATTLEANIMSTRUCT_VAR1 ; Unused? @@ -2344,7 +2348,9 @@ BattleAnimFunc_Sound: ld hl, BATTLEANIMSTRUCT_PARAM add hl, bc ld a, BATTLE_ANIM_FRAMESET_SOUND_1 - add [hl] ; BATTLE_ANIM_FRAMESET_SOUND_2 BATTLE_ANIM_FRAMESET_SOUND_3 + assert BATTLE_ANIM_FRAMESET_SOUND_1 + 1 == BATTLE_ANIM_FRAMESET_SOUND_2 \ + && BATTLE_ANIM_FRAMESET_SOUND_2 + 1 == BATTLE_ANIM_FRAMESET_SOUND_3 + add [hl] call ReinitBattleAnimFrameset ret @@ -2420,7 +2426,8 @@ BattleAnimFunc_ConfuseRay: and $80 rlca ld [hl], a - add BATTLE_ANIM_FRAMESET_CONFUSE_RAY_1 ; BATTLE_ANIM_FRAMESET_CONFUSE_RAY_2 + assert BATTLE_ANIM_FRAMESET_CONFUSE_RAY_1 + 1 == BATTLE_ANIM_FRAMESET_CONFUSE_RAY_2 + add BATTLE_ANIM_FRAMESET_CONFUSE_RAY_1 call ReinitBattleAnimFrameset ret @@ -2490,8 +2497,9 @@ BattleAnimFunc_Dizzy: rlca ld hl, BATTLEANIMSTRUCT_VAR1 add hl, bc - add [hl] ; BATTLE_ANIM_FRAMESET_61 BATTLE_ANIM_FRAMESET_62 - ; BATTLE_ANIM_FRAMESET_9C BATTLE_ANIM_FRAMESET_9D + assert BATTLE_ANIM_FRAMESET_CHICK_1 + 1 == BATTLE_ANIM_FRAMESET_CHICK_2 + assert BATTLE_ANIM_FRAMESET_IMP + 1 == BATTLE_ANIM_FRAMESET_IMP_FLIPPED + add [hl] call ReinitBattleAnimFrameset ld hl, BATTLEANIMSTRUCT_PARAM add hl, bc @@ -2528,15 +2536,15 @@ BattleAnimFunc_Dizzy: ld hl, BATTLEANIMSTRUCT_VAR1 add hl, bc ld a, [hl] - inc a ; BATTLE_ANIM_FRAMESET_62 - ; BATTLE_ANIM_FRAMESET_9D + assert BATTLE_ANIM_FRAMESET_CHICK_1 + 1 == BATTLE_ANIM_FRAMESET_CHICK_2 + assert BATTLE_ANIM_FRAMESET_IMP + 1 == BATTLE_ANIM_FRAMESET_IMP_FLIPPED + inc a jr .got_frameset .not_flipped ld hl, BATTLEANIMSTRUCT_VAR1 add hl, bc - ld a, [hl] ; BATTLE_ANIM_FRAMESET_61 - ; BATTLE_ANIM_FRAMESET_9C + ld a, [hl] ; BATTLE_ANIM_FRAMESET_CHICK_1 or BATTLE_ANIM_FRAMESET_IMP .got_frameset call ReinitBattleAnimFrameset ret @@ -2556,7 +2564,9 @@ BattleAnimFunc_Amnesia: ld hl, BATTLEANIMSTRUCT_PARAM add hl, bc ld a, [hl] - add BATTLE_ANIM_FRAMESET_AMNESIA_1 ; BATTLE_ANIM_FRAMESET_AMNESIA_2 BATTLE_ANIM_FRAMESET_AMNESIA_3 + assert BATTLE_ANIM_FRAMESET_AMNESIA_1 + 1 == BATTLE_ANIM_FRAMESET_AMNESIA_2 \ + && BATTLE_ANIM_FRAMESET_AMNESIA_2 + 1 == BATTLE_ANIM_FRAMESET_AMNESIA_3 + add BATTLE_ANIM_FRAMESET_AMNESIA_1 call ReinitBattleAnimFrameset ld hl, BATTLEANIMSTRUCT_PARAM add hl, bc @@ -2644,7 +2654,9 @@ BattleAnimFunc_String: add hl, bc set OAM_Y_FLIP, [hl] .not_param_zero - add BATTLE_ANIM_FRAMESET_STRING_SHOT_1 ; BATTLE_ANIM_FRAMESET_STRING_SHOT_2 BATTLE_ANIM_FRAMESET_STRING_SHOT_3 + assert BATTLE_ANIM_FRAMESET_STRING_SHOT_1 + 1 == BATTLE_ANIM_FRAMESET_STRING_SHOT_2 \ + && BATTLE_ANIM_FRAMESET_STRING_SHOT_2 + 1 == BATTLE_ANIM_FRAMESET_STRING_SHOT_3 + add BATTLE_ANIM_FRAMESET_STRING_SHOT_1 call ReinitBattleAnimFrameset .one ret @@ -3541,7 +3553,9 @@ BattleAnimFunc_SpeedLine: add hl, bc ld a, [hl] and $7f - add BATTLE_ANIM_FRAMESET_SPEED_LINE_1 ; BATTLE_ANIM_FRAMESET_SPEED_LINE_2 BATTLE_ANIM_FRAMESET_SPEED_LINE_3 + assert BATTLE_ANIM_FRAMESET_SPEED_LINE_1 + 1 == BATTLE_ANIM_FRAMESET_SPEED_LINE_2 \ + && BATTLE_ANIM_FRAMESET_SPEED_LINE_2 + 1 == BATTLE_ANIM_FRAMESET_SPEED_LINE_3 + add BATTLE_ANIM_FRAMESET_SPEED_LINE_1 call ReinitBattleAnimFrameset .one ld hl, BATTLEANIMSTRUCT_PARAM @@ -3713,8 +3727,13 @@ BattleAnimFunc_LockOnMindReader: and $f ld hl, BATTLEANIMSTRUCT_FRAMESET_ID add hl, bc - add [hl] ; BATTLE_ANIM_FRAMESET_8F BATTLE_ANIM_FRAMESET_90 BATTLE_ANIM_FRAMESET_91 - ; BATTLE_ANIM_FRAMESET_93 BATTLE_ANIM_FRAMESET_94 BATTLE_ANIM_FRAMESET_95 + assert BATTLE_ANIM_FRAMESET_LOCK_ON_1 + 1 == BATTLE_ANIM_FRAMESET_LOCK_ON_2 \ + && BATTLE_ANIM_FRAMESET_LOCK_ON_2 + 1 == BATTLE_ANIM_FRAMESET_LOCK_ON_3 \ + && BATTLE_ANIM_FRAMESET_LOCK_ON_3 + 1 == BATTLE_ANIM_FRAMESET_LOCK_ON_4 + assert BATTLE_ANIM_FRAMESET_MIND_READER_1 + 1 == BATTLE_ANIM_FRAMESET_MIND_READER_2 \ + && BATTLE_ANIM_FRAMESET_MIND_READER_2 + 1 == BATTLE_ANIM_FRAMESET_MIND_READER_3 \ + && BATTLE_ANIM_FRAMESET_MIND_READER_3 + 1 == BATTLE_ANIM_FRAMESET_MIND_READER_4 + add [hl] call ReinitBattleAnimFrameset ld hl, BATTLEANIMSTRUCT_PARAM add hl, bc @@ -3774,7 +3793,9 @@ BattleAnimFunc_HealBellNotes: ld hl, BATTLEANIMSTRUCT_PARAM add hl, bc ld a, BATTLE_ANIM_FRAMESET_MUSIC_NOTE_1 - add [hl] ; BATTLE_ANIM_FRAMESET_MUSIC_NOTE_2 BATTLE_ANIM_FRAMESET_MUSIC_NOTE_3 + assert BATTLE_ANIM_FRAMESET_MUSIC_NOTE_1 + 1 == BATTLE_ANIM_FRAMESET_MUSIC_NOTE_2 \ + && BATTLE_ANIM_FRAMESET_MUSIC_NOTE_2 + 1 == BATTLE_ANIM_FRAMESET_MUSIC_NOTE_3 + add [hl] call ReinitBattleAnimFrameset .one ld hl, BATTLEANIMSTRUCT_YOFFSET diff --git a/engine/items/pack.asm b/engine/items/pack.asm index 2a16868e90d..afa59839eef 100644 --- a/engine/items/pack.asm +++ b/engine/items/pack.asm @@ -501,11 +501,14 @@ TossMenu: ResetPocketCursorPositions: ; unreferenced ld a, [wCurPocket] - and a ; ITEM_POCKET + assert ITEM_POCKET == 0 + and a jr z, .items - dec a ; BALL_POCKET + assert BALL_POCKET == 1 + dec a jr z, .balls - dec a ; KEY_ITEM_POCKET + assert KEY_ITEM_POCKET == 2 + dec a jr z, .key ret diff --git a/engine/link/link.asm b/engine/link/link.asm index cb9a33a56d3..c40522cd314 100644 --- a/engine/link/link.asm +++ b/engine/link/link.asm @@ -2212,7 +2212,8 @@ endc call DelayFrames xor a ldh [hVBlank], a - inc a ; LINK_TIMECAPSULE + assert LINK_TIMECAPSULE == 1 + inc a ld [wLinkMode], a ret @@ -2285,7 +2286,7 @@ SetBitsForTimeCapsuleRequest: ldh [rSC], a ld a, (1 << rSC_ON) | (0 << rSC_CLOCK) ldh [rSC], a - xor a ; LINK_TIMECAPSULE - 1 + xor a ; LINK_NULL ld [wPlayerLinkAction], a ld [wChosenCableClubRoom], a ret diff --git a/engine/overworld/map_object_action.asm b/engine/overworld/map_object_action.asm index 916131f056f..f26bc4c2cba 100644 --- a/engine/overworld/map_object_action.asm +++ b/engine/overworld/map_object_action.asm @@ -275,8 +275,8 @@ SetFacingBoulderDust: and 2 ld a, FACING_BOULDER_DUST_1 jr z, .ok - inc a assert FACING_BOULDER_DUST_1 + 1 == FACING_BOULDER_DUST_2 + inc a .ok ld [hl], a ret @@ -291,8 +291,8 @@ SetFacingGrassShake: and 4 ld a, FACING_GRASS_1 jr z, .ok - inc a ; FACING_GRASS_2 - + assert FACING_GRASS_1 + 1 == FACING_GRASS_2 + inc a .ok ld [hl], a ret diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index 004cb51073c..ac8bac49713 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -2539,7 +2539,8 @@ Pokedex_GetArea: ld a, [wPlayerGender] bit PLAYERGENDER_FEMALE_F, a jr z, .male - inc c ; PAL_OW_BLUE + assert PAL_OW_RED + 1 == PAL_OW_BLUE + inc c .male ld a, c ld [hli], a ; attributes diff --git a/engine/pokemon/european_mail.asm b/engine/pokemon/european_mail.asm index 85b7a26496d..f2fc4d1e6ca 100644 --- a/engine/pokemon/european_mail.asm +++ b/engine/pokemon/european_mail.asm @@ -6,16 +6,20 @@ ParseMailLanguage: cp "E" ret nz ld a, [hli] - inc c ; MAIL_LANG_FRENCH + assert MAIL_LANG_ENGLISH + 1 == MAIL_LANG_FRENCH + inc c cp "F" ret z - inc c ; MAIL_LANG_GERMAN + assert MAIL_LANG_FRENCH + 1 == MAIL_LANG_GERMAN + inc c cp "G" ret z - inc c ; MAIL_LANG_ITALIAN + assert MAIL_LANG_GERMAN + 1 == MAIL_LANG_ITALIAN + inc c cp "I" ret z - inc c ; MAIL_LANG_SPANISH + assert MAIL_LANG_ITALIAN + 1 == MAIL_LANG_SPANISH + inc c cp "S" ret z ld c, MAIL_LANG_ENGLISH diff --git a/home/tilemap.asm b/home/tilemap.asm index 4f87e02d52d..96251e2eb8f 100644 --- a/home/tilemap.asm +++ b/home/tilemap.asm @@ -229,8 +229,10 @@ GetHPPal:: ld a, e cp (HP_BAR_LENGTH_PX * 50 / 100) ; 24 ret nc - inc d ; HP_YELLOW + assert HP_GREEN + 1 == HP_YELLOW + inc d cp (HP_BAR_LENGTH_PX * 21 / 100) ; 10 ret nc - inc d ; HP_RED + assert HP_YELLOW + 1 == HP_RED + inc d ret