summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2019-06-30 19:19:26 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2019-06-30 19:19:26 -0400
commit92f17e88120b01ff57f02fe13696556419b4221c (patch)
tree168f88299a9ce6134a39fa70d10a2970462f0a48 /src
parent04c9793429f5590fbc40a2aea4bcaf1ae8671b37 (diff)
Document pokemon_animations sprite ptr bug
Diffstat (limited to 'src')
-rw-r--r--src/pokemon_animation.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c
index a6d57b7de..340327475 100644
--- a/src/pokemon_animation.c
+++ b/src/pokemon_animation.c
@@ -867,6 +867,11 @@ u8 GetSpeciesBackAnimSet(u16 species)
#define tSaved0 data[4]
#define tSaved2 data[5]
+// BUG: In vanilla, tPtrLo is read as an s16, so if bit 15 of the
+// address were to be set it would cause the pointer to be read
+// as 0xFFFFXXXX instead of the desired 0x02YYXXXX.
+// By dumb luck, this is not an issue in vanilla. However,
+// changing the link order revealed this bug.
#if MODERN
#define ANIM_SPRITE(taskId) ((struct Sprite *)((gTasks[taskId].tPtrHi << 16) | ((u16)gTasks[taskId].tPtrLo)))
#else