diff --git a/configure.py b/configure.py index a802261..f605493 100644 --- a/configure.py +++ b/configure.py @@ -227,11 +227,11 @@ # dolphin library flags cflags_dolphin = [ *cflags_base, - "-lang=c", + "-lang=c", "-fp fmadd", "-fp_contract off", "-char signed", - "-str reuse", + "-str reuse", "-common off", "-O4,p", #"-requireprotos" @@ -240,11 +240,11 @@ # Renderware library flags cflags_renderware = [ *cflags_base, - "-lang=c", + "-lang=c", "-fp fmadd", "-fp_contract off", "-char signed", - "-str reuse", + "-str reuse", "-common off", "-O4,p", #"-requireprotos" @@ -265,7 +265,7 @@ "-str reuse,pool,readonly", "-use_lmw_stmw on", '-pragma "cpp_extensions on"', - "-inline off", + "-inline auto", "-gccinc", "-i include/bink", "-i include/inline", @@ -368,15 +368,15 @@ def MatchingFor(*versions): Object(NonMatching, "SB/Core/x/xModelBlur.cpp"), Object(NonMatching, "SB/Core/x/xCamera.cpp"), Object(NonMatching, "SB/Game/zWadNME.cpp"), - Object(NonMatching, "SB/Game/zWad1.cpp"), + Object(NonMatching, "SB/Game/zWad1.cpp"), Object(NonMatching, "SB/Game/zWad2.cpp"), Object(NonMatching, "SB/Game/zWad3.cpp"), Object(NonMatching, "SB/Game/zWadEnt.cpp"), Object(NonMatching, "SB/Game/zWadHud.cpp"), Object(NonMatching, "SB/Game/zWadUI.cpp"), Object(NonMatching, "SB/Game/zMain.cpp"), - Object(NonMatching, "SB/Game/zTalkBox.cpp"), - Object(NonMatching, "SB/Game/zTaskBox.cpp"), + Object(NonMatching, "SB/Game/zTalkBox.cpp", extra_cflags=["-inline off"]), + Object(NonMatching, "SB/Game/zTaskBox.cpp", extra_cflags=["-inline off"]), Object(NonMatching, "SB/Game/zSmoke.cpp"), Object(NonMatching, "SB/Game/zSplash.cpp"), Object(NonMatching, "SB/Game/zExplosion.cpp"), @@ -398,7 +398,7 @@ def MatchingFor(*versions): Object(Matching, "SB/Core/gc/iException.cpp"), Object(NonMatching, "SB/Core/gc/iScrFX.cpp"), Object(NonMatching, "SB/Core/gc/iARAMTmp.cpp"), - + ], }, { @@ -452,7 +452,7 @@ def MatchingFor(*versions): [ Object(Matching, "dolphin/src/ar/ar.c"), Object(Matching, "dolphin/src/ar/arq.c") - ] + ] ), DolphinLib( "ax", @@ -484,7 +484,7 @@ def MatchingFor(*versions): "base", [ Object(Matching, "dolphin/src/base/PPCArch.c") - ] + ] ), DolphinLib( "card", @@ -519,7 +519,7 @@ def MatchingFor(*versions): Object(NonMatching, "dolphin/src/dsp/dsp.c"), Object(Matching, "dolphin/src/dsp/dsp_debug.c"), Object(NonMatching, "dolphin/src/dsp/dsp_task.c") - ] + ] ), DolphinLib( "dvd", @@ -562,7 +562,7 @@ def MatchingFor(*versions): ] ), DolphinLib( - "mix", + "mix", [ Object(NonMatching, "dolphin/src/mix/mix.c") ] @@ -683,14 +683,14 @@ def MatchingFor(*versions): Object(NonMatching, "MSL_C/MSL_Common/strtold.c"), Object(NonMatching, "MSL_C/MSL_Common/strtoul.c"), Object(Matching, "MSL_C/MSL_Common/float.c"), - Object(NonMatching, "MSL_C/MSL_Common/char_io.c"), - Object(NonMatching, "MSL_C/MSL_Common/wchar_io.c"), + Object(NonMatching, "MSL_C/MSL_Common/char_io.c"), + Object(NonMatching, "MSL_C/MSL_Common/wchar_io.c"), Object(NonMatching, "MSL_C/MSL_Common_Embedded/uart_console_io_gcn.c") ] ), mslLib( "fdlibm.PPCEABI.H", - [], + [], [ Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_acos.c"), Object(Matching, "MSL_C/MSL_Common_Embedded/Math/Double_precision/e_asin.c"), @@ -747,7 +747,7 @@ def MatchingFor(*versions): Object(NonMatching, "debugger/embedded/MetroTRK/Processor/ppc/Generic/targimpl.c"), #Object(NonMatching, "debugger/embedded/MetroTRK/Processor/ppc/Export/targsupp.s"), Object(Matching, "debugger/embedded/MetroTRK/Processor/ppc/Generic/mpc_7xx_603e.c"), - Object(NonMatching, "debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk.c"), + Object(NonMatching, "debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk.c"), Object(NonMatching, "debugger/embedded/MetroTRK/Os/dolphin/usr_put.c"), Object(NonMatching, "debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk_glue.c"), Object(Matching, "debugger/embedded/MetroTRK/Os/dolphin/targcont.c"), diff --git a/src/SB/Core/gc/iWad.cpp b/src/SB/Core/gc/iWad.cpp index 30dbe76..84f95d7 100644 --- a/src/SB/Core/gc/iWad.cpp +++ b/src/SB/Core/gc/iWad.cpp @@ -423,6 +423,7 @@ static S32 iSG_mc_fclose(st_ISG_MEMCARD_DATA* mcdata) return iSG_mc_fclose(mcdata, NULL); } +// Inlining issue static S32 iSG_mc_fopen(st_ISG_MEMCARD_DATA* mcdata, const char* fname, S32 fsize, en_ISG_IOMODE mode, en_ASYNC_OPERR* operr) { @@ -857,6 +858,7 @@ static S32 iSG_bnr_unpack(st_ISG_TPL_TEXPALETTE* tpl) return iSG_tpl_unpack(tpl); } +// Inlining issue static S32 iSG_load_icondata() { g_rawicon = (st_ISG_TPL_TEXPALETTE*)iFileLoad("/SBGCIcon.tpl", NULL, &g_iconsize); @@ -1516,6 +1518,7 @@ char* iSGFileModDate(st_ISGSESSION* isgdata, const char* fname, S32* sec, S32* m return datestr; } +// Inlining issue char* iSGFileModDate(st_ISGSESSION* isgdata, const char* fname) { return iSGFileModDate(isgdata, fname, NULL, NULL, NULL, NULL, NULL, NULL); @@ -1559,6 +1562,7 @@ S32 iSGFileSize(st_ISGSESSION* isgdata, const char* fname) return ret; } +// Inlining issue S32 iSGTgtHaveRoomStartup(st_ISGSESSION* isgdata, S32 tidx, S32 fsize, const char* dpath, const char* fname, S32* bytesNeeded, S32* availOnDisk, S32* needFile) { @@ -1633,6 +1637,7 @@ S32 iSGTgtHaveRoomStartup(st_ISGSESSION* isgdata, S32 tidx, S32 fsize, const cha return (count >= 3) ? 0 : is_space; } +// Inlining issue S32 iSGTgtHaveRoom(st_ISGSESSION* isgdata, S32 tidx, S32 fsize, const char* dpath, const char* fname, S32* bytesNeeded, S32* availOnDisk, S32* needFile) { @@ -1992,6 +1997,7 @@ S32 iSGShutdown() return 1; } +// Inlining issue S32 iSGStartup() // TO-DO - 92% { if (g_isginit++ != 0) @@ -2146,6 +2152,7 @@ extern U32 HeapSize; extern U32 mem_top_alloc; extern U32 mem_base_alloc; +// Inlining issue void iMemExit() { free((void*)gMemInfo.DRAM.addr); @@ -3335,6 +3342,7 @@ void iEnvEndRenderFX(iEnv*) } } +// Inlining issue void iEnvRender(iEnv* env, bool) { RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA); diff --git a/src/SB/Core/x/xCamera.cpp b/src/SB/Core/x/xCamera.cpp index dc3bd8e..ca96ebb 100644 --- a/src/SB/Core/x/xCamera.cpp +++ b/src/SB/Core/x/xCamera.cpp @@ -385,6 +385,7 @@ static void _xCameraUpdate(xCamera* cam, F32 dt) // lol nope } +// Inlining issue void xCameraUpdate(xCamera* cam, F32 dt) { S32 i; diff --git a/src/SB/Core/x/xEnt.h b/src/SB/Core/x/xEnt.h index 5c9944e..8740fa9 100644 --- a/src/SB/Core/x/xEnt.h +++ b/src/SB/Core/x/xEnt.h @@ -232,12 +232,14 @@ void xEntSceneExit(); void xEntSceneInit(); void xEntSetTimePassed(F32 sec); -inline void xEntHide(xEnt* ent) +// Needs to be [gw] but not inline? +void xEntHide(xEnt* ent) { ent->flags &= ~0x1; } -inline void xEntShow(xEnt* ent) +// Needs to be [gw] but not inline? +void xEntShow(xEnt* ent) { ent->flags |= 0x1; } diff --git a/src/SB/Core/x/xGrid.h b/src/SB/Core/x/xGrid.h index 27d338b..1eb9cbe 100644 --- a/src/SB/Core/x/xGrid.h +++ b/src/SB/Core/x/xGrid.h @@ -76,7 +76,7 @@ void xGridCheckPosition(xGrid* grid, xVec3* pos, xQCData* qcd, GridEntCallback h S32 xGridEntIsTooBig(xGrid* grid, const xEnt* ent); S32 xGridAdd(xGrid* grid, xEnt* ent); -inline xGridBound* xGridIterFirstCell(xGridBound** head, xGridIterator& it) +xGridBound* xGridIterFirstCell(xGridBound** head, xGridIterator& it) { xGridBound* cell = *head; @@ -94,7 +94,7 @@ inline xGridBound* xGridIterFirstCell(xGridBound** head, xGridIterator& it) return cell; } -inline xGridBound* xGridIterFirstCell(xGrid* grid, S32 grx, S32 grz, xGridIterator& iter) +xGridBound* xGridIterFirstCell(xGrid* grid, S32 grx, S32 grz, xGridIterator& iter) { if (grx < 0 || grx >= grid->nx) { diff --git a/src/SB/Core/x/xWad1.cpp b/src/SB/Core/x/xWad1.cpp index 68a0933..f1082fd 100644 --- a/src/SB/Core/x/xWad1.cpp +++ b/src/SB/Core/x/xWad1.cpp @@ -1150,6 +1150,7 @@ static en_BIO_ASYNC_ERRCODES AsyncReadStatus(st_FILELOADINFO* fli) return BFD_AsyncReadStatus(fli); } +// Inlining issue static S32 AsyncIRead(st_FILELOADINFO* fli, S32 offset, char* data, S32 size, S32 n) { return BFD_AsyncRead(fli, offset, data, size, n, LITTLE_ENDIAN); @@ -1490,6 +1491,7 @@ static S32 BFD_getLength(tag_xFile* bffp, void* xtradata) return iFileGetSize(bffp); } +// Inlining issue st_FILELOADINFO* xBinioLoadCreate(const char* filename, S32) { st_FILELOADINFO* fli = NULL; @@ -1844,6 +1846,7 @@ void xAnimPlaySetup(xAnimPlay* play, void* object, xAnimTable* table, xModelInst xAnimPlaySetState(play->Single, table->StateList, 0.0f); } +// Inlining issue xAnimPlay* xAnimPoolAlloc(xMemPool* pool, void* object, xAnimTable* table, xModelInstance* modelInst) { @@ -1919,7 +1922,7 @@ void xAnimPoolCB(xMemPool* pool, void* data) clone->Pool = pool; } -#define ADD_4_BITS(x) (((x)&1) + (((x) >> 1) & 1) + (((x) >> 2) & 1) + (((x) >> 3) & 1)) +#define ADD_4_BITS(x) (((x) & 1) + (((x) >> 1) & 1) + (((x) >> 2) & 1) + (((x) >> 3) & 1)) void xAnimPoolInit(xMemPool* pool, U32 count, U32 singles, U32 blendFlags, U32 effectMax) { effectMax += effectMax & 1; diff --git a/src/SB/Core/x/xWad2.cpp b/src/SB/Core/x/xWad2.cpp index ac863c7..0c1af5d 100644 --- a/src/SB/Core/x/xWad2.cpp +++ b/src/SB/Core/x/xWad2.cpp @@ -1311,6 +1311,7 @@ static void DrawRing(xFXRing* m) // todo: uses int-to-float conversion } +// Inlining issue void xFXRingRender() { S32 i; @@ -4711,6 +4712,7 @@ namespace ent.pflags = 0x4; } + // Inlining issue void drop_stacked_entity(xEnt& ent) { ent.pflags = 0x4; @@ -4745,6 +4747,7 @@ namespace } } // namespace +// Inlining issue void xEntUpdate(xEnt* ent, xScene* sc, F32 dt) { xEntBeginUpdate(ent, sc, dt); diff --git a/src/SB/Core/x/xWad4.cpp b/src/SB/Core/x/xWad4.cpp index fcb792a..353d5ed 100644 --- a/src/SB/Core/x/xWad4.cpp +++ b/src/SB/Core/x/xWad4.cpp @@ -608,13 +608,15 @@ S32 xSGWriteData(st_XSAVEGAME_DATA* xsgdata, st_XSAVEGAME_WRITECONTEXT* wctxt, c return cnt; } +// Inlining issue S32 xSG_cb_leader_load(void*, st_XSAVEGAME_DATA* original_xsgdata, st_XSAVEGAME_READCONTEXT* rctxt, U32, S32) { char fundata[32] = {}; st_XSAVEGAME_LEADER discard = {}; - xSGReadData(original_xsgdata, rctxt, discard.gameLabel, sizeof(st_XSAVEGAME_LEADER)); - xSGReadData(original_xsgdata, rctxt, fundata, 0x16); + // TODO: Fix last two args in function signature + xSGReadData(original_xsgdata, rctxt, discard.gameLabel, 1, sizeof(st_XSAVEGAME_LEADER)); + xSGReadData(original_xsgdata, rctxt, fundata, 1, 0x16); return 1; } @@ -631,8 +633,9 @@ S32 xSG_cb_leader_svproc(void* cltdata, st_XSAVEGAME_DATA* original_xsgdata, leader.progress = xsg->progress; leader.thumbIconIdx = xsg->thumbIconIdx; - xSGWriteData(original_xsgdata, wctxt, leader.gameLabel, sizeof(st_XSAVEGAME_LEADER)); - xSGWriteData(original_xsgdata, wctxt, fundata, 0x16); + // TODO: Fix last two args in function signature + xSGWriteData(original_xsgdata, wctxt, leader.gameLabel, 1, sizeof(st_XSAVEGAME_LEADER)); + xSGWriteData(original_xsgdata, wctxt, fundata, 1, 0x16); return 1; } @@ -885,6 +888,7 @@ S32 xSGSetup(st_XSAVEGAME_DATA* xsgdata, S32 gidx, char* label, S32 progress, iT return result; } +// Inlining issue S32 xSGSetup(st_XSAVEGAME_DATA* xsgdata) { return xSGSetup(xsgdata, 0, "nothing", -1, 0, 0); @@ -1272,6 +1276,7 @@ S32 xSGDone(st_XSAVEGAME_DATA* xsgdata) return result; } +// Inlining issue st_XSAVEGAME_DATA* xSGInit(en_SAVEGAME_MODE mode) { st_XSAVEGAME_DATA* xsgdata = &g_xsgdata; @@ -2476,6 +2481,7 @@ void PKR_ReadDone(st_PACKER_READ_DATA* pr) g_loadlock &= ~(1 << lockid); } +// Inlining issue st_PACKER_READ_DATA* PKR_ReadInit(void* userdata, const char* pkgfile, U32 opts, S32* cltver, PKRAssetType* typelist, int) { diff --git a/src/SB/Game/zEnv.cpp b/src/SB/Game/zEnv.cpp index b90c469..76032a8 100644 --- a/src/SB/Game/zEnv.cpp +++ b/src/SB/Game/zEnv.cpp @@ -140,6 +140,7 @@ void zEnvInit(_zEnv* env, xEnvAsset* easset) } } +// Inlining issue void zEnvInit(void* env, void* easset) { zEnvInit((_zEnv*)env, (xEnvAsset*)easset); diff --git a/src/SB/Game/zNMETypeBossDennis.cpp b/src/SB/Game/zNMETypeBossDennis.cpp index 874e405..5759543 100644 --- a/src/SB/Game/zNMETypeBossDennis.cpp +++ b/src/SB/Game/zNMETypeBossDennis.cpp @@ -20,6 +20,7 @@ void zNMEDennis::MeterRender() { } +// Inlining issue void zNMEDennis::RenderHud() { zNMEDennis::MeterRender(); diff --git a/src/SB/Game/zSaveLoad.cpp b/src/SB/Game/zSaveLoad.cpp index 92f8e38..442ef24 100644 --- a/src/SB/Game/zSaveLoad.cpp +++ b/src/SB/Game/zSaveLoad.cpp @@ -168,7 +168,6 @@ S32 xSGT_SaveInfoCB(void* vp, st_XSAVEGAME_DATA* xsgdata, S32* need, S32* most) return 1; } - void zSaveLoad_DispatchCB(U32 dispatchEvent, const F32* toParam) { switch (dispatchEvent) @@ -1237,6 +1236,7 @@ S32 zSaveLoad_CardCheckSlotEmpty(S32 cardNumber, S32 gameNumber) return 1; } +// Inlining issue S32 zSaveLoad_CardCheckGameSlot(S32 cardNumber, S32 gameNumber, S32 mode) { if (mode == 1) @@ -1293,6 +1293,7 @@ S32 zSaveLoad_CardCheckSpace(S32 cardNumber, S32 mode) return 1; } +// Inlining issue S32 zSaveLoad_CardCheckValid(S32 cardNumber, S32 mode) { if (mode == 1) diff --git a/src/SB/Game/zTaskBox.cpp b/src/SB/Game/zTaskBox.cpp index 8ab4d1c..39c84c2 100644 --- a/src/SB/Game/zTaskBox.cpp +++ b/src/SB/Game/zTaskBox.cpp @@ -11,7 +11,10 @@ // CODE PORTED DIRECTLY FROM BFBB -extern ztaskbox* shared; +namespace +{ + ztaskbox* shared; +} void ztaskbox::load(const asset_type& a) { @@ -85,6 +88,8 @@ void ztaskbox::talk_callback::reset(ztaskbox& task) this->answer = ANSWER_CONTINUE; } +// Most functions in this file need `-inline off` to match, except for this one, +// but `-inline auto` has a depth of 4, and this matches best with a depth of 5. void ztaskbox::stop_talk() { ztaskbox* curr = this->current; diff --git a/src/SB/Game/zUIController.cpp b/src/SB/Game/zUIController.cpp index 065728d..3a1c539 100644 --- a/src/SB/Game/zUIController.cpp +++ b/src/SB/Game/zUIController.cpp @@ -4,6 +4,7 @@ void zUIController_Init(zUIController*, zUIControllerAsset*) { } +// Inlining issue void zUIController_Init(xBase&, xDynAsset&, unsigned long) { zUIController* UIControl = 0; diff --git a/src/SB/Game/zUIUserString.cpp b/src/SB/Game/zUIUserString.cpp index 452a565..b40c38d 100644 --- a/src/SB/Game/zUIUserString.cpp +++ b/src/SB/Game/zUIUserString.cpp @@ -2,6 +2,7 @@ void zUIUserString_Init(zUIUserString*, zUIUserStringAsset*) { } +// Inlining issue void zUIUserString_Init(xBase&, xDynAsset&, unsigned long) { zUIUserString* zUIString = 0;