mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Enable full IDO warnings (#781)
* Fix a lot of IDO warnings (and some Clang ones) * Format * Put FULL_DISASM=0 back * Fix bss
This commit is contained in:
@@ -100,7 +100,7 @@ ASFLAGS := -march=vr4300 -32 -Iinclude
|
||||
MIPS_VERSION := -mips2
|
||||
|
||||
# we support Microsoft extensions such as anonymous structs, which the compiler does support but warns for their usage. Surpress the warnings with -woff.
|
||||
CFLAGS += -G 0 -non_shared -Xfullwarn -Xcpluscomm $(IINC) -nostdinc -Wab,-r4300_mul -woff 624,649,838,712
|
||||
CFLAGS += -G 0 -non_shared -fullwarn -verbose -Xcpluscomm $(IINC) -nostdinc -Wab,-r4300_mul -woff 624,649,838,712,516
|
||||
|
||||
# Use relocations and abi fpr names in the dump
|
||||
OBJDUMP_FLAGS := -d -r -z -Mreg-names=32
|
||||
|
||||
+2
-2
@@ -2237,7 +2237,7 @@ void Scene_HeaderCmdPathList(GlobalContext* globalCtx, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdTransiActorList(GlobalContext* globalCtx, SceneCmd* cmd);
|
||||
void Door_InitContext(GameState* gameState, DoorContext* doorCtx);
|
||||
void Scene_HeaderCmdEnvLightSettings(GlobalContext* globalCtx, SceneCmd* cmd);
|
||||
s32 Scene_LoadAreaTextures(GlobalContext* globalCtx, s32 fileIndex);
|
||||
void Scene_LoadAreaTextures(GlobalContext* globalCtx, s32 fileIndex);
|
||||
void Scene_HeaderCmdSkyboxSettings(GlobalContext* globalCtx, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdSkyboxDisables(GlobalContext* globalCtx, SceneCmd* cmd);
|
||||
void Scene_HeaderCmdTimeSettings(GlobalContext* globalCtx, SceneCmd* cmd);
|
||||
@@ -2887,7 +2887,7 @@ void* GameAlloc_Malloc(GameAlloc* this, size_t size);
|
||||
void GameAlloc_Free(GameAlloc* this, void* data);
|
||||
void GameAlloc_Cleanup(GameAlloc* this);
|
||||
void GameAlloc_Init(GameAlloc* this);
|
||||
void* Graph_FaultClient(void);
|
||||
void Graph_FaultClient(void);
|
||||
void Graph_InitTHGA(TwoHeadGfxArena* arena, Gfx* buffer, s32 size);
|
||||
void Graph_SetNextGfxPool(GraphicsContext* gfxCtx);
|
||||
GameStateOverlay* Graph_GetNextGameState(GameState* gameState);
|
||||
|
||||
@@ -187,7 +187,10 @@ typedef struct SkelAnime {
|
||||
/* 0x24 */ Vec3s* morphTable; // Table of values used to morph between animations
|
||||
/* 0x28 */ f32 morphWeight; // Weight of the current animation morph as a fraction in [0,1]
|
||||
/* 0x2C */ f32 morphRate; // Reciprocal of the number of frames in the morph
|
||||
/* 0x30 */ s32 (*update)(); // Can be Loop, Partial loop, Play once, Morph, or Tapered morph. Link only has Loop, Play once, and Morph
|
||||
/* 0x30 */ union {
|
||||
s32 (*normal)(struct SkelAnime*);// Can be Loop, Partial loop, Play once, Morph, or Tapered morph
|
||||
s32 (*link)(struct GlobalContext*, struct SkelAnime*); // Loop, Play once, and Morph
|
||||
} update;
|
||||
/* 0x34 */ s8 initFlags; // Flags used when initializing Link's skeleton
|
||||
/* 0x35 */ u8 moveFlags; // Flags used for animations that move the actor in worldspace.
|
||||
/* 0x36 */ s16 prevRot; // Previous rotation in worldspace.
|
||||
|
||||
@@ -459,6 +459,7 @@ s32 AudioLoad_SyncLoadInstrument(s32 fontId, s32 instId, s32 drumId) {
|
||||
if (instrument->normalRangeHi != 0x7F) {
|
||||
return AudioLoad_SyncLoadSample(instrument->highNotesSound.sample, fontId);
|
||||
}
|
||||
// TODO: is this missing return UB?
|
||||
} else if (instId == 0x7F) {
|
||||
Drum* drum = AudioPlayback_GetDrum(fontId, drumId);
|
||||
|
||||
@@ -468,6 +469,7 @@ s32 AudioLoad_SyncLoadInstrument(s32 fontId, s32 instId, s32 drumId) {
|
||||
AudioLoad_SyncLoadSample(drum->sound.sample, fontId);
|
||||
return 0;
|
||||
}
|
||||
// TODO: is this missing return UB?
|
||||
}
|
||||
|
||||
void AudioLoad_AsyncLoad(s32 tableType, s32 id, s32 nChunks, s32 retData, OSMesgQueue* retQueue) {
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ GfxMasterList* gGfxMasterDL;
|
||||
CfbInfo sGraphCfbInfos[3];
|
||||
OSTime sGraphTaskStartTime;
|
||||
|
||||
void* Graph_FaultClient(void) {
|
||||
void Graph_FaultClient(void) {
|
||||
FaultDrawer_DrawText(30, 100, "ShowFrameBuffer PAGE 0/1");
|
||||
osViSwapBuffer(SysCfb_GetFbPtr(0));
|
||||
osViSetMode(D_801FBB88);
|
||||
|
||||
+1
-1
@@ -240,7 +240,7 @@ void ActorShadow_DrawFeet(Actor* actor, Lights* mapper, GlobalContext* globalCtx
|
||||
}
|
||||
actor->shape.unk_17 &= ~spB8;
|
||||
|
||||
if (!mapper->l.l) {} // POSSIBLE FAKE MATCH
|
||||
if ((uintptr_t)mapper->l.l) {} // POSSIBLE FAKE MATCH
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4441,11 +4441,13 @@ s32 WaterBox_GetSurfaceImpl(GlobalContext* globalCtx, CollisionContext* colCtx,
|
||||
return false;
|
||||
}
|
||||
|
||||
// boolean
|
||||
s32 WaterBox_GetSurface1(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface,
|
||||
WaterBox** outWaterBox) {
|
||||
WaterBox_GetSurface1_2(globalCtx, colCtx, x, z, ySurface, outWaterBox);
|
||||
return WaterBox_GetSurface1_2(globalCtx, colCtx, x, z, ySurface, outWaterBox);
|
||||
}
|
||||
|
||||
// boolean
|
||||
s32 WaterBox_GetSurface1_2(GlobalContext* globalCtx, CollisionContext* colCtx, f32 x, f32 z, f32* ySurface,
|
||||
WaterBox** outWaterBox) {
|
||||
s32 bgId;
|
||||
|
||||
@@ -1418,6 +1418,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
|
||||
}
|
||||
}
|
||||
#else
|
||||
void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx, u8* cutscenePtr);
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_demo/Cutscene_ProcessCommands.s")
|
||||
#endif
|
||||
|
||||
|
||||
@@ -309,6 +309,7 @@ void EffectBlure_GetComputedValues(EffectBlure* this, s32 index, f32 ratio, Vec3
|
||||
Vec3s sp30;
|
||||
f32 mode4Param;
|
||||
EffectBlureElement* elem = &this->elements[index];
|
||||
Vec3s* unusedPtr = &sp30; // Optimized out but seems necessary to match stack usage
|
||||
|
||||
switch (this->calcMode) {
|
||||
case 1:
|
||||
@@ -367,8 +368,6 @@ void EffectBlure_GetComputedValues(EffectBlure* this, s32 index, f32 ratio, Vec3
|
||||
break;
|
||||
}
|
||||
|
||||
sp30 = sp30; // Optimized out but seems necessary to match stack usage
|
||||
|
||||
if (this->flags & 0x10) {
|
||||
color1->r = color1->g = color1->b = color1->a = 255;
|
||||
color2->r = color2->g = color2->b = color2->a = 255;
|
||||
|
||||
+1
-1
@@ -216,7 +216,7 @@ void Lights_BindAll(Lights* lights, LightNode* listHead, Vec3f* refPos, GlobalCo
|
||||
}
|
||||
}
|
||||
|
||||
LightNode* Lights_FindBufSlot() {
|
||||
LightNode* Lights_FindBufSlot(void) {
|
||||
LightNode* ret;
|
||||
|
||||
if (sLightsBuffer.numOccupied >= LIGHTS_BUFFER_SIZE) {
|
||||
|
||||
+1
-1
@@ -638,7 +638,7 @@ void Distortion_Update(void) {
|
||||
sDistortionContext.countdown = 2;
|
||||
player = GET_PLAYER(globalCtx);
|
||||
|
||||
if (&player->actor != NULL) {
|
||||
if (player != NULL) {
|
||||
Actor_GetWorldPosShapeRot(&playerPosRot, &player->actor);
|
||||
}
|
||||
|
||||
|
||||
+2
-4
@@ -341,7 +341,7 @@ void Scene_HeaderCmdEnvLightSettings(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
* Loads different texture files for each region of the world.
|
||||
* These later are stored in segment 0x06, and used in maps.
|
||||
*/
|
||||
s32 Scene_LoadAreaTextures(GlobalContext* globalCtx, s32 fileIndex) {
|
||||
void Scene_LoadAreaTextures(GlobalContext* globalCtx, s32 fileIndex) {
|
||||
static RomFile sceneTextureFiles[9] = {
|
||||
{ 0, 0 }, // Default
|
||||
{ SEGMENT_ROM_START(scene_texture_01), SEGMENT_ROM_END(scene_texture_01) },
|
||||
@@ -358,10 +358,8 @@ s32 Scene_LoadAreaTextures(GlobalContext* globalCtx, s32 fileIndex) {
|
||||
|
||||
if (size != 0) {
|
||||
globalCtx->roomCtx.unk74 = THA_AllocEndAlign16(&globalCtx->state.heap, size);
|
||||
return DmaMgr_SendRequest0(globalCtx->roomCtx.unk74, vromStart, size);
|
||||
DmaMgr_SendRequest0(globalCtx->roomCtx.unk74, vromStart, size);
|
||||
}
|
||||
|
||||
// UB: Undefined behaviour to not have a return statement here, but it breaks matching to add one.
|
||||
}
|
||||
|
||||
// SceneTableEntry Header Command 0x11: Skybox Settings
|
||||
|
||||
@@ -234,7 +234,7 @@ f32 Scene_LagrangeInterp(s32 n, f32 x[], f32 fx[], f32 xp) {
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
for (i = 0, weightsPtr = weights, xPtr1 = x, fxPtr = fx, weightsPtr = weightsPtr; i < n; i++) {
|
||||
for (i = 0, xPtr1 = x, fxPtr = fx, weightsPtr = weights; i < n; i++) {
|
||||
for (xVal = *xPtr1, m = 1.0f, j = 0, xPtr2 = x; j < n; j++) {
|
||||
if (j != i) {
|
||||
m *= xVal - (*xPtr2);
|
||||
|
||||
+10
-10
@@ -1238,9 +1238,9 @@ void SkelAnime_InitLink(GlobalContext* globalCtx, SkelAnime* skelAnime, FlexSkel
|
||||
*/
|
||||
void LinkAnimation_SetUpdateFunction(SkelAnime* skelAnime) {
|
||||
if (skelAnime->mode <= ANIMMODE_LOOP_INTERP) {
|
||||
skelAnime->update = LinkAnimation_Loop;
|
||||
skelAnime->update.link = LinkAnimation_Loop;
|
||||
} else {
|
||||
skelAnime->update = LinkAnimation_Once;
|
||||
skelAnime->update.link = LinkAnimation_Once;
|
||||
}
|
||||
skelAnime->morphWeight = 0.0f;
|
||||
}
|
||||
@@ -1250,7 +1250,7 @@ void LinkAnimation_SetUpdateFunction(SkelAnime* skelAnime) {
|
||||
* finishes.
|
||||
*/
|
||||
s32 LinkAnimation_Update(GlobalContext* globalCtx, SkelAnime* skelAnime) {
|
||||
return skelAnime->update(globalCtx, skelAnime);
|
||||
return skelAnime->update.link(globalCtx, skelAnime);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1355,7 +1355,7 @@ void LinkAnimation_Change(GlobalContext* globalCtx, SkelAnime* skelAnime, LinkAn
|
||||
SkelAnime_CopyFrameTable(skelAnime, skelAnime->morphTable, skelAnime->jointTable);
|
||||
morphFrames = -morphFrames;
|
||||
} else {
|
||||
skelAnime->update = LinkAnimation_Morph;
|
||||
skelAnime->update.link = LinkAnimation_Morph;
|
||||
AnimationContext_SetLoadFrame(globalCtx, animation, (s32)startFrame, skelAnime->limbCount,
|
||||
skelAnime->morphTable);
|
||||
}
|
||||
@@ -1599,11 +1599,11 @@ void SkelAnime_InitSkin(GameState* gameState, SkelAnime* skelAnime, SkeletonHead
|
||||
*/
|
||||
void SkelAnime_SetUpdate(SkelAnime* skelAnime) {
|
||||
if (skelAnime->mode <= ANIMMODE_LOOP_INTERP) {
|
||||
skelAnime->update = SkelAnime_LoopFull;
|
||||
skelAnime->update.normal = SkelAnime_LoopFull;
|
||||
} else if (skelAnime->mode <= ANIMMODE_ONCE_INTERP) {
|
||||
skelAnime->update = SkelAnime_Once;
|
||||
skelAnime->update.normal = SkelAnime_Once;
|
||||
} else {
|
||||
skelAnime->update = SkelAnime_LoopPartial;
|
||||
skelAnime->update.normal = SkelAnime_LoopPartial;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1612,7 +1612,7 @@ void SkelAnime_SetUpdate(SkelAnime* skelAnime) {
|
||||
* finishes.
|
||||
*/
|
||||
s32 SkelAnime_Update(SkelAnime* skelAnime) {
|
||||
return skelAnime->update(skelAnime);
|
||||
return skelAnime->update.normal(skelAnime);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1774,10 +1774,10 @@ void Animation_ChangeImpl(SkelAnime* skelAnime, AnimationHeader* animation, f32
|
||||
morphFrames = -morphFrames;
|
||||
} else {
|
||||
if (taper != ANIMTAPER_NONE) {
|
||||
skelAnime->update = SkelAnime_MorphTaper;
|
||||
skelAnime->update.normal = SkelAnime_MorphTaper;
|
||||
skelAnime->taper = taper;
|
||||
} else {
|
||||
skelAnime->update = SkelAnime_Morph;
|
||||
skelAnime->update.normal = SkelAnime_Morph;
|
||||
}
|
||||
SkelAnime_GetFrameData(animation, startFrame, skelAnime->limbCount, skelAnime->morphTable);
|
||||
}
|
||||
|
||||
@@ -1495,7 +1495,7 @@ void func_80146DF8(SramContext* sramCtx) {
|
||||
}
|
||||
|
||||
void Sram_InitSram(GameState* gameState, SramContext* sramCtx) {
|
||||
if (&gSaveContext.save) {}
|
||||
if (gSaveContext.save.entranceIndex) {} // Required to match
|
||||
|
||||
func_801A3D98(gSaveContext.options.audioSetting);
|
||||
}
|
||||
|
||||
@@ -300,7 +300,6 @@ void func_809543D4(BgIngate* this, GlobalContext* globalCtx) {
|
||||
gSaveContext.save.weekEventReg[90] &= (u8)~0x40;
|
||||
func_8019F208();
|
||||
} else {
|
||||
this = this;
|
||||
func_800B7298(globalCtx, &this->dyna.actor, 6);
|
||||
this->unk160 &= ~0x4;
|
||||
this->actionFunc = func_809541B8;
|
||||
|
||||
@@ -1093,6 +1093,7 @@ static Color_RGB8 D_808BBB50[] = {
|
||||
{ 0, 50, 200 },
|
||||
{ 120, 150, 0 },
|
||||
};
|
||||
void func_808BB4F4(DoorWarp1* this, GlobalContext* globalCtx2);
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/overlays/ovl_Door_Warp1/func_808BB4F4.s")
|
||||
#endif
|
||||
|
||||
|
||||
@@ -669,7 +669,6 @@ void func_809C2730(EnAob01* this, GlobalContext* globalCtx) {
|
||||
void func_809C2788(EnAob01* this, GlobalContext* globalCtx) {
|
||||
this->unk_2D2 |= 0x20;
|
||||
if (func_809C25E4(this, globalCtx)) {
|
||||
globalCtx = globalCtx;
|
||||
if (func_801A8A50(0) != 0x41) {
|
||||
globalCtx->nextEntranceIndex = 0x7C10;
|
||||
gSaveContext.eventInf[0] = (gSaveContext.eventInf[0] & (u8)~7) | 3;
|
||||
|
||||
@@ -775,7 +775,6 @@ void EnBigpo_AdjustPoAlpha(EnBigpo* this, s32 alphaDiff) {
|
||||
this->actor.scale.x = newXYScale;
|
||||
this->actor.scale.z = newXYScale;
|
||||
this->actor.scale.y = (0.007f - (0.007f * lowerAlpha)) + 0.007f;
|
||||
lowerAlpha = lowerAlpha;
|
||||
} else {
|
||||
Actor_SetScale(&this->actor, lowerAlpha * 0.007f);
|
||||
this->actor.world.pos.y = this->savedHeight + (lowerAlpha * 15.0f);
|
||||
|
||||
@@ -982,7 +982,6 @@ s32 EnGb2_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
||||
EnGb2* this = THIS;
|
||||
|
||||
if (limbIndex == 7) {
|
||||
limbIndex = limbIndex;
|
||||
Matrix_RotateY(this->unk_270.y, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user