diff options
-rw-r--r-- | constants/battle_anim_constants.asm | 2 | ||||
-rw-r--r-- | engine/battle_anims/anim_commands.asm | 30 | ||||
-rw-r--r-- | engine/battle_anims/bg_effects.asm | 210 | ||||
-rw-r--r-- | macros/wram.asm | 8 | ||||
-rw-r--r-- | wram.asm | 27 |
5 files changed, 143 insertions, 134 deletions
diff --git a/constants/battle_anim_constants.asm b/constants/battle_anim_constants.asm index 2b66b544..fa34f3ad 100644 --- a/constants/battle_anim_constants.asm +++ b/constants/battle_anim_constants.asm @@ -813,7 +813,7 @@ BATTLEANIM_BASE_TILE EQU 7 * 7 ; Maximum size of a pokemon picture const BG_EFFECT_STRUCT_FUNCTION const BG_EFFECT_STRUCT_JT_INDEX const BG_EFFECT_STRUCT_BATTLE_TURN - const BG_EFFECT_STRUCT_03 + const BG_EFFECT_STRUCT_PARAM BG_EFFECT_STRUCT_LENGTH EQU const_value NUM_BG_EFFECTS EQU 5 ; see wActiveBGEffects diff --git a/engine/battle_anims/anim_commands.asm b/engine/battle_anims/anim_commands.asm index 9bba60a3..6d4129fa 100644 --- a/engine/battle_anims/anim_commands.asm +++ b/engine/battle_anims/anim_commands.asm @@ -586,13 +586,13 @@ BattleAnimCmd_Obj: BattleAnimCmd_BGEffect: call GetBattleAnimByte - ld [wBattleAnimTemp0], a + ld [wBattleBGEffectTempID], a call GetBattleAnimByte - ld [wBattleAnimTemp1], a + ld [wBattleBGEffectTempJumptableIndex], a call GetBattleAnimByte - ld [wBattleAnimTemp2], a + ld [wBattleBGEffectTempTurn], a call GetBattleAnimByte - ld [wBattleAnimTemp3], a + ld [wBattleBGEffectTempParam], a call _QueueBGEffect ret @@ -642,14 +642,14 @@ BattleAnimCmd_5GFX: ld c, a ld hl, wBattleAnimTileDict xor a - ld [wBattleAnimTemp0], a + ld [wBattleAnimGFXTempTileID], a .loop - ld a, [wBattleAnimTemp0] + ld a, [wBattleAnimGFXTempTileID] cp (vTiles1 - vTiles0) / LEN_2BPP_TILE - BATTLEANIM_BASE_TILE ret nc call GetBattleAnimByte ld [hli], a - ld a, [wBattleAnimTemp0] + ld a, [wBattleAnimGFXTempTileID] ld [hli], a push bc push hl @@ -662,9 +662,9 @@ endr add hl, de ld a, [wBattleAnimByte] call LoadBattleAnimGFX - ld a, [wBattleAnimTemp0] + ld a, [wBattleAnimGFXTempTileID] add c - ld [wBattleAnimTemp0], a + ld [wBattleAnimGFXTempTileID], a pop hl pop bc dec c @@ -770,12 +770,12 @@ BattleAnimCmd_BattlerGFX_1Row: ld hl, vTiles0 tile ($80 - 6 - 7) ld de, vTiles2 tile $06 ; Enemy feet start tile ld a, 7 tiles ; Enemy pic height - ld [wBattleAnimTemp0], a + ld [wBattleAnimGFXTempPicHeight], a ld a, 7 ; Copy 7x1 tiles call .LoadFeet ld de, vTiles2 tile $31 ; Player head start tile ld a, 6 tiles ; Player pic height - ld [wBattleAnimTemp0], a + ld [wBattleAnimGFXTempPicHeight], a ld a, 6 ; Copy 6x1 tiles call .LoadFeet ret @@ -787,7 +787,7 @@ BattleAnimCmd_BattlerGFX_1Row: lb bc, BANK(@), 1 call Request2bpp pop de - ld a, [wBattleAnimTemp0] + ld a, [wBattleAnimGFXTempPicHeight] ld l, a ld h, 0 add hl, de @@ -824,12 +824,12 @@ BattleAnimCmd_BattlerGFX_2Row: ld hl, vTiles0 tile ($80 - 6 * 2 - 7 * 2) ld de, vTiles2 tile $05 ; Enemy feet start tile ld a, 7 tiles ; Enemy pic height - ld [wBattleAnimTemp0], a + ld [wBattleAnimGFXTempPicHeight], a ld a, 7 ; Copy 7x2 tiles call .LoadHead ld de, vTiles2 tile $31 ; Player head start tile ld a, 6 tiles ; Player pic height - ld [wBattleAnimTemp0], a + ld [wBattleAnimGFXTempPicHeight], a ld a, 6 ; Copy 6x2 tiles call .LoadHead ret @@ -841,7 +841,7 @@ BattleAnimCmd_BattlerGFX_2Row: lb bc, BANK(@), 2 call Request2bpp pop de - ld a, [wBattleAnimTemp0] + ld a, [wBattleAnimGFXTempPicHeight] ld l, a ld h, 0 add hl, de diff --git a/engine/battle_anims/bg_effects.asm b/engine/battle_anims/bg_effects.asm index b587be2b..b504df29 100644 --- a/engine/battle_anims/bg_effects.asm +++ b/engine/battle_anims/bg_effects.asm @@ -48,13 +48,13 @@ QueueBGEffect: ld b, h ld hl, BG_EFFECT_STRUCT_FUNCTION add hl, bc - ld a, [wBattleAnimTemp0] + ld a, [wBattleBGEffectTempID] ld [hli], a - ld a, [wBattleAnimTemp1] + ld a, [wBattleBGEffectTempJumptableIndex] ld [hli], a - ld a, [wBattleAnimTemp2] + ld a, [wBattleBGEffectTempTurn] ld [hli], a - ld a, [wBattleAnimTemp3] + ld a, [wBattleBGEffectTempParam] ld [hl], a ret @@ -188,7 +188,7 @@ BattleBGEffect_FlashWhite: BattleBGEffect_FlashContinue: ; current timer, flash duration, number of flashes ld a, $1 - ld [wBattleAnimTemp0], a + ld [wBattleBGEffectTempID], a ; unused? ld hl, BG_EFFECT_STRUCT_JT_INDEX add hl, bc ld a, [hl] @@ -204,7 +204,7 @@ BattleBGEffect_FlashContinue: ld hl, BG_EFFECT_STRUCT_JT_INDEX add hl, bc ld [hl], a - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] and a @@ -388,9 +388,9 @@ BattleBGEffect_ShowMon: ld de, .PlayerData .got_pointer ld a, e - ld [wBattleAnimTemp1], a + ld [wBattlePicResizeTempPointer], a ld a, d - ld [wBattleAnimTemp2], a + ld [wBattlePicResizeTempPointer + 1], a call BattleBGEffect_RunPicResizeScript ret @@ -564,7 +564,7 @@ BattleBGEffect_RemoveMon: .user ld a, $8 .okay - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld [hl], a ret @@ -618,7 +618,7 @@ BattleBGEffect_RemoveMon: ld a, $1 ldh [hBGMapMode], a call BattleBGEffects_IncAnonJumptableIndex - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc dec [hl] ret @@ -626,7 +626,7 @@ BattleBGEffect_RemoveMon: .four xor a ldh [hBGMapMode], a - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] and a @@ -650,9 +650,9 @@ BattleBGEffect_EnterMon: ld de, .PlayerData .okay ld a, e - ld [wBattleAnimTemp1], a + ld [wBattlePicResizeTempPointer], a ld a, d - ld [wBattleAnimTemp2], a + ld [wBattlePicResizeTempPointer + 1], a call BattleBGEffect_RunPicResizeScript ret @@ -677,9 +677,9 @@ BattleBGEffect_ReturnMon: ld de, .PlayerData .okay ld a, e - ld [wBattleAnimTemp1], a + ld [wBattlePicResizeTempPointer], a ld a, d - ld [wBattleAnimTemp2], a + ld [wBattlePicResizeTempPointer + 1], a call BattleBGEffect_RunPicResizeScript ret @@ -712,14 +712,14 @@ BattleBGEffect_RunPicResizeScript: dw .end .zero - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld e, [hl] ld d, $0 inc [hl] - ld a, [wBattleAnimTemp1] + ld a, [wBattlePicResizeTempPointer] ld l, a - ld a, [wBattleAnimTemp2] + ld a, [wBattlePicResizeTempPointer + 1] ld h, a add hl, de add hl, de @@ -807,7 +807,7 @@ BattleBGEffect_RunPicResizeScript: pop hl inc hl ld a, [hli] - ld [wBattleAnimTemp0], a + ld [wBattlePicResizeTempBaseTileID], a ; get coord push de ld e, [hl] @@ -823,7 +823,7 @@ BattleBGEffect_RunPicResizeScript: .row push bc push hl - ld a, [wBattleAnimTemp0] + ld a, [wBattlePicResizeTempBaseTileID] ld b, a .col ld a, [de] @@ -1004,7 +1004,7 @@ BattleBGEffect_StartWater: BattleBGEffect_Water: ; BG_EFFECT_STRUCT_JT_INDEX: defines Y position of deformation - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] ld e, a @@ -1021,7 +1021,7 @@ BattleBGEffect_Water: ld hl, BG_EFFECT_STRUCT_JT_INDEX add hl, bc ld a, [hl] - ld [wBattleAnimTemp0], a + ld [wBattleSineWaveTempProgress], a ld hl, BG_EFFECT_STRUCT_BATTLE_TURN add hl, bc ld a, [hl] @@ -1060,13 +1060,13 @@ BattleBGEffect_Psychic: ldh [hLYOverrideEnd], a lb de, 6, 5 call DeformScreen - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld [hl], $0 ret .one - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] inc [hl] @@ -1115,7 +1115,7 @@ BattleBGEffect_NightShade: call BattleBGEffects_ClearLYOverrides ld a, LOW(rSCY) call BattleBGEffect_SetLCDStatCustoms1 - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld e, [hl] ld d, 2 @@ -1154,7 +1154,7 @@ BattleBGEffect_DoubleTeam: ret .one - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] cp $10 @@ -1164,7 +1164,7 @@ BattleBGEffect_DoubleTeam: ret .three - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] cp $ff @@ -1183,7 +1183,7 @@ BattleBGEffect_DoubleTeam: ld a, [hl] ld d, $2 call BattleBGEffects_Sine - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc add [hl] call .UpdateLYOverrides @@ -1236,7 +1236,7 @@ BattleBGEffect_AcidArmor: call BattleBGEffects_ClearLYOverrides ld a, LOW(rSCY) call BattleBGEffect_SetLCDStatCustoms1 - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld e, [hl] ld d, 2 @@ -1307,7 +1307,7 @@ BattleBGEffect_Withdraw: ret .one - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] and $3f @@ -1318,7 +1318,7 @@ BattleBGEffect_Withdraw: cp d ret nc call BGEffect_DisplaceLYOverridesBackup - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] rlca @@ -1353,13 +1353,13 @@ BattleBGEffect_Dig: ld hl, BG_EFFECT_STRUCT_BATTLE_TURN add hl, bc ld [hl], $2 - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld [hl], $0 ret .one - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] and a @@ -1410,7 +1410,7 @@ BattleBGEffect_Tackle: .zero ; Prepares mon to move forward (player moves right, enemy moves left) -; BG_EFFECT_STRUCT_03 will keep track of distance moved, so it's reset to 0 here +; BG_EFFECT_STRUCT_PARAM will keep track of distance moved, so it's reset to 0 here ; BG_EFFECT_STRUCT_BATTLE_TURN is set to 2 or -2 depending on target call BattleBGEffects_IncAnonJumptableIndex call BattleBGEffects_ClearLYOverrides @@ -1419,7 +1419,7 @@ BattleBGEffect_Tackle: ldh a, [hLYOverrideEnd] inc a ldh [hLYOverrideEnd], a - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld [hl], 0 call BGEffect_CheckBattleTurn @@ -1440,8 +1440,8 @@ BattleBGEffect_Tackle: Tackle_MoveForward: ; Moves user horizontally in a direction that can be positive or negative. When the limit is reached (8 pixels) we move to the next function in the jumptable (Tackle_ReturnMove) ; BG_EFFECT_STRUCT_BATTLE_TURN: speed and direction -; BG_EFFECT_STRUCT_03: keeps track of distance moved - ld hl, BG_EFFECT_STRUCT_03 +; BG_EFFECT_STRUCT_PARAM: keeps track of distance moved + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] cp -8 @@ -1455,7 +1455,7 @@ Tackle_MoveForward: ld hl, BG_EFFECT_STRUCT_BATTLE_TURN add hl, bc ld a, [hl] - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc add [hl] ld [hl], a @@ -1464,8 +1464,8 @@ Tackle_MoveForward: Tackle_ReturnMove: ; Move user horizontally back to initial position. When we back to position 0, we move to the next function in the jumptable ; BG_EFFECT_STRUCT_BATTLE_TURN: is turned into a negative number (this number is not saved to preserve the initial number) -; BG_EFFECT_STRUCT_03: keeps track of distance moved - ld hl, BG_EFFECT_STRUCT_03 +; BG_EFFECT_STRUCT_PARAM: keeps track of distance moved + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] and a @@ -1478,7 +1478,7 @@ Tackle_ReturnMove: ld a, [hl] xor $ff inc a - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc add [hl] ld [hl], a @@ -1550,7 +1550,7 @@ BattleBGEffect_BetaPursuit: ; unused VitalThrow_MoveBackwards: ; Prepares mon to move back back (player moves left, enemy moves right) -; BG_EFFECT_STRUCT_03: keeps track of distance moved, so it's reset to 0 here +; BG_EFFECT_STRUCT_PARAM: keeps track of distance moved, so it's reset to 0 here call BattleBGEffects_IncAnonJumptableIndex call BattleBGEffects_ClearLYOverrides ld a, LOW(rSCX) @@ -1558,7 +1558,7 @@ VitalThrow_MoveBackwards: ldh a, [hLYOverrideEnd] inc a ldh [hLYOverrideEnd], a - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld [hl], $0 call BGEffect_CheckBattleTurn @@ -1602,19 +1602,19 @@ BattleBGEffect_WobbleMon: ldh a, [hLYOverrideEnd] inc a ldh [hLYOverrideEnd], a - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld [hl], $0 ret .one - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] ld d, $8 call BattleBGEffects_Sine call BGEffect_FillLYOverridesBackup - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] add $4 @@ -1648,7 +1648,7 @@ BattleBGEffect_Flail: ret .one - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] ld d, $6 @@ -1668,7 +1668,7 @@ BattleBGEffect_Flail: ld a, [hl] add $8 ld [hl], a - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] add $2 @@ -1694,7 +1694,7 @@ BattleBGEffect_WaveDeformMon: ret .one - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] cp $20 @@ -1706,7 +1706,7 @@ BattleBGEffect_WaveDeformMon: ret .two - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] and a @@ -1739,7 +1739,7 @@ BattleBGEffect_BounceDown: ld hl, BG_EFFECT_STRUCT_BATTLE_TURN add hl, bc ld [hl], $1 - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld [hl], $20 ret @@ -1751,7 +1751,7 @@ BattleBGEffect_BounceDown: cp $38 ret nc push af - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] ld d, $10 @@ -1761,7 +1761,7 @@ BattleBGEffect_BounceDown: pop af add d call BGEffect_DisplaceLYOverridesBackup - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc inc [hl] inc [hl] @@ -1802,7 +1802,7 @@ BattleBGEffect_BetaSendOutMon1: ; unused jr .loop .done - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld [hl], $0 .one @@ -1816,7 +1816,7 @@ BattleBGEffect_BetaSendOutMon1: ; unused ret .next - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld [hl], $0 ldh a, [hLYOverrideStart] @@ -1860,7 +1860,7 @@ BattleBGEffect_BetaSendOutMon1: ; unused ret .GetLYOverride: - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] inc [hl] @@ -1938,7 +1938,7 @@ BattleBGEffect_FadeMonsToBlackRepeating: ret .one - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] inc [hl] @@ -2011,13 +2011,13 @@ BattleBGEffect_FadeMonsToBlackRepeating: .cgb_zero call BattleBGEffects_IncAnonJumptableIndex - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld [hl], $0 ret .cgb_one - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] inc [hl] @@ -2172,13 +2172,13 @@ BattleBGEffect_VibrateMon: ld hl, BG_EFFECT_STRUCT_BATTLE_TURN add hl, bc ld [hl], $1 - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld [hl], $20 ret .one - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] and a @@ -2216,13 +2216,13 @@ BattleBGEffect_WobblePlayer: ldh [hLYOverrideStart], a ld a, $37 ldh [hLYOverrideEnd], a - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld [hl], $0 ret .one - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] cp $40 @@ -2230,7 +2230,7 @@ BattleBGEffect_WobblePlayer: ld d, $6 call BattleBGEffects_Sine call BGEffect_FillLYOverridesBackup - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] add $2 @@ -2286,7 +2286,7 @@ BattleBGEffects_GetShakeAmount: .okay dec [hl] - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] and $f @@ -2313,7 +2313,7 @@ BattleBGEffects_GetShakeAmount: ret BattleBGEffect_WobbleScreen: - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] cp $40 @@ -2321,7 +2321,7 @@ BattleBGEffect_WobbleScreen: ld d, $6 call BattleBGEffects_Sine ldh [hSCX], a - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] add $2 @@ -2340,7 +2340,7 @@ BattleBGEffect_GetNthDMGPal: and a jr z, .zero dec [hl] - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] call BattleBGEffect_GetNextDMGPal @@ -2381,7 +2381,7 @@ BGEffect_RapidCyclePals: ldh a, [hLYOverrideEnd] inc a ldh [hLYOverrideEnd], a - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] ld [hl], $0 @@ -2410,7 +2410,7 @@ BGEffect_RapidCyclePals: ret .okay_2_dmg - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc dec [hl] ret @@ -2443,7 +2443,7 @@ BGEffect_RapidCyclePals: call BattleBGEffects_IncAnonJumptableIndex .player_turn_cgb call BattleBGEffects_IncAnonJumptableIndex - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] ld [hl], $0 @@ -2472,7 +2472,7 @@ BGEffect_RapidCyclePals: ret .okay_2_cgb - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc dec [hl] ret @@ -2503,7 +2503,7 @@ BGEffect_RapidCyclePals: ret .okay_4_cgb - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc dec [hl] ret @@ -2553,7 +2553,7 @@ BGEffects_LoadBGPal1_OBPal0: ret BattleBGEffect_GetFirstDMGPal: - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld a, [hl] inc [hl] @@ -2567,7 +2567,7 @@ BattleBGEffect_GetNextDMGPal: cp -2 jr nz, .repeat ld a, [de] - ld hl, BG_EFFECT_STRUCT_03 + ld hl, BG_EFFECT_STRUCT_PARAM add hl, bc ld [hl], $0 .repeat @@ -2634,19 +2634,15 @@ BattleBGEffects_ResetVideoHRAM: ret DeformScreen: -; wBattleAnimTemp0: Progress of the sine wave -; wBattleAnimTemp1 (e): Distance to skip -; wBattleAnimTemp2 (d): Size of wave -; wBattleAnimTemp3: Timer push bc xor a - ld [wBattleAnimTemp0], a + ld [wBattleSineWaveTempProgress], a ld a, e - ld [wBattleAnimTemp1], a + ld [wBattleSineWaveTempOffset], a ld a, d - ld [wBattleAnimTemp2], a + ld [wBattleSineWaveTempAmplitude], a ld a, $80 - ld [wBattleAnimTemp3], a + ld [wBattleSineWaveTempTimer], a ld bc, wLYOverridesBackup .loop ldh a, [hLYOverrideStart] @@ -2655,18 +2651,18 @@ DeformScreen: ldh a, [hLYOverrideEnd] cp c jr c, .next - ld a, [wBattleAnimTemp2] + ld a, [wBattleSineWaveTempAmplitude] ld d, a - ld a, [wBattleAnimTemp0] + ld a, [wBattleSineWaveTempProgress] call BattleBGEffects_Sine ld [bc], a .next inc bc - ld a, [wBattleAnimTemp1] - ld hl, wBattleAnimTemp0 + ld a, [wBattleSineWaveTempOffset] + ld hl, wBattleSineWaveTempProgress add [hl] ld [hl], a - ld hl, wBattleAnimTemp3 + ld hl, wBattleSineWaveTempTimer dec [hl] jr nz, .loop pop bc @@ -2675,26 +2671,26 @@ DeformScreen: InitSurfWaves: push bc xor a - ld [wBattleAnimTemp0], a + ld [wBattleSineWaveTempProgress], a ld a, e - ld [wBattleAnimTemp1], a + ld [wBattleSineWaveTempOffset], a ld a, d - ld [wBattleAnimTemp2], a + ld [wBattleSineWaveTempAmplitude], a ld a, $40 - ld [wBattleAnimTemp3], a + ld [wBattleSineWaveTempTimer], a ld bc, wSurfWaveBGEffect .loop - ld a, [wBattleAnimTemp2] + ld a, [wBattleSineWaveTempAmplitude] ld d, a - ld a, [wBattleAnimTemp0] + ld a, [wBattleSineWaveTempProgress] call BattleBGEffects_Sine ld [bc], a inc bc - ld a, [wBattleAnimTemp1] - ld hl, wBattleAnimTemp0 + ld a, [wBattleSineWaveTempOffset] + ld hl, wBattleSineWaveTempProgress add [hl] ld [hl], a - ld hl, wBattleAnimTemp3 + ld hl, wBattleSineWaveTempTimer dec [hl] jr nz, .loop pop bc @@ -2702,26 +2698,26 @@ InitSurfWaves: DeformWater: push bc - ld [wBattleAnimTemp3], a + ld [wBattleSineWaveTempTimer], a ld a, e - ld [wBattleAnimTemp1], a + ld [wBattleSineWaveTempOffset], a ld a, d - ld [wBattleAnimTemp2], a + ld [wBattleSineWaveTempAmplitude], a call .GetLYOverrideBackupAddrOffset ld hl, wLYOverridesBackup add hl, de ld c, l ld b, h .loop - ld a, [wBattleAnimTemp3] + ld a, [wBattleSineWaveTempTimer] and a jr z, .done dec a - ld [wBattleAnimTemp3], a + ld [wBattleSineWaveTempTimer], a push af - ld a, [wBattleAnimTemp2] + ld a, [wBattleSineWaveTempAmplitude] ld d, a - ld a, [wBattleAnimTemp1] + ld a, [wBattleSineWaveTempOffset] push hl call BattleBGEffects_Sine ld e, a @@ -2739,9 +2735,9 @@ DeformWater: ld [hl], e dec hl .skip2 - ld a, [wBattleAnimTemp1] + ld a, [wBattleSineWaveTempOffset] add $4 - ld [wBattleAnimTemp1], a + ld [wBattleSineWaveTempOffset], a pop af jr .loop @@ -2753,7 +2749,7 @@ DeformWater: .GetLYOverrideBackupAddrOffset: ldh a, [hLYOverrideStart] ld e, a - ld a, [wBattleAnimTemp0] + ld a, [wBattleSineWaveTempProgress] add e ld e, a ld d, $0 diff --git a/macros/wram.asm b/macros/wram.asm index b514bbde..ba1e52dc 100644 --- a/macros/wram.asm +++ b/macros/wram.asm @@ -370,8 +370,8 @@ battle_anim_struct: MACRO ENDM battle_bg_effect: MACRO -\1Function:: db -\1Field01:: ds 1 -\1Field02:: ds 1 -\1Field03:: ds 1 +\1Function:: db +\1JumptableIndex:: db +\1BattleTurn:: db +\1Param:: db ENDM @@ -685,19 +685,18 @@ wBattleAnimByte:: db wBattleAnimOAMPointerLo:: db UNION -; unidentified -wBattleAnimTemp0:: db -wBattleAnimTemp1:: db -wBattleAnimTemp2:: db -wBattleAnimTemp3:: db - -NEXTU wBattleObjectTempID:: db wBattleObjectTempXCoord:: db wBattleObjectTempYCoord:: db wBattleObjectTempParam:: db NEXTU +wBattleBGEffectTempID:: db +wBattleBGEffectTempJumptableIndex:: db +wBattleBGEffectTempTurn:: db +wBattleBGEffectTempParam:: db + +NEXTU wBattleAnimTempOAMFlags:: db wBattleAnimTempFixY:: db wBattleAnimTempTileID:: db @@ -707,6 +706,20 @@ wBattleAnimTempXOffset:: db wBattleAnimTempYOffset:: db wBattleAnimTempFrameOAMFlags:: db wBattleAnimTempPalette:: db + +NEXTU +wBattleAnimGFXTempTileID:: +wBattleAnimGFXTempPicHeight:: db + +NEXTU +wBattleSineWaveTempProgress:: db +wBattleSineWaveTempOffset:: db +wBattleSineWaveTempAmplitude:: db +wBattleSineWaveTempTimer:: db + +NEXTU +wBattlePicResizeTempBaseTileID:: db +wBattlePicResizeTempPointer:: dw ENDU UNION |