mirror of https://github.com/zeldaret/mm.git
Fix gcc warnings (#246)
* fix a huge amount of warnings * fix another big bunch * fix remaining warnings * Run formatter
This commit is contained in:
parent
7743e5a2c4
commit
51111676c4
8
Makefile
8
Makefile
|
@ -244,7 +244,7 @@ build/data/%.o: data/%.s
|
|||
|
||||
build/src/overlays/%.o: src/overlays/%.c
|
||||
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
|
||||
# $(CC_CHECK) $<
|
||||
$(CC_CHECK) $<
|
||||
@$(OBJDUMP) -d $@ > $(@:.o=.s)
|
||||
# TODO: `() || true` is currently necessary to suppress `Error 1 (ignored)` make warnings caused by `test`, but this will go away if
|
||||
# the following is moved to a separate rule that is only run once when all the required objects have been compiled.
|
||||
|
@ -253,18 +253,18 @@ build/src/overlays/%.o: src/overlays/%.c
|
|||
|
||||
build/src/%.o: src/%.c
|
||||
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
|
||||
# $(CC_CHECK) $<
|
||||
$(CC_CHECK) $<
|
||||
@$(OBJDUMP) -d $@ > $(@:.o=.s)
|
||||
|
||||
build/src/libultra/libc/ll.o: src/libultra/libc/ll.c
|
||||
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
|
||||
# $(CC_CHECK) $<
|
||||
$(CC_CHECK) $<
|
||||
python3 tools/set_o32abi_bit.py $@
|
||||
@$(OBJDUMP) -d $@ > $(@:.o=.s)
|
||||
|
||||
build/src/libultra/libc/llcvt.o: src/libultra/libc/llcvt.c
|
||||
$(CC) -c $(CFLAGS) $(MIPS_VERSION) $(OPTFLAGS) -o $@ $<
|
||||
# $(CC_CHECK) $<
|
||||
$(CC_CHECK) $<
|
||||
python3 tools/set_o32abi_bit.py $@
|
||||
@$(OBJDUMP) -d $@ > $(@:.o=.s)
|
||||
|
||||
|
|
|
@ -240,7 +240,7 @@ void __osFree(Arena* heap, void* ptr);
|
|||
void* __osRealloc(Arena* heap, void* oldPtr, u32 newSize);
|
||||
void __osAnalyzeArena(Arena* heap, u32* maxFreeBlock, u32* bytesFree, u32* bytesAllocated);
|
||||
u32 __osCheckArena(Arena* heap);
|
||||
void* proutSprintf(void* s, char* buf, size_t n);
|
||||
void* proutSprintf(void* s, const char* buf, size_t n);
|
||||
s32 vsprintf(char* dst, char* fmt, va_list args);
|
||||
s32 sprintf(char* s, char* fmt, ...);
|
||||
void PrintUtils_VPrintf(void* callback, const char* fmt, va_list args);
|
||||
|
@ -360,16 +360,16 @@ s32 osContStartQuery(OSMesgQueue* mq);
|
|||
void osContGetQuery(OSContStatus* data);
|
||||
void guLookAtHiliteF(float mf[4][4], LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp, f32 xl1, f32 yl1, f32 zl1, f32 xl2, f32 yl2, f32 zl2, s32 twidth, s32 theight);
|
||||
void guLookAtHilite(Mtx* m, LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp, f32 xl1, f32 yl1, f32 zl1, f32 xl2, f32 yl2, f32 zl2, s32 twidth, s32 theight);
|
||||
s32 _Printf(printf_func pfn, void* arg, const char* fmt, va_list ap);
|
||||
s32 _Printf(PrintCallback pfn, void* arg, const char* fmt, va_list ap);
|
||||
void _Putfld(_Pft* px, va_list* pap, u8 code, u8* ac);
|
||||
// void osVoiceClearDictionary(void);
|
||||
void osUnmapTLBAll(void);
|
||||
s32 osEPiStartDma(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction);
|
||||
// void __osVoiceContRead2(void);
|
||||
// void __osVoiceContDataCrc(void);
|
||||
u8* strchr(u8* __s, s32 __c);
|
||||
size_t strlen(u8* __s);
|
||||
void* memcpy(void* __dest, void* __src, size_t __n);
|
||||
const char* strchr(const char* __s, s32 __c);
|
||||
size_t strlen(const char* __s);
|
||||
void* memcpy(void* __dest, const void* __src, size_t __n);
|
||||
void osCreateMesgQueue(OSMesgQueue* mq, OSMesg* msq, s32 count);
|
||||
void osInvalICache(void* vaddr, s32 nbytes);
|
||||
void osInvalDCache(void* vaddr, s32 nbytes);
|
||||
|
@ -388,7 +388,7 @@ s32 osEPiRawReadIo (OSPiHandle* handle, u32 devAddr, u32* data);
|
|||
void osViSwapBuffer(void* frameBufPtr);
|
||||
void guPositionF(float mf[4][4], f32 r, f32 p, f32 h, f32 s, f32 x, f32 y, f32 z);
|
||||
void guPosition(Mtx* m, f32 r, f32 p, f32 h, f32 s, f32 x, f32 y, f32 z);
|
||||
void osEPiRawStartDma(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
s32 osEPiRawStartDma(OSPiHandle*, s32, u32, void*, u32);
|
||||
OSYieldResult osSpTaskYielded(OSTask* task);
|
||||
s32 memcmp(void* __s1, void* __s2, size_t __n);
|
||||
OSTime osGetTime(void);
|
||||
|
@ -618,6 +618,8 @@ void func_800B13D8(Vec3f* srcPos, f32 randScale, Vec3f* newPos, Vec3f* velocity,
|
|||
void func_800B14D4(GlobalContext* globalCtx, f32 randScale, Vec3f* srcPos);
|
||||
void func_800B1598(GlobalContext* globalCtx, f32 randScale, Vec3f* srcPos);
|
||||
void EffectSsKiraKira_SpawnSmallYellow (GlobalContext * globalCtx, Vec3f * pos, Vec3f * velocity, Vec3f * accel);
|
||||
void EffectSsKiraKira_SpawnSmall(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, Vec3f* accel,
|
||||
Color_RGBA8* primColor, Color_RGBA8* envColor);
|
||||
void EffectSsGSpk_SpawnSmall(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, Vec3f* velocity, Vec3f* accel,
|
||||
Color_RGBA8* primColor, Color_RGBA8* envColor);
|
||||
void EffectSsKiraKira_SpawnDispersed (GlobalContext * globalCtx, Vec3f * pos, Vec3f * velocity, Vec3f * accel, Color_RGBA8 * primColor, Color_RGBA8 * envColor, s16 scale, s32 life);
|
||||
|
@ -3359,7 +3361,7 @@ s32 Math3D_ColSphereLineSeg(Sphere16* sphere, LineSegment* line);
|
|||
void func_8017DD34(Sphere16* sphere, TriNorm* tri, Vec3f* pfParm3);
|
||||
s32 Math3D_ColSphereTri(Sphere16* sphere, TriNorm* tri, Vec3f* uParm3);
|
||||
// void func_8017E294(void);
|
||||
// void func_8017E350(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
|
||||
UNK_TYPE func_8017E350(UNK_PTR, Vec3f*, Vec3f*, Vec3f*, Vec3f*);
|
||||
s32 Math3D_ColCylinderTri(Cylinder16* cylinder, TriNorm* tri, Vec3f* pzParm3);
|
||||
// void func_8017F1A0(void);
|
||||
s32 Math3D_ColSphereSphere(Sphere16* sphere1, Sphere16* sphere2);
|
||||
|
@ -3411,7 +3413,7 @@ void SysMatrix_GetStateTranslationAndScaledX(f32 scale, Vec3f* dst);
|
|||
void SysMatrix_GetStateTranslationAndScaledY(f32 scale, Vec3f* dst);
|
||||
void SysMatrix_GetStateTranslationAndScaledZ(f32 scale, Vec3f* dst);
|
||||
void SysMatrix_MultiplyVector3fXZByCurrentState(Vec3f* src, Vec3f* dst);
|
||||
void SysMatrix_Copy(MtxF* dst, MtxF* src);
|
||||
void Matrix_MtxFCopy(MtxF* dst, MtxF* src);
|
||||
void SysMatrix_FromRSPMatrix(RSPMatrix* src, MtxF* dst);
|
||||
void SysMatrix_MultiplyVector3fByMatrix(Vec3f* src, Vec3f* dst, MtxF* matrix);
|
||||
void SysMatrix_TransposeXYZ(MtxF* matrix);
|
||||
|
@ -3879,7 +3881,7 @@ void func_8019FDC8(UNK_PTR arg0, u16 sfxId, UNK_TYPE arg2);
|
|||
// void func_801A0124(void);
|
||||
// void func_801A0184(void);
|
||||
// void func_801A01C4(void);
|
||||
// void func_801A0204(void);
|
||||
void func_801A0204(UNK_TYPE);
|
||||
// void func_801A0238(void);
|
||||
// void func_801A026C(void);
|
||||
// void func_801A0318(void);
|
||||
|
|
|
@ -169,13 +169,13 @@ typedef struct {
|
|||
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s32 active;
|
||||
/* 0x00 */ s32 active; // u32 maybe? need to check
|
||||
/* 0x04 */ OSThread* thread;
|
||||
/* 0x08 */ OSMesgQueue* cmdQueue;
|
||||
/* 0x0C */ OSMesgQueue* evtQueue;
|
||||
/* 0x10 */ OSMesgQueue* acsQueue;
|
||||
/* 0x14 */ s32 (*dma)(void);
|
||||
/* 0x18 */ s32 (*unk18)(void);
|
||||
/* 0x14 */ s32 (*piDmaCallback)(s32, u32, void*, u32);
|
||||
/* 0x18 */ s32 (*epiDmaCallback)(OSPiHandle*, s32, u32, void*, u32);
|
||||
} OSDevMgr;
|
||||
|
||||
|
||||
|
|
|
@ -1,26 +1,25 @@
|
|||
#ifndef _XSTDIO_H_
|
||||
#define _XSTDIO_H_
|
||||
|
||||
typedef double ldouble;
|
||||
#include "stdarg.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* 0x0 */ union {
|
||||
/* 0x0 */ long long ll;
|
||||
/* 0x0 */ ldouble ld;
|
||||
/* 0x0 */ s64 ll;
|
||||
/* 0x0 */ f64 ld;
|
||||
} v;
|
||||
/* 0x8 */ unsigned char* s;
|
||||
/* 0xC */ int n0;
|
||||
/* 0x10 */ int nz0;
|
||||
/* 0x14 */ int n1;
|
||||
/* 0x18 */ int nz1;
|
||||
/* 0x1C */ int n2;
|
||||
/* 0x20 */ int nz2;
|
||||
/* 0x24 */ int prec;
|
||||
/* 0x28 */ int width;
|
||||
/* 0x8 */ char* s;
|
||||
/* 0xC */ s32 n0;
|
||||
/* 0x10 */ s32 nz0;
|
||||
/* 0x14 */ s32 n1;
|
||||
/* 0x18 */ s32 nz1;
|
||||
/* 0x1C */ s32 n2;
|
||||
/* 0x20 */ s32 nz2;
|
||||
/* 0x24 */ s32 prec;
|
||||
/* 0x28 */ s32 width;
|
||||
/* 0x2C */ size_t nchar;
|
||||
/* 0x30 */ unsigned int flags;
|
||||
/* 0x34 */ unsigned char qual;
|
||||
/* 0x30 */ u32 flags;
|
||||
/* 0x34 */ u8 qual;
|
||||
} _Pft;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -394,7 +394,7 @@ typedef void(*func_ptr)(void);
|
|||
|
||||
typedef void(*osCreateThread_func)(void*);
|
||||
|
||||
typedef void*(*printf_func)(void*, char*, size_t);
|
||||
typedef void* (*PrintCallback)(void*, const char*, u32);
|
||||
|
||||
typedef enum {
|
||||
SLOWLY_CALLBACK_NO_ARGS,
|
||||
|
|
|
@ -104,7 +104,6 @@ typedef struct {
|
|||
/* 0x18 */ char* name;
|
||||
/* 0x1C */ u16 allocType; // bit 0: don't allocate memory, use actorContext->0x250? bit 1: Always keep loaded?
|
||||
/* 0x1E */ s8 numLoaded; // original name: "clients"
|
||||
/* 0x1F */ UNK_TYPE1 pad1F[0x1];
|
||||
} ActorOverlay; // size = 0x20
|
||||
|
||||
typedef void(*ActorShadowFunc)(struct Actor* actor, struct Lights* mapper, struct GlobalContext* globalCtx);
|
||||
|
|
|
@ -30,14 +30,19 @@ void Load2_Relocate(u32 allocatedVRamAddr, OverlayRelocationSection* overlayInfo
|
|||
case 0x2000000:
|
||||
if ((*inst & 0xf000000) == 0) {
|
||||
*inst = (*inst - vRamStart) + allocatedVRamAddr;
|
||||
} else {
|
||||
if (D_80096C30 > 2)
|
||||
}
|
||||
/*
|
||||
else {
|
||||
if (D_80096C30 > 2) {
|
||||
;
|
||||
}
|
||||
}
|
||||
*/
|
||||
break;
|
||||
case 0x4000000:
|
||||
*inst = (*inst & 0xfc000000) |
|
||||
(((((*inst & 0x3ffffff) << 2 | 0x80000000) - vRamStart) + allocatedVRamAddr & 0xfffffff) >> 2);
|
||||
*inst =
|
||||
(*inst & 0xfc000000) |
|
||||
((((((*inst & 0x3ffffff) << 2 | 0x80000000) - vRamStart) + allocatedVRamAddr) & 0xfffffff) >> 2);
|
||||
break;
|
||||
case 0x5000000:
|
||||
regReferences[*inst >> 0x10 & 0x1f] = inst;
|
||||
|
@ -46,12 +51,12 @@ void Load2_Relocate(u32 allocatedVRamAddr, OverlayRelocationSection* overlayInfo
|
|||
case 0x6000000:
|
||||
lastInst = regReferences[*inst >> 0x15 & 0x1f];
|
||||
signedOffset = (s16)*inst;
|
||||
if ((signedOffset + *lastInst * 0x10000 & 0xf000000) == 0) {
|
||||
if (((signedOffset + *lastInst * 0x10000) & 0xf000000) == 0) {
|
||||
relocatedAddress =
|
||||
((signedOffset + regValues[*inst >> 0x15 & 0x1f] * 0x10000) - vRamStart) + allocatedVRamAddr;
|
||||
*lastInst = (((relocatedAddress >> 0x10) & 0xFFFF) + ((relocatedAddress & 0x8000) ? 1 : 0)) |
|
||||
(*lastInst & 0xffff0000);
|
||||
*inst = *inst & 0xffff0000 | relocatedAddress & 0xffff;
|
||||
*inst = (*inst & 0xffff0000) | (relocatedAddress & 0xffff);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ void FaultDrawer_FillScreen() {
|
|||
#pragma GLOBAL_ASM("asm/non_matchings/boot/fault_drawer/D_80099080.s")
|
||||
|
||||
void FaultDrawer_VPrintf(const char* str, char* args) { // va_list
|
||||
_Printf((printf_func)FaultDrawer_FormatStringFunc, sFaultDrawContext, str, args);
|
||||
_Printf((PrintCallback)FaultDrawer_FormatStringFunc, sFaultDrawContext, str, args);
|
||||
}
|
||||
|
||||
void FaultDrawer_Printf(const char* fmt, ...) {
|
||||
|
|
|
@ -105,7 +105,7 @@ s32 Yaz0_DecompressImpl(u8* src, u8* dst) {
|
|||
src += 2;
|
||||
|
||||
chunkSize = (nibble == 0) // N = chunkSize; B = back offset
|
||||
? *src++ + 0x12 // 3 bytes 0B BB NN
|
||||
? (u32)(*src++ + 0x12) // 3 bytes 0B BB NN
|
||||
: nibble + 2; // 2 bytes NB BB
|
||||
|
||||
do {
|
||||
|
@ -125,8 +125,8 @@ s32 Yaz0_DecompressImpl(u8* src, u8* dst) {
|
|||
void Yaz0_Decompress(u32 romStart, void* dst, u32 size) {
|
||||
s32 status;
|
||||
u32 pad;
|
||||
u8 sp80[0x50];
|
||||
u8 sp30[0x50];
|
||||
char sp80[0x50];
|
||||
char sp30[0x50];
|
||||
|
||||
if (sYaz0CurDataEnd != NULL) {
|
||||
while (sYaz0CurDataEnd != NULL) {
|
||||
|
|
|
@ -176,7 +176,7 @@ void Game_ResizeHeap(GameState* gamestate, u32 size) {
|
|||
size = systemMaxFree - (sizeof(ArenaNode));
|
||||
}
|
||||
|
||||
if (buf = Gamealloc_Alloc(alloc, size)) {
|
||||
if ((buf = Gamealloc_Alloc(alloc, size)) != NULL) {
|
||||
THA_Ct(&gamestate->heap, buf, size);
|
||||
} else {
|
||||
THA_Ct(&gamestate->heap, 0, 0);
|
||||
|
|
|
@ -9,7 +9,7 @@ void TitleSetup_GameStateResetContext(void) {
|
|||
XREG(13) = 0;
|
||||
XREG(31) = 0;
|
||||
XREG(41) = 0x50;
|
||||
XREG(43) = 0xFFFFFC54;
|
||||
XREG(43) = 0xFC54;
|
||||
|
||||
XREG(44) = 0xD7;
|
||||
XREG(45) = 0xDA;
|
||||
|
|
|
@ -46,7 +46,7 @@ void func_800A81F0(EffectBlure* this, Vec3f* p1, Vec3f* p2) {
|
|||
Math_Vec3f_Scale(&sp154, scale);
|
||||
|
||||
SkinMatrix_SetTranslate(&sp110, sp160.x, sp160.y, sp160.z);
|
||||
Matrix_MakeRotationAroundUnitVector(&spD0, this->addAngle, sp154.x, sp154.y, sp154.z);
|
||||
SkinMatrix_SetRotateAroundVec(&spD0, this->addAngle, sp154.x, sp154.y, sp154.z);
|
||||
SkinMatrix_MtxFMtxFMult(&sp110, &spD0, &sp90);
|
||||
SkinMatrix_SetTranslate(&sp110, -sp160.x, -sp160.y, -sp160.z);
|
||||
SkinMatrix_MtxFMtxFMult(&sp90, &sp110, &sp50);
|
||||
|
|
|
@ -468,8 +468,8 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
Collision_CylinderMoveToActor(&this->actor, &this->collider);
|
||||
Collision_AddAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
Collider_UpdateCylinder(&this->actor, &this->collider);
|
||||
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
|
||||
|
||||
if ((this->actor.params == ITEM00_SHIELD_HERO) || (this->actor.params == ITEM00_MAP) ||
|
||||
(this->actor.params == ITEM00_COMPASS)) {
|
||||
|
@ -866,15 +866,18 @@ EnItem00* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, u32 pa
|
|||
}
|
||||
} else if (((paramFF == ITEM00_FLEXIBLE) || ((params & 0xFF) == ITEM00_BIG_FAIRY)) && (param10000 == 0)) {
|
||||
if ((params & 0xFF) == ITEM00_FLEXIBLE) {
|
||||
spawnedActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f,
|
||||
// TODO: fix cast, this actor is not an EnItem00
|
||||
spawnedActor =
|
||||
(EnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELF, spawnPos->x, spawnPos->y + 40.0f,
|
||||
spawnPos->z, 0, 0, 0, ((((param7F00 >> 8) & 0x7F) << 9) & 0xFE00) | 0x102);
|
||||
if (!Actor_GetCollectibleFlag(globalCtx, (param7F00 >> 8) & 0x7F)) {
|
||||
func_800F0568(globalCtx, spawnPos, 40, NA_SE_EV_BUTTERFRY_TO_FAIRY);
|
||||
}
|
||||
} else {
|
||||
spawnedActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELFORG, spawnPos->x, spawnPos->y + 40.0f,
|
||||
spawnPos->z, 0, 0, 0, ((((param7F00 >> 8) & 0x7F) & 0x7F) << 9) | 7);
|
||||
// TODO: fix cast, this actor is not an EnItem00
|
||||
spawnedActor = (EnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ELFORG, spawnPos->x,
|
||||
spawnPos->y + 40.0f, spawnPos->z, 0, 0, 0,
|
||||
((((param7F00 >> 8) & 0x7F) & 0x7F) << 9) | 7);
|
||||
if (param20000 == 0) {
|
||||
if (!Actor_GetCollectibleFlag(globalCtx, (param7F00 >> 8) & 0x7F)) {
|
||||
func_800F0568(globalCtx, spawnPos, 40, NA_SE_EV_BUTTERFRY_TO_FAIRY);
|
||||
|
@ -885,9 +888,9 @@ EnItem00* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, u32 pa
|
|||
if (param8000 == 0) {
|
||||
params = func_800A7650(params & 0xFF);
|
||||
}
|
||||
if (params != ITEM00_NO_DROP) {
|
||||
spawnedActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, spawnPos->x, spawnPos->y,
|
||||
spawnPos->z, 0, 0, 0, params | param8000 | param7F00);
|
||||
if (params != (u32)ITEM00_NO_DROP) {
|
||||
spawnedActor = (EnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, spawnPos->x,
|
||||
spawnPos->y, spawnPos->z, 0, 0, 0, params | param8000 | param7F00);
|
||||
if ((spawnedActor != NULL) && (param8000 == 0)) {
|
||||
if (param10000 == 0) {
|
||||
spawnedActor->actor.velocity.y = 8.0f;
|
||||
|
@ -897,7 +900,7 @@ EnItem00* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, u32 pa
|
|||
spawnedActor->actor.speedXZ = 2.0f;
|
||||
spawnedActor->actor.gravity = -0.9f;
|
||||
spawnedActor->actor.world.rot.y = randPlusMinusPoint5Scaled(65536.0f);
|
||||
Actor_SetScale(spawnedActor, 0.0f);
|
||||
Actor_SetScale(&spawnedActor->actor, 0.0f);
|
||||
spawnedActor->actionFunc = func_800A6780;
|
||||
spawnedActor->unk152 = 0xDC;
|
||||
if ((spawnedActor->actor.params != ITEM00_SMALL_KEY) &&
|
||||
|
@ -948,7 +951,7 @@ Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, u32 para
|
|||
}
|
||||
} else {
|
||||
params = func_800A7650(params);
|
||||
if (params != ITEM00_NO_DROP) {
|
||||
if (params != (u32)ITEM00_NO_DROP) {
|
||||
spawnedActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, spawnPos->x, spawnPos->y,
|
||||
spawnPos->z, 0, 0, 0, params | param8000 | param7F00);
|
||||
if (spawnedActor != NULL) {
|
||||
|
@ -1137,19 +1140,19 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
|
|||
}
|
||||
}
|
||||
|
||||
if (dropId != ITEM00_NO_DROP) {
|
||||
if (dropId != (u8)ITEM00_NO_DROP) {
|
||||
while (dropQuantity > 0) {
|
||||
if (param8000 == 0) {
|
||||
dropId = func_800A7650(dropId);
|
||||
if (dropId != ITEM00_NO_DROP) {
|
||||
spawnedActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00, spawnPos->x,
|
||||
spawnPos->y, spawnPos->z, 0, 0, 0, dropId);
|
||||
if ((spawnedActor != 0) && (dropId != ITEM00_NO_DROP)) {
|
||||
if (dropId != (u8)ITEM00_NO_DROP) {
|
||||
spawnedActor = (EnItem00*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_ITEM00,
|
||||
spawnPos->x, spawnPos->y, spawnPos->z, 0, 0, 0, dropId);
|
||||
if ((spawnedActor != 0) && (dropId != (u8)ITEM00_NO_DROP)) {
|
||||
spawnedActor->actor.velocity.y = 8.0f;
|
||||
spawnedActor->actor.speedXZ = 2.0f;
|
||||
spawnedActor->actor.gravity = -0.9f;
|
||||
spawnedActor->actor.world.rot.y = Rand_ZeroOne() * 40000.0f;
|
||||
Actor_SetScale(spawnedActor, 0.0f);
|
||||
Actor_SetScale(&spawnedActor->actor, 0.0f);
|
||||
spawnedActor->actionFunc = func_800A6780;
|
||||
spawnedActor->actor.flags = spawnedActor->actor.flags | 0x10;
|
||||
if ((spawnedActor->actor.params != ITEM00_SMALL_KEY) &&
|
||||
|
|
|
@ -18,7 +18,7 @@ void Font_LoadMessageBoxEndIcon(Font* font, u16 icon) {
|
|||
FONT_CHAR_TEX_SIZE);
|
||||
}
|
||||
|
||||
static char sFontOrdering[] = "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19"
|
||||
static u8 sFontOrdering[] = "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19"
|
||||
"!\"#$%&\'()*+,-./0123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
"\x00\x0D\x0E\x1A"
|
||||
"afjmosvwxyz{|}~"
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#include "global.h"
|
||||
|
||||
#define SCENE_ENTRY(name, textId, config) \
|
||||
{ (u32) _##name##SegmentRomStart, (u32)_##name##SegmentRomEnd, textId, 0, config }
|
||||
{ { (u32)_##name##SegmentRomStart, (u32)_##name##SegmentRomEnd }, textId, 0, config, 0 }
|
||||
|
||||
#define SCENE_ENTRY_NONE() \
|
||||
{ 0, 0, 0, 0, 0 }
|
||||
{ { 0, 0 }, 0, 0, 0, 0 }
|
||||
|
||||
SceneTableEntry gSceneTable[] = {
|
||||
SCENE_ENTRY(Z2_20SICHITAI2, 0x0116, SCENE_DRAW_CFG_MAT_ANIM),
|
||||
|
|
|
@ -24,8 +24,8 @@ void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgC
|
|||
__osPiDevMgr.cmdQueue = cmdQ;
|
||||
__osPiDevMgr.evtQueue = &D_8009E3D0;
|
||||
__osPiDevMgr.acsQueue = &__osPiAccessQueue;
|
||||
__osPiDevMgr.dma = (s32(*)(void))osPiRawStartDma;
|
||||
__osPiDevMgr.unk18 = (s32(*)(void))osEPiRawStartDma;
|
||||
__osPiDevMgr.piDmaCallback = osPiRawStartDma;
|
||||
__osPiDevMgr.epiDmaCallback = osEPiRawStartDma;
|
||||
osCreateThread(&D_8009D220, 0, __osDevMgrMain, (void*)&__osPiDevMgr, &piManagerStack[4096], pri);
|
||||
osStartThread(&D_8009D220);
|
||||
__osRestoreInt(savedMask);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include "osint.h"
|
||||
#include "assert.h"
|
||||
#include "global.h"
|
||||
|
||||
s32 __osSiRawWriteIo(u32 devAddr, u32 data) {
|
||||
if (__osSiDeviceBusy() != 0) {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include "osint.h"
|
||||
#include "assert.h"
|
||||
#include "global.h"
|
||||
|
||||
u32 __osSpGetStatus() {
|
||||
return *(vu32*)0xA4040010;
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#include "stdarg.h"
|
||||
#include "osint.h"
|
||||
#include "assert.h"
|
||||
#include "global.h"
|
||||
|
||||
s32 __osSpRawStartDma(s32 direction, u32 devAddr, void* dramAddr, u32 size) {
|
||||
if (__osSpDeviceBusy() != 0) {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include "osint.h"
|
||||
#include "assert.h"
|
||||
#include "global.h"
|
||||
|
||||
void __osSpSetStatus(u32 data) {
|
||||
*(vu32*)0xA4040010 = data;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "string.h"
|
||||
|
||||
unsigned char* strchr(const unsigned char* s, int c) {
|
||||
const char* strchr(const char* s, int c) {
|
||||
const unsigned char ch = c;
|
||||
|
||||
while (*s != ch) {
|
||||
|
@ -10,11 +10,11 @@ unsigned char* strchr(const unsigned char* s, int c) {
|
|||
s++;
|
||||
}
|
||||
|
||||
return (unsigned char*)s;
|
||||
return s;
|
||||
}
|
||||
|
||||
size_t strlen(const unsigned char* s) {
|
||||
const unsigned char* sc = s;
|
||||
size_t strlen(const char* s) {
|
||||
const char* sc = s;
|
||||
|
||||
while (*sc != '\0') {
|
||||
sc++;
|
||||
|
|
|
@ -9,9 +9,9 @@ void osCreateThread(OSThread* t, OSId id, void* entry, void* arg, void* sp, OSPr
|
|||
t->next = NULL;
|
||||
t->queue = NULL;
|
||||
t->context.pc = (u32)entry;
|
||||
t->context.a0 = (u64)arg;
|
||||
t->context.sp = (u64)sp - 16;
|
||||
t->context.ra = (u64)__osCleanupThread;
|
||||
t->context.a0 = arg;
|
||||
t->context.sp = (u64)(s32)sp - 16;
|
||||
t->context.ra = __osCleanupThread;
|
||||
|
||||
mask = 0x3FFF01;
|
||||
t->context.sr = 0xFF03;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "PR/ultratypes.h"
|
||||
#include "osint.h"
|
||||
#include "stdint.h"
|
||||
#include "global.h"
|
||||
|
||||
uintptr_t osVirtualToPhysical(void* virtualAddress) {
|
||||
if (((uintptr_t)virtualAddress >= 0x80000000) && ((uintptr_t)virtualAddress < 0xA0000000)) {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#include "global.h"
|
||||
|
||||
void* proutSprintf(void* dst, char* fmt, size_t size) {
|
||||
return (char*)memcpy(dst, fmt, size) + size;
|
||||
void* proutSprintf(void* dst, const char* fmt, size_t size) {
|
||||
return (void*)((uintptr_t)memcpy(dst, fmt, size) + size);
|
||||
}
|
||||
|
||||
int vsprintf(char* dst, char* fmt, va_list args) {
|
||||
int ans = _Printf(&proutSprintf, dst, fmt, args);
|
||||
int ans = _Printf(proutSprintf, dst, fmt, args);
|
||||
if (ans > -1) {
|
||||
dst[ans] = 0;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
char spaces[] = " ";
|
||||
char zeroes[] = "00000000000000000000000000000000";
|
||||
|
||||
int _Printf(printf_func pfn, void* arg, const char* fmt, va_list ap) {
|
||||
int _Printf(PrintCallback pfn, void* arg, const char* fmt, va_list ap) {
|
||||
_Pft x;
|
||||
x.nchar = 0;
|
||||
while (1) {
|
||||
|
|
|
@ -506,8 +506,8 @@ void EnFirefly_FlyAway(EnFirefly* this, GlobalContext* globalCtx) {
|
|||
this->timer--;
|
||||
}
|
||||
|
||||
if ((fabsf(this->actor.world.pos.y - this->maxAltitude) < 10.0f) &&
|
||||
(Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) < 20.0f) ||
|
||||
if (((fabsf(this->actor.world.pos.y - this->maxAltitude) < 10.0f) &&
|
||||
(Math_Vec3f_DistXZ(&this->actor.world.pos, &this->actor.home.pos) < 20.0f)) ||
|
||||
(this->timer == 0)) {
|
||||
EnFirefly_SetupFlyIdle(this);
|
||||
return;
|
||||
|
|
|
@ -31,7 +31,7 @@ typedef struct EnFirefly {
|
|||
/* 0x23C */ Vec3s morphTable[28];
|
||||
/* 0x2E4 */ f32 maxAltitude;
|
||||
/* 0x2E8 */ Vec3f unk_2E8;
|
||||
/* 0x2F4 */ s32 unk_2F4;
|
||||
/* 0x2F4 */ u32 unk_2F4;
|
||||
/* 0x2F8 */ Vec3f unk_2F8;
|
||||
/* 0x304 */ Vec3f unk_304;
|
||||
/* 0x304 */ Vec3f unk_310;
|
||||
|
|
|
@ -184,7 +184,7 @@ void func_80BCF4AC(EnHg* this, GlobalContext* globalCtx) {
|
|||
this->actor.speedXZ = 1.6f;
|
||||
if (!(player->stateFlags2 & 0x08000000) && !func_80152498(&globalCtx->msgCtx)) {
|
||||
if (((this->skelAnime.animCurrentFrame > 9.0f) && (this->skelAnime.animCurrentFrame < 16.0f)) ||
|
||||
(this->skelAnime.animCurrentFrame > 44.0f) && (this->skelAnime.animCurrentFrame < 51.0f)) {
|
||||
((this->skelAnime.animCurrentFrame > 44.0f) && (this->skelAnime.animCurrentFrame < 51.0f))) {
|
||||
Actor_SetVelocityAndMoveYRotationAndGravity(&this->actor);
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 5, 0x3E8, 0x14);
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
|
|
|
@ -22,10 +22,12 @@ void EnOssan_DrawPartTimeWorker(Actor* thisx, GlobalContext* globalCtx);
|
|||
|
||||
void EnOssan_InitCuriosityShopMan(EnOssan* this, GlobalContext* globalCtx);
|
||||
void EnOssan_InitPartTimeWorker(EnOssan* this, GlobalContext* globalCtx);
|
||||
s32 EnOssan_GetWelcomeCuriosityShopMan(EnOssan* this, GlobalContext* globalCtx);
|
||||
void EnOssan_InitShop(EnOssan* this, GlobalContext* globalCtx);
|
||||
void EnOssan_Idle(EnOssan* this, GlobalContext* globalCtx);
|
||||
void EnOssan_BeginInteraction(EnOssan* this, GlobalContext* globalCtx);
|
||||
void EnOssan_Hello(EnOssan* this, GlobalContext* globalCtx);
|
||||
s32 EnOssan_GetWelcomePartTimeWorker(EnOssan* this, GlobalContext* globalCtx);
|
||||
void EnOssan_SetHaveMet(EnOssan* this);
|
||||
void EnOssan_StartShopping(GlobalContext* globalCtx, EnOssan* this);
|
||||
void EnOssan_FaceShopkeeper(EnOssan* this, GlobalContext* globalCtx);
|
||||
|
@ -45,6 +47,9 @@ void EnOssan_ResetItemPosition(EnOssan* this);
|
|||
void EnOssan_Blink(EnOssan* this);
|
||||
void EnOssan_GetCutscenes(EnOssan* this, GlobalContext* globalCtx);
|
||||
|
||||
s32 EnOssan_ReturnItemToShelf(EnOssan* this);
|
||||
s32 EnOssan_TakeItemOffShelf(EnOssan* this);
|
||||
|
||||
extern FlexSkeletonHeader D_060028A0;
|
||||
extern TexturePtr D_06005BC0;
|
||||
extern TexturePtr D_06006498;
|
||||
|
|
|
@ -570,7 +570,7 @@ void EnPametfrog_JumpToWall(EnPametfrog* this, GlobalContext* globalCtx) {
|
|||
(COLPOLY_GET_NORMAL(this->actor.wallPoly->normal.y) < 0.5f)) {
|
||||
EnPametfrog_SetupWallCrawl(this);
|
||||
} else if (!(this->actor.bgCheckFlags & 1) ||
|
||||
(this->skelAnime.animCurrentFrame > 1.0f) && (this->skelAnime.animCurrentFrame < 12.0f)) {
|
||||
((this->skelAnime.animCurrentFrame > 1.0f) && (this->skelAnime.animCurrentFrame < 12.0f))) {
|
||||
this->actor.speedXZ = 12.0f;
|
||||
} else {
|
||||
this->actor.speedXZ = 0.0f;
|
||||
|
|
|
@ -159,7 +159,7 @@ static EnSob1ActionFunc sInitFuncs[] = {
|
|||
EnSob1_InitGoronShopkeeper,
|
||||
};
|
||||
|
||||
extern Vec3f sPosOffset[] = {
|
||||
static Vec3f sPosOffset[] = {
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
{ 0.0f, -4.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f },
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# Generated warnings counters
|
||||
warnings_setup_new.txt
|
||||
warnings_disasm_new.txt
|
||||
warnings_build_new.txt
|
||||
|
|
Loading…
Reference in New Issue