diff --git a/ld/gamefiles.inc b/ld/gamefiles.inc index e6bcf4ac6..2f4928c91 100644 --- a/ld/gamefiles.inc +++ b/ld/gamefiles.inc @@ -31,7 +31,7 @@ build/ROMID/game/game_0125a0.o (section); \ build/ROMID/game/game_012d50.o (section); \ build/ROMID/game/game_013010.o (section); \ - build/ROMID/game/game_013260.o (section); \ + build/ROMID/game/sparksreset.o (section); \ build/ROMID/game/weatherallocate.o (section); \ build/ROMID/game/game_013540.o (section); \ build/ROMID/game/game_013550.o (section); \ diff --git a/src/game/game_013260.c b/src/game/game_013260.c deleted file mode 100644 index 23352c2fc..000000000 --- a/src/game/game_013260.c +++ /dev/null @@ -1,50 +0,0 @@ -#include -#include "constants.h" -#include "game/data/data_000000.h" -#include "game/data/data_0083d0.h" -#include "game/data/data_00e460.h" -#include "game/data/data_0160b0.h" -#include "game/data/data_01a3a0.h" -#include "game/data/data_020df0.h" -#include "game/data/data_02da90.h" -#include "gvars/gvars.h" -#include "types.h" - -GLOBAL_ASM( -glabel func0f013260 -/* f013260: 3c01800a */ lui $at,%hi(var800a3fc0) -/* f013264: 3c03800a */ lui $v1,%hi(g_SparkGroups) -/* f013268: 3c02800a */ lui $v0,%hi(var800a4130) -/* f01326c: ac203fc0 */ sw $zero,%lo(var800a3fc0)($at) -/* f013270: 24424130 */ addiu $v0,$v0,%lo(var800a4130) -/* f013274: 24633fc8 */ addiu $v1,$v1,%lo(g_SparkGroups) -.L0f013278: -/* f013278: 24630024 */ addiu $v1,$v1,0x24 -/* f01327c: 1462fffe */ bne $v1,$v0,.L0f013278 -/* f013280: ac60ffe4 */ sw $zero,-0x1c($v1) -/* f013284: 3c01800a */ lui $at,%hi(var800a4130) -/* f013288: ac204130 */ sw $zero,%lo(var800a4130)($at) -/* f01328c: 3c018008 */ lui $at,%hi(g_SparksAreActive) -/* f013290: 03e00008 */ jr $ra -/* f013294: ac20f0b8 */ sw $zero,%lo(g_SparksAreActive)($at) -/* f013298: 00000000 */ sll $zero,$zero,0x0 -/* f01329c: 00000000 */ sll $zero,$zero,0x0 -); - -// Mismatch because the lui %hi instructions are swapped -//void func0f013260(void) -//{ -// struct sparkgroup *group; -// struct sparkgroup *end; -// var800a3fc0 = 0; -// end = &g_SparkGroups[10]; -// group = &g_SparkGroups[0]; -// -// while (group != end) { -// group->age = 0; -// group++; -// } -// -// var800a4130 = 0; -// g_SparksAreActive = 0; -//} diff --git a/src/game/game_167ae0.c b/src/game/game_167ae0.c index 55a96a90f..350b95ace 100644 --- a/src/game/game_167ae0.c +++ b/src/game/game_167ae0.c @@ -26,7 +26,7 @@ #include "game/game_012450.h" #include "game/game_0125a0.h" #include "game/game_013010.h" -#include "game/game_013260.h" +#include "game/sparksreset.h" #include "game/weatherallocate.h" #include "game/game_013540.h" #include "game/game_013550.h" @@ -365,7 +365,7 @@ void func0f167e7c(s32 stagenum) func0f0953cc(); func0f013010(); func0f013130(); - func0f013260(); + sparksReset(); weatherAllocate(); boostAndSlayerSfxStopAll(); diff --git a/src/game/sparksreset.c b/src/game/sparksreset.c new file mode 100644 index 000000000..5ef0c6cdd --- /dev/null +++ b/src/game/sparksreset.c @@ -0,0 +1,24 @@ +#include +#include "constants.h" +#include "game/data/data_000000.h" +#include "game/data/data_0083d0.h" +#include "game/data/data_00e460.h" +#include "game/data/data_0160b0.h" +#include "game/data/data_01a3a0.h" +#include "game/data/data_020df0.h" +#include "game/data/data_02da90.h" +#include "gvars/gvars.h" +#include "types.h" + +void sparksReset(void) +{ + s32 i; + var800a3fc0 = 0; + + for (i = 0; i < 10; i++) { + g_SparkGroups[i].age = 0; + } + + var800a4130 = 0; + g_SparksAreActive = false; +} diff --git a/src/game/weatherallocate.c b/src/game/weatherallocate.c index 26f921c3b..f1a8541e8 100644 --- a/src/game/weatherallocate.c +++ b/src/game/weatherallocate.c @@ -7,7 +7,6 @@ #include "game/data/data_01a3a0.h" #include "game/data/data_020df0.h" #include "game/data/data_02da90.h" -#include "game/game_013260.h" #include "game/weather.h" #include "gvars/gvars.h" #include "lib/lib_121e0.h" diff --git a/src/include/game/game_013260.h b/src/include/game/game_013260.h deleted file mode 100644 index 82768b596..000000000 --- a/src/include/game/game_013260.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef IN_GAME_GAME_013260_H -#define IN_GAME_GAME_013260_H -#include -#include "types.h" - -void func0f013260(void); - -#endif diff --git a/src/include/game/sparksreset.h b/src/include/game/sparksreset.h new file mode 100644 index 000000000..6cc169342 --- /dev/null +++ b/src/include/game/sparksreset.h @@ -0,0 +1,8 @@ +#ifndef IN_GAME_SPARKSRESET_H +#define IN_GAME_SPARKSRESET_H +#include +#include "types.h" + +void sparksReset(void); + +#endif