summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Winwood <twwinwood@gmail.com>2018-06-18 07:15:14 +0100
committerThomas Winwood <twwinwood@gmail.com>2018-06-18 07:15:14 +0100
commit346b9deadcbbd1f11a1e1081dca540211e1bc0fa (patch)
tree08de6ad94487fcbf5e62651dd6d0372383b4e56f /src
parent093d767eb6a943a5ef19fee69ab24398c3f7fa7b (diff)
Decompile sub_80DDCC8
(I didn't actually do this one, shinny did)
Diffstat (limited to 'src')
-rw-r--r--src/ghost.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/ghost.c b/src/ghost.c
index 042707bfb..6c7e36190 100644
--- a/src/ghost.c
+++ b/src/ghost.c
@@ -73,4 +73,38 @@ void sub_80DDC4C(struct Sprite *sprite)
}
else
sub_80DDCC8(sprite);
+}
+
+void sub_80DDCC8(struct Sprite *sprite)
+{
+
+ s16 r0;
+ if(sprite->data[6] > 0xFF)
+ {
+ if(++sprite->data[6] == 0x10d)
+ sprite->data[6] = 0;
+ return;
+ }
+
+ r0 = sprite->data[7];
+ sprite->data[7]++;
+
+ if((r0 & 0xFF) == 0)
+ {
+ sprite->data[7] &= 0xff00;
+ if((sprite->data[7] & 0x100) != 0)
+ sprite->data[6]++;
+ else
+ sprite->data[6]--;
+ }
+ else
+ return;
+
+ REG_BLDALPHA = ((16 - sprite->data[6]) << 8) | sprite->data[6];
+ if(sprite->data[6] == 0 || sprite->data[6] == 16)
+ {
+ sprite->data[7] ^= 0x100;
+ }
+ if(sprite->data[6] == 0)
+ sprite->data[6] = 0x100;
} \ No newline at end of file