From 67beec5cbe1ac37e551f15a317fd249fb487a4e9 Mon Sep 17 00:00:00 2001 From: KDSKardabox Date: Sun, 23 Dec 2018 00:34:00 +0530 Subject: [PATCH 1/3] Move 2 functions of electric from ice --- src/electric.c | 29 ++++++++++++++++++++++++++++- src/ice.c | 35 +++-------------------------------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/src/electric.c b/src/electric.c index ed495fa593..7711053655 100644 --- a/src/electric.c +++ b/src/electric.c @@ -6,7 +6,6 @@ #include "sound.h" extern void sub_810E2C8(struct Sprite *); -extern bool8 sub_810B614(struct Task *task, u8 taskId); extern void TranslateAnimSpriteToTargetMonLocation(struct Sprite *); static void sub_810A1A8(struct Sprite *); @@ -38,6 +37,8 @@ static void sub_810B1F0(struct Sprite *); static void sub_810B23C(struct Sprite *); static bool8 sub_810B430(struct Task *task, u8 taskId); static void sub_810B51C(struct Sprite *); +static bool8 sub_810B614(struct Task *task, u8 taskId); +static void sub_810B684(struct Sprite *sprite); const union AnimCmd gUnknown_085956A4[] = { @@ -1493,3 +1494,29 @@ void sub_810B55C(u8 taskId) break; } } + +bool8 sub_810B614(struct Task *task, u8 taskId) +{ + u8 spriteId = CreateSprite(&gUnknown_085956C0, task->data[13], task->data[14], task->data[12]); + + if (spriteId != MAX_SPRITES) + { + gSprites[spriteId].callback = sub_810B684; + gSprites[spriteId].data[6] = taskId; + gSprites[spriteId].data[7] = 10; + task->data[10]++; + } + if (task->data[14] >= task->data[15]) + return TRUE; + task->data[14] += 32; + return FALSE; +} + +static void sub_810B684(struct Sprite *sprite) +{ + if (sprite->animEnded) + { + gTasks[sprite->data[6]].data[sprite->data[7]]--; + DestroySprite(sprite); + } +} \ No newline at end of file diff --git a/src/ice.c b/src/ice.c index 329cd0b9a6..3f6bd151fe 100644 --- a/src/ice.c +++ b/src/ice.c @@ -20,8 +20,7 @@ struct HailStruct { s32 unk3:4; }; -extern void sub_810B684(struct Sprite *); -extern void sub_810B6C4(struct Sprite *); +static void sub_810B6C4(struct Sprite *); extern void sub_810B848(struct Sprite *); extern void AnimIcePunchSwirlingParticle(struct Sprite *); extern void AnimIceBeamParticle(struct Sprite *); @@ -524,37 +523,10 @@ const struct SpriteTemplate gUnknown_08595DFC = .callback = InitIceBallParticle, }; -extern const struct SpriteTemplate gUnknown_085956C0; - -bool8 sub_810B614(struct Task *task, u8 taskId) -{ - u8 spriteId = CreateSprite(&gUnknown_085956C0, task->data[13], task->data[14], task->data[12]); - - if (spriteId != MAX_SPRITES) - { - gSprites[spriteId].callback = sub_810B684; - gSprites[spriteId].data[6] = taskId; - gSprites[spriteId].data[7] = 10; - task->data[10]++; - } - if (task->data[14] >= task->data[15]) - return TRUE; - task->data[14] += 32; - return FALSE; -} - -void sub_810B684(struct Sprite *sprite) -{ - if (sprite->animEnded) - { - gTasks[sprite->data[6]].data[sprite->data[7]]--; - DestroySprite(sprite); - } -} // probably unused #ifdef NONMATCHING -void sub_810B6C4(struct Sprite *sprite) +static void sub_810B6C4(struct Sprite *sprite) { s16 targetX, targetY, attackerX, attackerY; s16 i; @@ -596,7 +568,7 @@ void sub_810B6C4(struct Sprite *sprite) } #else NAKED -void sub_810B6C4(struct Sprite *sprite) +static void sub_810B6C4(struct Sprite *sprite) { asm_unified("push {r4-r7,lr}\n\ mov r7, r10\n\ @@ -783,7 +755,6 @@ _0810B80A:\n\ .pool\n"); } #endif - void sub_810B848(struct Sprite *sprite) { if (sprite->data[0] != 0) From b394ad77815fce6ab7373f6f9d1ef9577c8a962a Mon Sep 17 00:00:00 2001 From: KDSKardabox Date: Sun, 23 Dec 2018 11:55:01 +0530 Subject: [PATCH 2/3] Add space --- src/ice.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ice.c b/src/ice.c index 3f6bd151fe..05ca630d52 100644 --- a/src/ice.c +++ b/src/ice.c @@ -755,6 +755,7 @@ _0810B80A:\n\ .pool\n"); } #endif + void sub_810B848(struct Sprite *sprite) { if (sprite->data[0] != 0) From 436122ec93e850546ad64bffc99f91a57f247261 Mon Sep 17 00:00:00 2001 From: KDSKardabox Date: Sun, 23 Dec 2018 13:07:00 +0530 Subject: [PATCH 3/3] Add new line at EOL --- src/electric.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/electric.c b/src/electric.c index 7711053655..abb6c8dd88 100644 --- a/src/electric.c +++ b/src/electric.c @@ -1519,4 +1519,4 @@ static void sub_810B684(struct Sprite *sprite) gTasks[sprite->data[6]].data[sprite->data[7]]--; DestroySprite(sprite); } -} \ No newline at end of file +}