aboutsummaryrefslogtreecommitdiffstats
path: root/engine/battle/animations.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2026-01-17 22:38:33 -0600
committerdannye <33dannye@gmail.com>2026-01-17 22:38:33 -0600
commitbc2354dd6626ce28bb9561547ed2107cfa56c18e (patch)
tree5902d4c3389253c76b7c3351e0d7dfecb551c28d /engine/battle/animations.asm
parentIdentify characters in `_OakSpeechText2B` and `Printer_GetMonStats.IDNo` (#144) (diff)
parentUse macros for `WildMonEncounterSlotChances` (#562) (diff)
downloadpokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.tar.gz
pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.tar.xz
pokeyellow-bc2354dd6626ce28bb9561547ed2107cfa56c18e.zip
Merge branch 'master' of https://github.com/pret/pokered
Diffstat (limited to 'engine/battle/animations.asm')
-rw-r--r--engine/battle/animations.asm52
1 files changed, 27 insertions, 25 deletions
diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm
index 5adecbd7..aafb966e 100644
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -24,7 +24,7 @@ DrawFrameBlock:
jp z, .flipHorizontalTranslateDown ; SUBANIMTYPE_HFLIP
dec a
jr z, .flipBaseCoords ; SUBANIMTYPE_COORDFLIP
-.noTransformation
+; no transformation
ld a, [wBaseCoordY]
add [hl]
ld [de], a ; store Y
@@ -157,7 +157,7 @@ DrawFrameBlock:
ld a, [wNumFBTiles]
cp c
jp nz, .loop ; go back up if there are more tiles to draw
-.afterDrawingTiles
+; after drawing tiles
ld a, [wFBMode]
cp FRAMEBLOCKMODE_02
jr z, .advanceFrameBlockDestAddr ; skip delay and don't clean OAM buffer
@@ -210,7 +210,7 @@ PlayAnimation:
jr z, .AnimationOver
cp FIRST_SE_ID ; is this subanimation or a special effect?
jr c, .playSubanimation
-.doSpecialEffect
+; do Special Effect
ld c, a
ld de, SpecialEffectPointers
.searchSpecialEffectTableLoop
@@ -315,11 +315,11 @@ LoadSubanimation:
and %11100000
cp SUBANIMTYPE_ENEMY << 5
vc_hook Reduce_move_anim_flashing_Reflect
- jr nz, .isNotType5
-.isType5
+ jr nz, .isNotTypeEnemy
+; subanim type enemy
call GetSubanimationTransform2
jr .saveTransformation
-.isNotType5
+.isNotTypeEnemy
vc_hook Reduce_move_anim_flashing_Self_Destruct
call GetSubanimationTransform1
.saveTransformation
@@ -440,11 +440,11 @@ MoveAnimation:
jr nz, .animationsDisabled
call ShareMoveAnimations
call PlayAnimation
- jr .next4
+ jr .next
.animationsDisabled
ld c, 30
call DelayFrames
-.next4
+.next
vc_hook Stop_reducing_move_anim_flashing_Reflect
call PlayApplyingAttackAnimation ; shake the screen or flash the pic in and out (to show damage)
.animationFinished
@@ -968,7 +968,7 @@ BallMoveDistances2:
DoGrowlSpecialEffects:
ld hl, wShadowOAM
ld de, wShadowOAMSprite04
- ld bc, $10
+ ld bc, OBJ_SIZE * 4
call CopyData ; copy the musical note graphic
ld a, [wSubAnimCounter]
dec a
@@ -1141,6 +1141,8 @@ SetAnimationBGPalette:
call UpdateCGBPal_BGP
ret
+AnimationUnusedShakeScreen: ; unreferenced
+; Shakes the screen for a while.
ld b, $5
AnimationShakeScreenVertically:
@@ -1272,12 +1274,12 @@ _AnimationSlideMonUp:
push bc
; In each iteration, slide up all rows but the top one (which is overwritten).
- ld b, 6
+ ld b, PIC_HEIGHT - 1
.slideLoop
push bc
push de
push hl
- ld bc, 7
+ ld bc, PIC_WIDTH
call CopyData
; Note that de and hl are popped in the same order they are pushed, swapping
; their values. When CopyData is called, hl points to a tile 1 row below
@@ -1301,10 +1303,10 @@ _AnimationSlideMonUp:
ld a, [wSlideMonUpBottomRowLeftTile]
inc a
ld [wSlideMonUpBottomRowLeftTile], a
- ld c, 7
+ ld c, PIC_WIDTH
.fillBottomRowLoop
ld [hli], a
- add 7
+ add PIC_WIDTH
dec c
jr nz, .fillBottomRowLoop
@@ -1381,7 +1383,7 @@ AdjustOAMBlockXPos:
ld h, d
AdjustOAMBlockXPos2:
- ld de, 4
+ ld de, OBJ_SIZE
.loop
ld a, [wCoordAdjustmentAmount]
ld b, a
@@ -1391,7 +1393,7 @@ AdjustOAMBlockXPos2:
jr c, .skipPuttingEntryOffScreen
; put off-screen if X >= 168
dec hl
- ld a, 160
+ ld a, SCREEN_HEIGHT_PX + OAM_Y_OFS
ld [hli], a
.skipPuttingEntryOffScreen
ld [hl], a
@@ -1405,7 +1407,7 @@ AdjustOAMBlockYPos:
ld h, d
AdjustOAMBlockYPos2:
- ld de, 4
+ ld de, OBJ_SIZE
.loop
ld a, [wCoordAdjustmentAmount]
ld b, a
@@ -1756,7 +1758,7 @@ _AnimationShootBallsUpward:
dec a
ld [wNumShootingBalls], a
.next
- ld de, 4
+ ld de, OBJ_SIZE
add hl, de ; next OAM entry
dec b
jr nz, .innerLoop
@@ -1809,10 +1811,10 @@ AnimationMinimizeMon:
ld hl, wTempPic
push hl
xor a
- ld bc, 7 * 7 * $10
+ ld bc, PIC_SIZE tiles
call FillMemory
pop hl
- ld de, 7 * 3 * $10 + 4 * $10 + 4
+ ld de, (PIC_WIDTH * 3 + 4) tiles + TILE_SIZE / 4
add hl, de
ld de, MinimizedMonSprite
ld c, MinimizedMonSpriteEnd - MinimizedMonSprite
@@ -1860,7 +1862,7 @@ AnimationSlideMonDownAndHide:
jr nz, .loop
call AnimationHideMonPic
ld hl, wTempPic
- ld bc, 7 * 7 tiles
+ ld bc, PIC_SIZE tiles
xor a
call FillMemory
jp CopyTempPicToMonPic
@@ -1951,7 +1953,7 @@ CopyTempPicToMonPic:
ld hl, vFrontPic ; enemy turn
.next
ld de, wTempPic
- ld bc, 7 * 7
+ ld bc, PIC_SIZE
jp CopyVideoData
AnimationWavyScreen:
@@ -2019,7 +2021,7 @@ AnimationSubstitute:
; Changes the pokemon's sprite to the mini sprite
ld hl, wTempPic
xor a
- ld bc, 7 * 7 tiles
+ ld bc, PIC_SIZE tiles
call FillMemory
ldh a, [hWhoseTurn]
and a
@@ -2055,7 +2057,7 @@ AnimationSubstitute:
jp AnimationShowMonPic
CopyMonsterSpriteData:
- ld bc, 1 tiles
+ ld bc, TILE_SIZE
ld a, BANK(MonsterSprite)
jp FarCopyData
@@ -2538,7 +2540,7 @@ FallingObjects_UpdateOAMEntry:
inc a
cp 112
jr c, .next
- ld a, 160 ; if Y >= 112, put it off-screen
+ ld a, SCREEN_HEIGHT_PX + OAM_Y_OFS ; if Y >= 112, put it off-screen
.next
ld [hli], a ; Y
cp 40
@@ -2655,7 +2657,7 @@ AnimationShakeEnemyHUD:
; Make a copy of the back pic's tile patterns in sprite tile pattern VRAM.
ld de, vBackPic
ld hl, vSprites
- ld bc, 7 * 7
+ ld bc, PIC_SIZE
call CopyVideoData
xor a