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
This commit is contained in:
petrie911
2024-02-16 16:04:22 -06:00
committed by GitHub
parent 16cc6a411f
commit 209b929eda
60 changed files with 1756 additions and 1495 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
#include "global.h"
#include "prevent_bss_reordering.h"
// #include "prevent_bss_reordering.h"
f32 __dx1;
f32 __dx2;
+494 -2
View File
@@ -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;
+9 -9
View File
@@ -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) {
+1 -1
View File
@@ -313,7 +313,7 @@ void func_800A25DC(void) {
}
}
void func_800A26C0(void) {
void Game_Update(void) {
s32 i;
u8 spBB;
u16 var_v0_3;
+1 -1
View File
@@ -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);
+1
View File
@@ -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))))
+58 -71
View File
@@ -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);
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
#include "global.h"
#include "sys.h"
void func_8001EE60(void) {
}
+2 -1
View File
@@ -1,4 +1,5 @@
#include "global.h"
#include "sys.h"
#include "PR/os_internal.h"
FaultMgr gFaultMgr;
+1 -1
View File
@@ -1,4 +1,4 @@
#include "global.h"
#include "sys.h"
OSContPad gControllerHold[4];
OSContPad gControllerPress[4];
+13 -15
View File
@@ -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;
}
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
#include "global.h"
#include "sys.h"
void Lights_AddLight(Gfx** dList) {
gSPNumLights((*dList)++, 7);
+13 -84
View File
@@ -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();
}
+2 -1
View File
@@ -1,4 +1,5 @@
#include "global.h"
#include "prevent_bss_reordering.h"
#include "sys.h"
s32 sSeededRandSeed3;
s32 sRandSeed1;
+14 -14
View File
@@ -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) {
+1 -1
View File
@@ -1,4 +1,4 @@
#include "global.h"
#include "sys.h"
Mtx gIdentityMtx = { {
{
+2 -1
View File
@@ -1,4 +1,5 @@
#include "global.h"
#include "prevent_bss_reordering.h"
#include "sys.h"
s32 sMemoryBuffer[0x2200];
s32* sMemoryPtr;
+1 -1
View File
@@ -1,6 +1,6 @@
#include "global.h"
#include "sys.h"
SaveFile gSaveIOBuffer;
SaveFile sPrevSaveData;
+1 -1
View File
@@ -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 $";
+1 -1
View File
@@ -1,4 +1,4 @@
#include "global.h"
#include "sys.h"
TimerTask sTimerTasks[0x10];
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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;
+4 -4
View File
@@ -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];
+10 -4
View File
@@ -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;
}
+1 -1
View File
@@ -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) {
+2 -2
View File
@@ -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;
+8 -8
View File
@@ -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;
}
}
}
+1 -1
View File
@@ -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;
}
}
}
+4 -3
View File
@@ -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);
}
}
+1 -1
View File
@@ -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;
+126 -110
View File
@@ -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;
}
+76 -225
View File
@@ -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;
+2 -1
View File
@@ -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"