From 209b929eda0d1a98aaea90bec00f6f07c83ee5e9 Mon Sep 17 00:00:00 2001 From: petrie911 <69443847+petrie911@users.noreply.github.com> Date: Fri, 16 Feb 2024 16:04:22 -0600 Subject: [PATCH] Import main, context, and option bss. Refactor headers. Some enum cleanup. (#130) * stuff * fixes * addrs * new header * its bss time * format and such * fake symbols begone * whoops forgot pragmas --- .vscode/settings.json | 12 +- include/assets.h | 6 +- include/buffers.h | 15 + include/context.h | 354 ++++++++++++ include/fox_map.h | 13 +- include/fox_option.h | 25 +- include/functions.h | 66 +-- include/gfx.h | 4 + include/global.h | 17 +- include/i4.h | 1 - include/libc/math.h | 28 +- include/macros.h | 6 + include/sf64level.h | 21 +- include/sf64math.h | 16 + include/sf64object.h | 2 + include/sf64save.h | 68 +++ include/sf64thread.h | 88 ++- include/structs.h | 48 -- include/sys.h | 60 ++ include/variables.h | 547 +------------------ linker_scripts/us/symbol_addrs.txt | 25 +- linker_scripts/us/symbol_addrs_EBFBE0.txt | 209 +++---- linker_scripts/us/symbol_addrs_engine.txt | 10 +- linker_scripts/us/symbol_addrs_nlib_vars.txt | 10 +- linker_scripts/us/symbol_addrs_overlays.txt | 161 +++--- src/main/fox_97F80.c | 2 +- src/main/fox_context.c | 496 ++++++++++++++++- src/main/fox_enmy2.c | 18 +- src/main/fox_game.c | 2 +- src/main/fox_hud.c | 2 +- src/main/fox_play.c | 1 + src/main/fox_tank.c | 129 ++--- src/main/sys_1FA60.c | 2 +- src/main/sys_fault.c | 3 +- src/main/sys_joybus.c | 2 +- src/main/sys_lib.c | 28 +- src/main/sys_lights.c | 2 +- src/main/sys_main.c | 97 +--- src/main/sys_math.c | 3 +- src/main/sys_math64.c | 28 +- src/main/sys_matrix.c | 2 +- src/main/sys_memory.c | 3 +- src/main/sys_save.c | 2 +- src/main/sys_sprintf.c | 2 +- src/main/sys_timer.c | 2 +- src/overlays/ovl_i2/fox_me.c | 2 +- src/overlays/ovl_i2/fox_sx.c | 2 +- src/overlays/ovl_i4/fox_bo.c | 8 +- src/overlays/ovl_i4/fox_fo.c | 14 +- src/overlays/ovl_i4/fox_ka.c | 2 +- src/overlays/ovl_i4/fox_sz.c | 4 +- src/overlays/ovl_i5/fox_ma.c | 16 +- src/overlays/ovl_i5/fox_ti_cs.c | 2 +- src/overlays/ovl_i6/fox_andross.c | 7 +- src/overlays/ovl_i6/fox_sy.c | 2 +- src/overlays/ovl_menu/fox_map.c | 236 ++++---- src/overlays/ovl_menu/fox_option.c | 301 +++------- src/overlays/ovl_menu/fox_title.c | 3 +- yamls/us/main.yaml | 8 +- yamls/us/overlays.yaml | 6 +- 60 files changed, 1756 insertions(+), 1495 deletions(-) create mode 100644 include/buffers.h create mode 100644 include/context.h create mode 100644 include/sf64save.h create mode 100644 include/sys.h diff --git a/.vscode/settings.json b/.vscode/settings.json index 0ef8ac66..67636854 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -52,7 +52,17 @@ "prevent_bss_reordering2.h": "c", "ast_aq.h": "c", "ast_8e1f80.h": "c", - "fox_end2.inc" : "c" + "fox_end2.inc": "c", + "sf64thread.h": "c", + "gfx.h": "c", + "os.h": "c", + "math.h": "c", + "context.h": "c", + "sf64player.h": "c", + "sys.h": "c", + "fox_option_assets.h": "c", + "mods.h": "c", + "i5.h": "c" }, "C_Cpp_Runner.msvcBatchPath": "" } \ No newline at end of file diff --git a/include/assets.h b/include/assets.h index 77de00d6..d139775d 100644 --- a/include/assets.h +++ b/include/assets.h @@ -2,12 +2,8 @@ #ifndef ASSETS_H #define ASSETS_H -#include "libc/stdbool.h" -#include "sf64math.h" -#include "structs.h" -#include "gfx.h" +#include "sys.h" #include "sf64level.h" -#include "sf64thread.h" #include "sf64object.h" #include "sf64player.h" diff --git a/include/buffers.h b/include/buffers.h new file mode 100644 index 00000000..bde03717 --- /dev/null +++ b/include/buffers.h @@ -0,0 +1,15 @@ +#ifndef BUFFERS_H +#define BUFFERS_H + +#include "gfx.h" + +extern u64 gDramStack[]; +extern u8 gOSYieldData[]; +extern FrameBuffer gZBuffer; // z buffer +extern u8 gTaskOutputBuffer[]; +extern u8 gAudioDataBuffer[]; +extern u16 gTextureRenderBuffer[]; +extern u16 gFillBuffer[]; +extern FrameBuffer gFrameBuffers[]; // 8038F800 + +#endif diff --git a/include/context.h b/include/context.h new file mode 100644 index 00000000..8ccdf044 --- /dev/null +++ b/include/context.h @@ -0,0 +1,354 @@ +#ifndef CONTEXT_H +#define CONTEXT_H + +#include "sys.h" +#include "sf64level.h" +#include "sf64object.h" +#include "sf64player.h" + +extern s32 gOverlaySetup; +extern s32 gOverlayStage; +extern s32 D_80177824; // some sort of flag +extern s32 D_8017782C; // some sort of flag. all range related? +extern GameState gGameState; +extern s32 D_Timer_8017783C; // next game state timer? +extern s32 D_80177844; // timer for vs item spawn +extern OptionState gOptionMenuStatus; +extern s32 D_80177854; // pause-related state +extern s32 D_80177868; // some sort of state. pause-related? +extern LevelMode gLevelMode; +extern DrawMode gDrawMode; +extern s32 gPlayerNum; +extern s32 gCamCount; +extern s32 gTeamShields[6]; +extern s32 gSavedTeamShields[6]; +extern UNK_TYPE D_801778F0[6]; +extern s32 gTeamDamage[6]; +extern u8 D_80177930; // next planet path +extern f32 gGroundLevel; +extern f32 D_80177950; +extern f32 D_80177968; +extern f32 D_80177970; +extern f32 D_80177978; +extern f32 D_80177980; +extern f32 D_80177988; +extern f32 D_801779A0; +extern f32 D_801779B8; +extern f32 D_801779C0; +extern Vec3f D_801779D8; +extern Vec3f D_801779E8; +extern bool gExpertMode; +extern s32 D_80177A10[10]; +extern f32 D_80177A48[10]; +extern s32 gCsFrameCount; +extern u8 D_80177A98; +extern u8 D_80177AB0; +extern u8 D_80177AC8; +extern s32 D_80177AE0; +extern s32 gMainController; +extern s32 D_80177B40; +extern PlanetId gCurrentPlanet; // D_80177B48 // Arrow pointer? +extern s32 D_80177B50[7]; +extern s32 D_80177B70[7]; +extern PlanetId D_80177B90[7]; +extern s32 D_80177BB0[7]; +extern s32 D_80177BD8[22]; // overruns D_80177C30? +extern s32 D_80177C38[6]; +extern s32 D_80177C58[6]; +extern u8 gSoundMode; +extern s32 gVolumeSettings[3]; +extern u16 D_80177C90; +extern u8 gLevelType; +extern s32 D_80177CA0; +extern UNK_TYPE F_80177CA8; +extern f32 D_80177CB0; +extern UNK_TYPE F_80177CB8; +extern f32 D_80177CC0; +extern f32 D_80177CC8; +extern f32 D_80177CE8; +extern f32 D_80177D08; +extern f32 D_80177D20; +extern f32 D_80177D38; +extern f32 D_80177D50; +extern f32 D_80177D68; +extern UNK_TYPE F_80177D80; +extern UNK_TYPE F_80177DE8; +extern s32 gGameFrameCount; +extern s32 D_80177DC8; +extern s32 D_80177E70; +extern s32 D_80177E78; +extern s32 D_80177E80; +extern Vec3f D_80177E88; +extern Vec3f D_80177F10; +extern UNK_TYPE F_80178020; +extern s32 D_8017812C; +extern LevelId gCurrentLevel; +extern s32 D_8017827C; +extern s32 gBossActive; +extern s32 D_8017828C; +extern s32 D_80178294; +extern s32 gRadioState; +extern s32 D_801782A4; +extern s32 D_Timer_801782AC; +extern s32 D_Timer_801782B4; +// extern s32 D_801782B8; +extern s32 D_801782C0; +extern s32 D_801782C8; +extern s32 D_801782D0; +extern s32 D_801782D8; +extern UNK_TYPE F_801782E0; +extern s32 D_801782E8; +extern UNK_TYPE F_801782F0; +extern s32 D_801782F8; +extern s32 D_80178300; +extern u16* D_80178308; +extern ObjectInit* D_80178310; +extern s32 gFogRed; +extern s32 gFogGreen; +extern s32 gFogBlue; +extern s32 gFogAlpha; +extern s32 D_80178340; // alpha something +extern s32 D_80178348; // red something +extern s32 D_80178350; // green something +extern s32 D_80178354; // blue something +extern s32 D_80178358; // alpha target +extern s32 D_8017835C; // alpha step +extern s32 D_80178360; // 2 lights second color +extern s32 D_80178364; +extern s32 D_80178368; +extern f32 D_8017836C; // 2 lights second color brightness +extern f32 D_80178370; // Vec3f? +extern f32 D_80178374; +extern f32 D_80178378; +extern s32 D_8017837C; +extern u32 D_80178380[4]; // player alphas +extern s32 D_80178390[4]; // player reds +extern s32 D_801783A0[4]; // player greens +extern s32 D_801783B0[4]; // player alphas +extern UNK_TYPE D_801783C0[4]; +extern f32 D_801783D0; // something x translate +extern f32 D_801783D4; // something y translate +extern s32 gFogNear; //near +extern s32 gFogFar; //far +extern UNK_TYPE F_801783E0[12]; +extern s32 D_80178410; +extern f32 D_80178414; +extern f32 D_80178418; +extern UNK_TYPE F_8017841C; +extern f32 D_80178420; +extern f32 D_80178424; +extern f32 D_80178428; +extern f32 D_8017842C; +extern f32 D_80178430; +extern UNK_TYPE F_80178434; +extern UNK_TYPE F_80178438; +extern UNK_TYPE F_8017843C; +extern f32 D_80178440; +extern f32 D_80178444; +extern f32 D_80178448; +extern f32 D_80178450[3]; +extern f32 D_80178460[3]; +extern f32 D_80178470[3]; +extern f32 D_8017847C; +extern s32 D_80178480; +extern s32 D_80178484; +extern bool D_80178488; +extern UNK_TYPE F_8017848C; +extern UNK_TYPE F_80178490; +extern s32 D_80178494; +extern f32 D_80178498; +extern f32 D_8017849C; +extern f32 D_801784A0; +extern s32 D_801784A4; +extern UNK_TYPE F_801784A8; +extern s32 D_801784AC; +extern UNK_TYPE F_801784B0; +extern UNK_TYPE F_801784B4; +extern f32 D_801784B8; // effective Vec3f +extern f32 D_801784BC; +extern f32 D_801784C0; +extern f32 D_801784C4; // effective Vec3f +extern f32 D_801784C8; +extern f32 D_801784CC; +extern f32 D_801784D0; // effective Vec3f +extern f32 D_801784D4; +extern f32 D_801784D8; +extern s32 gLight1x; // Vec3i light direction +extern s32 gLight1y; +extern s32 gLight1z; +extern f32 D_801784E8; +extern f32 D_801784EC; // effective Vec3f? +extern f32 D_801784F0; +extern f32 D_801784F4; +extern f32 D_801784F8; // effective Vec3f +extern f32 D_801784FC; +extern f32 D_80178500; +extern s32 gLight2x; // Vec3i light direction alternate +extern s32 gLight2y; +extern s32 gLight2z; +extern f32 D_80178510; +extern UNK_TYPE F_801784514; +extern UNK_TYPE F_801784518; +extern UNK_TYPE F_80178451C; +extern f32 D_80178520; // effective Vec3f +extern f32 D_80178524; +extern f32 D_80178528; +extern UNK_TYPE F_80178452C; +extern UNK_TYPE F_801784530; +extern UNK_TYPE F_801784534; +extern f32 D_80178538; +extern f32 D_8017853C; +extern s32 D_80178540; +extern s32 D_80178544; +extern s32 gLight1R; // Color32 light color 1 +extern s32 gLight1G; +extern s32 gLight1B; +extern s32 gAmbientR; // Color32 ambient color +extern s32 gAmbientG; +extern s32 gAmbientB; +extern UNK_TYPE F_801784560; +extern s32 gLight2R; // Color32 light color 2 +extern s32 gLight2G; +extern s32 gLight2B; +extern s32 D_80178570; // Color32 light color 2 modifier? +extern s32 D_80178574; +extern s32 D_80178578; +extern s32 D_80161A70; // Color32? +extern s32 D_80161A74; +extern s32 D_80161A78; +extern s32 D_80161A7C; +extern s32 D_80161A80; +extern s32 D_80161A84; +extern s32 D_80161A88; +extern s32 D_80161A8C; +extern u8 gGoldRingCount[4]; +extern u8 D_80161A94[4]; +extern s32 gHitCount; +extern s32 gSavedHitCount; +extern s16 gLifeCount[4]; +extern LaserStrength gLaserStrength[4]; +extern s32 D_80161AB8; +extern UNK_TYPE F_80161AC0[16]; +extern Object_80 gObjects80[50]; +extern Object_4C gObjects4C[40]; +extern Actor gActors[60]; +extern Boss gBosses[4]; +extern Effect gEffects[100]; +extern Item gItems[20]; +extern PlayerShot gPlayerShots[16]; +extern UnkEntity30 gUnkEntities30[100]; +extern UnkEntity28 gUnkEntities28[65]; +extern BonusText gBonusText[10]; +extern s32 D_80176550[2]; +extern f32 D_80176558[2][100]; +extern f32 D_80176878[2][100]; +extern f32 D_80176B98[2][100]; +extern f32 D_80176EB8[2][100]; +extern f32 D_801771D8[2][100]; +extern f32 D_80177500[2][100]; +extern u16 D_80177828; // enemy shot speed? +extern u8 D_80177830; // show level complete status overlay +extern s32 D_80177838; // level clear related +extern s32 D_80177840; // timer for mission accomplished scrren +extern s32 gBossHealthBar; +extern s32 D_80177850; // bonus text related. set to 15 but never read +extern s32 D_80177858[4]; +extern s32 D_80177870[4]; +extern s32 gHandicap[4]; +extern VsStage gVersusStage; +extern s32 D_801778A4; +extern s32 D_801778AC; +extern s32 D_801778C8; +extern bool gVersusMode; +extern u16 gBoostButton[4]; +extern u16 gBrakeButton[4]; +extern u16 gShootButton[4]; +extern u16 gBombButton[4]; +extern f32 D_80177958[4]; +extern s32 D_8017796C; +extern OSContPad* gInputHold; +extern OSContPad* gInputPress; +extern u8* D_80177984; +extern s32 D_80177990[4]; +extern f32 D_801779A8[4]; +extern u8 D_801779BC; +extern s32 gChargeTimers[4]; +extern f32 D_801779E4; +extern f32 D_801779F4; +extern s32 D_Timer_80177A00[4]; +extern s32 D_Timer_80177A38[4]; +extern s32 D_Timer_80177A70[4]; +extern s32 D_Timer_80177A88[4]; +extern f32 D_80177AA0[4]; +extern f32 D_80177AB8[4]; +extern s32 D_80177AD0[4]; +extern s32 D_80177AE8[4]; +extern s32 D_80177B00[4][4]; +extern u8 D_Timer_80177B44; +extern u8 D_80177B4C; +extern u8 D_80177B6C; +extern u8 D_80177B8C; +extern u8 D_80177BAC; +extern u16 D_Timer_80177BD0[4]; +extern u16 D_80177C30[4]; +extern s32 D_80177C50; +extern s32 D_80177C70; +extern s32 D_80177C78; +extern s32 D_80177C8C; +extern s32 D_80177C94; +extern s32 D_80177C9C; +extern s32 D_80177CA4; +extern s32 D_80177CAC; +extern s32 D_80177CB4; +extern s32 D_80177CBC; +extern s32 D_80177CC4; +extern s32 D_80177CD0[6]; +extern s32 D_80177CF0[6]; +extern s32 gRightWingHealth[4]; +extern s32 gLeftWingHealth[4]; +extern s32 D_80177D40[4]; +extern s32 D_80177D58[4]; +extern s32 D_80177D70[4]; +extern s32 D_80177D88[4]; +extern s32 gBombCount[4]; +extern s32 D_80177DB8[4]; +extern s32 D_80177DD0[4][10]; +extern s32 D_80177E74; +extern s32 D_80177E7C; +extern s32 D_80177E84; +extern Vec3f D_80177E98[10]; +extern f32 D_80177F20[65]; +extern f32 D_80178028[65]; +extern f32 D_80178130[65]; +extern u8 D_80178238[65]; +extern Player* gPlayer; +extern f32* D_80178288; +extern f32* D_80178290; +extern u32* D_80178298; +extern UNK_TYPE F_801782A0; +extern Object_58* gObjects58; +extern UNK_TYPE F_801782B0; +extern s32 D_801782B8; +extern s32 D_801782BC; +extern PosRot* D_801782C4; +extern f32* D_801782CC; +extern f32* D_801782D4; +extern f32* D_801782DC; +extern f32* D_801782E4; +extern f32* D_801782EC; +extern UNK_TYPE F_801782F4; +extern s32 D_801782FC; +extern UNK_TYPE F_80178304; +extern UNK_TYPE F_8017830C; +extern UNK_TYPE F_80178314; +extern UNK_TYPE F_80178318; +extern UNK_TYPE F_8017831C; +extern UNK_TYPE F_80178324; +extern UNK_TYPE F_8017832C; +extern UNK_TYPE F_80178334; +extern UNK_TYPE F_8017833C; +extern UNK_TYPE F_80178344; +extern UNK_TYPE F_8017834C; + + +#endif diff --git a/include/fox_map.h b/include/fox_map.h index 9b23fd5a..15e3a51b 100644 --- a/include/fox_map.h +++ b/include/fox_map.h @@ -2,6 +2,7 @@ #define FOX_MAP_H #include "PR/ultratypes.h" +#include "sf64level.h" typedef struct { /* 0x0 */ f32 angle; @@ -12,8 +13,8 @@ typedef struct { typedef struct { /* 0x00 */ s32 unk_00; - /* 0x04 */ s32 unk_04; - /* 0x08 */ s32 unk_08; + /* 0x04 */ PlanetId unk_04; + /* 0x08 */ PlanetId unk_08; /* 0x0C */ s32 unk_0C; /* 0x10 */ char pad10[0x4]; /* 0x14 */ s32 unk_14; @@ -21,7 +22,7 @@ typedef struct { } UnkStruct_D_menu_801AFD18; // size = 0x1C typedef struct { - /* 0x00 */ s32 id; + /* 0x00 */ PlanetId id; /* 0x04 */ f32 unk_04; /* 0x08 */ f32 unk_08; /* 0x0C */ f32 zAngle; @@ -30,9 +31,9 @@ typedef struct { /* 0x20 */ f32 scale; /* 0x24 */ s32 alpha; /* 0x28 */ s32 unk_28; - /* 0x2C */ s32 unk_2C; - /* 0x30 */ s32 unk_30; - /* 0x34 */ s32 unk_34; + /* 0x2C */ PlanetId unk_2C; + /* 0x30 */ PlanetId unk_30; + /* 0x34 */ PlanetId unk_34; } Planet; // size = 0x38 typedef struct { diff --git a/include/fox_option.h b/include/fox_option.h index a23058db..488113bf 100644 --- a/include/fox_option.h +++ b/include/fox_option.h @@ -45,17 +45,17 @@ typedef struct { /* 0x5C */ s32 unk_5C; } OptionEntry; // size = 0x60 +typedef struct { + /* 0x0 */ PlanetId unk_0; + /* 0x4 */ PlanetId unk_4; + /* 0x8 */ s32 unk_8; +} UnkStruct_D_menu_801AED4C; // size = 0xC + typedef struct { s32 unk_0; s32 unk_4; } UnkStruct_D_menu_801B9250; -typedef struct { - /* 0x0 */ s32 unk_0; - /* 0x4 */ s32 unk_4; - /* 0x8 */ s32 unk_8; -} UnkStruct_D_menu_801AED4C; // size = 0xC - typedef enum OptionId { OPTION_MAIN = 1000, OPTION_VERSUS_STAGE = 2000, @@ -123,13 +123,10 @@ void func_menu_8018FC14(void); void func_menu_8018FD08(void); void func_menu_8018FF74(void); - -void Option_Setup(void); void Option_UpdateEntry(void); void Option_MapUpdate(void); void Option_MainMenuUpdate(void); void Option_TrainingUpdate(void); -void func_menu_801929F0(void); void Option_MainMenuDraw(void); void Option_VersusUpdate(void); void Option_VersusDraw(void); @@ -166,7 +163,7 @@ void func_menu_80198608(s32, s32, f32, f32); void func_menu_8019882C(s32, s32, f32, f32); void func_menu_8019896C(s32, f32, s32); void func_menu_80199198(f32 arg0, f32 arg1, f32 arg2); -s32 func_menu_80199284(s32 arg0, s32 arg1); +s32 func_menu_80199284(PlanetId start, PlanetId end); void Option_VersusMenuInit(void); void Option_VersusMenuUpdate(void); void func_menu_8019949C(void); @@ -191,20 +188,22 @@ void func_menu_8019AFFC(void); void func_menu_8019B1F8(void); void func_menu_8019B3DC(void); void func_menu_8019B5AC(void); +void func_menu_8019B6D8(f32 xPos, f32 yPos, f32 offset, s32 r, s32 g, s32 b); void func_menu_8019B7D4(void); void func_menu_8019B8A0(s32 arg0); void func_menu_8019B8C8(void); void Option_DrawMenuLabel(void); -void func_menu_8019BDF0(void); void Option_DrawMenuCard(MenuContext_38 arg0); void Option_DrawMenuArwing(ArwingPosition arg0); void func_menu_8019BC44(f32, f32, f32, f32, f32, f32); +void func_menu_8019BDF0(void); void func_menu_8019BE7C(f32, f32, f32, f32 *, f32 *, f32 *); void func_menu_8019BF34(void); -void func_menu_8019B6D8(f32 xPos, f32 yPos, f32 offset, s32 r, s32 g, s32 b); void func_menu_8019C04C(void); void Option_DrawCardLabel(OptionTexture arg0); s32 func_menu_8019C418(s32* arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7, UnkStruct_D_menu_801B9250* arg8); +s32 func_menu_8019C5A0(s32*); +s32 func_menu_8019C66C(f32* arg0, f32 arg1, f32 arg2, UnkStruct_D_menu_801B9250* arg3); void func_menu_8019C824(f32* ); s32 func_menu_8019C8C4(void); void func_menu_8019CAE0(void); @@ -220,8 +219,6 @@ void func_menu_8019DF64(void); void Option_InvoiceUpdate(void); void Option_InvoiceDraw(void); -s32 func_menu_8019C5A0(s32*); -s32 func_menu_8019C66C(f32* arg0, f32 arg1, f32 arg2, UnkStruct_D_menu_801B9250* arg3); void func_menu_8019E8D0(void); void func_menu_801A07E8(u8*, u8*, f32*); void func_menu_801AD7EC(s32, s32, s32); diff --git a/include/functions.h b/include/functions.h index 4321c631..70626a27 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1,22 +1,13 @@ #ifndef FUNCTIONS_H #define FUNCTIONS_H -#include "libc/stdbool.h" +#include "sys.h" #include "structs.h" #include "sf64object.h" -#include "sf64thread.h" #include "sf64player.h" #include "sf64mesg.h" -s32 Lib_vsPrintf(char* dst, const char* fmt, va_list args); -void Lib_Perspective(Gfx** dList); -void Lib_Ortho(Gfx** dList); -void Lib_DmaRead(void* src, void* dst, s32 size); -void Lib_FillScreen(u8 setFill); - -void Memory_FreeAll(void); -void* Memory_Allocate(s32); - +// audio void func_8000FFCC(void); void func_80016A50(void); @@ -64,38 +55,6 @@ void func_8001DECC(void); SPTask* func_8001DF50(void); void func_8001EE00(void); -f32 func_8001FE60(f32); -f64 func_8001FE6C(f64); -s32 func_8001FE78(f32); -s32 func_8001FE88(f64); -f32 func_8001FE98(f32); -f64 func_8001FEA4(f64); -s32 func_8001FEB0(f32); -s32 func_8001FEC0(f64); -f32 func_8001FED0(f32); -f64 func_8001FEDC(f64); -s32 func_8001FEE8(f32); -s32 func_8001FEF8(f64); -f32 func_8001FF08(f32); -f64 func_8001FF14(f64); -s32 func_8001FF20(f32); -s32 func_8001FF30(f64); -f32 func_8001FF40(f32); -f64 func_8001FF5C(f64); -s32 func_8001FF7C(f32); -s32 func_8001FF9C(f64); -f32 func_8001FAE4(f32); -f32 func_8001FB04(f32); -f64 func_8001FB24(f64); -f32 func_8001FB58(f32); -f32 func_8001FB88(f32); -f32 func_8001FBA8(f32); -f32 func_8001FBC8(f32); - -void RdRam_CheckIPL3(void); -void Mio0_Decompress(void* header, u8* dst); -s32 vsprintf(char* dst, const char* fmt, va_list args); - // fox_360 void func_8002ED60(Player*); void func_8002E3E0(Actor*); @@ -467,7 +426,6 @@ void func_80084488(s32); void func_80084688(s32, s32); // fox_hud - void func_80084B94(s32); void func_800857DC(f32, f32, f32, f32); void func_80085890(f32, f32, f32, f32); @@ -522,19 +480,6 @@ void func_80098860(Plane* plane, Vec3f* point, Vec3f* normal); s32 func_800988B4(Vec3f* vec, Plane* plane); s32 func_800998FC(Vec3f*, Vec3f*, Vec3f*, s32, Vec3f*, f32*); -// fox_game -void Game_Initialize(void); -void Game_SetGameState(void); -bool func_800A1B6C(void); -void func_800A1C14(Gfx**); -void func_800A1E68(Gfx**); -void func_800A1F44(void); -void func_800A1FB0(Gfx**, u8 , u8); -void func_800A24DC(s32); -void func_800A26C0(void); -void func_800A25DC(void); -Actor* func_800A3608(ObjectId); - // fox_A4290 bool func_800A3690(Vec3f*, Vec3f*, s32, Vec3f*); @@ -596,9 +541,6 @@ void Radio_PlayMessage(u16*, RadioCharacterId); void func_800BB388(void); void func_800BB5D0(void); -// fox_reset -void Graphics_NMIWipe(void); - // fox_versus s32 func_800C1E9C(void); void func_800C1ED4(void); @@ -606,10 +548,6 @@ void func_800C20B0(void); void func_800C2190(void); void func_800C26C8(void); -// fox_save -s32 Save_Write(void); -s32 Save_Read(void); - void func_menu_80187520(u32, void*); void func_menu_8019E8D0(void); diff --git a/include/gfx.h b/include/gfx.h index ee9750c6..72a4f750 100644 --- a/include/gfx.h +++ b/include/gfx.h @@ -62,6 +62,8 @@ typedef struct Limb { /* 0x01C */ struct Limb* child; } Limb; // size = 0x20 +void Graphics_NMIWipe(void); + void Lights_SetOneLight(Gfx** dList, s32 dirX, s32 dirY, s32 dirZ, s32 colR, s32 colG, s32 colB, s32 ambR, s32 ambG, s32 ambB); void Lights_SetTwoLights(Gfx** dList, s32 dir1x, s32 dir1y, s32 dir1z, s32 dir2x, s32 dir2y, s32 dir2z, s32 col1r, s32 col1g, s32 col1b, s32 col2r, s32 col2g, s32 col2b, s32 ambR, s32 ambG, s32 ambB); @@ -255,5 +257,7 @@ typedef enum SetupDL { } SetupDL; extern Gfx gSetupDLs[SETUPDL_MAX][9]; // 0x800D31B0 +extern u8 D_80178580[]; +extern void* D_80178710; #endif diff --git a/include/global.h b/include/global.h index 611dc25f..18273a67 100644 --- a/include/global.h +++ b/include/global.h @@ -1,27 +1,16 @@ #ifndef GLOBAL_H #define GLOBAL_H -#include "PR/xstdio.h" -#include "PR/os_internal.h" -#include "PR/controller.h" -#include "libultra/ultra64.h" -#include "libc/math.h" -#include "libc/stdarg.h" -#include "libc/stdbool.h" -#include "libc/stdint.h" -#include "libc/stddef.h" -#include "libc/string.h" +#include "sys.h" + #include "functions.h" #include "variables.h" +#include "context.h" #include "structs.h" -#include "macros.h" -#include "sf64math.h" #include "sf64mesg.h" #include "sf64object.h" #include "sf64level.h" -#include "sf64thread.h" #include "sf64player.h" -#include "gfx.h" #include "i1.h" #include "i2.h" #include "i3.h" diff --git a/include/i4.h b/include/i4.h index c521d5b9..2c9f51a4 100644 --- a/include/i4.h +++ b/include/i4.h @@ -9,7 +9,6 @@ #include "sf64mesg.h" extern Matrix D_i4_8019EE80; -extern s32 D_i4_801A03DC; void func_i4_8018EF6C(Player*); void func_i4_8018F94C(Player*); diff --git a/include/libc/math.h b/include/libc/math.h index 129d9684..0e63d99b 100644 --- a/include/libc/math.h +++ b/include/libc/math.h @@ -6,19 +6,12 @@ #define M_PI 3.14159265358979323846f #define M_DTOR (M_PI / 180.0f) #define M_RTOD (180.0f / M_PI) -#define M_DTOD 1.0f #define M_SQRT2 1.41421356237309504880f #define M_SQRT1_2 0.70710678118654752440f /* 1/sqrt(2) */ #define FLT_MAX 340282346638528859811704183484516925440.0f #define SHT_MAX 32767.0f #define SHT_MINV (1.0f / SHT_MAX) -#define RAD_TO_DEG(radians) (((radians) * 180.0f) / M_PI) -#define DEG_TO_RAD(degrees) (((degrees) / 180.0f) * M_PI) - -#define SIN_DEG(angle) __sinf((M_DTOR)*(angle)) -#define COS_DEG(angle) __cosf((M_DTOR)*(angle)) - typedef union { struct { u32 hi; @@ -53,4 +46,25 @@ float sqrtf(float f); double sqrt(double d); #pragma intrinsic(sqrt) +f32 __floorf(f32); +f64 __floor(f64); +s32 __lfloorf(f32); +s32 __lfloor(f64); +f32 __ceilf(f32); +f64 __ceil(f64); +s32 __lceilf(f32); +s32 __lceil(f64); +f32 __truncf(f32); +f64 __trunc(f64); +s32 __ltruncf(f32); +s32 __ltrunc(f64); +f32 __roundf(f32); +f64 __round(f64); +s32 __lroundf(f32); +s32 __lround(f64); +f32 __nearbyintf(f32); +f64 __nearbyint(f64); +s32 __lnearbyintf(f32); +s32 __lnearbyint(f64); + #endif diff --git a/include/macros.h b/include/macros.h index 0474f68e..6205e298 100644 --- a/include/macros.h +++ b/include/macros.h @@ -25,6 +25,12 @@ #define DOT_XYZ(a, b) ((a).x * (b).x + (a).y * (b).y + (a).z * (b).z) #define ABS(x) ((x) >= 0 ? (x) : -(x)) +#define RAD_TO_DEG(radians) (((radians) * 180.0f) / M_PI) +#define DEG_TO_RAD(degrees) (((degrees) / 180.0f) * M_PI) + +#define SIN_DEG(angle) __sinf((M_DTOR)*(angle)) +#define COS_DEG(angle) __cosf((M_DTOR)*(angle)) + #define USEC_TO_CYCLES(n) (((u64)(n)*(osClockRate/15625LL))/(1000000LL/15625LL)) #define MSEC_TO_CYCLES(n) (USEC_TO_CYCLES((n) * 1000LL)) diff --git a/include/sf64level.h b/include/sf64level.h index f89a303d..5fd18853 100644 --- a/include/sf64level.h +++ b/include/sf64level.h @@ -90,16 +90,17 @@ typedef enum LevelId { } LevelId; typedef enum PlanetId { - /* 0 */ PLANET_METEO, - /* 1 */ PLANET_AREA_6, - /* 2 */ PLANET_BOLSE, - /* 3 */ PLANET_SECTOR_Z, - /* 4 */ PLANET_SECTOR_X, - /* 5 */ PLANET_SECTOR_Y, - /* 6 */ PLANET_KATINA, - /* 7 */ PLANET_MACBETH, - /* 8 */ PLANET_ZONESS, - /* 9 */ PLANET_CORNERIA, + /* -1 */ PLANET_NONE=-1, + /* 0 */ PLANET_METEO, + /* 1 */ PLANET_AREA_6, + /* 2 */ PLANET_BOLSE, + /* 3 */ PLANET_SECTOR_Z, + /* 4 */ PLANET_SECTOR_X, + /* 5 */ PLANET_SECTOR_Y, + /* 6 */ PLANET_KATINA, + /* 7 */ PLANET_MACBETH, + /* 8 */ PLANET_ZONESS, + /* 9 */ PLANET_CORNERIA, /* 10 */ PLANET_TITANIA, /* 11 */ PLANET_AQUAS, /* 12 */ PLANET_FORTUNA, diff --git a/include/sf64math.h b/include/sf64math.h index f68c02a1..ba2df34b 100644 --- a/include/sf64math.h +++ b/include/sf64math.h @@ -40,6 +40,14 @@ typedef union { // u64 force_struct_alignment; } Matrix; // size = 0x40 +extern Mtx gIdentityMtx; // 800C4620 +extern Matrix gIdentityMatrix; //800C4660 + +extern Matrix* gGfxMatrix; +extern Matrix sGfxMatrixStack[0x20]; +extern Matrix* gCalcMatrix; +extern Matrix sCalcMatrixStack[0x20]; + f32 Math_ModF(f32 value, f32 mod); void Rand_Init(void); f32 Rand_ZeroOne(void); @@ -89,4 +97,12 @@ s64 __ull_div(s64, s64); s64 __ll_mul(s64, s64); s64 __ll_rshift(s64, s64); +f32 Math_FloorF(f32); +f32 Math_CeilF(f32); +f64 Math_Fabs(f64); +f32 Math_FabsF(f32); +f32 Math_NearbyIntF(f32); +f32 Math_TruncF(f32); +f32 Math_RoundF(f32); + #endif diff --git a/include/sf64object.h b/include/sf64object.h index 312d3dc5..26f0a8c1 100644 --- a/include/sf64object.h +++ b/include/sf64object.h @@ -703,6 +703,8 @@ typedef enum ObjectId { #define OBJ_UNK_1000 1000 +Actor* func_800A3608(ObjectId); + // template enums for boss work buffers typedef enum { diff --git a/include/sf64save.h b/include/sf64save.h new file mode 100644 index 00000000..7be617a8 --- /dev/null +++ b/include/sf64save.h @@ -0,0 +1,68 @@ +#ifndef SF64_SAVE +#define SF64_SAVE + +#include "PR/ultratypes.h" + +typedef struct { + /* bit 0 */ u8 unk_0 : 3; + /* bit 3 */ u8 expertMedal : 1; + /* bit 4 */ u8 expertClear : 1; + /* bit 5 */ u8 played : 1; + /* bit 6 */ u8 normalMedal : 1; + /* bit 7 */ u8 normalClear : 1; +} PlanetData; // size = 0x1 + +typedef struct { + /* bit 0 */ u16 unk_0 : 8; + /* bit 8 */ u16 unk_8 : 4; + /* bit C */ u16 unk_C : 1; + /* bit D */ u16 unk_D : 1; + /* bit E */ u16 unk_E : 1; + /* bit F */ u16 unk_F : 1; +} Save_SubStruct_5E; // size = 0x10 + +typedef struct{ + /* 0x00 */ PlanetData planet[16]; + /* 0x10 */ char pad10[0x4]; + /* 0x14 */ u8 soundMode; + /* 0x15 */ u8 musicVolume; + /* 0x16 */ u8 voiceVolume; + /* 0x17 */ u8 sfxVolume; + /* 0x18 */ u8 unk_18[10][3]; + /* 0x36 */ u8 unk_36[10]; + /* 0x40 */ u8 unk_40[10]; + /* 0x4A */ u16 unk_4A[10]; + /* 0x5E */ Save_SubStruct_5E unk_5E[10][7]; + /* 0xEA */ u8 unk_EA; + /* 0xEB */ char padEB[0x3]; + /* 0xEE */ char padEE[0x10]; +} SaveData; // size = 0xFE + +typedef struct { + /* 0x00 */ union { + u8 raw[sizeof(SaveData)]; + SaveData data; + }; + /* 0xFE */ u16 checksum; +} Save; // size = 0x100 + +typedef struct { + /* 0x000 */ Save save; + /* 0x100 */ Save backup; +} SaveFile; // size = 0x200 + +s32 Save_Write(void); +s32 Save_Read(void); + +void Save_ReadData(void); +void Save_WriteData(void); + +s32 Save_WriteEeprom(SaveFile*); +s32 Save_ReadEeprom(SaveFile*); + +extern SaveFile gSaveIOBuffer; +extern SaveFile sPrevSaveData; +extern Save gDefaultSave; +extern SaveFile gSaveFile; + +#endif diff --git a/include/sf64thread.h b/include/sf64thread.h index 8fcb87c9..407d0f72 100644 --- a/include/sf64thread.h +++ b/include/sf64thread.h @@ -70,8 +70,6 @@ typedef struct { void Controller_Init(void); void Controller_UpdateInput(void); void Controller_ReadData(void); -void Save_ReadData(void); -void Save_WriteData(void); void Controller_Rumble(void); s32 Timer_CreateTask(u64, TimerAction, s32*, s32); @@ -80,9 +78,6 @@ void Timer_SetValue(s32* address, s32 value); void Timer_CompleteTask(TimerTask*); void Timer_Wait(u64); -s32 Save_WriteEeprom(SaveFile*); -s32 Save_ReadEeprom(SaveFile*); - void Fault_ThreadEntry(void*); void func_80007FE4(FrameBuffer*, u16, u16); void Fault_Init(void); @@ -97,6 +92,89 @@ typedef enum { /* 16 */ SI_CONT_READ_DONE, } SerialMesg; +extern OSContPad gControllerHold[4]; +extern OSContPad gControllerPress[4]; +extern u8 gControllerPlugged[4]; +extern u32 gControllerLock; +extern u8 gControllerRumble[4]; +extern OSContPad sNextController[4]; // +extern OSContPad sPrevController[4]; // +extern OSContStatus sControllerStatus[4]; // +extern OSPfs sControllerMotor[4]; // + +extern u8 gAudioThreadStack[0x1000]; // 800DDAA0 +extern OSThread gGraphicsThread; // 800DEAA0 +extern u8 gGraphicsThreadStack[0x1000]; // 800DEC50 +extern OSThread gTimerThread; // 800DFC50 +extern u8 gTimerThreadStack[0x1000]; // 800DFE00 +extern OSThread gSerialThread; // 800E0E00 +extern u8 gSerialThreadStack[0x1000]; // 800E0FB0 + +extern SPTask* gCurrentTask; +extern SPTask* sAudioTasks[1]; +extern SPTask* sGfxTasks[2]; +extern SPTask* sNewAudioTasks[1]; +extern SPTask* sNewGfxTasks[2]; +extern u32 gSegments[16]; // 800E1FD0 +extern OSMesgQueue gPiMgrCmdQueue; // 800E2010 +extern OSMesg sPiMgrCmdBuff[50]; // 800E2028 + +extern OSMesgQueue gDmaMsgQueue; +extern void* sDmaMsgBuff[1]; +extern OSIoMesg gDmaIOMsg; +extern OSMesgQueue gSerialEventQueue; +extern void* sSerialEventBuff[1]; +extern OSMesgQueue gMainThreadMsgQueue; +extern void* sMainThreadMsgBuff[32]; +extern OSMesgQueue gTaskMsgQueue; +extern void* sTaskMsgBuff[16]; +extern OSMesgQueue gAudioVImsgQueue; +extern void* sAudioVImsgBuff[1]; +extern OSMesgQueue gAudioTaskMsgQueue; +extern void* sAudioTaskMsgBuff[1]; +extern OSMesgQueue gGfxVImsgQueue; +extern void* sGfxVImsgBuff[4]; +extern OSMesgQueue gGfxTaskMsgQueue; +extern void* sGfxTaskMsgBuff[2]; +extern OSMesgQueue gSerialThreadMsgQueue; +extern void* sSerialThreadMsgBuff[8]; +extern OSMesgQueue gControllerMsgQueue; +extern void* sControllerMsgBuff[1]; +extern OSMesgQueue gSaveMsgQueue; +extern void* sSaveMsgBuff[1]; +extern OSMesgQueue gTimerTaskMsgQueue; +extern void* sTimerTaskMsgBuff[16]; +extern OSMesgQueue gTimerWaitMsgQueue; +extern void* sTimerWaitMsgBuff[1]; + +extern GfxPool gGfxPools[2]; // 800E23B0 + +extern GfxPool* gGfxPool; +extern SPTask* gGfxTask; +extern Vp* gViewport; +extern Mtx* gGfxMtx; +extern Gfx* gUnkDisp1; +extern Gfx* gMasterDisp; +extern Gfx* gUnkDisp2; +extern Lightsn* gLight; +extern FrameBuffer* gFrameBuffer; +extern u16* gTextureRender; + +extern u8 D_80137E78; +extern u32 gSysFrameCount; +extern u8 gStartNMI; +extern u8 gStopTasks; +extern u8 D_80137E84[4]; +extern u16 gFillScreenColor; +extern u16 gFillScreen; + +extern u8 gUnusedStack[0x1000]; +extern OSThread sIdleThread; // 80138E90 +extern u8 sIdleThreadStack[0x1000]; // 801390A0 +extern OSThread gMainThread; // 8013A040 +extern u8 sMainThreadStack[0x1000]; // 8013A1F0 +extern OSThread gAudioThread; //8013B1F0 + #define MSG_QUEUE_EMPTY -1 #define FAULT_MESG_BREAK 1 diff --git a/include/structs.h b/include/structs.h index 618d4281..38f2cae8 100644 --- a/include/structs.h +++ b/include/structs.h @@ -6,54 +6,6 @@ #define UNK_TYPE s32 -typedef struct { - /* bit 0 */ u8 unk_0 : 3; - /* bit 3 */ u8 expertMedal : 1; - /* bit 4 */ u8 expertClear : 1; - /* bit 5 */ u8 played : 1; - /* bit 6 */ u8 normalMedal : 1; - /* bit 7 */ u8 normalClear : 1; -} PlanetData; // size = 0x1 - -typedef struct { - /* bit 0 */ u16 unk_0 : 8; - /* bit 8 */ u16 unk_8 : 4; - /* bit C */ u16 unk_C : 1; - /* bit D */ u16 unk_D : 1; - /* bit E */ u16 unk_E : 1; - /* bit F */ u16 unk_F : 1; -} Save_SubStruct_5E; // size = 0x10 - -typedef struct{ - /* 0x00 */ PlanetData planet[16]; - /* 0x10 */ char pad10[0x4]; - /* 0x14 */ u8 soundMode; - /* 0x15 */ u8 musicVolume; - /* 0x16 */ u8 voiceVolume; - /* 0x17 */ u8 sfxVolume; - /* 0x18 */ u8 unk_18[10][3]; - /* 0x36 */ u8 unk_36[10]; - /* 0x40 */ u8 unk_40[10]; - /* 0x4A */ u16 unk_4A[10]; - /* 0x5E */ Save_SubStruct_5E unk_5E[10][7]; - /* 0xEA */ u8 unk_EA; - /* 0xEB */ char padEB[0x3]; - /* 0xEE */ char padEE[0x10]; -} SaveData; // size = 0xFE - -typedef struct { - /* 0x00 */ union { - u8 raw[sizeof(SaveData)]; - SaveData data; - }; - /* 0xFE */ u16 checksum; -} Save; // size = 0x100 - -typedef struct { - /* 0x000 */ Save save; - /* 0x100 */ Save backup; -} SaveFile; // size = 0x200 - typedef struct { /* 0x00 */ u8 unk_00; /* 0x02 */ u16 unk_02; diff --git a/include/sys.h b/include/sys.h new file mode 100644 index 00000000..c0bb5046 --- /dev/null +++ b/include/sys.h @@ -0,0 +1,60 @@ +#ifndef SYS_H +#define SYS_H + +#include "PR/xstdio.h" +#include "PR/controller.h" +#include "libultra/ultra64.h" +#include "libc/math.h" +#include "libc/stdarg.h" +#include "libc/stdbool.h" +#include "libc/stdint.h" +#include "libc/stddef.h" +#include "libc/string.h" +#include "macros.h" +#include "sf64math.h" +#include "gfx.h" +#include "sf64thread.h" +#include "sf64save.h" +#include "buffers.h" + +typedef s32 (*CompareFunc)(void*, void*); + +s32 Lib_vsPrintf(char* dst, const char* fmt, va_list args); +void Lib_vTable(s32 index, void (**table)(s32, s32), s32 arg0, s32 arg1); +void Lib_QuickSort(u8* first, u32 length, u32 size, CompareFunc cFunc); +void Lib_Perspective(Gfx** dList); +void Lib_Ortho(Gfx** dList); +void Lib_DmaRead(void* src, void* dst, s32 size); +void Lib_FillScreen(u8 setFill); + +void Memory_FreeAll(void); +void* Memory_Allocate(s32); + +void func_8001EE60(void); +void RdRam_CheckIPL3(void); +void Mio0_Decompress(void* header, u8* dst); +s32 vsprintf(char* dst, const char* fmt, va_list args); + +void Game_Initialize(void); +void Game_Update(void); + +extern s32 D_800D2860[]; +extern s32 D_800D2870; + +extern f32 D_80161A10; +extern f32 D_80161A14; +extern s32 gPlayerInactive[4]; +extern s32 D_80161A28; +extern u8 D_80161A2C; +extern u16 D_80161A2E; +extern u16 gNextLevel; +extern u16 gNextGameState; +extern u16 D_80161A34; +extern u16 gBgColor; +extern u8 gBlurAlpha; +extern u8 D_80161A39; +extern f32 D_80161A3C; +extern f32 D_80161A40; +extern f32 D_80161A44; + +#endif diff --git a/include/variables.h b/include/variables.h index 44aa6598..935d2925 100644 --- a/include/variables.h +++ b/include/variables.h @@ -1,27 +1,12 @@ #ifndef VARIABLES_H #define VARIABLES_H -#include "libc/stdbool.h" -#include "sf64math.h" +#include "sys.h" #include "structs.h" -#include "gfx.h" #include "sf64level.h" -#include "sf64thread.h" #include "sf64object.h" #include "sf64player.h" -extern u64 __rspboot_start[]; -extern u64 __rspboot_end[]; -extern u64 __aspmain_start[]; -extern u64 __aspmain_end[]; -extern u64 __f3dex_start[]; -extern u64 __f3dex_end[]; -extern u8 gF3dexData[SP_UCODE_DATA_SIZE]; -extern u8 gAspMainData[]; - -extern Mtx gIdentityMtx; // 800C4620 -extern Matrix gIdentityMatrix; //800C4660 - extern f32 D_800C5D28[]; extern f32 D_800C5D34; extern s8 D_800C5D3C; @@ -32,98 +17,6 @@ extern OSMesgQueue* D_800C7C5C; extern OSMesgQueue* D_800C7C60; extern OSMesgQueue* D_800C7C64; -extern OSContPad gControllerHold[4]; -extern OSContPad gControllerPress[4]; -extern u8 gControllerPlugged[4]; -extern u32 gControllerLock; -extern u8 gControllerRumble[4]; -extern OSContPad sNextController[4]; // -extern OSContPad sPrevController[4]; // -extern OSContStatus sControllerStatus[4]; // -extern OSPfs sControllerMotor[4]; // - -extern u8 gAudioThreadStack[0x1000]; // 800DDAA0 -extern OSThread gGraphicsThread; // 800DEAA0 -extern u8 gGraphicsThreadStack[0x1000]; // 800DEC50 -extern OSThread gTimerThread; // 800DFC50 -extern u8 gTimerThreadStack[0x1000]; // 800DFE00 -extern OSThread gSerialThread; // 800E0E00 -extern u8 gSerialThreadStack[0x1000]; // 800E0FB0 - -extern SPTask* gCurrentTask; -extern SPTask* sAudioTasks[1]; -extern SPTask* sGfxTasks[2]; -extern SPTask* sNewAudioTasks[1]; -extern SPTask* sNewGfxTasks[2]; -extern u32 gSegments[16]; // 800E1FD0 -extern OSMesgQueue gPiMgrCmdQueue; // 800E2010 -extern OSMesg sPiMgrCmdBuff[50]; // 800E2028 - -extern OSMesgQueue gDmaMsgQueue; -extern void* sDmaMsgBuff[1]; -extern OSIoMesg gDmaIOMsg; -extern OSMesgQueue gSerialEventQueue; -extern void* sSerialEventBuff[1]; -extern OSMesgQueue gMainThreadMsgQueue; -extern void* sMainThreadMsgBuff[32]; -extern OSMesgQueue gTaskMsgQueue; -extern void* sTaskMsgBuff[16]; -extern OSMesgQueue gAudioVImsgQueue; -extern void* sAudioVImsgBuff[1]; -extern OSMesgQueue gAudioTaskMsgQueue; -extern void* sAudioTaskMsgBuff[1]; -extern OSMesgQueue gGfxVImsgQueue; -extern void* sGfxVImsgBuff[4]; -extern OSMesgQueue gGfxTaskMsgQueue; -extern void* sGfxTaskMsgBuff[2]; -extern OSMesgQueue gSerialThreadMsgQueue; -extern void* sSerialThreadMsgBuff[8]; -extern OSMesgQueue gControllerMsgQueue; -extern void* sControllerMsgBuff[1]; -extern OSMesgQueue gSaveMsgQueue; -extern void* sSaveMsgBuff[1]; -extern OSMesgQueue gTimerTaskMsgQueue; -extern void* sTimerTaskMsgBuff[16]; -extern OSMesgQueue gTimerWaitMsgQueue; -extern void* sTimerWaitMsgBuff[1]; - -extern GfxPool gGfxPools[2]; // 800E23B0 - -extern GfxPool* gGfxPool; -extern SPTask* gGfxTask; -extern Vp* gViewport; -extern Mtx* gGfxMtx; -extern Gfx* gUnkDisp1; -extern Gfx* gMasterDisp; -extern Gfx* gUnkDisp2; -extern Lightsn* gLight; -extern FrameBuffer* gFrameBuffer; -extern u16* gTextureRender; - -extern u8 D_80137E78; -extern u32 gSysFrameCount; -extern u8 gStartNMI; -extern u8 gStopTasks; -extern u8 D_80137E84[4]; -extern u16 gFillScreenColor; -extern u16 gFillScreen; - -extern u8 gUnusedStack[0x1000]; -extern OSThread sIdleThread; // 80138E90 -extern u8 sIdleThreadStack[0x1000]; // 801390A0 -extern OSThread gMainThread; // 8013A040 -extern u8 sMainThreadStack[0x1000]; // 8013A1F0 -extern OSThread gAudioThread; //8013B1F0 - -extern Matrix* gGfxMatrix; -extern Matrix sGfxMatrixStack[0x20]; -extern Matrix* gCalcMatrix; -extern Matrix sCalcMatrixStack[0x20]; - -extern SaveFile gSaveIOBuffer; -extern SaveFile sPrevSaveData; -extern FaultMgr gFaultMgr; - extern OSMesg D_80156600[1]; extern OSMesg D_80156608[4]; extern OSMesg D_80156618[1]; @@ -207,8 +100,6 @@ extern s16 D_800CFF94[]; extern u8 D_800CFFB4[]; extern f32 D_800CFFC4[]; -// fox_effect - // fox_hud extern s16 D_800D1970; extern f32 D_800D19AC[]; @@ -223,15 +114,6 @@ extern s32 D_800D2190[]; extern f32 D_800D21A0; extern f32 D_800D21A4; -// fox_game -extern s32 D_800D2860[]; -extern s32 D_800D2870; -extern s32 D_800D2874[]; -extern s32 D_800D2884[]; -extern s32 D_800D2894[]; -extern s32 D_800D28A4[]; -extern s32 sOverlaySetups[]; - // fox_A4290 extern CollisionHeader D_800D2B38[]; extern CollisionHeader2 D_800D2CA0[]; @@ -240,15 +122,9 @@ extern CollisionHeader2 D_800D2CA0[]; extern u8 D_800D2F68; extern u8 D_800D3180[30]; -// unknown, could be fox_rcp, fox_play, or a data-only file. -extern UNK_TYPE D_800D31A0[4]; - // fox_radio extern s32 gCurrentMsgPri; -// fox_save -extern Save gDefaultSave; - // fox_360 extern s32 D_8015F900; extern s32 D_8015F904; @@ -267,9 +143,6 @@ extern s32 D_8015F93C; extern s32 D_8015F940; extern f32 D_8015F944; -// fox_beam -// extern Vec3f D_8015F950; - // fox_bg extern f32 D_8015F960; extern u8 D_8015F964; @@ -281,7 +154,6 @@ extern s32 D_8015F978; extern s32 D_8015F97C; extern s32 D_8015F980; extern f32 D_8015F984; -// extern f32 D_80161394; // fox_boss extern s32 gBossFrameCount; @@ -305,7 +177,7 @@ extern s32 D_Timer_80161670[4]; extern s32 D_80161680; extern u8 D_80161684; -// fox_6B3B0 +// fox_enmy2 extern s32 D_80161690; // fox_hud @@ -318,23 +190,6 @@ extern s32 D_8016172C; extern s32 D_80161730; extern s32 gShowBossHealth; // 0x80161734 -// fox_game -extern f32 D_80161A10; -extern f32 D_80161A14; -extern s32 gPlayerInactive[4]; -extern s32 D_80161A28; -extern u8 D_80161A2C; -extern u16 D_80161A2E; -extern u16 gNextLevel; -extern u16 gNextGameState; -extern u16 D_80161A34; -extern u16 gBgColor; -extern u8 gBlurAlpha; -extern u8 D_80161A39; -extern f32 D_80161A3C; -extern f32 D_80161A40; -extern f32 D_80161A44; - // fox_play extern u8 D_80161A50; extern f32 D_80161A54; @@ -345,387 +200,7 @@ extern u16 D_80161A62; extern s32 D_80161A64; extern EnvSettings* sEnvSettings; -// fox_context -extern s32 D_80161A70; // Color32? -extern s32 D_80161A74; -extern s32 D_80161A78; -extern s32 D_80161A7C; -extern s32 D_80161A80; -extern s32 D_80161A84; -extern s32 D_80161A88; -extern s32 D_80161A8C; -extern u8 gGoldRingCount[4]; -extern u8 D_80161A94[4]; -extern s32 gHitCount; -extern s32 gSavedHitCount; -extern s16 gLifeCount[4]; -extern LaserStrength gLaserStrength[4]; -// -extern s32 D_80161AB8; -// 0x44 -extern Object_80 gObjects80[50]; -extern Object_4C gObjects4C[40]; -extern Actor gActors[60]; -extern Boss gBosses[4]; -extern Effect gEffects[100]; -extern Item gItems[20]; -extern PlayerShot gPlayerShots[16]; -extern UnkEntity30 gUnkEntities30[100]; -extern UnkEntity28 gUnkEntities28[65]; -extern BonusText gBonusText[10]; -// 0x100 -extern s32 D_80176550[2]; -extern f32 D_80176558[2][100]; -extern f32 D_80176878[2][100]; -extern f32 D_80176B98[2][100]; -extern f32 D_80176EB8[2][100]; -extern f32 D_801771D8[2][100]; -extern s32 gOverlaySetup; -// -extern f32 D_80177500[2][100]; -extern s32 gOverlayStage; -extern s32 D_80177824; -extern u16 D_80177828; -extern s32 D_8017782C; -extern u8 D_80177830; -extern GameState gGameState; -extern s32 D_80177838; -extern s32 D_Timer_8017783C; -extern s32 D_80177840; // Stage clear time -extern s32 D_80177844; -extern s32 gBossHealthBar; -extern OptionState gOptionMenuStatus; -extern s32 D_80177850; -extern s32 D_80177854; -extern s32 D_80177858[4]; -extern s32 D_80177868; -// -extern s32 D_80177870[4]; -extern LevelMode gLevelMode; -// -extern s32 gHandicap[4]; -extern DrawMode gDrawMode; -extern VsStage gVersusStage; -extern s32 gPlayerNum; -extern s32 D_801778A4; -extern s32 gCamCount; -extern s32 D_801778AC; -extern s32 gTeamShields[6]; -extern s32 D_801778C8; -// -extern s32 gSavedTeamShields[6]; -extern bool gVersusMode; -// -extern UNK_TYPE D_801778F0[6]; -extern u16 gBoostButton[4]; -extern s32 gTeamDamage[6]; -extern u16 gBrakeButton[4]; -extern u8 D_80177930; -// -extern u16 gShootButton[4]; -extern f32 gGroundLevel; -// -extern u16 gBombButton[4]; -extern f32 D_80177950; -// -extern f32 D_80177958[4]; -extern f32 D_80177968; -extern s32 D_8017796C; -extern f32 D_80177970; -extern OSContPad* gInputHold; -extern f32 D_80177978; -extern OSContPad* gInputPress; -extern f32 D_80177980; -extern u8* D_80177984; -extern f32 D_80177988; -// -extern s32 D_80177990[4]; -extern f32 D_801779A0; -// -extern f32 D_801779A8[4]; -extern f32 D_801779B8; -extern u8 D_801779BC; -extern f32 D_801779C0; -// -extern s32 gChargeTimers[4]; -extern Vec3f D_801779D8; -extern f32 D_801779E4; -extern Vec3f D_801779E8; -extern f32 D_801779F4; -extern bool gExpertMode; -// -extern s32 D_Timer_80177A00[4]; -extern s32 D_80177A10[10]; -extern s32 D_Timer_80177A38[4]; -extern f32 D_80177A48[10]; -extern s32 D_Timer_80177A70[4]; -extern s32 gCsFrameCount; -// -extern s32 D_Timer_80177A88[4]; -extern u8 D_80177A98; -// -extern f32 D_80177AA0[4]; -extern u8 D_80177AB0; -// -extern f32 D_80177AB8[4]; -extern u8 D_80177AC8; -// -extern s32 D_80177AD0[4]; -extern s32 D_80177AE0; -// -extern s32 D_80177AE8[4]; -extern s32 gMainController; -// -extern s32 D_80177B00[4][4]; -extern s32 D_80177B40; -extern u8 D_Timer_80177B44; -extern s32 gCurrentPlanet; // D_80177B48 // Arrow pointer? -extern u8 D_80177B4C; -extern s32 D_80177B50[7]; -extern u8 D_80177B6C; -extern s32 D_80177B70[7]; -extern u8 D_80177B8C; -extern s32 D_80177B90[7]; -extern u8 D_80177BAC; -extern s32 D_80177BB0[7]; -// -extern u16 D_Timer_80177BD0[4]; -extern s32 D_80177BD8[22]; // overruns D_80177C30? -// -0x8?? -extern u16 D_80177C30[4]; -extern s32 D_80177C38[6]; -extern s32 D_80177C50; -extern s32 D_80177C58[6]; -// 0x1C -extern s32 D_80177C70; -extern u8 gSoundMode; -extern s32 D_80177C78; -// -extern s32 gVolumeSettings[3]; -extern s32 D_80177C8C; -extern u16 D_80177C90; -extern s32 D_80177C94; -extern u8 gLevelType; -extern s32 D_80177C9C; -extern s32 D_80177CA0; -extern s32 D_80177CA4; -// -extern s32 D_80177CAC; -extern f32 D_80177CB0; -extern s32 D_80177CB4; -// -extern s32 D_80177CBC; -extern f32 D_80177CC0; -extern s32 D_80177CC4; -extern f32 D_80177CC8; -// -extern s32 D_80177CD0[6]; -extern f32 D_80177CE8; -// -extern s32 D_80177CF0[6]; -extern f32 D_80177D08; -// -extern s32 gRightWingHealth[4]; -extern f32 D_80177D20; -// -extern s32 gLeftWingHealth[4]; -extern f32 D_80177D38; -// -extern s32 D_80177D40[4]; -extern f32 D_80177D50; -// -extern s32 D_80177D58[4]; -extern f32 D_80177D68; -// -extern s32 D_80177D70[4]; -// 0x8 -extern s32 D_80177D88[4]; -// 0x8 -extern s32 gBombCount[4]; -extern s32 gGameFrameCount; -// -extern s32 D_80177DB8[4]; -extern s32 D_80177DC8; -// -extern s32 D_80177DD0[4][10]; -extern s32 D_80177E70; -extern s32 D_80177E74; -extern s32 D_80177E78; -extern s32 D_80177E7C; -extern s32 D_80177E80; -extern s32 D_80177E84; -extern Vec3f D_80177E88; -// -extern Vec3f D_80177E98[10]; -extern Vec3f D_80177F10; -// 0xC -extern f32 D_80177F24[60]; -// 0x18 -extern f32 D_8017802C[60]; -// 0x10 -extern s32 D_8017812C; -// -extern f32 D_80178134[60]; -// 0x10 -extern LevelId gCurrentLevel; -extern u8 D_80178238[60]; -// 0x8 -extern s32 D_8017827C; -extern Player* gPlayer; -extern s32 gBossActive; -extern f32* D_80178288; -extern s32 D_8017828C; -extern f32* D_80178290; -extern s32 D_80178294; -extern u32* D_80178298; -extern s32 gRadioState; -// -extern s32 D_801782A4; -extern Object_58* gObjects58; -extern s32 D_Timer_801782AC; -// -extern s32 D_Timer_801782B4; -extern s32 D_801782B8; -extern s32 D_801782BC; -extern s32 D_801782C0; -extern PosRot* D_801782C4; -extern s32 D_801782C8; -extern f32* D_801782CC; -extern s32 D_801782D0; -extern f32* D_801782D4; -extern s32 D_801782D8; -extern f32* D_801782DC; -// -extern f32* D_801782E4; -extern s32 D_801782E8; -extern f32* D_801782EC; -// 0x8 -extern s32 D_801782F8; -extern s32 D_801782FC; -extern s32 D_80178300; -// -extern u16* D_80178308; -// -extern ObjectInit* D_80178310; -// 0xC -extern s32 gFogRed; -// -extern s32 gFogGreen; -// -extern s32 gFogBlue; -// -extern s32 gFogAlpha; -// -extern s32 D_80178340; // alpha something -// -extern s32 D_80178348; // red something -// -extern s32 D_80178350; // green something -extern s32 D_80178354; // blue something -extern s32 D_80178358; // alpha target -extern s32 D_8017835C; // alpha step -extern s32 D_80178360; // 2 lights second color -extern s32 D_80178364; -extern s32 D_80178368; -extern f32 D_8017836C; // 2 lights second color brightness -extern f32 D_80178370; // Vec3f? -extern f32 D_80178374; -extern f32 D_80178378; -extern s32 D_8017837C; -extern u32 D_80178380[4]; // player alphas -extern s32 D_80178390[4]; // player reds -extern s32 D_801783A0[4]; // player greens -extern s32 D_801783B0[4]; // player alphas -extern UNK_TYPE D_801783C0[4]; -extern f32 D_801783D0; // something x translate -extern f32 D_801783D4; // something y translate -extern s32 gFogNear; //near -extern s32 gFogFar; //far -// 0x30 -extern s32 D_80178410; -extern f32 D_80178414; -extern f32 D_80178418; -// -extern f32 D_80178420; -extern f32 D_80178424; -extern f32 D_80178428; -extern f32 D_8017842C; -extern f32 D_80178430; -// 0xC -extern f32 D_80178440; -extern f32 D_80178444; -extern f32 D_80178448; -// -extern f32 D_80178450[3]; -// -extern f32 D_80178460[3]; -// -extern f32 D_80178470[3]; -extern f32 D_8017847C; -extern s32 D_80178480; -extern s32 D_80178484; -extern bool D_80178488; -// 0x8 -extern s32 D_80178494; -extern f32 D_80178498; -extern f32 D_8017849C; -extern f32 D_801784A0; -extern s32 D_801784A4; -// -extern s32 D_801784AC; -// 0x8 -extern f32 D_801784B8; // effective Vec3f -extern f32 D_801784BC; -extern f32 D_801784C0; -extern f32 D_801784C4; // effective Vec3f -extern f32 D_801784C8; -extern f32 D_801784CC; -extern f32 D_801784D0; // effective Vec3f -extern f32 D_801784D4; -extern f32 D_801784D8; -extern s32 gLight1x; // Vec3i light direction -extern s32 gLight1y; -extern s32 gLight1z; -extern f32 D_801784E8; -extern f32 D_801784EC; // effective Vec3f? -extern f32 D_801784F0; -extern f32 D_801784F4; -extern f32 D_801784F8; // effective Vec3f -extern f32 D_801784FC; -extern f32 D_80178500; -extern s32 gLight2x; // Vec3i light direction alternate -extern s32 gLight2y; -extern s32 gLight2z; -extern f32 D_80178510; -// 0xC -extern f32 D_80178520; // effective Vec3f -extern f32 D_80178524; -extern f32 D_80178528; -// 0xC -extern f32 D_80178538; -extern f32 D_8017853C; -extern s32 D_80178540; -extern s32 D_80178544; -extern s32 gLight1R; // Color32 light color 1 -extern s32 gLight1G; -extern s32 gLight1B; -extern s32 gAmbientR; // Color32 ambient color -extern s32 gAmbientG; -extern s32 gAmbientB; -// -extern s32 gLight2R; // Color32 light color 2 -extern s32 gLight2G; -extern s32 gLight2B; -extern s32 D_80178570; // Color32 light color 2 modifier? -extern s32 D_80178574; -extern s32 D_80178578; - -// fox_rcp? -extern u8 D_80178580[]; -extern void* D_80178710; - //fox_radio - extern u16** D_80178720; extern s32 D_80178724; extern s32 D_80178728; @@ -778,9 +253,6 @@ extern s32 D_80178850[4]; extern OSTime D_80178860; extern OSTime D_80178868; -// fox_save -extern SaveFile gSaveFile; - // gfx_data extern u16 D_Unk_800DACB8[][32]; extern u16 D_Tex_800D99F8[]; @@ -808,24 +280,9 @@ extern u16 gHaasEffectDelaySizes[64]; // extern EnvelopePoint gDefaultEnvelope[]; // extern NoteUnkStruct gZeroNoteSub; // extern NoteUnkStruct gDefaultNoteSub; -extern s32 D_800D4A90; -extern s32 D_800D4A94; -extern s32 D_800D4A98; // versus frame counter? -extern s32 D_800D4A9C; -extern s32 D_800D4AA0; extern s16 D_800DD200[]; extern f32 gHeadsetPanVolume[]; extern f32 gStereoPanVolume[]; extern f32 gDefaultPanVolume[]; -// buffers -extern u64 gDramStack[]; -extern u8 gOSYieldData[]; -extern FrameBuffer gZBuffer; // z buffer -extern u8 gTaskOutputBuffer[]; -extern u8 gAudioDataBuffer[]; -extern u16 gTextureRenderBuffer[]; -extern u16 gFillBuffer[]; -extern FrameBuffer gFrameBuffers[]; // 8038F800 - #endif // VARIABLES_H diff --git a/linker_scripts/us/symbol_addrs.txt b/linker_scripts/us/symbol_addrs.txt index d57aa761..400b9359 100644 --- a/linker_scripts/us/symbol_addrs.txt +++ b/linker_scripts/us/symbol_addrs.txt @@ -1,5 +1,3 @@ -D_800C90F0 = 0x800C90F0; -__libm_qnan_f = 0x800C9570; D_1 = 0x1; //ignore:true D_80120000 = 0x80120000;//ignore:true D_80130001 = 0x80130001;//ignore:true @@ -25,6 +23,7 @@ D_80000018 = 0x80000018;//ignore:true D_8000001C = 0x8000001C;//ignore:true D_80000024 = 0x80000024;//ignore:true +D_800C90F0 = 0x800C90F0; D_800C45E0 = 0x800C45E0; D_80151650 = 0x80151650; //ignore:true @@ -52,6 +51,28 @@ D_800CBDD4 = 0x800CBDD4; //size:0x98 D_800D55D0 = 0x800D55D0; //type:f32 +__libm_qnan_f = 0x800C9570; +__floorf = 0x8001FE60; +__floor = 0x8001FE6C; +__lfloorf = 0x8001FE78; +__lfloor = 0x8001FE88; +__ceilf = 0x8001FE98; +__ceil = 0x8001FEA4; +__lceilf = 0x8001FEB0; +__lceil = 0x8001FEC0; +__truncf = 0x8001FED0; +__trunc = 0x8001FEDC; +__ltruncf = 0x8001FEE8; +__ltrunc = 0x8001FEF8; +__roundf = 0x8001FF08; +__round = 0x8001FF14; +__lroundf = 0x8001FF20; +__lround = 0x8001FF30; +__nearbyintf = 0x8001FF40; +__nearbyint = 0x8001FF5C; +__lnearbyintf = 0x8001FF7C; +__lnearbyint = 0x8001FF9C; + __dx1 = 0x80161950; __dx2 = 0x80161954; __dy1 = 0x80161958; diff --git a/linker_scripts/us/symbol_addrs_EBFBE0.txt b/linker_scripts/us/symbol_addrs_EBFBE0.txt index 5972188c..f2751b8d 100644 --- a/linker_scripts/us/symbol_addrs_EBFBE0.txt +++ b/linker_scripts/us/symbol_addrs_EBFBE0.txt @@ -6,109 +6,110 @@ GetPlanetId = 0x801A6480; // force_migration:True segment:ovl_menu sOptionCardList = 0x801AE638; // type:OptionEntry segment:ovl_menu size:0x240 D_menu_801AE99C = 0x801AE99C; // force_migration:True segment:ovl_menu sTimeTrialMinuteTextures = 0x801AF28C; // force_migration:True segment:ovl_menu -sPlanetList = 0x801AF7E8; -spectrumAnalizerMode = 0x801B9318; +sPlanetList = 0x801AF7E8;// segment:ovl_menu +spectrumAnalizerMode = 0x801B9318;// segment:ovl_menu D_menu_801B6E50 = 0x801B6E50; // force_migration:True segment:ovl_menu -D_menu_801B7BA0 = 0x801B7BA0; -D_menu_801B827C = 0x801B827C; -D_menu_801B9710 = 0x801B9710; -D_menu_801B9A10 = 0x801B9A10; -D_menu_801B9D10 = 0x801B9D10; -D_menu_801BA010 = 0x801BA010; -D_menu_801BA310 = 0x801BA310; -D_menu_801BA610 = 0x801BA610; -D_menu_801BA910 = 0x801BA910; -D_menu_801BAC10 = 0x801BAC10; -D_menu_801BAF10 = 0x801BAF10; -D_menu_801BB210 = 0x801BB210; -D_menu_801BB510 = 0x801BB510; -D_menu_801BBB10 = 0x801BBB10; -D_menu_801BBE10 = 0x801BBE10; -D_menu_801BC110 = 0x801BC110; -D_menu_801BC410 = 0x801BC410; -D_menu_801BC710 = 0x801BC710; -D_menu_801BCA10 = 0x801BCA10; -D_menu_801BCD10 = 0x801BCD10; -D_menu_801BD010 = 0x801BD010; -D_menu_801BD310 = 0x801BD310; -D_menu_801BD610 = 0x801BD610; -D_menu_801BD910 = 0x801BD910; -D_menu_801BDF10 = 0x801BDF10; -D_menu_801BE210 = 0x801BE210; -D_menu_801BE510 = 0x801BE510; -D_menu_801BE810 = 0x801BE810; -D_menu_801BEB10 = 0x801BEB10; -D_menu_801BEE10 = 0x801BEE10; -D_menu_801BF110 = 0x801BF110; -D_menu_801BF410 = 0x801BF410; -D_menu_801BF710 = 0x801BF710; -D_menu_801BFA10 = 0x801BFA10; -D_menu_801BFD10 = 0x801BFD10; -D_menu_801C0310 = 0x801C0310; -D_menu_801C0610 = 0x801C0610; -D_menu_801C0910 = 0x801C0910; -D_menu_801C0C10 = 0x801C0C10; -D_menu_801C0F10 = 0x801C0F10; -D_menu_801C1210 = 0x801C1210; -D_menu_801C1510 = 0x801C1510; -D_menu_801C1810 = 0x801C1810; -D_menu_801C1B10 = 0x801C1B10; -D_menu_801C1E10 = 0x801C1E10; -D_menu_801C2110 = 0x801C2110; -D_menu_801C2710 = 0x801C2710; -D_menu_801C2A10 = 0x801C2A10; -D_menu_801C2D10 = 0x801C2D10; -D_menu_801C3010 = 0x801C3010; -D_menu_801C3310 = 0x801C3310; -D_menu_801C3610 = 0x801C3610; -D_menu_801C3910 = 0x801C3910; -D_menu_801C3C10 = 0x801C3C10; -D_menu_801C3F10 = 0x801C3F10; -D_menu_801C4210 = 0x801C4210; -D_menu_801C4510 = 0x801C4510; -D_menu_801C4B10 = 0x801C4B10; -D_menu_801C4E10 = 0x801C4E10; -D_menu_801C5110 = 0x801C5110; -D_menu_801C5410 = 0x801C5410; -D_menu_801C5710 = 0x801C5710; -D_menu_801C5A10 = 0x801C5A10; -D_menu_801C5D10 = 0x801C5D10; -D_menu_801C6010 = 0x801C6010; -D_menu_801C6310 = 0x801C6310; -D_menu_801C6610 = 0x801C6610; -D_menu_801C6910 = 0x801C6910; -D_menu_801C6F10 = 0x801C6F10; -D_menu_801C7210 = 0x801C7210; -D_menu_801C7510 = 0x801C7510; -D_menu_801C7810 = 0x801C7810; -D_menu_801C7B10 = 0x801C7B10; -D_menu_801C7E10 = 0x801C7E10; -D_menu_801C8110 = 0x801C8110; -D_menu_801C8410 = 0x801C8410; -D_menu_801C8710 = 0x801C8710; -D_menu_801C8A10 = 0x801C8A10; -D_menu_801C8D10 = 0x801C8D10; -D_menu_801C9310 = 0x801C9310; -D_menu_801C9610 = 0x801C9610; -D_menu_801C9910 = 0x801C9910; -D_menu_801C9C10 = 0x801C9C10; -D_menu_801C9F10 = 0x801C9F10; -D_menu_801CA210 = 0x801CA210; -D_menu_801CA510 = 0x801CA510; -D_menu_801CA810 = 0x801CA810; -D_menu_801CAB10 = 0x801CAB10; -D_menu_801CAE10 = 0x801CAE10; -D_menu_801CB110 = 0x801CB110; -D_menu_801CB710 = 0x801CB710; -D_menu_801CBA10 = 0x801CBA10; -D_menu_801CBD10 = 0x801CBD10; -D_menu_801CC010 = 0x801CC010; -D_menu_801CC310 = 0x801CC310; -D_menu_801CC610 = 0x801CC610; -D_menu_801CC910 = 0x801CC910; -D_menu_801CCC10 = 0x801CCC10; -D_menu_801CCF10 = 0x801CCF10; -D_menu_801CD210 = 0x801CD210; -D_menu_801CD510 = 0x801CD510; -sCurrentPlanetId = 0x801CD954; +D_menu_801B7BA0 = 0x801B7BA0;// segment:ovl_menu +D_menu_801B8248 = 0x801B8248; // size:0x28 segment:ovl_menu +D_menu_801B827C = 0x801B827C; // segment:ovl_menu +D_menu_801B9710 = 0x801B9710; // segment:ovl_menu +D_menu_801B9A10 = 0x801B9A10; // segment:ovl_menu +D_menu_801B9D10 = 0x801B9D10; // segment:ovl_menu +D_menu_801BA010 = 0x801BA010; // segment:ovl_menu +D_menu_801BA310 = 0x801BA310; // segment:ovl_menu +D_menu_801BA610 = 0x801BA610; // segment:ovl_menu +D_menu_801BA910 = 0x801BA910; // segment:ovl_menu +D_menu_801BAC10 = 0x801BAC10; // segment:ovl_menu +D_menu_801BAF10 = 0x801BAF10; // segment:ovl_menu +D_menu_801BB210 = 0x801BB210; // segment:ovl_menu +D_menu_801BB510 = 0x801BB510; // segment:ovl_menu +D_menu_801BBB10 = 0x801BBB10; // segment:ovl_menu +D_menu_801BBE10 = 0x801BBE10; // segment:ovl_menu +D_menu_801BC110 = 0x801BC110; // segment:ovl_menu +D_menu_801BC410 = 0x801BC410; // segment:ovl_menu +D_menu_801BC710 = 0x801BC710; // segment:ovl_menu +D_menu_801BCA10 = 0x801BCA10; // segment:ovl_menu +D_menu_801BCD10 = 0x801BCD10; // segment:ovl_menu +D_menu_801BD010 = 0x801BD010; // segment:ovl_menu +D_menu_801BD310 = 0x801BD310; // segment:ovl_menu +D_menu_801BD610 = 0x801BD610; // segment:ovl_menu +D_menu_801BD910 = 0x801BD910; // segment:ovl_menu +D_menu_801BDF10 = 0x801BDF10; // segment:ovl_menu +D_menu_801BE210 = 0x801BE210; // segment:ovl_menu +D_menu_801BE510 = 0x801BE510; // segment:ovl_menu +D_menu_801BE810 = 0x801BE810; // segment:ovl_menu +D_menu_801BEB10 = 0x801BEB10; // segment:ovl_menu +D_menu_801BEE10 = 0x801BEE10; // segment:ovl_menu +D_menu_801BF110 = 0x801BF110; // segment:ovl_menu +D_menu_801BF410 = 0x801BF410; // segment:ovl_menu +D_menu_801BF710 = 0x801BF710; // segment:ovl_menu +D_menu_801BFA10 = 0x801BFA10; // segment:ovl_menu +D_menu_801BFD10 = 0x801BFD10; // segment:ovl_menu +D_menu_801C0310 = 0x801C0310; // segment:ovl_menu +D_menu_801C0610 = 0x801C0610; // segment:ovl_menu +D_menu_801C0910 = 0x801C0910; // segment:ovl_menu +D_menu_801C0C10 = 0x801C0C10; // segment:ovl_menu +D_menu_801C0F10 = 0x801C0F10; // segment:ovl_menu +D_menu_801C1210 = 0x801C1210; // segment:ovl_menu +D_menu_801C1510 = 0x801C1510; // segment:ovl_menu +D_menu_801C1810 = 0x801C1810; // segment:ovl_menu +D_menu_801C1B10 = 0x801C1B10; // segment:ovl_menu +D_menu_801C1E10 = 0x801C1E10; // segment:ovl_menu +D_menu_801C2110 = 0x801C2110; // segment:ovl_menu +D_menu_801C2710 = 0x801C2710; // segment:ovl_menu +D_menu_801C2A10 = 0x801C2A10; // segment:ovl_menu +D_menu_801C2D10 = 0x801C2D10; // segment:ovl_menu +D_menu_801C3010 = 0x801C3010; // segment:ovl_menu +D_menu_801C3310 = 0x801C3310; // segment:ovl_menu +D_menu_801C3610 = 0x801C3610; // segment:ovl_menu +D_menu_801C3910 = 0x801C3910; // segment:ovl_menu +D_menu_801C3C10 = 0x801C3C10; // segment:ovl_menu +D_menu_801C3F10 = 0x801C3F10; // segment:ovl_menu +D_menu_801C4210 = 0x801C4210; // segment:ovl_menu +D_menu_801C4510 = 0x801C4510; // segment:ovl_menu +D_menu_801C4B10 = 0x801C4B10; // segment:ovl_menu +D_menu_801C4E10 = 0x801C4E10; // segment:ovl_menu +D_menu_801C5110 = 0x801C5110; // segment:ovl_menu +D_menu_801C5410 = 0x801C5410; // segment:ovl_menu +D_menu_801C5710 = 0x801C5710; // segment:ovl_menu +D_menu_801C5A10 = 0x801C5A10; // segment:ovl_menu +D_menu_801C5D10 = 0x801C5D10; // segment:ovl_menu +D_menu_801C6010 = 0x801C6010; // segment:ovl_menu +D_menu_801C6310 = 0x801C6310; // segment:ovl_menu +D_menu_801C6610 = 0x801C6610; // segment:ovl_menu +D_menu_801C6910 = 0x801C6910; // segment:ovl_menu +D_menu_801C6F10 = 0x801C6F10; // segment:ovl_menu +D_menu_801C7210 = 0x801C7210; // segment:ovl_menu +D_menu_801C7510 = 0x801C7510; // segment:ovl_menu +D_menu_801C7810 = 0x801C7810; // segment:ovl_menu +D_menu_801C7B10 = 0x801C7B10; // segment:ovl_menu +D_menu_801C7E10 = 0x801C7E10; // segment:ovl_menu +D_menu_801C8110 = 0x801C8110; // segment:ovl_menu +D_menu_801C8410 = 0x801C8410; // segment:ovl_menu +D_menu_801C8710 = 0x801C8710; // segment:ovl_menu +D_menu_801C8A10 = 0x801C8A10; // segment:ovl_menu +D_menu_801C8D10 = 0x801C8D10; // segment:ovl_menu +D_menu_801C9310 = 0x801C9310; // segment:ovl_menu +D_menu_801C9610 = 0x801C9610; // segment:ovl_menu +D_menu_801C9910 = 0x801C9910; // segment:ovl_menu +D_menu_801C9C10 = 0x801C9C10; // segment:ovl_menu +D_menu_801C9F10 = 0x801C9F10; // segment:ovl_menu +D_menu_801CA210 = 0x801CA210; // segment:ovl_menu +D_menu_801CA510 = 0x801CA510; // segment:ovl_menu +D_menu_801CA810 = 0x801CA810; // segment:ovl_menu +D_menu_801CAB10 = 0x801CAB10; // segment:ovl_menu +D_menu_801CAE10 = 0x801CAE10; // segment:ovl_menu +D_menu_801CB110 = 0x801CB110; // segment:ovl_menu +D_menu_801CB710 = 0x801CB710; // segment:ovl_menu +D_menu_801CBA10 = 0x801CBA10; // segment:ovl_menu +D_menu_801CBD10 = 0x801CBD10; // segment:ovl_menu +D_menu_801CC010 = 0x801CC010; // segment:ovl_menu +D_menu_801CC310 = 0x801CC310; // segment:ovl_menu +D_menu_801CC610 = 0x801CC610; // segment:ovl_menu +D_menu_801CC910 = 0x801CC910; // segment:ovl_menu +D_menu_801CCC10 = 0x801CCC10; // segment:ovl_menu +D_menu_801CCF10 = 0x801CCF10; // segment:ovl_menu +D_menu_801CD210 = 0x801CD210; // segment:ovl_menu +D_menu_801CD510 = 0x801CD510; // segment:ovl_menu +sCurrentPlanetId = 0x801CD954; // segment:ovl_menu // sPlanetsPositions = 0x801CE960; // force_migration:True segment:ovl_menu \ No newline at end of file diff --git a/linker_scripts/us/symbol_addrs_engine.txt b/linker_scripts/us/symbol_addrs_engine.txt index 76d8d2b0..dd6053f0 100644 --- a/linker_scripts/us/symbol_addrs_engine.txt +++ b/linker_scripts/us/symbol_addrs_engine.txt @@ -358,7 +358,7 @@ func_800A1F44 = 0x800A1F44; func_800A1FB0 = 0x800A1FB0; func_800A24DC = 0x800A24DC; func_800A25DC = 0x800A25DC; -func_800A26C0 = 0x800A26C0; +Game_Update = 0x800A26C0; func_800A3608 = 0x800A3608; @@ -379,6 +379,7 @@ D_Timer_80161A60 = 0x80161A60; D_80161A62 = 0x80161A62; D_80161A64 = 0x80161A64; sEnvSettings = 0x80161A68; +D_800D2F68 = 0x800D2F68; //type:u8 // fox_context D_80161A70 = 0x80161A70; @@ -404,7 +405,7 @@ gItems = 0x801737E0; //size:0x870 gPlayerShots = 0x80174050; //size:0x700 gUnkEntities30 = 0x80174750; //size:0x12C0 gUnkEntities28 = 0x80175A10; //size:0xA28 -gBonusText = 0x80176438; //size:0x18 +gBonusText = 0x80176438; //size:0x118 D_80176550 = 0x80176550; D_80176558 = 0x80176558; D_80176878 = 0x80176878; @@ -531,9 +532,12 @@ D_80177E80 = 0x80177E80; D_80177E88 = 0x80177E88; // size:0xC D_80177E98 = 0x80177E98; D_80177F10 = 0x80177F10; +D_80177F20 = 0x80177F20; //size:0xF4 +D_80178028 = 0x80178028; //size:0xF4 D_8017812C = 0x8017812C; +D_80178130 = 0x80178130; //size:0xF4 gCurrentLevel = 0x80178234; -D_80178238 = 0x80178238;//size:4 type:u8 +D_80178238 = 0x80178238;//size:0x3D type:u8 D_8017827C = 0x8017827C; gPlayer = 0x80178280; gBossActive = 0x80178284; diff --git a/linker_scripts/us/symbol_addrs_nlib_vars.txt b/linker_scripts/us/symbol_addrs_nlib_vars.txt index 07141cdd..170b07b7 100644 --- a/linker_scripts/us/symbol_addrs_nlib_vars.txt +++ b/linker_scripts/us/symbol_addrs_nlib_vars.txt @@ -1,9 +1,9 @@ // rsp -__rspboot_start = 0x80000450;//name_end:__rspboot_end -__aspmain_start = 0x80000520;//name_end:__aspmain_end -__f3dex_start = 0x80001410;//name_end:__f3dex_end -gF3dexData = 0x800C3DD0; //name_end:gF3dexData_end -gAspMainData = 0x800C32E0; //name_end:gAspMainData_end +rspbootTextStart = 0x80000450;//name_end:rspbootTextEnd +aspMainTextStart = 0x80000520;//name_end:aspMainTextEnd +gspF3DEX_fifoTextStart = 0x80001410;//name_end:gspF3DEX_fifoTextEnd +gspF3DEX_fifoDataStart = 0x800C3DD0; //name_end:gspF3DEX_fifoDataEnd +aspMainDataStart = 0x800C32E0; //name_end:aspMainDataEnd // sys_joybus gControllerHold = 0x800DD880; // size:0x18 diff --git a/linker_scripts/us/symbol_addrs_overlays.txt b/linker_scripts/us/symbol_addrs_overlays.txt index 11d82e6d..df4efd77 100644 --- a/linker_scripts/us/symbol_addrs_overlays.txt +++ b/linker_scripts/us/symbol_addrs_overlays.txt @@ -1,15 +1,15 @@ -func_i1_8018ED78 = 0x8018ED78; -func_i1_8018EE84 = 0x8018EE84; -func_i1_8018B0B4 = 0x8018B0B4; -func_i1_801878D8 = 0x801878D8; -func_i1_8018BE7C = 0x8018BE7C; -func_i1_8019250C = 0x8019250C; -func_i1_80192CB0 = 0x80192CB0; -func_i1_80192EA4 = 0x80192EA4; -func_i1_801933B4 = 0x801933B4; -func_i1_801935CC = 0x801935CC; +func_i1_8018ED78 = 0x8018ED78;//segment:ovl_i1 +func_i1_8018EE84 = 0x8018EE84;//segment:ovl_i1 +func_i1_8018B0B4 = 0x8018B0B4;//segment:ovl_i1 +func_i1_801878D8 = 0x801878D8;//segment:ovl_i1 +func_i1_8018BE7C = 0x8018BE7C;//segment:ovl_i1 +func_i1_8019250C = 0x8019250C;//segment:ovl_i1 +func_i1_80192CB0 = 0x80192CB0;//segment:ovl_i1 +func_i1_80192EA4 = 0x80192EA4;//segment:ovl_i1 +func_i1_801933B4 = 0x801933B4;//segment:ovl_i1 +func_i1_801935CC = 0x801935CC;//segment:ovl_i1 D_i1_8019A04C = 0x8019A04C; // size:0xC type:s16 segment:ovl_i1 -D_i1_8019B6C0 = 0x8019B6C0; +D_i1_8019B6C0 = 0x8019B6C0;//segment:ovl_i1 D_i1_8019A008 = 0x8019A008; // segment:ovl_i1 D_i1_8019A820 = 0x8019A820; // segment:ovl_i1 type:s16 size:0x198 D_i1_8019AD2C = 0x8019AD2C; // segment:ovl_i1 size:0x28 @@ -18,9 +18,9 @@ D_i1_8019A748 = 0x8019A748; // segment:ovl_i1 size:0xD8 type:s32 D_i1_8019A500 = 0x8019A500; // segment:ovl_i1 type:s16 size:0x44 D_i1_8019B838 = 0x8019B838; // segment:ovl_i1 size:0x880 -func_i2_80187B08 = 0x80187B08; -func_i2_80188A40 = 0x80188A40; -D_i2_80195D70 = 0x80195D70; +func_i2_80187B08 = 0x80187B08;//segment:ovl_i2 +func_i2_80188A40 = 0x80188A40;//segment:ovl_i2 +D_i2_80195D70 = 0x80195D70;//segment:ovl_i2 D_i4_8019F168 = 0x8019F168; // type:Vec3f segment:ovl_i4 D_i4_8019F18C = 0x8019F18C; // type:f32 segment:ovl_i4 D_i4_8019F198 = 0x8019F198; // type:u8 size:0x28 segment:ovl_i4 force_migration:True @@ -53,25 +53,25 @@ D_menu_801AEE6C = 0x801AEE6C; // type:s32 size:0x58 force_migration:True segment D_menu_801AF25C = 0x801AF25C; // type:f32 size:0x18 force_migration:True segment:ovl_menu D_menu_801AF274 = 0x801AF274; // type:f32 size:0x18 force_migration:True segment:ovl_menu -func_i3_80187754 = 0x80187754; -func_i3_801932AC = 0x801932AC; -func_i3_8019B1F0 = 0x8019B1F0; -func_i3_8019B810 = 0x8019B810; -func_i3_8019C200 = 0x8019C200; -func_i3_8019D060 = 0x8019D060; -func_i3_801AD688 = 0x801AD688; -func_i3_801AE3AC = 0x801AE3AC; -func_i3_801AF9FC = 0x801AF9FC; -func_i3_801B10F8 = 0x801B10F8; -func_i3_801B6344 = 0x801B6344; -func_i3_801B6E54 = 0x801B6E54; -func_i3_801B7AF0 = 0x801B7AF0; -func_i3_801BA57C = 0x801BA57C; -func_i3_801BB26C = 0x801BB26C; -func_i3_801915A4 = 0x801915A4; -func_i3_80191BB8 = 0x80191BB8; -D_i3_801C2240 = 0x801C2240; -D_i3_801C4188 = 0x801C4188; +func_i3_80187754 = 0x80187754;//segment:ovl_i3 +func_i3_801932AC = 0x801932AC;//segment:ovl_i3 +func_i3_8019B1F0 = 0x8019B1F0;//segment:ovl_i3 +func_i3_8019B810 = 0x8019B810;//segment:ovl_i3 +func_i3_8019C200 = 0x8019C200;//segment:ovl_i3 +func_i3_8019D060 = 0x8019D060;//segment:ovl_i3 +func_i3_801AD688 = 0x801AD688;//segment:ovl_i3 +func_i3_801AE3AC = 0x801AE3AC;//segment:ovl_i3 +func_i3_801AF9FC = 0x801AF9FC;//segment:ovl_i3 +func_i3_801B10F8 = 0x801B10F8;//segment:ovl_i3 +func_i3_801B6344 = 0x801B6344;//segment:ovl_i3 +func_i3_801B6E54 = 0x801B6E54;//segment:ovl_i3 +func_i3_801B7AF0 = 0x801B7AF0;//segment:ovl_i3 +func_i3_801BA57C = 0x801BA57C;//segment:ovl_i3 +func_i3_801BB26C = 0x801BB26C;//segment:ovl_i3 +func_i3_801915A4 = 0x801915A4;//segment:ovl_i3 +func_i3_80191BB8 = 0x80191BB8;//segment:ovl_i3 +D_i3_801C2240 = 0x801C2240;//segment:ovl_i3 +D_i3_801C4188 = 0x801C4188;//segment:ovl_i3 D_i3_801C2250 = 0x801C2250;//size:0xA0 segment:ovl_i3 D_i3_801C22F0 = 0x801C22F0;//size:0x40 segment:ovl_i3 D_i3_801BF1F0 = 0x801BF1F0;//size:0x30 type:f32 segment:ovl_i3 @@ -114,70 +114,63 @@ D_i3_801C2740 = 0x801C2740; //segment:ovl_i3 size:0x28 D_i3_801C2768 = 0x801C2768; //segment:ovl_i3 size:0x38 D_i3_801C27A0 = 0x801C27A0; //segment:ovl_i3 size:0x20 -func_i4_80198594 = 0x80198594; -func_i4_80193CA4 = 0x80193CA4; -D_i4_801A03C0 = 0x801A03C0; -D_i4_8019EE80 = 0x8019EE80; -D_i4_801A03DC = 0x801A03DC; +func_i4_80198594 = 0x80198594;//segment:ovl_i4 +func_i4_80193CA4 = 0x80193CA4;//segment:ovl_i4 +D_i4_801A03C0 = 0x801A03C0;//segment:ovl_i4 +D_i4_8019EE80 = 0x8019EE80;//segment:ovl_i4 +D_i4_801A03DC = 0x801A03DC;//segment:ovl_i4 -func_i5_8018E3B0 = 0x8018E3B0; -func_i5_8018B720 = 0x8018B720; -func_i5_801990DC = 0x801990DC; -func_i5_801B6AEC = 0x801B6AEC; -func_i5_80189B80 = 0x80189B80; -func_i5_8018ADC4 = 0x8018ADC4; -func_i5_8018B96C = 0x8018B96C; -func_i5_8018BFB0 = 0x8018BFB0; -func_i5_8018E3CC = 0x8018E3CC; -func_i5_8018E5E8 = 0x8018E5E8; -func_i5_8018EFF0 = 0x8018EFF0; -func_i5_8018F0D8 = 0x8018F0D8; -func_i5_8018FA48 = 0x8018FA48; -func_i5_80199F8C = 0x80199F8C; -func_i5_801A3E70 = 0x801A3E70; -func_i5_801A4660 = 0x801A4660; -func_i5_801A4AF8 = 0x801A4AF8; -func_i5_801A5E2C = 0x801A5E2C; -func_i5_801A6134 = 0x801A6134; -func_i5_801A65E0 = 0x801A65E0; -func_i5_801A7D98 = 0x801A7D98; -func_i5_801B6E20 = 0x801B6E20; -D_i5_801B7584 = 0x801B7584; -D_i5_801B7608 = 0x801B7608; -D_i5_801B769C = 0x801B769C; +func_i5_8018E3B0 = 0x8018E3B0;//segment:ovl_i5 +func_i5_8018B720 = 0x8018B720;//segment:ovl_i5 +func_i5_801990DC = 0x801990DC;//segment:ovl_i5 +func_i5_801B6AEC = 0x801B6AEC;//segment:ovl_i5 +func_i5_80189B80 = 0x80189B80;//segment:ovl_i5 +func_i5_8018ADC4 = 0x8018ADC4;//segment:ovl_i5 +func_i5_8018B96C = 0x8018B96C;//segment:ovl_i5 +func_i5_8018BFB0 = 0x8018BFB0;//segment:ovl_i5 +func_i5_8018E3CC = 0x8018E3CC;//segment:ovl_i5 +func_i5_8018E5E8 = 0x8018E5E8;//segment:ovl_i5 +func_i5_8018EFF0 = 0x8018EFF0;//segment:ovl_i5 +func_i5_8018F0D8 = 0x8018F0D8;//segment:ovl_i5 +func_i5_8018FA48 = 0x8018FA48;//segment:ovl_i5 +func_i5_80199F8C = 0x80199F8C;//segment:ovl_i5 +func_i5_801A3E70 = 0x801A3E70;//segment:ovl_i5 +func_i5_801A4660 = 0x801A4660;//segment:ovl_i5 +func_i5_801A4AF8 = 0x801A4AF8;//segment:ovl_i5 +func_i5_801A5E2C = 0x801A5E2C;//segment:ovl_i5 +func_i5_801A6134 = 0x801A6134;//segment:ovl_i5 +func_i5_801A65E0 = 0x801A65E0;//segment:ovl_i5 +func_i5_801A7D98 = 0x801A7D98;//segment:ovl_i5 +func_i5_801B6E20 = 0x801B6E20;//segment:ovl_i5 +D_i5_801B7584 = 0x801B7584;//segment:ovl_i5 +D_i5_801B7608 = 0x801B7608;//segment:ovl_i5 +D_i5_801B769C = 0x801B769C;//segment:ovl_i5 +D_i5_801BA1E8 = 0x801BA1E8;//segment:ovl_i5 +D_i5_801BE250 = 0x801BE250;//segment:ovl_i5 size:0xA0 +D_i5_801BE2F0 = 0x801BE2F0;//segment:ovl_i5 size:0x12 D_i5_801B8198 = 0x801B8198;//size:0x210 segment:ovl_i5 D_i5_801B83A8 = 0x801B83A8;//size:0x814 type:f32 segment:ovl_i5 -D_i5_801BA1E8 = 0x801BA1E8; D_i5_801BA708 = 0x801BA708;//size:0xC type:Vec3f segment:ovl_i5 D_i5_801BAA50 = 0x801BAA50;//size:0x26 type:s16 segment:ovl_i5 -D_i5_801BBEE0 = 0x801BBEE0; +D_i5_801BBEE0 = 0x801BBEE0;//segment:ovl_i5 D_i5_801BBF00 = 0x801BBF00;//size:0xA78 segment:ovl_i5 -D_i5_801BE250 = 0x801BE250; -D_i5_801BE258 = 0x801BE258; -D_i5_801BE25C = 0x801BE25C; -D_i5_801BE274 = 0x801BE274; -D_i5_801BE280 = 0x801BE280; -D_i5_801BE284 = 0x801BE284; -D_i5_801BE29C = 0x801BE29C; -D_i5_801BE2FA = 0x801BE2FA; -D_i5_801BE2A4 = 0x801BE2A4; D_i5_801BE748 = 0x801BE748;//size:0x3600 type:Vtx segment:ovl_i5 D_i5_801C62D8 = 0x801C62D8;//size:0xC type:Vec3f segment:ovl_i5 D_i5_801C65B8 = 0x801C65B8;//size:0x870 segment:ovl_i5 D_i5_801C6E28 = 0x801C6E28;//size:0x34 type:s32 segment:ovl_i5 -func_i6_801888F4 = 0x801888F4; -func_i6_80197CC4 = 0x80197CC4; -func_i6_8018D16C = 0x8018D16C; +func_i6_801888F4 = 0x801888F4; //segment:ovl_i6 +func_i6_80197CC4 = 0x80197CC4; //segment:ovl_i6 +func_i6_8018D16C = 0x8018D16C; //segment:ovl_i6 D_i6_801A68B0 = 0x801A68B0;//size:0x48 type:Vec3f segment:ovl_i6 D_i6_801A68F8 = 0x801A68F8;//size:0xC type:f32 segment:ovl_i6 -D_i6_801A7F30 = 0x801A7F30; -D_i6_801A7F58 = 0x801A7F58; -D_i6_801A7F60 = 0x801A7F60; -D_i6_801A7F68 = 0x801A7F68; -D_i6_801A7F70 = 0x801A7F70; -D_i6_801A7F78 = 0x801A7F78; -D_i5_801BE308 = 0x801BE308; +D_i6_801A7F30 = 0x801A7F30; //segment:ovl_i6 +D_i6_801A7F58 = 0x801A7F58; //segment:ovl_i6 +D_i6_801A7F60 = 0x801A7F60; //segment:ovl_i6 +D_i6_801A7F68 = 0x801A7F68; //segment:ovl_i6 +D_i6_801A7F70 = 0x801A7F70; //segment:ovl_i6 +D_i6_801A7F78 = 0x801A7F78; //segment:ovl_i6 +D_i5_801BE308 = 0x801BE308; //segment:ovl_i6 D_ending_80196D08 = 0x80196D08;//size:0x280 segment:ovl_ending D_ending_80196FA0 = 0x80196FA0;//size:0x960 segment:ovl_ending diff --git a/src/main/fox_97F80.c b/src/main/fox_97F80.c index 42aba980..6f734dce 100644 --- a/src/main/fox_97F80.c +++ b/src/main/fox_97F80.c @@ -1,5 +1,5 @@ #include "global.h" -#include "prevent_bss_reordering.h" +// #include "prevent_bss_reordering.h" f32 __dx1; f32 __dx2; diff --git a/src/main/fox_context.c b/src/main/fox_context.c index 30d81846..7bebccf6 100644 --- a/src/main/fox_context.c +++ b/src/main/fox_context.c @@ -1,6 +1,498 @@ -#include "global.h" +// clang-format off +// extern int Dummyhalf; +struct Dummy0 {int x;}; +struct Dummy1 {int x;}; +struct Dummy2 {int x;}; +struct Dummy3 {int x;}; +struct Dummy4 {int x;}; +struct Dummy5 {int x;}; +struct Dummy6 {int x;}; +struct Dummy7 {int x;}; +struct Dummy8 {int x;}; +struct Dummy9 {int x;}; +struct Dummy10 {int x;}; +struct Dummy11 {int x;}; +struct Dummy12 {int x;}; +struct Dummy13 {int x;}; +struct Dummy14 {int x;}; +struct Dummy15 {int x;}; +struct Dummy16 {int x;}; +struct Dummy17 {int x;}; +struct Dummy18 {int x;}; +struct Dummy19 {int x;}; +struct Dummy20 {int x;}; +struct Dummy21 {int x;}; +struct Dummy22 {int x;}; +struct Dummy23 {int x;}; +struct Dummy24 {int x;}; +struct Dummy25 {int x;}; +struct Dummy26 {int x;}; +struct Dummy27 {int x;}; +struct Dummy28 {int x;}; +struct Dummy29 {int x;}; +struct Dummy30 {int x;}; +struct Dummy31 {int x;}; +struct Dummy32 {int x;}; +struct Dummy33 {int x;}; +struct Dummy34 {int x;}; +struct Dummy35 {int x;}; +struct Dummy36 {int x;}; +struct Dummy37 {int x;}; +struct Dummy38 {int x;}; +struct Dummy39 {int x;}; +struct Dummy40 {int x;}; +struct Dummy41 {int x;}; +struct Dummy42 {int x;}; +struct Dummy43 {int x;}; +struct Dummy44 {int x;}; +struct Dummy45 {int x;}; +struct Dummy46 {int x;}; +struct Dummy47 {int x;}; +struct Dummy48 {int x;}; +struct Dummy49 {int x;}; +struct Dummy50 {int x;}; +struct Dummy51 {int x;}; +struct Dummy52 {int x;}; +struct Dummy53 {int x;}; +struct Dummy54 {int x;}; +struct Dummy55 {int x;}; +struct Dummy56 {int x;}; +struct Dummy57 {int x;}; +struct Dummy58 {int x;}; +struct Dummy59 {int x;}; +struct Dummy60 {int x;}; +struct Dummy61 {int x;}; +struct Dummy62 {int x;}; +struct Dummy63 {int x;}; +struct Dummy64 {int x;}; +struct Dummy65 {int x;}; +struct Dummy66 {int x;}; +struct Dummy67 {int x;}; +struct Dummy68 {int x;}; +struct Dummy69 {int x;}; +struct Dummy70 {int x;}; +struct Dummy71 {int x;}; +struct Dummy72 {int x;}; +struct Dummy73 {int x;}; +// struct Dummy75 { int x; }; +// struct Dummy76 { int x; }; +// struct Dummy77 { int x; }; +// struct Dummy78 { int x; }; +// struct Dummy79 { int x; }; +// struct Dummy80 { int x; }; +// struct Dummy81 { int x; }; +// struct Dummy82 { int x; }; +// struct Dummy83 { int x; }; +// struct Dummy84 { int x; }; +// struct Dummy85 { int x; }; +// struct Dummy86 { int x; }; +// struct Dummy87 { int x; }; +// struct Dummy88 { int x; }; +// struct Dummy89 { int x; }; +// struct Dummy90 { int x; }; +// struct Dummy91 { int x; }; +// struct Dummy92 { int x; }; +// struct Dummy93 { int x; }; +// struct Dummy94 { int x; }; +// struct Dummy95 { int x; }; +// struct Dummy96 { int x; }; +// struct Dummy97 { int x; }; +// struct Dummy98 { int x; }; +// struct Dummy99 { int x; }; +// struct Dummy100 { int x; }; +// struct Dummy101 { int x; }; +// struct Dummy102 { int x; }; +// struct Dummy103 { int x; }; +// struct Dummy104 { int x; }; +// struct Dummy105 { int x; }; +// struct Dummy106 { int x; }; +// struct Dummy107 { int x; }; +// struct Dummy108 { int x; }; +// struct Dummy109 { int x; }; +// struct Dummy110 { int x; }; +// struct Dummy111 { int x; }; +// struct Dummy112 { int x; }; +// struct Dummy113 { int x; }; +// struct Dummy114 { int x; }; +// struct Dummy115 { int x; }; +// struct Dummy116 { int x; }; +// struct Dummy117 { int x; }; +// struct Dummy118 { int x; }; +// struct Dummy119 { int x; }; +// struct Dummy120 { int x; }; +// struct Dummy121 { int x; }; +// struct Dummy122 { int x; }; +// struct Dummy123 { int x; }; +// struct Dummy124 { int x; }; +// struct Dummy125 { int x; }; +// struct Dummy126 { int x; }; +// struct Dummy127 { int x; }; +// clang-format on +#include "sys.h" +#include "sf64level.h" +#include "sf64object.h" +#include "sf64player.h" + +s32 gOverlaySetup; +s32 gOverlayStage; +s32 D_80177824; // some sort of flag +s32 D_8017782C; // some sort of flag. all range related? +GameState gGameState; +s32 D_Timer_8017783C; // next game state timer? +s32 D_80177844; // timer for vs item spawn +OptionState gOptionMenuStatus; +s32 D_80177854; // pause-related state +s32 D_80177868; // some sort of state. pause-related? +LevelMode gLevelMode; +DrawMode gDrawMode; +s32 gPlayerNum; +s32 gCamCount; +s32 gTeamShields[6]; +s32 gSavedTeamShields[6]; +UNK_TYPE D_801778F0[6]; +s32 gTeamDamage[6]; +u8 D_80177930; // next planet path +f32 gGroundLevel; +f32 D_80177950; +f32 D_80177968; +f32 D_80177970; +f32 D_80177978; +f32 D_80177980; +f32 D_80177988; +f32 D_801779A0; +f32 D_801779B8; +f32 D_801779C0; +Vec3f D_801779D8; +Vec3f D_801779E8; +bool gExpertMode; +s32 D_80177A10[10]; +f32 D_80177A48[10]; +s32 gCsFrameCount; +u8 D_80177A98; +u8 D_80177AB0; +u8 D_80177AC8; +s32 D_80177AE0; +s32 gMainController; +s32 D_80177B40; +s32 gCurrentPlanet; // D_80177B48 // Arrow pointer? +s32 D_80177B50[7]; +s32 D_80177B70[7]; +PlanetId D_80177B90[7]; +s32 D_80177BB0[7]; +s32 D_80177BD8[22]; // overruns D_80177C30? +s32 D_80177C38[6]; +s32 D_80177C58[6]; +u8 gSoundMode; +s32 gVolumeSettings[3]; +u16 D_80177C90; +u8 gLevelType; +s32 D_80177CA0; +UNK_TYPE F_80177CA8; +f32 D_80177CB0; +UNK_TYPE F_80177CB8; +f32 D_80177CC0; +f32 D_80177CC8; +f32 D_80177CE8; +f32 D_80177D08; +f32 D_80177D20; +f32 D_80177D38; +f32 D_80177D50; +f32 D_80177D68; +UNK_TYPE F_80177D80; +UNK_TYPE F_80177DE8; +s32 gGameFrameCount; +s32 D_80177DC8; +s32 D_80177E70; +s32 D_80177E78; +s32 D_80177E80; +Vec3f D_80177E88; +Vec3f D_80177F10; +UNK_TYPE F_80178020; +s32 D_8017812C; +LevelId gCurrentLevel; +s32 D_8017827C; +s32 gBossActive; +s32 D_8017828C; +s32 D_80178294; +s32 gRadioState; +s32 D_801782A4; +s32 D_Timer_801782AC; +s32 D_Timer_801782B4; u8 D_800D3180[30] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -UNK_TYPE D_800D31A0[4] = { 0 }; +s32 D_801782C0; +s32 D_801782C8; +s32 D_801782D0; +s32 D_801782D8; +UNK_TYPE F_801782E0; +s32 D_801782E8; +UNK_TYPE F_801782F0; +s32 D_801782F8; +s32 D_80178300; +u16* D_80178308; +ObjectInit* D_80178310; +UNK_TYPE F_80178318; +s32 gFogRed; +s32 gFogGreen; +s32 gFogBlue; +s32 gFogAlpha; +s32 D_80178340; // alpha something +s32 D_80178348; // red something +s32 D_80178350; // green something +s32 D_80178354; // blue something +s32 D_80178358; // alpha target +s32 D_8017835C; // alpha step +s32 D_80178360; // 2 lights second color +s32 D_80178364; +s32 D_80178368; +f32 D_8017836C; // 2 lights second color brightness +f32 D_80178370; // Vec3f? +f32 D_80178374; +f32 D_80178378; +s32 D_8017837C; +u32 D_80178380[4]; // player alphas +s32 D_80178390[4]; // player reds +s32 D_801783A0[4]; // player greens +s32 D_801783B0[4]; // player alphas +UNK_TYPE D_801783C0[4]; +f32 D_801783D0; // something x translate +f32 D_801783D4; // something y translate +s32 gFogNear; // near +s32 gFogFar; // far +UNK_TYPE F_801783E0; +UNK_TYPE F_801783E4; +UNK_TYPE F_801783E8; +UNK_TYPE F_801783EC; +UNK_TYPE F_801783F0; +UNK_TYPE F_801783F4; +UNK_TYPE F_801783F8; +UNK_TYPE F_801783FC; +UNK_TYPE F_80178400; +UNK_TYPE F_80178404; +UNK_TYPE F_80178408; +UNK_TYPE F_8017840C; +s32 D_80178410; +f32 D_80178414; +f32 D_80178418; +UNK_TYPE F_8017841C; +f32 D_80178420; +f32 D_80178424; +f32 D_80178428; +f32 D_8017842C; +f32 D_80178430; +UNK_TYPE F_80178434; +UNK_TYPE F_80178438; +UNK_TYPE F_8017843C; +f32 D_80178440; +f32 D_80178444; +f32 D_80178448; +f32 D_80178450[3]; +f32 D_80178460[3]; +f32 D_80178470[3]; +f32 D_8017847C; +s32 D_80178480; +s32 D_80178484; +bool D_80178488; +UNK_TYPE F_8017848C; +UNK_TYPE F_80178490; +s32 D_80178494; +f32 D_80178498; +f32 D_8017849C; +f32 D_801784A0; +s32 D_801784A4; +UNK_TYPE F_801784A8; +s32 D_801784AC; +UNK_TYPE F_801784B0; +UNK_TYPE F_801784B4; +f32 D_801784B8; // effective Vec3f +f32 D_801784BC; +f32 D_801784C0; +f32 D_801784C4; // effective Vec3f +f32 D_801784C8; +f32 D_801784CC; +f32 D_801784D0; // effective Vec3f +f32 D_801784D4; +f32 D_801784D8; +s32 gLight1x; // Vec3i light direction +s32 gLight1y; +s32 gLight1z; +f32 D_801784E8; +f32 D_801784EC; // effective Vec3f? +f32 D_801784F0; +f32 D_801784F4; +f32 D_801784F8; // effective Vec3f +f32 D_801784FC; +f32 D_80178500; +s32 gLight2x; // Vec3i light direction alternate +s32 gLight2y; +s32 gLight2z; +f32 D_80178510; +UNK_TYPE F_801784514; +UNK_TYPE F_801784518; +UNK_TYPE F_80178451C; +f32 D_80178520; // effective Vec3f +f32 D_80178524; +f32 D_80178528; +UNK_TYPE F_80178452C; +UNK_TYPE F_801784530; +UNK_TYPE F_801784534; +f32 D_80178538; +f32 D_8017853C; +s32 D_80178540; +s32 D_80178544; +s32 gLight1R; // Color32 light color 1 +s32 gLight1G; +s32 gLight1B; +s32 gAmbientR; // Color32 ambient color +s32 gAmbientG; +s32 gAmbientB; +UNK_TYPE F_80178560; +s32 gLight2R; // Color32 light color 2 +s32 gLight2G; +s32 gLight2B; +UNK_TYPE P_800D31A0 = 0; +s32 D_80178570; // Color32 light color 2 modifier? +s32 D_80178574; +s32 D_80178578; +s32 D_80161A70; // Color32? start of bss +s32 D_80161A74; +s32 D_80161A78; +s32 D_80161A7C; +s32 D_80161A80; +s32 D_80161A84; +s32 D_80161A88; +s32 D_80161A8C; +u8 gGoldRingCount[4]; +u8 D_80161A94[4]; +s32 gHitCount; +s32 gSavedHitCount; +s16 gLifeCount[4]; +LaserStrength gLaserStrength[4]; +s32 D_80161AB8; +UNK_TYPE F_80161AC0[4]; +UNK_TYPE F_80161AD0[4]; +UNK_TYPE F_80161AEC[4]; +UNK_TYPE F_80161AF0[4]; +UNK_TYPE P_800D31A4 = 0; +Object_80 gObjects80[50]; +Object_4C gObjects4C[40]; +Actor gActors[60]; +Boss gBosses[4]; +Effect gEffects[100]; +Item gItems[20]; +PlayerShot gPlayerShots[16]; +UnkEntity30 gUnkEntities30[100]; +UnkEntity28 gUnkEntities28[65]; +BonusText gBonusText[10]; +s32 D_80176550[2]; +f32 D_80176558[2][100]; +f32 D_80176878[2][100]; +f32 D_80176B98[2][100]; +f32 D_80176EB8[2][100]; +f32 D_801771D8[2][100]; +f32 D_80177500[2][100]; +UNK_TYPE P_800D31A8 = 0; +u16 D_80177828; // enemy shot speed? +u8 D_80177830; // show level complete status overlay +s32 D_80177838; // level clear related +s32 D_80177840; // timer for mission accomplished scrren +s32 gBossHealthBar; +s32 D_80177850; // bonus text related. set to 15 but never read +s32 D_80177858[4]; +s32 D_80177870[4]; +s32 gHandicap[4]; +VsStage gVersusStage; +s32 D_801778A4; +s32 D_801778AC; +s32 D_801778C8; +bool gVersusMode; +u16 gBoostButton[4]; +u16 gBrakeButton[4]; +u16 gShootButton[4]; +u16 gBombButton[4]; +f32 D_80177958[4]; +s32 D_8017796C; +OSContPad* gInputHold; +OSContPad* gInputPress; +u8* D_80177984; +s32 D_80177990[4]; +f32 D_801779A8[4]; +u8 D_801779BC; +s32 gChargeTimers[4]; +f32 D_801779E4; +f32 D_801779F4; +s32 D_Timer_80177A00[4]; +s32 D_Timer_80177A38[4]; +s32 D_Timer_80177A70[4]; +s32 D_Timer_80177A88[4]; +f32 D_80177AA0[4]; +f32 D_80177AB8[4]; +s32 D_80177AD0[4]; +s32 D_80177AE8[4]; +s32 D_80177B00[4][4]; +u8 D_Timer_80177B44; +u8 D_80177B4C; +u8 D_80177B6C; +u8 D_80177B8C; +u8 D_80177BAC; +u16 D_Timer_80177BD0[4]; +u16 D_80177C30[4]; +s32 D_80177C50; +s32 D_80177C70; +s32 D_80177C78; +s32 D_80177C8C; +s32 D_80177C94; +s32 D_80177C9C; +s32 D_80177CA4; +s32 D_80177CAC; +s32 D_80177CB4; +s32 D_80177CBC; +s32 D_80177CC4; +s32 D_80177CD0[6]; +s32 D_80177CF0[6]; +s32 gRightWingHealth[4]; +s32 gLeftWingHealth[4]; +s32 D_80177D40[4]; +s32 D_80177D58[4]; +s32 D_80177D70[4]; +s32 D_80177D88[4]; +s32 gBombCount[4]; +s32 D_80177DB8[4]; +s32 D_80177DD0[4][10]; +s32 D_80177E74; +s32 D_80177E7C; +s32 D_80177E84; +Vec3f D_80177E98[10]; +f32 D_80177F20[65]; +f32 D_80178028[65]; +f32 D_80178130[65]; +u8 D_80178238[65]; +Player* gPlayer; +f32* D_80178288; +f32* D_80178290; +u32* D_80178298; +UNK_TYPE F_801782A0; +Object_58* gObjects58; +UNK_TYPE F_801782B0; +s32 D_801782B8; +s32 D_801782BC; +PosRot* D_801782C4; +f32* D_801782CC; +f32* D_801782D4; +f32* D_801782DC; +f32* D_801782E4; +f32* D_801782EC; +UNK_TYPE F_801782F4; +s32 D_801782FC; +UNK_TYPE F_80178304; +UNK_TYPE F_8017830C; +UNK_TYPE F_80178314; +UNK_TYPE F_8017831C; +UNK_TYPE F_80178324; +UNK_TYPE F_8017832C; +UNK_TYPE F_80178334; +UNK_TYPE F_8017833C; +UNK_TYPE F_80178344; +UNK_TYPE F_8017834C; diff --git a/src/main/fox_enmy2.c b/src/main/fox_enmy2.c index 88979745..132112c3 100644 --- a/src/main/fox_enmy2.c +++ b/src/main/fox_enmy2.c @@ -3669,9 +3669,9 @@ void func_80072594(Actor* actor) { } if (gLevelMode == LEVELMODE_ALL_RANGE) { - D_80177F24[actor->index] = actor->obj.pos.x; - D_8017802C[actor->index] = actor->obj.pos.z; - D_80178134[actor->index] = Math_ModF(actor->unk_0F4.y, 360.0f) + 180.0f; + D_80177F20[actor->index + 1] = actor->obj.pos.x; + D_80178028[actor->index + 1] = actor->obj.pos.z; + D_80178130[actor->index + 1] = Math_ModF(actor->unk_0F4.y, 360.0f) + 180.0f; D_80178238[actor->index + 1] = 1; } } @@ -4111,9 +4111,9 @@ void func_800763A4(Actor* actor) { func_80066254(actor); if (gLevelMode == LEVELMODE_ALL_RANGE) { - D_80177F24[actor->index] = actor->obj.pos.x; - D_8017802C[actor->index] = actor->obj.pos.z; - D_80178134[actor->index] = 1001.0f; + D_80177F20[actor->index + 1] = actor->obj.pos.x; + D_80178028[actor->index + 1] = actor->obj.pos.z; + D_80178130[actor->index + 1] = 1001.0f; } return; } @@ -4308,9 +4308,9 @@ void func_800763A4(Actor* actor) { } if (gLevelMode == LEVELMODE_ALL_RANGE) { - D_80177F24[actor->index] = actor->obj.pos.x; - D_8017802C[actor->index] = actor->obj.pos.z; - D_80178134[actor->index] = actor->unk_0F4.y + 180.0f; + D_80177F20[actor->index + 1] = actor->obj.pos.x; + D_80178028[actor->index + 1] = actor->obj.pos.z; + D_80178130[actor->index + 1] = actor->unk_0F4.y + 180.0f; } if (actor->obj.id == OBJ_ACTOR_197) { diff --git a/src/main/fox_game.c b/src/main/fox_game.c index 5242cfc2..676f879c 100644 --- a/src/main/fox_game.c +++ b/src/main/fox_game.c @@ -313,7 +313,7 @@ void func_800A25DC(void) { } } -void func_800A26C0(void) { +void Game_Update(void) { s32 i; u8 spBB; u16 var_v0_3; diff --git a/src/main/fox_hud.c b/src/main/fox_hud.c index aadb60b2..356bdda5 100644 --- a/src/main/fox_hud.c +++ b/src/main/fox_hud.c @@ -5923,7 +5923,7 @@ void func_80095604(Player* player) { D_8017835C = 16; if (D_80178340 == 255) { - D_800D3180[13] = Play_CheckMedalStatus(150) + 1; + D_800D3180[LEVEL_AQUAS] = Play_CheckMedalStatus(150) + 1; player->state_1C8 = PLAYERSTATE_1C8_6; player->timer_1F8 = 0; func_8001DBD0(10); diff --git a/src/main/fox_play.c b/src/main/fox_play.c index 64be73ec..a3be8a46 100644 --- a/src/main/fox_play.c +++ b/src/main/fox_play.c @@ -26,6 +26,7 @@ s32 D_80161A64; EnvSettings* sEnvSettings; extern f32 D_i3_801C4188; +extern s32 D_i4_801A03DC; #define MEM_ARRAY_ALLOCATE(arr, count) ((arr) = Memory_Allocate((count) * sizeof(*(arr)))) diff --git a/src/main/fox_tank.c b/src/main/fox_tank.c index 9c58281d..925b0aae 100644 --- a/src/main/fox_tank.c +++ b/src/main/fox_tank.c @@ -8,18 +8,6 @@ void func_800481F4(Player* player); s32 func_80046E40(Player* player, f32* hitboxData, s32* index, f32 xPos, f32 yPos, f32 zPos, f32 xRot, f32 yRot, f32 zRot, f32 arg9, f32 argA, f32 argB); -typedef struct { - /* 0x00 */ char pad0[0x54]; - /* 0x54 */ f32 unk_54; - /* 0x58 */ f32 unk_58; - /* 0x5C */ f32 unk_5C; - /* 0x60 */ char pad60[0xC]; - /* 0x6C */ f32 unk_6C; - /* 0x70 */ f32 unk_70; - /* 0x74 */ f32 unk_74; -} UnkStruct_D_i5_801BE250; // probably fake. investigate later. -extern UnkStruct_D_i5_801BE250 D_i5_801BE250; - static u8 D_800C9F00 = 0; static u8 D_800C9F04 = 0; static u8 D_800C9F08 = 0; @@ -33,14 +21,8 @@ static f32 D_800C9F28 = 0.0f; Vec3f D_800C9F2C = { 0.0f, 0.0f, 0.0f }; static s32 D_800C9F38 = 0; // unused -extern f32 D_i5_801BE258; -extern f32 D_i5_801BE25C; -extern f32 D_i5_801BE274; -extern f32 D_i5_801BE280; -extern f32 D_i5_801BE284; -extern f32 D_i5_801BE29C; -extern f32 D_i5_801BE2A4; -extern s16 D_i5_801BE2FA; +extern f32 D_i5_801BE250[40]; +extern s16 D_i5_801BE2F0[9]; void func_80043280(u16* text0, u16* text1, f32 zRot) { s32 py; @@ -331,13 +313,13 @@ void func_800444BC(Player* player) { func_i5_801B6E20(player->pos.x, player->unk_138 + player->unk_144, &sp40, &sp38, &sp3C); } if (gCurrentLevel == LEVEL_MACBETH) { - D_i5_801BE250.unk_6C = gGroundLevel; - D_i5_801BE250.unk_70 = D_i5_801BE250.unk_74 = 0.0f; + D_i5_801BE250[27] = gGroundLevel; + D_i5_801BE250[28] = D_i5_801BE250[29] = 0.0f; D_800C9F10 = 0.0f; func_80047754(player); - sp38 = D_i5_801BE250.unk_6C; - sp40 = D_i5_801BE250.unk_70; - sp3C = D_i5_801BE250.unk_74; + sp38 = D_i5_801BE250[27]; + sp40 = D_i5_801BE250[28]; + sp3C = D_i5_801BE250[29]; } if ((player->pos.y - sp30) < sp38) { if (player->vel.y < -10.0f) { @@ -861,16 +843,16 @@ void func_8004641C(Player* player, s32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 a sp80 = sp64.y + arg3; sp7C = sp64.z + arg4; if (func_800A8054(arg1, arg2, arg3, arg4, sp84, sp80, sp7C, &sp58, &sp4C)) { - if (D_i5_801BE250.unk_6C < arg3 + sp58.y) { - D_i5_801BE250.unk_6C = arg3 + sp58.y; + if (D_i5_801BE250[27] < arg3 + sp58.y) { + D_i5_801BE250[27] = arg3 + sp58.y; if (arg1 == OBJ_80_67) { player->unk_1DC = 0; D_800C9F04 = 1; } } - D_i5_801BE250.unk_70 = sp58.x; - D_i5_801BE250.unk_74 = sp58.z; - } else if ((arg1 == OBJ_80_67) && (D_i5_801BE250.unk_6C == 0.0f) && + D_i5_801BE250[28] = sp58.x; + D_i5_801BE250[29] = sp58.z; + } else if ((arg1 == OBJ_80_67) && (D_i5_801BE250[27] == 0.0f) && func_800A8054(arg1, arg2 + 20.0f, arg3, arg4, sp84, sp80, sp7C, &sp58, &sp4C)) { player->unk_1DC = 9; player->timer_1E8 = 15; @@ -917,9 +899,9 @@ void func_80046704(Player* player) { if (((player->pos.x - 820.0f) <= obj80->obj.pos.x) && (obj80->obj.pos.x <= (player->pos.x + 820.0f)) && ((player->pos.y - 50.0f) <= obj80->obj.pos.y) && (obj80->obj.pos.y <= (player->pos.y + 50.0f)) && (player->unk_138 <= obj80->obj.pos.z) && (obj80->obj.pos.z <= (player->unk_138 + 960.0f))) { - D_i5_801BE250.unk_6C = obj80->obj.pos.y; + D_i5_801BE250[27] = obj80->obj.pos.y; player->unk_064 = player->pos.x; - player->unk_068 = D_i5_801BE250.unk_6C - 3.0f; + player->unk_068 = D_i5_801BE250[27] - 3.0f; } } if ((obj80->obj.id == OBJ_80_59) || (obj80->obj.id == OBJ_80_60) || (obj80->obj.id == OBJ_80_61) || @@ -969,7 +951,7 @@ void func_80046704(Player* player) { if (!(((player->pos.x - 210.0f) <= obj80->obj.pos.x) && (obj80->obj.pos.x <= (player->pos.x + 210.0f))) && - (D_i5_801BE250.unk_6C == 0.f) && (player->vel.y < 0.f)) { + (D_i5_801BE250[27] == 0.f) && (player->vel.y < 0.f)) { player->unk_1DC = 9; player->timer_1E8 = 15; if ((player->pos.x - 200.0f) <= obj80->obj.pos.x) { @@ -979,7 +961,7 @@ void func_80046704(Player* player) { } } else { D_800C9F04 = 1; - D_i5_801BE250.unk_6C = obj80->obj.pos.y + 206.0f; + D_i5_801BE250[27] = obj80->obj.pos.y + 206.0f; player->unk_1DC = 0; } } @@ -990,9 +972,9 @@ void func_80046704(Player* player) { player->unk_068 = obj80->obj.pos.y + 204.0f; } } else if ((obj80->obj.id == OBJ_80_105) && func_i5_801A3C20(player->unk_138)) { - if (((player->pos.x - 200.0f) < D_i5_801BE250.unk_54) && - (D_i5_801BE250.unk_54 < (player->pos.x + 200.0f))) { - player->unk_068 = D_i5_801BE250.unk_58 - 1.0f; + if (((player->pos.x - 200.0f) < D_i5_801BE250[21]) && + (D_i5_801BE250[21] < (player->pos.x + 200.0f))) { + player->unk_068 = D_i5_801BE250[22] - 1.0f; } } } @@ -1179,49 +1161,52 @@ void func_80047504(Player* player) { } } +// lots of fake stuff here void func_80047754(Player* player) { u8 sp2F = false; - if ((D_i5_801BE2FA == 0) && (func_i5_801A3300(player, player->unk_138, player->unk_0E8) == 0)) { - if (((player->pos.x - 110.0f) < D_i5_801BE274) && (D_i5_801BE274 < (player->pos.x + 110.0f)) && - ((player->pos.y - 60.0f) < (D_i5_801BE258 + 30.0f)) && ((D_i5_801BE258 + 30.0f) < (player->pos.y + 60.f))) { - func_80047D38(player, D_i5_801BE258 + 29.0f); - player->unk_0E4 = D_i5_801BE25C; + if ((D_i5_801BE2F0[5] == 0) && (func_i5_801A3300(player, player->unk_138, player->unk_0E8) == 0)) { + if (((player->pos.x - 110.0f) < D_i5_801BE250[9]) && (D_i5_801BE250[9] < (player->pos.x + 110.0f)) && + ((player->pos.y - 60.0f) < (D_i5_801BE250[2] + 30.0f)) && + ((D_i5_801BE250[2] + 30.0f) < (player->pos.y + 60.f))) { + func_80047D38(player, D_i5_801BE250[2] + 29.0f); + player->unk_0E4 = D_i5_801BE250[3]; func_80047FBC(player); sp2F = true; - } else if (((player->pos.x - 150.0f) < D_i5_801BE274) && (D_i5_801BE274 < (player->pos.x + 150.0f)) && - ((player->pos.y - 60.0f) < (D_i5_801BE258 + 30.0f)) && - ((D_i5_801BE258 + 30.0f) < (player->pos.y + 60.0f))) { - func_80047E7C(player, D_i5_801BE274, D_i5_801BE258 + 30.0f); + } else { + if (((player->pos.x - 150.0f) < D_i5_801BE250[9]) && (D_i5_801BE250[9] < (player->pos.x + 150.0f)) && + ((player->pos.y - 60.0f) < (D_i5_801BE250[2] + 30.0f)) && + ((D_i5_801BE250[2] + 30.0f) < (player->pos.y + 60.0f))) { + func_80047E7C(player, D_i5_801BE250[9], D_i5_801BE250[2] + 30.0f); + } + if (1) {} } } if (func_i5_801A3C20(player->unk_138)) { - player->unk_0E4 = D_i5_801BE250.unk_5C; - if (((player->pos.x - 200.0f) < D_i5_801BE250.unk_54) && (D_i5_801BE250.unk_54 < (player->pos.x + 200.0f))) { - if (((player->pos.y - 60.0f) < D_i5_801BE250.unk_58) && (D_i5_801BE250.unk_58 < (player->pos.y + 60.0f))) { - func_80047D38(player, D_i5_801BE250.unk_58); + player->unk_0E4 = D_i5_801BE250[23]; + if (((player->pos.x - 200.0f) < D_i5_801BE250[21]) && (D_i5_801BE250[21] < (player->pos.x + 200.0f))) { + if (((player->pos.y - 60.0f) < D_i5_801BE250[22]) && (D_i5_801BE250[22] < (player->pos.y + 60.0f))) { + func_80047D38(player, D_i5_801BE250[22]); } else { - if ((100.0f < (D_i5_801BE250.unk_58 - player->pos.y)) && - ((D_i5_801BE250.unk_58 - player->pos.y) < 130.0f)) { + if ((100.0f < (D_i5_801BE250[22] - player->pos.y)) && ((D_i5_801BE250[22] - player->pos.y) < 130.0f)) { player->unk_0A0 = 999.0f; player->pos.y = player->unk_090.y - 1.0f; } goto label_29; } - if (!(((player->pos.x - 65.0f) < D_i5_801BE250.unk_54) && - (D_i5_801BE250.unk_54 < (player->pos.x + 65.0f)))) { - if (!(((player->pos.x - 100.0f) < D_i5_801BE250.unk_54) && - (D_i5_801BE250.unk_54 < (player->pos.x + 100.0f)))) { + if (!(((player->pos.x - 65.0f) < D_i5_801BE250[21]) && (D_i5_801BE250[21] < (player->pos.x + 65.0f)))) { + if (!(((player->pos.x - 100.0f) < D_i5_801BE250[21]) && + (D_i5_801BE250[21] < (player->pos.x + 100.0f)))) { player->unk_1D4 = 9; - Math_SmoothStepToF(&player->pos.y, D_i5_801BE250.unk_58 + 100.0f, 0.5f, 20.0f, 0); + Math_SmoothStepToF(&player->pos.y, D_i5_801BE250[22] + 100.0f, 0.5f, 20.0f, 0); player->vel.y = 2.0f; Math_SmoothStepToF(&player->unk_0E8, 0.0f, 0.5f, 20.0f, 0); - Math_SmoothStepToF(&player->pos.x, D_i5_801BE2A4, 0.02f, 30.0f, 0); + Math_SmoothStepToF(&player->pos.x, D_i5_801BE250[21], 0.02f, 30.0f, 0); Math_SmoothStepToF(&player->unk_12C, -30.0f, 1.0f, 10.0f, 0); - D_i5_801BE284 += 0; // fake? + D_i5_801BE250[13] += 0; // fake? } player->unk_188 = 0; - if (player->pos.x < D_i5_801BE250.unk_54) { + if (player->pos.x < D_i5_801BE250[21]) { player->vel.x = 0.0f; player->pos.x += 8.0f; } else { @@ -1233,25 +1218,27 @@ void func_80047754(Player* player) { } label_29: - if (((D_i5_801BE2FA == 1) || (player->unk_138 < -116467.875f)) && + if (((D_i5_801BE2F0[5] == 1) || (player->unk_138 < -116467.875f)) && (func_i5_801A3790(player, player->unk_138, player->unk_0E8) == 0)) { - if (((player->pos.x - 110.0f) < D_i5_801BE29C) && (D_i5_801BE29C < (player->pos.x + 110.0f)) && - ((player->pos.y - 60.0f) < (D_i5_801BE280 + 30.0f)) && - ((D_i5_801BE280 + 30.0f) < (player->pos.y + 60.0f))) { + if (((player->pos.x - 110.0f) < D_i5_801BE250[19]) && (D_i5_801BE250[19] < (player->pos.x + 110.0f)) && + ((player->pos.y - 60.0f) < (D_i5_801BE250[12] + 30.0f)) && + ((D_i5_801BE250[12] + 30.0f) < (player->pos.y + 60.0f))) { sp2F = true; - func_80047D38(player, D_i5_801BE280 + 29.0f); - player->unk_0E4 = D_i5_801BE284; // not fake, but weird - player->unk_0E4 = D_i5_801BE284; + func_80047D38(player, D_i5_801BE250[12] + 29.0f); + player->unk_0E4 = D_i5_801BE250[13]; // not fake, but weird + player->unk_0E4 = D_i5_801BE250[13]; func_80047FBC(player); } else { - if (((player->pos.x - 150.0f) < D_i5_801BE29C) && (D_i5_801BE29C < (player->pos.x + 150.0f)) && - ((player->pos.y - 60.0f) < (D_i5_801BE280 + 30.0f)) && - ((D_i5_801BE280 + 30.0f) < (player->pos.y + 60.0f))) { - func_80047E7C(player, D_i5_801BE29C, D_i5_801BE280 + 30.0f); + if (((player->pos.x - 150.0f) < D_i5_801BE250[19]) && (D_i5_801BE250[19] < (player->pos.x + 150.0f)) && + ((player->pos.y - 60.0f) < (D_i5_801BE250[12] + 30.0f)) && + ((D_i5_801BE250[12] + 30.0f) < (player->pos.y + 60.0f))) { + func_80047E7C(player, D_i5_801BE250[19], D_i5_801BE250[12] + 30.0f); } } } if (!sp2F) { + if (!D_i5_801BE250) {} + func_80046704(player); } } diff --git a/src/main/sys_1FA60.c b/src/main/sys_1FA60.c index 54e438f5..6956496b 100644 --- a/src/main/sys_1FA60.c +++ b/src/main/sys_1FA60.c @@ -1,4 +1,4 @@ -#include "global.h" +#include "sys.h" void func_8001EE60(void) { } diff --git a/src/main/sys_fault.c b/src/main/sys_fault.c index 6ac6d778..14a322e2 100644 --- a/src/main/sys_fault.c +++ b/src/main/sys_fault.c @@ -1,4 +1,5 @@ -#include "global.h" +#include "sys.h" +#include "PR/os_internal.h" FaultMgr gFaultMgr; diff --git a/src/main/sys_joybus.c b/src/main/sys_joybus.c index ea68fb75..fb6ad5ac 100644 --- a/src/main/sys_joybus.c +++ b/src/main/sys_joybus.c @@ -1,4 +1,4 @@ -#include "global.h" +#include "sys.h" OSContPad gControllerHold[4]; OSContPad gControllerPress[4]; diff --git a/src/main/sys_lib.c b/src/main/sys_lib.c index 5e89f103..953b5084 100644 --- a/src/main/sys_lib.c +++ b/src/main/sys_lib.c @@ -1,13 +1,13 @@ -#include "global.h" +#include "sys.h" s32 Lib_vsPrintf(char* dst, const char* fmt, va_list args) { return vsprintf(dst, fmt, args); } -void Lib_vTable(s32 arg0, void (**arg1)(s32, s32), s32 arg2, s32 arg3) { - void (*temp)(s32, s32) = arg1[arg0]; +void Lib_vTable(s32 index, void (**table)(s32, s32), s32 arg0, s32 arg1) { + void (*func)(s32, s32) = table[index]; - temp(arg2, arg3); + func(arg0, arg1); } void Lib_SwapBuffers(u8* buf1, u8* buf2, s32 len) { @@ -21,18 +21,16 @@ void Lib_SwapBuffers(u8* buf1, u8* buf2, s32 len) { } } -typedef s32 (*CompareFunc)(void*, void*); - -void Lib_QuickSort(u8* first, u32 curLen, u32 size, CompareFunc cFunc) { +void Lib_QuickSort(u8* first, u32 length, u32 size, CompareFunc cFunc) { u32 splitIdx; u8* last; u8* right; u8* left; while (1) { - last = first + (curLen - 1) * size; + last = first + (length - 1) * size; - if (curLen == 2) { + if (length == 2) { if (cFunc(first, last) > 0) { Lib_SwapBuffers(first, last, size); } @@ -58,27 +56,27 @@ void Lib_QuickSort(u8* first, u32 curLen, u32 size, CompareFunc cFunc) { } Lib_SwapBuffers(last, left, size); splitIdx = (left - first) / size; - if (curLen / 2 < splitIdx) { - if ((curLen - splitIdx) > 2) { - Lib_QuickSort(left + size, curLen - splitIdx - 1, size, cFunc); + if (length / 2 < splitIdx) { + if ((length - splitIdx) > 2) { + Lib_QuickSort(left + size, length - splitIdx - 1, size, cFunc); } if (splitIdx < 2) { return; } left = first; - curLen = splitIdx; + length = splitIdx; } else { if (splitIdx >= 2) { Lib_QuickSort(first, splitIdx, size, cFunc); } - if ((curLen - splitIdx) <= 2) { + if ((length - splitIdx) <= 2) { return; } first = left + size; - curLen -= splitIdx + 1; + length -= splitIdx + 1; } } } diff --git a/src/main/sys_lights.c b/src/main/sys_lights.c index dc8ae5bf..f063877a 100644 --- a/src/main/sys_lights.c +++ b/src/main/sys_lights.c @@ -1,4 +1,4 @@ -#include "global.h" +#include "sys.h" void Lights_AddLight(Gfx** dList) { gSPNumLights((*dList)++, 7); diff --git a/src/main/sys_main.c b/src/main/sys_main.c index 3ea50708..623a5017 100644 --- a/src/main/sys_main.c +++ b/src/main/sys_main.c @@ -1,12 +1,16 @@ -#include "global.h" +#include "sys.h" + +void func_8000FFCC(void); +SPTask* func_8001DF50(void); +void func_8001DCE0(void); +void func_8001DECC(void); s32 sGammaMode = 1; -#ifdef BSS_IMPORT + SPTask* gCurrentTask; SPTask* sAudioTasks[1]; SPTask* sGfxTasks[2]; SPTask* sNewAudioTasks[1]; -// 0x4 gap here SPTask* sNewGfxTasks[2]; u32 gSegments[16]; // 800E1FD0 OSMesgQueue gPiMgrCmdQueue; // 800E2010 @@ -74,81 +78,6 @@ OSThread gTimerThread; // 800DFC50 u8 gTimerThreadStack[0x1000]; // 800DFE00 OSThread gSerialThread; // 800E0E00 u8 gSerialThreadStack[0x1000]; // 800E0FB0 -#else -extern u8 gAudioThreadStack[0x1000]; // 800DDAA0 -extern OSThread gGraphicsThread; // 800DEAA0 -extern u8 gGraphicsThreadStack[0x1000]; // 800DEC50 -extern OSThread gTimerThread; // 800DFC50 -extern u8 gTimerThreadStack[0x1000]; // 800DFE00 -extern OSThread gSerialThread; // 800E0E00 -extern u8 gSerialThreadStack[0x1000]; // 800E0FB0 - -extern SPTask* gCurrentTask; -extern SPTask* sAudioTasks[1]; -extern SPTask* sGfxTasks[2]; -extern SPTask* sNewAudioTasks[1]; -// 0x4 gap here -extern SPTask* sNewGfxTasks[2]; -extern u32 gSegments[16]; // 800E1FD0 -extern OSMesgQueue gPiMgrCmdQueue; // 800E2010 -extern OSMesg sPiMgrCmdBuff[50]; // 800E2028 - -extern OSMesgQueue gDmaMsgQueue; -extern void* sDmaMsgBuff[1]; -extern OSIoMesg gDmaIOMsg; -extern OSMesgQueue gSerialEventQueue; -extern void* sSerialEventBuff[1]; -extern OSMesgQueue gMainThreadMsgQueue; -extern void* sMainThreadMsgBuff[32]; -extern OSMesgQueue gTaskMsgQueue; -extern void* sTaskMsgBuff[16]; -extern OSMesgQueue gAudioVImsgQueue; -extern void* sAudioVImsgBuff[1]; -extern OSMesgQueue gAudioTaskMsgQueue; -extern void* sAudioTaskMsgBuff[1]; -extern OSMesgQueue gGfxVImsgQueue; -extern void* sGfxVImsgBuff[4]; -extern OSMesgQueue gGfxTaskMsgQueue; -extern void* sGfxTaskMsgBuff[2]; -extern OSMesgQueue gSerialThreadMsgQueue; -extern void* sSerialThreadMsgBuff[8]; -extern OSMesgQueue gControllerMsgQueue; -extern void* sControllerMsgBuff[1]; -extern OSMesgQueue gSaveMsgQueue; -extern void* sSaveMsgBuff[1]; -extern OSMesgQueue gTimerTaskMsgQueue; -extern void* sTimerTaskMsgBuff[16]; -extern OSMesgQueue gTimerWaitMsgQueue; -extern void* sTimerWaitMsgBuff[1]; - -extern GfxPool gGfxPools[2]; - -extern GfxPool* gGfxPool; -extern SPTask* gGfxTask; -extern Vp* gViewport; -extern Mtx* gGfxMtx; -extern Gfx* gUnkDisp1; -extern Gfx* gMasterDisp; -extern Gfx* gUnkDisp2; -extern Lightsn* gLight; -extern FrameBuffer* gFrameBuffer; -extern u16* gTextureRender; - -extern u8 D_80137E78; -extern u32 gSysFrameCount; -extern u8 gStartNMI; -extern u8 gStopTasks; -extern u8 D_80137E84[4]; -extern u16 gFillScreenColor; -extern u16 gFillScreen; - -extern u8 gUnusedStack[0x1000]; -extern OSThread sIdleThread; // 80138E90 -extern u8 sIdleThreadStack[0x1000]; // 801390A0 -extern OSThread gMainThread; // 8013A040 -extern u8 sMainThreadStack[0x1000]; // 8013A1F0 -extern OSThread gAudioThread; // 8013B1F0 -#endif void Main_Initialize(void) { u8 i; @@ -207,11 +136,11 @@ void Graphics_SetTask(void) { gGfxTask->msg = (OSMesg) TASK_MESG_2; gGfxTask->task.t.type = M_GFXTASK; gGfxTask->task.t.flags = 0; - gGfxTask->task.t.ucode_boot = __rspboot_start; - gGfxTask->task.t.ucode_boot_size = (uintptr_t) __rspboot_end - (uintptr_t) __rspboot_start; - gGfxTask->task.t.ucode = __f3dex_start; + gGfxTask->task.t.ucode_boot = rspbootTextStart; + gGfxTask->task.t.ucode_boot_size = (uintptr_t) rspbootTextEnd - (uintptr_t) rspbootTextStart; + gGfxTask->task.t.ucode = gspF3DEX_fifoTextStart; gGfxTask->task.t.ucode_size = SP_UCODE_SIZE; - gGfxTask->task.t.ucode_data = (u64*) &gF3dexData; + gGfxTask->task.t.ucode_data = (u64*) &gspF3DEX_fifoDataStart; gGfxTask->task.t.ucode_data_size = SP_UCODE_DATA_SIZE; gGfxTask->task.t.dram_stack = gDramStack; gGfxTask->task.t.dram_stack_size = SP_DRAM_STACK_SIZE8; @@ -314,7 +243,7 @@ void Graphics_ThreadEntry(void* arg0) { { gSPSegment(gUnkDisp1++, 0, 0); gSPDisplayList(gMasterDisp++, gGfxPool->unkDL1); - func_800A26C0(); + Game_Update(); gSPEndDisplayList(gUnkDisp1++); gSPEndDisplayList(gUnkDisp2++); gSPDisplayList(gMasterDisp++, gGfxPool->unkDL2); @@ -335,7 +264,7 @@ void Graphics_ThreadEntry(void* arg0) { { gSPSegment(gUnkDisp1++, 0, 0); gSPDisplayList(gMasterDisp++, gGfxPool->unkDL1); - func_800A26C0(); + Game_Update(); if (gStartNMI == 1) { Graphics_NMIWipe(); } diff --git a/src/main/sys_math.c b/src/main/sys_math.c index 58f50661..2cd5c35b 100644 --- a/src/main/sys_math.c +++ b/src/main/sys_math.c @@ -1,4 +1,5 @@ -#include "global.h" +#include "prevent_bss_reordering.h" +#include "sys.h" s32 sSeededRandSeed3; s32 sRandSeed1; diff --git a/src/main/sys_math64.c b/src/main/sys_math64.c index 8873c62f..23399534 100644 --- a/src/main/sys_math64.c +++ b/src/main/sys_math64.c @@ -1,35 +1,35 @@ -#include "global.h" +#include "sys.h" -f32 func_8001FAB0(f32 x) { +f32 Math_TanF(f32 x) { return __sinf(x) / __cosf(x); } -f32 func_8001FAE4(f32 x) { - return func_8001FE60(x); +f32 Math_FloorF(f32 x) { + return __floorf(x); } -f32 func_8001FB04(f32 x) { - return func_8001FE98(x); +f32 Math_CeilF(f32 x) { + return __ceilf(x); } -f64 func_8001FB24(f64 x) { +f64 Math_Fabs(f64 x) { return (x < 0.0) ? -x : x; } -f32 func_8001FB58(f32 x) { +f32 Math_FabsF(f32 x) { return (x < 0.0f) ? -x : x; } -f32 func_8001FB88(f32 x) { - return func_8001FF40(x); +f32 Math_NearbyIntF(f32 x) { + return __nearbyintf(x); } -f32 func_8001FBA8(f32 x) { - return func_8001FED0(x); +f32 Math_TruncF(f32 x) { + return __truncf(x); } -f32 func_8001FBC8(f32 x) { - return func_8001FF08(x); +f32 Math_RoundF(f32 x) { + return __roundf(x); } f32 Math_FAtanF(f32 x) { diff --git a/src/main/sys_matrix.c b/src/main/sys_matrix.c index 9d255a47..f50cfb64 100644 --- a/src/main/sys_matrix.c +++ b/src/main/sys_matrix.c @@ -1,4 +1,4 @@ -#include "global.h" +#include "sys.h" Mtx gIdentityMtx = { { { diff --git a/src/main/sys_memory.c b/src/main/sys_memory.c index c83fbbee..9520e9a8 100644 --- a/src/main/sys_memory.c +++ b/src/main/sys_memory.c @@ -1,4 +1,5 @@ -#include "global.h" +#include "prevent_bss_reordering.h" +#include "sys.h" s32 sMemoryBuffer[0x2200]; s32* sMemoryPtr; diff --git a/src/main/sys_save.c b/src/main/sys_save.c index 20ce9136..13cf52ea 100644 --- a/src/main/sys_save.c +++ b/src/main/sys_save.c @@ -1,6 +1,6 @@ -#include "global.h" +#include "sys.h" SaveFile gSaveIOBuffer; SaveFile sPrevSaveData; diff --git a/src/main/sys_sprintf.c b/src/main/sys_sprintf.c index 33df713d..0b2e506f 100644 --- a/src/main/sys_sprintf.c +++ b/src/main/sys_sprintf.c @@ -1,4 +1,4 @@ -#include "global.h" +#include "sys.h" char D_800C7C80[] = "$Id: sprintf.c,v 1.5 1997/03/19 02:28:53 hayakawa Exp $"; diff --git a/src/main/sys_timer.c b/src/main/sys_timer.c index fa5ab6e0..071c12ed 100644 --- a/src/main/sys_timer.c +++ b/src/main/sys_timer.c @@ -1,4 +1,4 @@ -#include "global.h" +#include "sys.h" TimerTask sTimerTasks[0x10]; diff --git a/src/overlays/ovl_i2/fox_me.c b/src/overlays/ovl_i2/fox_me.c index 30bfb3db..82501394 100644 --- a/src/overlays/ovl_i2/fox_me.c +++ b/src/overlays/ovl_i2/fox_me.c @@ -2331,7 +2331,7 @@ void func_i2_8018E084(Player* player) { player->state_1C8 = PLAYERSTATE_1C8_6; player->timer_1F8 = 0; D_8017837C = 4; - D_800D3180[1] = Play_CheckMedalStatus(0xC8) + 1; + D_800D3180[LEVEL_METEO] = Play_CheckMedalStatus(0xC8) + 1; } } } else { diff --git a/src/overlays/ovl_i2/fox_sx.c b/src/overlays/ovl_i2/fox_sx.c index 7d77ce0d..7439ca70 100644 --- a/src/overlays/ovl_i2/fox_sx.c +++ b/src/overlays/ovl_i2/fox_sx.c @@ -1777,7 +1777,7 @@ void func_i2_80194728(Player* player) { D_8017837C = 4; player->timer_1F8 = 0; func_800A6148(); - D_800D3180[2] = Play_CheckMedalStatus(150) + 1; + D_800D3180[LEVEL_SECTOR_X] = Play_CheckMedalStatus(150) + 1; } } break; diff --git a/src/overlays/ovl_i4/fox_bo.c b/src/overlays/ovl_i4/fox_bo.c index 2c5edd47..249f1592 100644 --- a/src/overlays/ovl_i4/fox_bo.c +++ b/src/overlays/ovl_i4/fox_bo.c @@ -1,5 +1,5 @@ -#include "prevent_bss_reordering.h" -#include "prevent_bss_reordering2.h" +// #include "prevent_bss_reordering.h" +// #include "prevent_bss_reordering2.h" #include "global.h" typedef struct UnkStruct_D_i4_801A03E0 { @@ -394,7 +394,7 @@ void func_i4_8018C158(Actor* actor) { break; case 390: - if (D_800D3180[14] == 0) { + if (D_800D3180[LEVEL_FORTUNA] == 0) { Radio_PlayMessage(gMsg_ID_9285, RCID_FOX); } else { Radio_PlayMessage(gMsg_ID_11241, RCID_FOX); @@ -1593,7 +1593,7 @@ void func_i4_8018F94C(Player* player) { gNextLevel = LEVEL_VENOM_1; func_8001CA24(0); Audio_KillSfx(player->sfxPos); - D_800D3180[17] = Play_CheckMedalStatus(150) + 1; + D_800D3180[LEVEL_BOLSE] = Play_CheckMedalStatus(150) + 1; for (i = 1; i < 6; i++) { D_80177C38[i] = gTeamShields[i]; diff --git a/src/overlays/ovl_i4/fox_fo.c b/src/overlays/ovl_i4/fox_fo.c index 785073fd..dcc8a4c6 100644 --- a/src/overlays/ovl_i4/fox_fo.c +++ b/src/overlays/ovl_i4/fox_fo.c @@ -593,8 +593,14 @@ void func_i4_8018906C(void) { f32 D_i4_8019EE4C[] = { -200.0f, 200.0f, -50.0f, -2000.0f }; f32 D_i4_8019EE5C[] = { 0.0f, 30.0f, -90.0f, 0.0f }; -f32 D_i4_8019EE6C[] = { -100.0f, -200.0f, -300.0f }; -s32 D_i4_8019EE78[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +f32 D_i4_8019EE6C[] = { -100.0f, -200.0f, -300.0f, 0.0f }; +s32 D_i4_8019EE7C = 0; // padding for dword aligned matrix? +Matrix D_i4_8019EE80 = { { + { 0.0f, 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f, 0.0f }, + { 0.0f, 0.0f, 0.0f, 0.0f }, +} }; void func_i4_801890EC(Actor* actor, s32 arg1) { Actor_Initialize(actor); @@ -1091,7 +1097,7 @@ void func_i4_8018927C(Player* player) { for (i = 0; i < 6; i++) { D_80177CF0[i] = D_80177CD0[i]; } - D_800D3180[0xE] = Play_CheckMedalStatus(50) + 1; + D_800D3180[LEVEL_FORTUNA] = Play_CheckMedalStatus(50) + 1; } break; @@ -1318,7 +1324,7 @@ void func_i4_8018927C(Player* player) { } // clang-format on - D_800D3180[14] = Play_CheckMedalStatus(50) + 1; + D_800D3180[LEVEL_FORTUNA] = Play_CheckMedalStatus(50) + 1; func_800A6148(); break; } diff --git a/src/overlays/ovl_i4/fox_ka.c b/src/overlays/ovl_i4/fox_ka.c index dfb4fbb3..25c74c6b 100644 --- a/src/overlays/ovl_i4/fox_ka.c +++ b/src/overlays/ovl_i4/fox_ka.c @@ -1557,7 +1557,7 @@ void func_i4_80197290(Player* player) { player->state_1C8 = PLAYERSTATE_1C8_6; player->timer_1F8 = 0; D_8017837C = 4; - D_800D3180[16] = Play_CheckMedalStatus(150) + 1; + D_800D3180[LEVEL_KATINA] = Play_CheckMedalStatus(150) + 1; } } switch (gCsFrameCount) { diff --git a/src/overlays/ovl_i4/fox_sz.c b/src/overlays/ovl_i4/fox_sz.c index 7d05e009..99b68928 100644 --- a/src/overlays/ovl_i4/fox_sz.c +++ b/src/overlays/ovl_i4/fox_sz.c @@ -52,7 +52,7 @@ void func_i4_80199900(Actor* actor, s32 arg1) { func_800182F4(0x110100FF); } - if ((D_i4_801A0560 == 3) && (D_800D3180[8] != 0)) { + if ((D_i4_801A0560 == 3) && (D_800D3180[LEVEL_ZONESS] != 0)) { D_800C9B4C = D_8015F928 + 110; } } @@ -1344,7 +1344,7 @@ void func_i4_8019C85C(Player* player) { player->state_1C8 = PLAYERSTATE_1C8_6; player->timer_1F8 = 0; D_8017837C = 4; - D_800D3180[18] = Play_CheckMedalStatus(100) + 1; + D_800D3180[LEVEL_SECTOR_Z] = Play_CheckMedalStatus(100) + 1; } } break; diff --git a/src/overlays/ovl_i5/fox_ma.c b/src/overlays/ovl_i5/fox_ma.c index 68662833..3a45ec52 100644 --- a/src/overlays/ovl_i5/fox_ma.c +++ b/src/overlays/ovl_i5/fox_ma.c @@ -6419,7 +6419,7 @@ void func_i5_801AF8F4(Player* player) { } break; case 1420: - if (D_800D3180[8] != 0) { + if (D_800D3180[LEVEL_ZONESS] != 0) { func_i5_801AF44C(); } break; @@ -6427,7 +6427,7 @@ void func_i5_801AF8F4(Player* player) { D_i5_801BA88C = 170.0f; break; case 1500: - if (D_800D3180[8] != 0) { + if (D_800D3180[LEVEL_ZONESS] != 0) { Radio_PlayMessage(gMsg_ID_17300, RCID_KATT); } break; @@ -6517,7 +6517,7 @@ void func_i5_801AF8F4(Player* player) { D_8017837C = 4; func_800A6148(); func_8001DBD0(10); - D_800D3180[11] = Play_CheckMedalStatus(150) + 1; + D_800D3180[LEVEL_MACBETH] = Play_CheckMedalStatus(150) + 1; } } } @@ -7024,17 +7024,17 @@ void func_i5_801B3D04(Player* player) { } break; case 680: - if (D_800D3180[8] != 0) { + if (D_800D3180[LEVEL_ZONESS] != 0) { func_i5_801B3718(); } break; case 1027: - if (D_800D3180[8] != 0) { + if (D_800D3180[LEVEL_ZONESS] != 0) { Radio_PlayMessage(gMsg_ID_17350, RCID_KATT); } break; case 1065: - if (D_800D3180[8] != 0) { + if (D_800D3180[LEVEL_ZONESS] != 0) { gActors[8].state++; } break; @@ -7048,7 +7048,7 @@ void func_i5_801B3D04(Player* player) { gActors[2].state++; break; case 1158: - if (D_800D3180[8] != 0) { + if (D_800D3180[LEVEL_ZONESS] != 0) { Object_Kill(&gActors[8].obj, gActors[8].sfxPos); } /* fallthrough */ @@ -7083,7 +7083,7 @@ void func_i5_801B3D04(Player* player) { D_8017837C = 4; func_800A6148(); func_8001DBD0(10); - D_800D3180[11] = Play_CheckMedalStatus(150) + 1; + D_800D3180[LEVEL_MACBETH] = Play_CheckMedalStatus(150) + 1; } } } diff --git a/src/overlays/ovl_i5/fox_ti_cs.c b/src/overlays/ovl_i5/fox_ti_cs.c index 20ccf930..33914531 100644 --- a/src/overlays/ovl_i5/fox_ti_cs.c +++ b/src/overlays/ovl_i5/fox_ti_cs.c @@ -526,7 +526,7 @@ void func_i5_801882CC(Player* player) { D_8017837C = 4; func_800A6148(); func_8001DBD0(10); - D_800D3180[12] = Play_CheckMedalStatus(150) + 1; + D_800D3180[LEVEL_TITANIA] = Play_CheckMedalStatus(150) + 1; } } } diff --git a/src/overlays/ovl_i6/fox_andross.c b/src/overlays/ovl_i6/fox_andross.c index 9a9d02f3..029157d7 100644 --- a/src/overlays/ovl_i6/fox_andross.c +++ b/src/overlays/ovl_i6/fox_andross.c @@ -3511,8 +3511,9 @@ void func_i6_80193AE4(s32 actorIndex) { Audio_PlaySfx(0x3100000C, actor->sfxPos, 4, &D_800C5D34, &D_800C5D34, &D_800C5D3C); } -//! @bug This references a variable in another overlay, causing undefined behavior -//! In US v1.1, that address contains the store instruction for player->vel.y = vel.y; in func_i6_80196BF8 +//! @bug This references a variable in another overlay, causing undefined behavior. +//! In US v1.1, that address contains the store instruction for player->vel.y = vel.y; in func_i6_80196BF8. Setting this +//! to nop is harmless, as the overlay will be unloaded next frame. extern s32 D_ending_80196D00; void func_i6_80193C4C(Player* player) { @@ -3986,7 +3987,7 @@ void func_i6_80193C4C(Player* player) { if (D_80178340 == 0xFF) { gNextGameState = GSTATE_CREDITS; D_ending_80196D00 = 0; - D_800D3180[9] = Play_CheckMedalStatus(200) + 1; + D_800D3180[LEVEL_VENOM_ANDROSS] = Play_CheckMedalStatus(200) + 1; func_8001DC6C(0, 0x1B); } } diff --git a/src/overlays/ovl_i6/fox_sy.c b/src/overlays/ovl_i6/fox_sy.c index d689c4ce..9d7ef4eb 100644 --- a/src/overlays/ovl_i6/fox_sy.c +++ b/src/overlays/ovl_i6/fox_sy.c @@ -2105,7 +2105,7 @@ void func_i6_8019EE60(Player* player) { player->state_1C8 = PLAYERSTATE_1C8_6; player->timer_1F8 = 0; D_8017837C = 4; - D_800D3180[5] = Play_CheckMedalStatus(150) + 1; + D_800D3180[LEVEL_SECTOR_Y] = Play_CheckMedalStatus(150) + 1; } } break; diff --git a/src/overlays/ovl_menu/fox_map.c b/src/overlays/ovl_menu/fox_map.c index 59964647..84dd91a7 100644 --- a/src/overlays/ovl_menu/fox_map.c +++ b/src/overlays/ovl_menu/fox_map.c @@ -6,7 +6,7 @@ #include "mods.h" #include "prevent_bss_reordering.h" -#include "prevent_bss_reordering2.h" +// #include "prevent_bss_reordering2.h" #include "global.h" #include "fox_map.h" #include "fox_option.h" @@ -35,8 +35,8 @@ s32 D_menu_801CD944; // mapState s32 D_menu_801CD948; s32 D_menu_801CD94C; s32 D_menu_801CD950; -s32 sCurrentPlanetId; // sCurrentPlanetId -s32 D_menu_801CD958; +PlanetId sCurrentPlanetId; // sCurrentPlanetId +PlanetId sNextPlanetId; s32 D_menu_801CD95C; s32 D_menu_801CD960; s32 D_menu_801CD964; @@ -194,44 +194,60 @@ extern u16 D_6000000[]; s32 D_menu_801AF420[2] = { 10, 20 }; u16* D_menu_801AF428[15][2] = { - gMsg_ID_1220, gMsg_ID_1230, gMsg_ID_1320, gMsg_ID_1330, gMsg_ID_1300, gMsg_ID_1310, gMsg_ID_1420, gMsg_ID_1430, - gMsg_ID_1260, gMsg_ID_1270, gMsg_ID_1440, gMsg_ID_1450, gMsg_ID_1360, gMsg_ID_1370, gMsg_ID_1340, gMsg_ID_1350, - gMsg_ID_1400, gMsg_ID_1410, gMsg_ID_1200, gMsg_ID_1210, gMsg_ID_1240, gMsg_ID_1250, gMsg_ID_1380, gMsg_ID_1390, - gMsg_ID_1280, gMsg_ID_1290, NULL, NULL, gMsg_ID_1460, gMsg_ID_1470, + { gMsg_ID_1220, gMsg_ID_1230 }, { gMsg_ID_1320, gMsg_ID_1330 }, + { gMsg_ID_1300, gMsg_ID_1310 }, { gMsg_ID_1420, gMsg_ID_1430 }, + { gMsg_ID_1260, gMsg_ID_1270 }, { gMsg_ID_1440, gMsg_ID_1450 }, + { gMsg_ID_1360, gMsg_ID_1370 }, { gMsg_ID_1340, gMsg_ID_1350 }, + { gMsg_ID_1400, gMsg_ID_1410 }, { gMsg_ID_1200, gMsg_ID_1210 }, + { gMsg_ID_1240, gMsg_ID_1250 }, { gMsg_ID_1380, gMsg_ID_1390 }, + { gMsg_ID_1280, gMsg_ID_1290 }, { NULL, NULL }, + { gMsg_ID_1460, gMsg_ID_1470 }, }; Planet planet[PLANET_MAX] = { /* PLANET_METEO */ - { 0, 1150.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -130.0f, 1.0f, 0, 0, PLANET_FORTUNA, -1, PLANET_KATINA }, + { PLANET_METEO, 1150.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -130.0f, 1.0f, 0, 0, PLANET_FORTUNA, PLANET_NONE, + PLANET_KATINA }, /* PLANET_AREA_6 */ - { 1, 1400.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -315.0f, 0.15f, 0, 2, -1, -1, -1 }, + { PLANET_AREA_6, 1400.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -315.0f, 0.15f, 0, 2, PLANET_NONE, PLANET_NONE, + PLANET_NONE }, /* PLANET_BOLSE */ - { 2, 1400.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -345.0f, 0.15f, 0, 2, -1, -1, -1 }, + { PLANET_BOLSE, 1400.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -345.0f, 0.15f, 0, 2, PLANET_NONE, PLANET_NONE, + PLANET_NONE }, /* PLANET_SECTOR_Z */ - { 3, 1125.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -285.0f, 2.5f * 2.0f, 0, 1, PLANET_BOLSE, PLANET_AREA_6, -1 }, + { PLANET_SECTOR_Z, 1125.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -285.0f, 2.5f * 2.0f, 0, 1, PLANET_BOLSE, PLANET_AREA_6, + PLANET_NONE }, /* PLANET_SECTOR_X */ - { 4, 750.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -60.0f, 2.5f * 2.0f, 0, 1, PLANET_TITANIA, PLANET_MACBETH, + { PLANET_SECTOR_X, 750.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -60.0f, 2.5f * 2.0f, 0, 1, PLANET_TITANIA, PLANET_MACBETH, PLANET_SECTOR_Z }, /* PLANET_SECTOR_Y */ - { 5, 1125.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -190.0f, 2.5f * 2.0f, 0, 1, PLANET_KATINA, PLANET_AQUAS, -1 }, + { PLANET_SECTOR_Y, 1125.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -190.0f, 2.5f * 2.0f, 0, 1, PLANET_KATINA, PLANET_AQUAS, + PLANET_NONE }, /* PLANET_KATINA */ - { 6, 750.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -150.0f, 2.5f, 0, 4, PLANET_SECTOR_X, PLANET_SOLAR, -1 }, + { PLANET_KATINA, 750.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -150.0f, 2.5f, 0, 4, PLANET_SECTOR_X, PLANET_SOLAR, + PLANET_NONE }, /* PLANET_MACBETH */ - { 7, 825.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -330.0f, 2.5f, 0, 4, PLANET_BOLSE, PLANET_AREA_6, -1 }, + { PLANET_MACBETH, 825.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -330.0f, 2.5f, 0, 4, PLANET_BOLSE, PLANET_AREA_6, + PLANET_NONE }, /* PLANET_ZONESS */ - { 8, 900.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -260.0f, 2.5f, 0, 4, PLANET_MACBETH, PLANET_SECTOR_Z, -1 }, + { PLANET_ZONESS, 900.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -260.0f, 2.5f, 0, 4, PLANET_MACBETH, PLANET_SECTOR_Z, + PLANET_NONE }, /* PLANET_CORNERIA */ - { 9, 1500.0f, 0.0f, 10.0f, 0.0f, 0.0f, 0.0f, -150.0f, 5.0f, 0, 4, PLANET_METEO, PLANET_SECTOR_Y, -1 }, + { PLANET_CORNERIA, 1500.0f, 0.0f, 10.0f, 0.0f, 0.0f, 0.0f, -150.0f, 5.0f, 0, 4, PLANET_METEO, PLANET_SECTOR_Y, + PLANET_NONE }, /* PLANET_TITANIA */ - { 10, 975.0f, 0.0f, -10.0f, 0.0f, 0.0f, 0.0f, -375.0f, 2.5f, 0, 4, PLANET_BOLSE, -1, -1 }, + { PLANET_TITANIA, 975.0f, 0.0f, -10.0f, 0.0f, 0.0f, 0.0f, -375.0f, 2.5f, 0, 4, PLANET_BOLSE, PLANET_NONE, + PLANET_NONE }, /* PLANET_AQUAS */ - { 11, 900.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -220.0f, 2.5f, 0, 4, PLANET_ZONESS, -1, -1 }, + { PLANET_AQUAS, 900.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -220.0f, 2.5f, 0, 4, PLANET_ZONESS, PLANET_NONE, + PLANET_NONE }, /* PLANET_FORTUNA */ - { 12, 975.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -105.0f, 2.5f, 0, 4, PLANET_SECTOR_X, PLANET_SOLAR, -1 }, + { PLANET_FORTUNA, 975.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -105.0f, 2.5f, 0, 4, PLANET_SECTOR_X, PLANET_SOLAR, + PLANET_NONE }, /* PLANET_VENOM */ - { 13, 1800.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -330.0f, 9.0f, 0, 4, -1, -1, -1 }, + { PLANET_VENOM, 1800.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -330.0f, 9.0f, 0, 4, PLANET_NONE, PLANET_NONE, PLANET_NONE }, /* PLANET_SOLAR */ - { 14, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 10.0f, 0, 3, PLANET_MACBETH, -1, -1 }, + { PLANET_SOLAR, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 10.0f, 0, 3, PLANET_MACBETH, PLANET_NONE, PLANET_NONE }, }; // unused @@ -1040,7 +1056,7 @@ void func_menu_801A5E80(void); void func_menu_801A6368(void); void func_menu_801A61B4(LevelId level); bool func_menu_801A62FC(PlanetId planet); -s32 func_menu_801A655C(s32 arg0, s32 arg1); +s32 func_menu_801A655C(PlanetId start, PlanetId end); void func_menu_801A6628(void); void func_menu_801A6694(void); void func_menu_801A68E4(void); @@ -1168,9 +1184,9 @@ void func_menu_8019E99C(void) { D_menu_801CD994 = 0; D_menu_801CD9CC = 0; - D_menu_801CEB48[0] = 0; - D_menu_801CEB48[1] = 0; - D_menu_801CEB48[2] = 0; + D_menu_801CEB48[0] = false; + D_menu_801CEB48[1] = false; + D_menu_801CEB48[2] = false; for (i = 0; i < 10; i++) { D_menu_801CEB58[1][i] = 0; @@ -1362,15 +1378,15 @@ void func_menu_8019F164(void) { switch (D_menu_801CD93C) { case 0: - D_menu_801CD958 = planet[sCurrentPlanetId].unk_2C; + sNextPlanetId = planet[sCurrentPlanetId].unk_2C; break; case 1: - D_menu_801CD958 = planet[sCurrentPlanetId].unk_30; + sNextPlanetId = planet[sCurrentPlanetId].unk_30; break; case 2: - D_menu_801CD958 = planet[sCurrentPlanetId].unk_34; + sNextPlanetId = planet[sCurrentPlanetId].unk_34; break; } @@ -1481,13 +1497,13 @@ void func_menu_8019F600(void) { D_80177B70[i] = 0; D_80177B50[i] = 0x00FFFFFF; } - D_80177B90[0] = 9; - D_80177B90[1] = -1; - D_80177B90[2] = -1; - D_80177B90[3] = -1; - D_80177B90[4] = -1; - D_80177B90[5] = -1; - D_80177B90[6] = 13; + D_80177B90[0] = PLANET_CORNERIA; + D_80177B90[1] = PLANET_NONE; + D_80177B90[2] = PLANET_NONE; + D_80177B90[3] = PLANET_NONE; + D_80177B90[4] = PLANET_NONE; + D_80177B90[5] = PLANET_NONE; + D_80177B90[6] = PLANET_VENOM; for (i = 0; i < 24; i++) { D_menu_801AFD18[i].unk_18 = 255; @@ -1569,17 +1585,17 @@ void func_menu_8019FA1C(void) { void func_menu_8019FC04(void) { s32 i; - if (gCurrentPlanet != 0) { - D_menu_801CEB48[1] = 1; - D_menu_801CEB48[2] = 1; + if (gCurrentPlanet != PLANET_METEO) { + D_menu_801CEB48[1] = true; + D_menu_801CEB48[2] = true; } for (i = 0; i < 7; i++) { - if (D_80177B90[i] == 6) { - D_menu_801CEB48[1] = 0; + if (D_80177B90[i] == PLANET_KATINA) { + D_menu_801CEB48[1] = false; } - if (D_80177B90[i] == 5) { - D_menu_801CEB48[2] = 0; + if (D_80177B90[i] == PLANET_SECTOR_Y) { + D_menu_801CEB48[2] = false; } } } @@ -2378,7 +2394,7 @@ void func_menu_801A1C14(void) { Audio_PlaySfx(0x19004013U, D_800C5D28, 4U, &D_800C5D34, &D_800C5D34, &D_800C5D3C); D_menu_801CD9D8 = 1; if (sCurrentPlanetId == PLANET_CORNERIA) { - D_menu_801CEB48[0] = 1; + D_menu_801CEB48[0] = true; for (i = 0; i < 10; i++) { D_menu_801CEB58[0][i] = RAND_INT(3.0f); D_menu_801CEBD0[0][i] = 255; @@ -2633,11 +2649,11 @@ void func_menu_801A281C(void) { D_menu_801CEF58[0].z = D_menu_801CEF58[1].z = D_menu_801CDA08; D_menu_801CEF58[5].x = D_menu_801CEF58[4].x = D_menu_801CEF58[3].x = D_menu_801CEF58[2].x = - planet[D_menu_801CD958].pos.x; + planet[sNextPlanetId].pos.x; D_menu_801CEF58[5].y = D_menu_801CEF58[4].y = D_menu_801CEF58[3].y = D_menu_801CEF58[2].y = - planet[D_menu_801CD958].pos.y; + planet[sNextPlanetId].pos.y; D_menu_801CEF58[5].z = D_menu_801CEF58[4].z = D_menu_801CEF58[3].z = D_menu_801CEF58[2].z = - planet[D_menu_801CD958].pos.z; + planet[sNextPlanetId].pos.z; D_menu_801CDA0C = -46.5f; D_menu_801CDA10 = 0.0f; @@ -2665,7 +2681,7 @@ void func_menu_801A281C(void) { D_menu_801CEEE8[7].y = D_menu_801CEEE8[6].y; D_menu_801CEEE8[7].z = D_menu_801CEEE8[6].z; - D_menu_801CEECC = func_menu_801A655C(sCurrentPlanetId, D_menu_801CD958); + D_menu_801CEECC = func_menu_801A655C(sCurrentPlanetId, sNextPlanetId); if (D_menu_801CD93C == 2) { D_80177BD8[D_menu_801CEECC] = 5; @@ -2803,7 +2819,7 @@ void func_menu_801A2EB8(void) { func_menu_801A3440(D_menu_801CEEE0); if (D_menu_801CD9C4 == 80) { - sCurrentPlanetId = D_menu_801CD958; + sCurrentPlanetId = sNextPlanetId; D_80177B90[gCurrentPlanet] = sCurrentPlanetId; func_menu_801A6368(); } @@ -2814,14 +2830,14 @@ void func_menu_801A2EB8(void) { D_menu_801AFD18[D_menu_801CEECC].unk_18 = 255; } - planet[D_menu_801CD958].alpha += 16; - if ((D_menu_801CD958 == PLANET_SECTOR_Z) || (D_menu_801CD958 == PLANET_SECTOR_X) || - (D_menu_801CD958 == PLANET_SECTOR_Y)) { - if (planet[D_menu_801CD958].alpha > 144) { - planet[D_menu_801CD958].alpha = 144; + planet[sNextPlanetId].alpha += 16; + if ((sNextPlanetId == PLANET_SECTOR_Z) || (sNextPlanetId == PLANET_SECTOR_X) || + (sNextPlanetId == PLANET_SECTOR_Y)) { + if (planet[sNextPlanetId].alpha > 144) { + planet[sNextPlanetId].alpha = 144; } - } else if (planet[D_menu_801CD958].alpha > 255) { - planet[D_menu_801CD958].alpha = 255; + } else if (planet[sNextPlanetId].alpha > 255) { + planet[sNextPlanetId].alpha = 255; } } else { @@ -2843,7 +2859,7 @@ void func_menu_801A2EB8(void) { #define PLANET_ID i for (PLANET_ID = 0; PLANET_ID < PLANET_MAX; PLANET_ID++) { - if ((PLANET_ID == sCurrentPlanetId) || (PLANET_ID == D_menu_801CD958)) { + if ((PLANET_ID == sCurrentPlanetId) || (PLANET_ID == sNextPlanetId)) { continue; } @@ -2880,16 +2896,16 @@ void func_menu_801A2EB8(void) { if (D_menu_801CEED8 == -1) { D_menu_801CEED4 = -1; - if (planet[D_menu_801CD958].unk_2C != -1) { - temp1 = func_menu_801A655C(D_menu_801CD958, planet[D_menu_801CD958].unk_2C); + if (planet[sNextPlanetId].unk_2C != PLANET_NONE) { + temp1 = func_menu_801A655C(sNextPlanetId, planet[sNextPlanetId].unk_2C); D_80177BD8[temp1] = 1; D_menu_801AFD18[temp1].unk_18 = 255; D_menu_801CEED4 = temp1; } D_menu_801CEED0 = -1; - if (planet[D_menu_801CD958].unk_30 != -1) { - temp2 = func_menu_801A655C(D_menu_801CD958, planet[D_menu_801CD958].unk_30); + if (planet[sNextPlanetId].unk_30 != PLANET_NONE) { + temp2 = func_menu_801A655C(sNextPlanetId, planet[sNextPlanetId].unk_30); D_80177BD8[temp2] = 1; D_menu_801AFD18[temp2].unk_18 = 255; D_menu_801CEED0 = temp2; @@ -3517,19 +3533,19 @@ void func_menu_801A4FC4(void) { gLaserStrength[gPlayerNum] = 0; gBombCount[gPlayerNum] = 3; - if (planet[sCurrentPlanetId].unk_2C != -1) { + if (planet[sCurrentPlanetId].unk_2C != PLANET_NONE) { temp2 = func_menu_801A655C(sCurrentPlanetId, planet[sCurrentPlanetId].unk_2C); D_80177BD8[temp2] = 0; D_menu_801AFD18[temp2].unk_18 = 0; } - if (planet[sCurrentPlanetId].unk_30 != -1) { + if (planet[sCurrentPlanetId].unk_30 != PLANET_NONE) { temp = func_menu_801A655C(sCurrentPlanetId, planet[sCurrentPlanetId].unk_30); D_80177BD8[temp] = 0; D_menu_801AFD18[temp].unk_18 = 0; } - if (planet[sCurrentPlanetId].unk_34 != -1) { + if (planet[sCurrentPlanetId].unk_34 != PLANET_NONE) { temp = func_menu_801A655C(sCurrentPlanetId, planet[sCurrentPlanetId].unk_34); D_80177BD8[temp] = 0; D_menu_801AFD18[temp].unk_18 = 0; @@ -3542,7 +3558,7 @@ void func_menu_801A4FC4(void) { D_menu_801CEEAC = 255; gTotalHits -= D_80177B70[gCurrentPlanet - 1]; - D_80177B90[gCurrentPlanet] = -1; + D_80177B90[gCurrentPlanet] = PLANET_NONE; D_80177B70[gCurrentPlanet - 1] = 0; D_80177BB0[gCurrentPlanet - 1] = 0; D_80177B50[gCurrentPlanet - 1] = 0x00FFFFFF; @@ -3553,19 +3569,19 @@ void func_menu_801A4FC4(void) { sCurrentPlanetId = D_menu_801CD950; - if (planet[sCurrentPlanetId].unk_2C != -1) { + if (planet[sCurrentPlanetId].unk_2C != PLANET_NONE) { temp2 = func_menu_801A655C(sCurrentPlanetId, planet[sCurrentPlanetId].unk_2C); D_80177BD8[temp2] = 1; D_menu_801AFD18[temp2].unk_18 = 255; } - if (planet[sCurrentPlanetId].unk_30 != -1) { + if (planet[sCurrentPlanetId].unk_30 != PLANET_NONE) { temp = func_menu_801A655C(sCurrentPlanetId, planet[sCurrentPlanetId].unk_30); D_80177BD8[temp] = 1; D_menu_801AFD18[temp].unk_18 = 255; } - if (planet[sCurrentPlanetId].unk_34 != -1) { + if (planet[sCurrentPlanetId].unk_34 != PLANET_NONE) { temp = func_menu_801A655C(sCurrentPlanetId, planet[sCurrentPlanetId].unk_34); D_80177BD8[temp] = 0; D_menu_801AFD18[temp].unk_18 = 0; @@ -3580,13 +3596,13 @@ void func_menu_801A53C8(void) { D_menu_801CEFD8 ^= 1; - if (planet[sCurrentPlanetId].unk_2C != -1) { + if (planet[sCurrentPlanetId].unk_2C != PLANET_NONE) { temp2 = func_menu_801A655C(sCurrentPlanetId, planet[sCurrentPlanetId].unk_2C); D_80177BD8[temp2] = 0; D_menu_801AFD18[temp2].unk_18 = 0; } - if (planet[sCurrentPlanetId].unk_30 != -1) { + if (planet[sCurrentPlanetId].unk_30 != PLANET_NONE) { temp = func_menu_801A655C(sCurrentPlanetId, planet[sCurrentPlanetId].unk_30); D_80177BD8[temp] = 0; D_menu_801AFD18[temp].unk_18 = 0; @@ -3600,20 +3616,20 @@ void func_menu_801A53C8(void) { sCurrentPlanetId = D_menu_801CD950; if (!D_menu_801CEFD8) { - D_menu_801CD958 = planet[sCurrentPlanetId].unk_2C; + sNextPlanetId = planet[sCurrentPlanetId].unk_2C; } else if (D_menu_801CD93C != 2) { - if (planet[sCurrentPlanetId].unk_30 != -1) { - D_menu_801CD958 = planet[sCurrentPlanetId].unk_30; + if (planet[sCurrentPlanetId].unk_30 != PLANET_NONE) { + sNextPlanetId = planet[sCurrentPlanetId].unk_30; } else { - D_menu_801CD958 = planet[sCurrentPlanetId].unk_2C; + sNextPlanetId = planet[sCurrentPlanetId].unk_2C; } - } else if (planet[sCurrentPlanetId].unk_34 != -1) { - D_menu_801CD958 = planet[sCurrentPlanetId].unk_34; + } else if (planet[sCurrentPlanetId].unk_34 != PLANET_NONE) { + sNextPlanetId = planet[sCurrentPlanetId].unk_34; } else { - D_menu_801CD958 = planet[sCurrentPlanetId].unk_2C; + sNextPlanetId = planet[sCurrentPlanetId].unk_2C; } - D_menu_801CEECC = func_menu_801A655C(sCurrentPlanetId, D_menu_801CD958); + D_menu_801CEECC = func_menu_801A655C(sCurrentPlanetId, sNextPlanetId); D_menu_801AFD18[D_menu_801CEECC].unk_18 = 255; @@ -3631,19 +3647,19 @@ void func_menu_801A53C8(void) { D_menu_801CEEA8 = 255; D_menu_801CEEAC = 255; - sCurrentPlanetId = D_menu_801CD958; + sCurrentPlanetId = sNextPlanetId; D_80177B90[gCurrentPlanet] = sCurrentPlanetId; func_menu_801A6368(); - if (planet[D_menu_801CD958].unk_2C != -1) { - temp2 = func_menu_801A655C(D_menu_801CD958, planet[D_menu_801CD958].unk_2C); + if (planet[sNextPlanetId].unk_2C != PLANET_NONE) { + temp2 = func_menu_801A655C(sNextPlanetId, planet[sNextPlanetId].unk_2C); D_80177BD8[temp2] = 1; D_menu_801AFD18[temp2].unk_18 = 255; } - if (planet[D_menu_801CD958].unk_30 != -1) { - temp = func_menu_801A655C(D_menu_801CD958, planet[D_menu_801CD958].unk_30); + if (planet[sNextPlanetId].unk_30 != PLANET_NONE) { + temp = func_menu_801A655C(sNextPlanetId, planet[sNextPlanetId].unk_30); D_80177BD8[temp] = 1; D_menu_801AFD18[temp].unk_18 = 255; } @@ -3858,7 +3874,7 @@ void func_menu_801A5E80(void) { if (D_menu_801B8284 < 120) { D_menu_801B8284 += 15; if (sCurrentPlanetId == PLANET_CORNERIA) { - *D_menu_801CEB48 = 0; + D_menu_801CEB48[0] = false; } } else { D_menu_801CD9B8 = 5; @@ -4124,11 +4140,11 @@ PlanetId GetPlanetId(LevelId level) { return planet; } -s32 func_menu_801A655C(s32 arg0, s32 arg1) { +s32 func_menu_801A655C(PlanetId start, PlanetId end) { s32 i; for (i = 0; i < 24; i++) { - if ((D_menu_801AFD18[i].unk_04 == arg0) && (D_menu_801AFD18[i].unk_08 == arg1)) { + if ((D_menu_801AFD18[i].unk_04 == start) && (D_menu_801AFD18[i].unk_08 == end)) { break; } } @@ -4444,7 +4460,7 @@ void func_menu_801A6EC0(PlanetId planetId) { void func_menu_801A7230(PlanetId planetId) { switch (planet[planetId].unk_28) { case 0: - if ((D_menu_801CD944 == 3 || planetId == sCurrentPlanetId || planetId == D_menu_801CD958) && + if ((D_menu_801CD944 == 3 || planetId == sCurrentPlanetId || planetId == sNextPlanetId) && D_menu_801CD944 != 1 && D_menu_801CD944 != 7) { RCP_SetupDL(&gMasterDisp, 0x35); } else { @@ -4454,7 +4470,7 @@ void func_menu_801A7230(PlanetId planetId) { break; case 2: - if ((D_menu_801CD944 == 3 || planetId == sCurrentPlanetId || planetId == D_menu_801CD958) && + if ((D_menu_801CD944 == 3 || planetId == sCurrentPlanetId || planetId == sNextPlanetId) && D_menu_801CD944 != 1 && D_menu_801CD944 != 7) { RCP_SetupDL(&gMasterDisp, 0x17); } else { @@ -4903,7 +4919,7 @@ void func_menu_801A89BC(PlanetId planetId, s32 arg1) { return; } - if (D_menu_801CEB48[arg1] == 0) { + if (!D_menu_801CEB48[arg1]) { return; } @@ -5364,7 +5380,7 @@ void func_menu_801A9FD4(s32 arg0) { Matrix_SetGfxMtx(&gMasterDisp); for (var_fs0 = 0.0f, var_fs1 = -41.5f, i = 0; i < var_s3; i++, var_fs0 += 24.0f + temp, var_fs1 += 13.8f) { - if (D_80177B90[i] != -1) { + if (D_80177B90[i] != PLANET_NONE) { func_menu_801AA434(i, 28.0f + var_fs0, 182.0f, D_80177B90[i]); func_menu_801AA778(i, var_fs1, -25.4f, D_80177B90[i]); } @@ -5382,7 +5398,7 @@ void func_menu_801AA1CC(s32 arg0) { s32 temp; f32 y = 182.0f; f32 x2 = 16.0f; - s32* ptr = &D_80177B90[0]; + PlanetId* ptr = &D_80177B90[0]; for (x = 0.0f, i = 0; i < 7; i++, x += 24.0f + x2, ptr++) { RCP_SetupDL(&gMasterDisp, 0x53); @@ -6330,64 +6346,64 @@ void func_menu_801ACD90(s32 index, Vec3f* src, Vec3f* dest) { temp1 = 40.0f; - if (D_menu_801AFD18[index].unk_04 == 12) { + if (D_menu_801AFD18[index].unk_04 == PLANET_FORTUNA) { temp1 = 50.0f; } - if (D_menu_801AFD18[index].unk_04 == 10) { + if (D_menu_801AFD18[index].unk_04 == PLANET_TITANIA) { temp1 = 60.0f; } - if (D_menu_801AFD18[index].unk_04 == 14) { + if (D_menu_801AFD18[index].unk_04 == PLANET_SOLAR) { temp1 = 20.0f; } - if (D_menu_801AFD18[index].unk_04 == 0) { + if (D_menu_801AFD18[index].unk_04 == PLANET_METEO) { temp1 = 60.0f; } - if (D_menu_801AFD18[index].unk_04 == 4) { + if (D_menu_801AFD18[index].unk_04 == PLANET_SECTOR_X) { temp1 = 20.0f; } - if (D_menu_801AFD18[index].unk_04 == 5) { + if (D_menu_801AFD18[index].unk_04 == PLANET_SECTOR_Y) { temp1 = 20.0f; } - if (D_menu_801AFD18[index].unk_04 == 3) { + if (D_menu_801AFD18[index].unk_04 == PLANET_SECTOR_Z) { temp1 = 20.0f; } - if (D_menu_801AFD18[index].unk_04 == 1) { + if (D_menu_801AFD18[index].unk_04 == PLANET_AREA_6) { temp1 = 1200.0f; } - if (D_menu_801AFD18[index].unk_04 == 2) { + if (D_menu_801AFD18[index].unk_04 == PLANET_BOLSE) { temp1 = 1200.0f; } temp2 = 40.0f; - if (D_menu_801AFD18[index].unk_08 == 10) { + if (D_menu_801AFD18[index].unk_08 == PLANET_TITANIA) { temp2 = 60.0f; } - if (D_menu_801AFD18[index].unk_08 == 12) { + if (D_menu_801AFD18[index].unk_08 == PLANET_FORTUNA) { temp2 = 50.0f; } - if (D_menu_801AFD18[index].unk_08 == 14) { + if (D_menu_801AFD18[index].unk_08 == PLANET_SOLAR) { temp2 = 20.0f; } - if (D_menu_801AFD18[index].unk_08 == 0) { + if (D_menu_801AFD18[index].unk_08 == PLANET_METEO) { temp2 = 60.0f; } - if (D_menu_801AFD18[index].unk_08 == 4) { + if (D_menu_801AFD18[index].unk_08 == PLANET_SECTOR_X) { temp2 = 20.0f; } - if (D_menu_801AFD18[index].unk_08 == 5) { + if (D_menu_801AFD18[index].unk_08 == PLANET_SECTOR_Y) { temp2 = 20.0f; } - if (D_menu_801AFD18[index].unk_08 == 3) { + if (D_menu_801AFD18[index].unk_08 == PLANET_SECTOR_Z) { temp2 = 20.0f; } - if (D_menu_801AFD18[index].unk_08 == 1) { + if (D_menu_801AFD18[index].unk_08 == PLANET_AREA_6) { temp2 = 1200.0f; } - if (D_menu_801AFD18[index].unk_08 == 2) { + if (D_menu_801AFD18[index].unk_08 == PLANET_BOLSE) { temp2 = 1200.0f; } - if (D_menu_801AFD18[index].unk_08 == 13) { + if (D_menu_801AFD18[index].unk_08 == PLANET_VENOM) { temp2 = 30.0f; } diff --git a/src/overlays/ovl_menu/fox_option.c b/src/overlays/ovl_menu/fox_option.c index 5e615c40..0af051ea 100644 --- a/src/overlays/ovl_menu/fox_option.c +++ b/src/overlays/ovl_menu/fox_option.c @@ -5,16 +5,28 @@ */ #include "mods.h" -// #include "prevent_bss_reordering2.h" -// #include "prevent_bss_reordering.h" + +#include "prevent_bss_reordering.h" #include "global.h" + #include "fox_option.h" -//! TODO: IMPORT BSS +extern s32 D_menu_801B81A8[][3]; +extern Gfx D_menu_801B4A40[]; +extern Gfx D_menu_801B5E78[]; +extern Gfx D_menu_801B61E0[]; +extern Gfx D_menu_801B6548[]; +extern Gfx D_menu_801B4D70[]; +extern Gfx D_menu_801B5B10[]; +extern Gfx D_menu_801B5440[]; +extern Gfx D_menu_801B50D8[]; +extern Gfx D_menu_801B5E78[]; +extern Gfx D_menu_801B57A8[]; -// #define IMPORT_BSS +#include "fox_option_assets.h" + +extern f32 D_menu_801CD818[]; -#ifdef IMPORT_BSS s32 D_menu_801B9090; s32 D_menu_801B9094; s32 D_menu_801B9098; // gap @@ -28,7 +40,7 @@ f32 D_menu_801B9100[3]; // gap f32 D_menu_801B9110[3]; f32 D_menu_801B911C; f32 D_menu_801B9120; -OptionId D_menu_801B9124; +enum OptionId D_menu_801B9124; s32 D_menu_801B9128; s32 D_menu_801B912C; s32 D_menu_801B9130; @@ -102,6 +114,7 @@ f32 D_menu_801B9298[32]; s32 spectrumAnalizerMode; s32 D_menu_801B931C; bool D_menu_801B9320; // MusicPlaying status in the expert sound options +extern s32 BSS_PAD_0; s32 D_menu_801B9330[2]; s32 D_menu_801B933C; s32 D_menu_801B9340; // gap @@ -116,6 +129,7 @@ s32 D_menu_801B937C; UnkStruct_D_menu_801B9250 D_menu_801B9380[4]; UnkStruct_D_menu_801B9250 D_menu_801B93A0[4]; u8 D_menu_801B93C4; +extern s32 BSS_PAD_1; s32 D_menu_801B93D0; s32 D_menu_801B93D4; s32 D_menu_801B93D8; @@ -129,137 +143,18 @@ f32 D_menu_801B93F4; f32 D_menu_801B93F8; // gap UnkStruct_D_menu_801B9250 D_menu_801B9400; UnkStruct_D_menu_801B9250 D_menu_801B9408; -#else -extern s32 D_menu_801B9330[2]; -extern s32 D_menu_801B933C; -extern s32 D_menu_801B9340; // gap -extern s32 D_menu_801B9348[4]; -extern f32 D_menu_801B9358[4]; -extern f32 D_menu_801B9368; -extern s32 D_menu_801B936C; -extern f32 D_menu_801B9370; -extern s32 D_menu_801B9374; -extern f32 D_menu_801B9378; -extern s32 D_menu_801B937C; -extern UnkStruct_D_menu_801B9250 D_menu_801B9380[4]; -extern UnkStruct_D_menu_801B9250 D_menu_801B93A0[4]; -extern u8 D_menu_801B93C4; -extern s32 D_menu_801B93D0; -extern s32 D_menu_801B93D4; -extern s32 D_menu_801B93D8; -extern s32 D_menu_801B93DC; -extern s32 D_menu_801B93E0; -extern s32 D_menu_801B93E4; -extern s32 D_menu_801B93E8; -extern s32 D_menu_801B93EC; -extern f32 D_menu_801B93F0; -extern f32 D_menu_801B93F4; -extern f32 D_menu_801B93F8; // gap -extern UnkStruct_D_menu_801B9250 D_menu_801B9400; -extern UnkStruct_D_menu_801B9250 D_menu_801B9408; -extern s32 D_menu_801B9090; -extern s32 D_menu_801B9094; -extern s32 D_menu_801B9098; // gap -extern s32 D_menu_801B90A0[3]; // gap -extern s32 D_menu_801B90B0[3]; // gap -extern f32 D_menu_801B90C0[3]; // gap -extern f32 D_menu_801B90D0[3]; // gap -extern f32 D_menu_801B90E0[3]; // gap -extern f32 D_menu_801B90F0[3]; // gap -extern f32 D_menu_801B9100[3]; // gap -extern f32 D_menu_801B9110[3]; -extern f32 D_menu_801B911C; -extern f32 D_menu_801B9120; -extern OptionId D_menu_801B9124; -extern s32 D_menu_801B9128; -extern s32 D_menu_801B912C; -extern s32 D_menu_801B9130; -extern s32 D_menu_801B9134; -extern s32 D_menu_801B9138; -extern s32 D_menu_801B913C; -extern s32 D_menu_801B9140[3]; -extern s32 D_menu_801B914C; -extern u8 D_menu_801B9150[3][2]; -extern s32 D_menu_801B9158; -extern UnkStruct_D_menu_801B9250 D_menu_801B9160[3]; -extern s32 D_menu_801B9178; -extern s32 D_menu_801B917C; -extern UnkStruct_D_menu_801B9250 D_menu_801B9180; // gap -extern UnkStruct_D_menu_801B9250 D_menu_801B9188; -extern UnkStruct_D_menu_801B9250 D_menu_801B9190; -extern UnkStruct_D_menu_801B9250 D_menu_801B9198; -extern s32 D_menu_801B91A0; -extern s32 D_menu_801B91A4; -extern s32 D_menu_801B91A8; -extern s32 D_menu_801B91AC; -extern s32 D_menu_801B91B0; -extern s32 D_menu_801B91B4; -extern s32 D_menu_801B91B8; -extern s32 D_menu_801B91BC; -extern s32 D_menu_801B91C0; -extern s32 D_menu_801B91C4; -extern s32 D_menu_801B91C8; -extern s32 D_menu_801B91CC; -extern s32 D_menu_801B91D0; -extern f32 D_menu_801B91D4; -extern f32 D_menu_801B91D8; -extern f32 D_menu_801B91DC; -extern f32 D_menu_801B91E0; -extern f32 D_menu_801B91E4; -extern f32 D_menu_801B91E8; -extern f32 D_menu_801B91EC; -extern s32 D_menu_801B91F0; -extern f32 D_menu_801B91F4; -extern f32 D_menu_801B91F8; -extern f32 D_menu_801B91FC; -extern f32 D_menu_801B9200; -extern f32 D_menu_801B9204; -extern f32 D_menu_801B9208; -extern f32 D_menu_801B920C; -extern f32 D_menu_801B9210; -extern s32 D_menu_801B9214; -extern f32 D_menu_801B9218; -extern f32 D_menu_801B921C; -extern f32 D_menu_801B9220; -extern f32 D_menu_801B9224; -extern f32 D_menu_801B9228; -extern s32 D_menu_801B922C; -extern s32 D_menu_801B9230; -extern s32 D_menu_801B9234; -extern s32 D_menu_801B9238; -extern s32 D_menu_801B923C; -extern s32 D_menu_801B9240; -extern s32 D_menu_801B9244; -extern s32 D_menu_801B9248; -extern u8 D_menu_801B924C; -extern UnkStruct_D_menu_801B9250 D_menu_801B9250; -extern UnkStruct_D_menu_801B9250 D_menu_801B9258; -extern UnkStruct_D_menu_801B9250 D_menu_801B9260; -extern UnkStruct_D_menu_801B9250 D_menu_801B9268; -extern f32 D_menu_801B9270[5]; -extern s32 D_menu_801B9284; -extern s32 D_menu_801B9288; // gap -extern UnkStruct_D_menu_801B9250 D_menu_801B9290; -extern f32 D_menu_801B9298[32]; -extern s32 spectrumAnalizerMode; -extern s32 D_menu_801B931C; -extern bool D_menu_801B9320; // MusicPlaying status in the expert sound options -#endif -extern s32 D_menu_801B81A8[][3]; - -extern Gfx D_menu_801B4A40[]; -extern Gfx D_menu_801B5E78[]; -extern Gfx D_menu_801B61E0[]; -extern Gfx D_menu_801B6548[]; -extern Gfx D_menu_801B4D70[]; -extern Gfx D_menu_801B5B10[]; -extern Gfx D_menu_801B5440[]; -extern Gfx D_menu_801B50D8[]; -extern Gfx D_menu_801B5E78[]; -extern Gfx D_menu_801B57A8[]; - -#include "fox_option_assets.h" +#include "prevent_bss_reordering2.h" +struct BssPad0 { + int x; +}; +struct BssPad1 { + int x; +}; +// struct BssPad2 {int x;}; +// struct BssPad3 {int x;}; +// struct BssPad4 {int x;}; +extern s32 BSS_PAD_2; static f32 sOptionCardPosY[] = { 60.0f, 36.0f, 12.0f, -12.0f, -36.0f, -60.0f }; // D_menu_801AE570 static f32 sOptionCardTextPosX[] = { 124.0f, 118.0f, 145.0f, 125.0f, 133.0f, 118.0f }; // D_menu_801AE588 @@ -273,8 +168,6 @@ static f32 D_menu_801AE600[] = { 151.0f, 151.0f }; static f32 D_menu_801AE608[] = { 8.0f, 8.0f, 8.0f, 8.0f, 8.0f, 8.0f }; static f32 D_menu_801AE620[] = { 1.9f, 2.4f, 0.9f, 1.9f, 1.8f, 2.4f }; -extern f32 D_menu_801CD818[]; - // D_menu_801AE638 static OptionEntry sOptionCardList[] = { { @@ -469,7 +362,7 @@ static f32 D_menu_801AEF9C[] = { 89.0f, 115.0f, 139.0f }; void Option_Setup(void) { bool enableExpertModes; - bool var_v0_2; + bool playedExpertMode; s32 i; D_80137E78 = 2; @@ -522,7 +415,7 @@ void Option_Setup(void) { D_menu_801B91A8 = 0; D_menu_801B91AC = 0; D_menu_801B91B0 = 0; - var_v0_2 = gExpertMode; + playedExpertMode = gExpertMode; gExpertMode = false; gGameFrameCount = 0; @@ -534,10 +427,10 @@ void Option_Setup(void) { if ((D_80161A34 == 5) || (D_80161A34 == 8)) { if (D_80161A34 == 8) { - D_80177B90[gCurrentPlanet] = 13; + D_80177B90[gCurrentPlanet] = PLANET_VENOM; if (D_800D3180[LEVEL_VENOM_ANDROSS] == 1) { gSaveFile.save.data.planet[SAVE_SLOT_VENOM_1].played = 1; - if (var_v0_2 != 0) { + if (playedExpertMode) { gSaveFile.save.data.planet[SAVE_SLOT_VENOM_1].expertClear = 1; } else { gSaveFile.save.data.planet[SAVE_SLOT_VENOM_1].normalClear = 1; @@ -546,7 +439,7 @@ void Option_Setup(void) { } else if (D_800D3180[LEVEL_VENOM_ANDROSS] == 2) { D_80177BB0[gCurrentPlanet] = 1; gSaveFile.save.data.planet[SAVE_SLOT_VENOM_2].played = 1; - if (var_v0_2) { + if (playedExpertMode) { gSaveFile.save.data.planet[SAVE_SLOT_VENOM_2].expertClear = 1; gSaveFile.save.data.planet[SAVE_SLOT_VENOM_2].expertMedal = 1; } else { @@ -2436,8 +2329,8 @@ void func_menu_801982B0(s32 arg0, s32 arg1, f32 arg2, f32 arg3, s32 arg4) { s32 g; s32 b; s32 temp_v0; - s32 temp1; - s32 temp2; + PlanetId start; + PlanetId end; if ((arg3 > 30.0f) && (arg3 < 200.0f)) { RCP_SetupDL(&gMasterDisp, 0x4C); @@ -2446,10 +2339,10 @@ void func_menu_801982B0(s32 arg0, s32 arg1, f32 arg2, f32 arg3, s32 arg4) { g = 255; r = 255; if (arg1 < (arg4 - 1)) { - temp1 = gSaveFile.save.data.unk_5E[arg0][arg1].unk_8 & 15; - temp2 = gSaveFile.save.data.unk_5E[arg0][arg1 + 1].unk_8 & 15; + start = gSaveFile.save.data.unk_5E[arg0][arg1].unk_8 & 0xF; + end = gSaveFile.save.data.unk_5E[arg0][arg1 + 1].unk_8 & 0xF; - temp_v0 = func_menu_80199284(temp1, temp2); + temp_v0 = func_menu_80199284(start, end); g = 255; b = 255; @@ -2518,7 +2411,7 @@ void func_menu_80198608(s32 arg0, s32 arg1, f32 arg2, f32 arg3) { } void func_menu_8019882C(s32 arg0, s32 arg1, f32 arg2, f32 arg3) { - s32 temp; + PlanetId temp; char* sp20; f32 temp2; @@ -2537,7 +2430,7 @@ void func_menu_8019896C(s32 arg0, f32 y, s32 arg2) { static f32 D_menu_801AF134 = -121.0f; static f32 D_menu_801AF138 = 40.1f; s32 i; - s32 data; + PlanetId planet; s32 spFC; s32 spF4; f32 x; @@ -2551,10 +2444,10 @@ void func_menu_8019896C(s32 arg0, f32 y, s32 arg2) { spFC = gSaveFile.save.data.unk_4A[arg0]; for (x = D_menu_801AF134, i = 0; i < arg2; i++, x += D_menu_801AF138) { - data = gSaveFile.save.data.unk_5E[arg0][i].unk_8 & 15; + planet = gSaveFile.save.data.unk_5E[arg0][i].unk_8 & 0xF; - switch (data) { - case 13: + switch (planet) { + case SAVE_SLOT_SOLAR: RCP_SetupDL(&gMasterDisp, 0x43); gDPSetPrimColor(gMasterDisp++, 0, 0, 240, 0, 0, 255); @@ -2566,16 +2459,16 @@ void func_menu_8019896C(s32 arg0, f32 y, s32 arg2) { Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, 1); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[data]); + gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 128); gDPSetEnvColor(gMasterDisp++, 31, 0, 0, 0); Matrix_Scale(gGfxMatrix, 0.8f, 0.8f, 0.8f, 1); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[data]); + gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); Matrix_Pop(&gGfxMatrix); break; - case 0: + case PLANET_METEO: RCP_SetupDL(&gMasterDisp, 0x3E); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); @@ -2585,19 +2478,19 @@ void func_menu_8019896C(s32 arg0, f32 y, s32 arg2) { Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, 1); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[data]); + gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); Matrix_Translate(gGfxMatrix, 18.0f, -20.0f, 0.0f, 1); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[data]); + gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); Matrix_Pop(&gGfxMatrix); break; - case 4: - case 5: - case 3: + case PLANET_SECTOR_X: + case PLANET_SECTOR_Y: + case PLANET_SECTOR_Z: RCP_SetupDL(&gMasterDisp, 0x3E); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 144); @@ -2607,12 +2500,12 @@ void func_menu_8019896C(s32 arg0, f32 y, s32 arg2) { Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, 1); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[data]); + gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); Matrix_Pop(&gGfxMatrix); break; - case 2: + case PLANET_BOLSE: RCP_SetupDL(&gMasterDisp, 0x17); Lights_SetOneLight(&gMasterDisp, 0, 0, 100, 100, 100, 70, 100, 100, 100); @@ -2622,12 +2515,12 @@ void func_menu_8019896C(s32 arg0, f32 y, s32 arg2) { Matrix_Scale(gGfxMatrix, 0.01f, 0.01f, 0.01f, 1); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[data]); + gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); Matrix_Pop(&gGfxMatrix); break; - case 1: + case PLANET_AREA_6: RCP_SetupDL(&gMasterDisp, 0x17); Lights_SetOneLight(&gMasterDisp, 0, 0, 100, 100, 100, 70, 100, 100, 100); @@ -2637,7 +2530,7 @@ void func_menu_8019896C(s32 arg0, f32 y, s32 arg2) { Matrix_Scale(gGfxMatrix, 0.01f, 0.01f, 0.01f, 1); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[data]); + gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); Matrix_Pop(&gGfxMatrix); break; @@ -2652,10 +2545,10 @@ void func_menu_8019896C(s32 arg0, f32 y, s32 arg2) { Matrix_Scale(gGfxMatrix, 0.3f, 0.3f, 0.3f, 1); Matrix_SetGfxMtx(&gMasterDisp); - gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[data]); + gSPDisplayList(gMasterDisp++, D_menu_801AEE6C[planet]); - if ((data != 14) && (data != 15) && (data != 11)) { - if (data == 7) { + if ((planet != SAVE_SLOT_VENOM_1) && (planet != SAVE_SLOT_VENOM_2) && (planet != PLANET_AQUAS)) { + if (planet == PLANET_MACBETH) { gDPSetPrimColor(gMasterDisp++, 0, 0, 64, 64, 64, 255); } else { gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); @@ -2701,11 +2594,11 @@ void func_menu_80199198(f32 arg0, f32 arg1, f32 arg2) { Matrix_Pop(&gGfxMatrix); } -s32 func_menu_80199284(s32 arg0, s32 arg1) { +s32 func_menu_80199284(PlanetId start, PlanetId end) { s32 i; for (i = 0; i < 24; i++) { - if ((D_menu_801AED4C[i].unk_0 == arg0) && (D_menu_801AED4C[i].unk_4 == arg1)) { + if ((D_menu_801AED4C[i].unk_0 == start) && (D_menu_801AED4C[i].unk_4 == end)) { break; } } @@ -2969,8 +2862,6 @@ void func_menu_80199EA8(void) { } } -// D_menu_801B9358 needs to be static but belongs to bss section? -#if defined(IMPORT_BSS) || defined(NON_MATCHING) void Option_VersusStageInit(void) { s32 i; @@ -2981,11 +2872,11 @@ void Option_VersusStageInit(void) { D_menu_801B93D8 = D_80161A28; D_menu_801B93DC = D_menu_801B9340; D_801778C8 = D_menu_801B93DC; - - for (i = 0; i < 4; i++) { + // clang-format off + for (i = 0; i < 4; i++) {\ D_menu_801B9358[i] = 0; } - + // clang-format on D_menu_801B936C = 0; D_menu_801B9374 = 0; D_menu_801B937C = 0; @@ -2996,12 +2887,8 @@ void Option_VersusStageInit(void) { D_menu_801B9378 = 255.0f; func_menu_8019A080(); } -#else -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_menu/fox_option/Option_VersusStageInit.s") -#endif // D_menu_801B9380 needs to be static but belongs to bss section? -#if defined(IMPORT_BSS) || defined(NON_MATCHING) void func_menu_8019A080(void) { s32 i; @@ -3010,9 +2897,6 @@ void func_menu_8019A080(void) { D_menu_801B9380[i].unk_4 = 0; } } -#else -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_menu/fox_option/func_menu_8019A080.s") -#endif void Option_VersusStageUpdate(void) { switch (D_menu_801B93D0) { @@ -3329,29 +3213,17 @@ void func_menu_8019AB30(void) { TextureRect_8bIA(&gMasterDisp, D_7001DF0, 80, 10, 122.0f, 49.0f, 1.0f, 1.0f); } } -// extern f32 D_menu_801B9324; // in-function -// extern f32 D_menu_801B9328; //gap, in-function -// extern f32 D_menu_801B9338; // in-function -// needs in function static -#if defined(IMPORT_BSS) || defined(NON_MATCHING) -#ifndef IMPORT_BSS -extern f32 D_menu_801B9324; -extern f32 D_menu_801B9328; -extern f32 D_menu_801B9338; -#endif void func_menu_8019AD84(void) { -#ifdef IMPORT_BSS + static f32 D_menu_801AF25C[6] = { 156.0f, 112.0f, 112.0f, 112.0f, 112.0f, 112.0f }; + static f32 D_menu_801AF274[6] = { 46.0f, 43.0f, 43.0f, 43.0f, 43.0f, 43.0f }; static f32 D_menu_801B9324; static f32 D_menu_801B9328; static f32 D_menu_801B9338; -#endif s32 pad[2]; s32 colorGB; s32 var_v0; - static f32 D_menu_801AF25C[6] = { 156.0f, 112.0f, 112.0f, 112.0f, 112.0f, 112.0f }; - static f32 D_menu_801AF274[6] = { 46.0f, 43.0f, 43.0f, 43.0f, 43.0f, 43.0f }; - // D_menu_801AF28C + static u8* sTimeTrialMinuteTextures[] = { D_70024D0, D_7002730, D_7002990, D_7002BF0, D_7002E50 }; RCP_SetupDL(&gMasterDisp, 0x53); @@ -3396,29 +3268,13 @@ void func_menu_8019AD84(void) { TextureRect_8bIA(&gMasterDisp, D_7002110, 80, 12, D_menu_801AF25C[0], D_menu_801AF274[0], 1.0f, 1.0f); } } -#else -static f32 D_menu_801AF25C[6] = { 156.0f, 112.0f, 112.0f, 112.0f, 112.0f, 112.0f }; -static f32 D_menu_801AF274[6] = { 46.0f, 43.0f, 43.0f, 43.0f, 43.0f, 43.0f }; -// D_menu_801AF28C -static u8* sTimeTrialMinuteTextures[] = { D_70024D0, D_7002730, D_7002990, D_7002BF0, D_7002E50 }; -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_menu/fox_option/func_menu_8019AD84.s") -#endif -// needs in-function static data & bss -#if defined(IMPORT_BSS) || defined(NON_MATCHING) -#ifndef IMPORT_BSS -extern f32 D_menu_801B93C0; -extern f32 D_menu_801B93C8; -extern f32 D_menu_801B93CC; -#endif void func_menu_8019AFFC(void) { - static f32 D_menu_801AF2A0 = 101.0f; - static f32 D_menu_801AF2A4 = 86.0f; -#ifdef IMPORT_BSS static f32 D_menu_801B93C0; static f32 D_menu_801B93C8; static f32 D_menu_801B93CC; -#endif + static f32 D_menu_801AF2A0 = 101.0f; + static f32 D_menu_801AF2A4 = 86.0f; s32 var_v0; s32 colorGB; @@ -3461,11 +3317,6 @@ void func_menu_8019AFFC(void) { func_menu_8019B3DC(); } } -#else -static f32 D_menu_801AF2A0 = 101.0f; -static f32 D_menu_801AF2A4 = 86.0f; -#pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/ovl_menu/fox_option/func_menu_8019AFFC.s") -#endif void func_menu_8019B1F8(void) { static f32 D_menu_801AF2A8 = 69.0f; @@ -4307,12 +4158,12 @@ void func_menu_8019D624(void) { var_a0 = D_80177B90[j]; - if (D_80177B90[j] == 13) { - var_a0 = 14; + if (D_80177B90[j] == PLANET_VENOM) { + var_a0 = SAVE_SLOT_VENOM_1; } - if (D_80177B90[j] == 14) { - var_a0 = 13; + if (D_80177B90[j] == PLANET_SOLAR) { + var_a0 = SAVE_SLOT_SOLAR; } var_s0[10][j].unk_8 = var_a0; diff --git a/src/overlays/ovl_menu/fox_title.c b/src/overlays/ovl_menu/fox_title.c index b1c5203f..4cafa422 100644 --- a/src/overlays/ovl_menu/fox_title.c +++ b/src/overlays/ovl_menu/fox_title.c @@ -3,7 +3,8 @@ * System: Title * Description: Starfox Title Handler */ - +#include "prevent_bss_reordering.h" +#include "prevent_bss_reordering2.h" #include "global.h" #include "fox_title.h" diff --git a/yamls/us/main.yaml b/yamls/us/main.yaml index 7b6dd7ba..90c39aee 100644 --- a/yamls/us/main.yaml +++ b/yamls/us/main.yaml @@ -15,8 +15,8 @@ subsegments: # Microcode - [0x01050, textbin, rspboot] - - [0x01120, bin, aspmain] - - [0x02010, bin, f3dex] + - [0x01120, textbin, aspmain] + - [0x02010, textbin, f3dex] # Nintendo libraries - [0x03440, c, sys_joybus] @@ -325,7 +325,7 @@ # Nintendo Library bss - { start: 0xDE480, type: .bss, vram: 0x800DD880, name: sys_joybus } - - { type: bss, vram: 0x800DDAA0, name: sys_main } + - { type: .bss, vram: 0x800DDAA0, name: sys_main } - { type: .bss, vram: 0x8013B3A0, name: sys_math } - { type: .bss, vram: 0x8013B3C0, name: sys_matrix } - { type: .bss, vram: 0x8013C3D0, name: sys_memory } @@ -374,7 +374,7 @@ - { type: .bss, vram: 0x801619A0, name: fox_std_lib } - { type: .bss, vram: 0x80161A10, name: fox_game } - { type: .bss, vram: 0x80161A50, name: fox_play } - - { type: bss, vram: 0x80161A70, name: fox_context} + - { type: .bss, vram: 0x80161A70, name: fox_context} - { type: .bss, vram: 0x80178580, name: fox_rcp } - { type: .bss, vram: 0x80178720, name: fox_radio } - { type: .bss, vram: 0x80178750, name: fox_versus } diff --git a/yamls/us/overlays.yaml b/yamls/us/overlays.yaml index a24ddf17..fbcd025c 100644 --- a/yamls/us/overlays.yaml +++ b/yamls/us/overlays.yaml @@ -182,7 +182,7 @@ - [0xEEFB80, .rodata, fox_map] - { start: 0xEF0260, type: .bss, vram: 0x801B7BA0, name: fox_i_menu } - { type: .bss, vram: 0x801B7BB0, name: fox_title } - - { type: bss, vram: 0x801B9090, name: fox_option } + - { type: .bss, vram: 0x801B9090, name: fox_option } - { type: .bss, vram: 0x801B9410, name: fox_map } - name: ovl_ending @@ -221,8 +221,8 @@ dir: main start: 0xEFFB74 vram: 0x80281000 - bss_size: 0x17F300 - exclusive_ram_id: buffers + bss_size: 0x17F000 + exclusive_ram_id: buffer subsegments: - { start: 0xEFFB74, type: .bss, vram: 0x80281000, name: fox_buffers }