diff options
author | Kaz <kazbloxmc@gmail.com> | 2020-05-27 03:18:08 -0400 |
---|---|---|
committer | Kaz <kazbloxmc@gmail.com> | 2020-05-27 03:18:08 -0400 |
commit | 3852f258c0497adddd580bd1b883d6108a18fb3e (patch) | |
tree | b9026bb6b430ba0bd6b3f807686c12fb07369610 | |
parent | 2683073ab281ad0388b34dbd0c8fd701ad251736 (diff) |
Eliminate some confusion and further elaborate.
-rw-r--r-- | src/battle/anim/water.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/battle/anim/water.c b/src/battle/anim/water.c index b241bd722..94cdd784b 100644 --- a/src/battle/anim/water.c +++ b/src/battle/anim/water.c @@ -1695,13 +1695,13 @@ void sub_80D4D64(struct Sprite *sprite, s32 xDiff, s32 yDiff) s16 randomSomethingY; something = sprite->data[0] / 2; - // regalloc acts funny here... + // Without the weird hack? you are about to see below, regalloc acts funny here... combinedX = sprite->pos1.x + sprite->pos2.x; combinedY = sprite->pos1.y + sprite->pos2.y; /* - Then goes back to normal at this exact point. Something must have existed here. - Whatever it was, it's not the traditional if (0) or do {} while (0). Nor is it - var++--. It's something completely obscene. + Then goes back to normal at this exact point. Something must have existed here + that lined up regalloc properly. Whatever it was, it's not the traditional if + (0) or do {} while (0). Nor is it var++--. It's something completely obscene. Upon random experiments, there was an observation about how parameters affected regalloc in ways more bizarre than local variables. xDiff++; xDiff--; had actually @@ -1750,6 +1750,7 @@ void sub_80D4D64(struct Sprite *sprite, s32 xDiff, s32 yDiff) u8 unk = -unk; // ...this is what I came up with. It matches. // i = -i; // This matches too. It might just work on any uninitialized. } + // by the way, yDiff works for the if case too, but oddly not sprite. randomSomethingY = yDiff + (Random() % 10) - 5; randomSomethingX = -xDiff + (Random() % 10) - 5; |