summaryrefslogtreecommitdiff
path: root/src/battle/anim/glow.c
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2017-11-26 21:18:19 -0800
committerGitHub <noreply@github.com>2017-11-26 21:18:19 -0800
commite6500d12a21e9833e08ad25cc6a76b075cff42dd (patch)
treeebd886d19c3a3257b21590d558ec724ca7d6e849 /src/battle/anim/glow.c
parent0793afb9e8eeb508375344ca683f97bbc797771a (diff)
parent85dc553b949b05ec4fdc0e223c29161465a132b7 (diff)
Merge pull request #473 from ProjectRevoTPP/split_80C
split battle_anim_80CA710
Diffstat (limited to 'src/battle/anim/glow.c')
-rwxr-xr-xsrc/battle/anim/glow.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/battle/anim/glow.c b/src/battle/anim/glow.c
new file mode 100755
index 000000000..6038825af
--- /dev/null
+++ b/src/battle/anim/glow.c
@@ -0,0 +1,55 @@
+#include "global.h"
+#include "rom_8077ABC.h"
+#include "trig.h"
+#include "battle_anim.h"
+#include "sound.h"
+#include "ewram.h"
+#include "palette.h"
+#include "decompress.h"
+
+extern s16 gBattleAnimArgs[];
+extern u8 gBattleAnimBankAttacker;
+extern u8 gBattleAnimBankTarget;
+
+extern u16 gUnknown_083D7A5C[5];
+
+extern struct INCBIN_U8 gBattleAnimSpritePalette_206;
+
+// glow (a whitening effect where the Pokemon glows white in a cycle.)
+// Used in Heal Bell.
+
+void sub_80D1ADC(u8 taskId)
+{
+ int i;
+ u8 sp[8];
+ void* src;
+ void* dest;
+ void* what;
+ sp[0] = IndexOfSpritePaletteTag(0x27DE);
+ for (i = 1; i <= 4; i++)
+ {
+ sp[i] = AllocSpritePalette(0x2710 - i);
+ }
+
+ src = &gBattleAnimSpritePalette_206;
+ dest = (NotInBattle()) ? gSharedMem + 0x18000 - 0x3800: gSharedMem + 0x18000;
+ LZDecompressWram(src, dest);
+ for (i = 0; i <= 4; i++)
+ {
+ what = ((NotInBattle()) ? gSharedMem + 0x14800 : gSharedMem + 0x18000) + (i << 5);
+ LoadPalette(what, (u16)((sp[i] << 4) + 0x100), 32);
+ }
+
+ DestroyAnimVisualTask(taskId);
+}
+
+void sub_80D1B80(u8 taskId)
+{
+ int i;
+ for (i = 0; i < 5; i++)
+ {
+ FreeSpritePaletteByTag(gUnknown_083D7A5C[i]);
+ }
+
+ DestroyAnimVisualTask(taskId);
+}