summaryrefslogtreecommitdiff
path: root/src/code_80086E70.c
diff options
context:
space:
mode:
authorTyler McGavran <tyler.taggerung@gmail.com>2023-03-29 20:52:15 -0400
committerGitHub <noreply@github.com>2023-03-29 18:52:15 -0600
commit782ed71f6135152697c6da5a232cef4aa1804d85 (patch)
treed6aeccc50bebbfa7c9319dfb6428a1b025c7e9ae /src/code_80086E70.c
parent8d118db0b25edfbabb059e4b977e339ca9d8f885 (diff)
Massive data relocation (#295)
Mostly relocating rodata from data/* files to the appropriate asm/nonmatching/* files, although there is some plain data relocating to be found in here too. Big change to note is the addition of the code_802AAA70.c file, split from memory.c. Based on some padding in the ro/data for memory it seems clear that a split is needed, although it is not clear that exact spot chosen for the split is correct. Still, it gets the file padding for the ro/data and text segments correct so it can't be too wrong. Also included is an update to the asm_processor tool to support the .hword directive. I made a PR to the main repo of that project with an identical change and it was accepted. Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Diffstat (limited to 'src/code_80086E70.c')
-rw-r--r--src/code_80086E70.c37
1 files changed, 5 insertions, 32 deletions
diff --git a/src/code_80086E70.c b/src/code_80086E70.c
index 59e543b41..611f2d522 100644
--- a/src/code_80086E70.c
+++ b/src/code_80086E70.c
@@ -9,6 +9,7 @@
#include "memory.h"
#include "code_80071F00.h"
#include "code_80086E70.h"
+#include "code_802AAA70.h"
void func_80086E70(s32 arg0) {
D_80165C18[arg0].unk_0AE = 1;// * 0xE0)) = 1;
@@ -848,26 +849,6 @@ UNUSED void func_8008900C(Player *player) {
player->unk_09C = 0.0f;
}
-#ifdef NEEDS_RODATA
-//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
-extern Player *gPlayerOne;
-extern s16 gCurrentCourseId; /* unable to generate initializer */
-// These are all .rodata
-extern f32 D_800EF4A0;
-extern f32 D_800EF4A4;
-extern f32 D_800EF4A8;
-extern f32 D_800EF4AC;
-extern f32 D_800EF4B0;
-extern f32 D_800EF4B4;
-extern f32 D_800EF4B8;
-extern f32 D_800EF4BC;
-extern f32 D_800EF4C0;
-extern f32 D_800EF4C4;
-extern f32 D_800EF4C8;
-extern f32 D_800EF4CC;
-extern f32 D_800EF4D0;
-extern f32 D_800EF4D4;
-
void func_80089020(s32 playerId, f32 *arg1) {
f32 var_f0;
f32 var_f2;
@@ -879,7 +860,7 @@ void func_80089020(s32 playerId, f32 *arg1) {
var_f2 = -*arg1;
}
if (player->unk_0BC & 0xC0) {
- if (gCurrentCourseId == 0x000C) {
+ if (gCurrentCourseId == COURSE_SHERBET_LAND) {
if (var_f2 <= 0.5) {
var_f0 = 0.025f;
} else if (var_f2 <= 2.0) {
@@ -900,7 +881,7 @@ void func_80089020(s32 playerId, f32 *arg1) {
var_f0 = 0.25f;
}
}
- } else if (gCurrentCourseId == 0x000C) {
+ } else if (gCurrentCourseId == COURSE_SHERBET_LAND) {
if (var_f2 <= 0.5) {
var_f0 = 0.025f;
} else if (var_f2 <= 2.0) {
@@ -916,16 +897,13 @@ void func_80089020(s32 playerId, f32 *arg1) {
} else if (var_f2 <= 3.0) {
var_f0 = 0.07f;
} else if (var_f2 <= 4.0) {
- var_f0 = 0.1f;
- } else {
var_f0 = 0.075f;
+ } else {
+ var_f0 = 0.1f;
}
}
f32_step_towards(arg1, 0.0f, var_f0);
}
-#else
-GLOBAL_ASM("asm/non_matchings/code_80086E70/func_80089020.s")
-#endif
#ifdef MIPS_TO_C
//generated by m2c commit 8267401fa4ef7a38942dcca43353cc1bcc6efabc
@@ -1360,8 +1338,6 @@ UNUSED void func_8008A610(s32 objectIndex) {
}
}
-#ifdef NEEDS_RODATA
-extern f64 D_800EF4F0;// = 500.0;
void func_8008A6DC(s32 objectIndex, f32 arg1) {
u16 var_a2;
s32 loopIndex;
@@ -1382,9 +1358,6 @@ void func_8008A6DC(s32 objectIndex, f32 arg1) {
}
}
}
-#else
-GLOBAL_ASM("asm/non_matchings/code_80086E70/func_8008A6DC.s")
-#endif
UNUSED void func_8008A810(s32 arg0) {
func_8008A6DC(arg0, 500.0f);