From 00f5bfbd4f33829cbb04c985f424044f3ab16636 Mon Sep 17 00:00:00 2001 From: bluisblu <53455507+bluisblu@users.noreply.github.com> Date: Sun, 24 May 2026 08:11:03 -0400 Subject: [PATCH] Move weak inlines to xBase and xFile headers --- configure.py | 6 +++--- src/SB/Core/x/xBase.cpp | 20 -------------------- src/SB/Core/x/xBase.h | 23 +++++++++++++++++++---- src/SB/Core/x/xFile.h | 11 +++++++++-- src/SB/Core/x/xbinio.cpp | 22 ++++------------------ 5 files changed, 35 insertions(+), 47 deletions(-) diff --git a/configure.py b/configure.py index a45e7cbcf..86acf5752 100644 --- a/configure.py +++ b/configure.py @@ -409,8 +409,8 @@ def MatchingFor(*versions): "progress_category": "game", "objects": [ Object(NonMatching, "SB/Core/x/xAnim.cpp", extra_cflags=["-sym on"]), - Object(Matching, "SB/Core/x/xBase.cpp"), - Object(Matching, "SB/Core/x/xbinio.cpp"), + Object(Matching, "SB/Core/x/xBase.cpp", extra_cflags=["-sym on"]), + Object(Matching, "SB/Core/x/xbinio.cpp", extra_cflags=["-sym on"]), Object(NonMatching, "SB/Core/x/xBound.cpp"), Object(NonMatching, "SB/Core/x/xCamera.cpp"), Object(NonMatching, "SB/Core/x/xClimate.cpp"), @@ -502,7 +502,7 @@ def MatchingFor(*versions): Object(NonMatching, "SB/Game/zLOD.cpp"), Object(NonMatching, "SB/Game/zMain.cpp"), Object(Equivalent, "SB/Game/zMenu.cpp"), - Object(Matching, "SB/Game/zMovePoint.cpp"), + Object(Matching, "SB/Game/zMovePoint.cpp", extra_cflags=["-sym on"]), Object(NonMatching, "SB/Game/zMusic.cpp"), Object(Equivalent, "SB/Game/zParCmd.cpp"), Object(Matching, "SB/Game/zParEmitter.cpp"), diff --git a/src/SB/Core/x/xBase.cpp b/src/SB/Core/x/xBase.cpp index 59f953133..261bd143d 100644 --- a/src/SB/Core/x/xBase.cpp +++ b/src/SB/Core/x/xBase.cpp @@ -49,23 +49,3 @@ void xBaseReset(xBase* xb, xBaseAsset* asset) xBaseValidate(xb); } - -void xBaseValidate(xBase* xb) -{ - xb->baseFlags |= 0x4; -} - -bool xBaseIsEnabled(const xBase* xb) -{ - return (xb->baseFlags & 0x1); -} - -void xBaseDisable(xBase* xb) -{ - xb->baseFlags &= ~0x1; -} - -void xBaseEnable(xBase* xb) -{ - xb->baseFlags |= 0x1; -} diff --git a/src/SB/Core/x/xBase.h b/src/SB/Core/x/xBase.h index a6f326912..67cd670a8 100644 --- a/src/SB/Core/x/xBase.h +++ b/src/SB/Core/x/xBase.h @@ -34,9 +34,24 @@ void xBaseSave(xBase* ent, xSerial* s); void xBaseLoad(xBase* ent, xSerial* s); void xBaseReset(xBase* xb, xBaseAsset* asset); U32 xBaseIsValid(xBase* xb); -void xBaseValidate(xBase* xb); -bool xBaseIsEnabled(const xBase* xb); -void xBaseDisable(xBase* xb); -void xBaseEnable(xBase* xb); +inline void xBaseValidate(xBase* xb) +{ + xb->baseFlags |= 0x4; +} + +inline bool xBaseIsEnabled(const xBase* xb) +{ + return (xb->baseFlags & 0x1); +} + +inline void xBaseDisable(xBase* xb) +{ + xb->baseFlags &= ~0x1; +} + +inline void xBaseEnable(xBase* xb) +{ + xb->baseFlags |= 0x1; +} #endif diff --git a/src/SB/Core/x/xFile.h b/src/SB/Core/x/xFile.h index 3ff4e2b71..afe8cec17 100644 --- a/src/SB/Core/x/xFile.h +++ b/src/SB/Core/x/xFile.h @@ -20,7 +20,14 @@ struct tag_xFile void* user_data; }; -void xFileSetUserData(tag_xFile* file, void* userdata); -XFILE_READSECTOR_STATUS xFileReadAsyncStatus(S32 key, S32* amtToFar); +inline void xFileSetUserData(tag_xFile* file, void* userdata) +{ + file->user_data = userdata; +} + +inline XFILE_READSECTOR_STATUS xFileReadAsyncStatus(S32 key, S32* amtToFar) +{ + return (XFILE_READSECTOR_STATUS)iFileReadAsyncStatus(key, amtToFar); +} #endif diff --git a/src/SB/Core/x/xbinio.cpp b/src/SB/Core/x/xbinio.cpp index 49b30a43f..0d1d97e7b 100644 --- a/src/SB/Core/x/xbinio.cpp +++ b/src/SB/Core/x/xbinio.cpp @@ -57,16 +57,14 @@ static en_BIO_ASYNC_ERRCODES AsyncReadStatus(st_FILELOADINFO* fli); static void Swap2(char* d, S32 n); static void Swap4(char* d, S32 n); static void Swap8(char* d, S32 n); -static tag_xFile* BFD_open(const char* filename, const char* mode, U32 lockid, S32, - void* xtradata); +static tag_xFile* BFD_open(const char* filename, const char* mode, U32 lockid, S32, void* xtradata); static void BFD_close(tag_xFile* bffp, void* xtradata); static S32 BFD_read(void* data, S32 elesize, S32 elecnt, tag_xFile* bffp, void* xtradata); static S32 BFD_seek(tag_xFile* bffp, S32 offset, S32 whence, void* xtradata); static S32 BFD_getLength(tag_xFile* bffp, void* xtradata); static S32 BFD_startSector(const char* filename); static void BFD_cb_GCP2_readasync(tag_xFile* bffp); -static S32 BFD_AsyncRead(st_FILELOADINFO* fli, S32 pos, void* data, S32 size, S32 n, - S32 endian); +static S32 BFD_AsyncRead(st_FILELOADINFO* fli, S32 pos, void* data, S32 size, S32 n, S32 endian); static en_BIO_ASYNC_ERRCODES BFD_AsyncReadStatus(st_FILELOADINFO* fli); st_FILELOADINFO* xBinioLoadCreate(const char* filename) @@ -433,8 +431,7 @@ static void Swap8(char* d, S32 n) } } -static tag_xFile* BFD_open(const char* filename, const char* mode, U32 lockid, S32, - void* xtradata) +static tag_xFile* BFD_open(const char* filename, const char* mode, U32 lockid, S32, void* xtradata) { tag_xFile* bffp; U32 orc; // open return code @@ -617,8 +614,7 @@ static void BFD_cb_GCP2_readasync(tag_xFile* bffp) { } -static S32 BFD_AsyncRead(st_FILELOADINFO* fli, S32 pos, void* data, S32 size, S32 n, - S32 endian) +static S32 BFD_AsyncRead(st_FILELOADINFO* fli, S32 pos, void* data, S32 size, S32 n, S32 endian) { tag_xFile* file = (tag_xFile*)fli->privdata; st_BINIO_XTRADATA* xtra = (st_BINIO_XTRADATA*)fli->xtradata; @@ -722,13 +718,3 @@ static en_BIO_ASYNC_ERRCODES BFD_AsyncReadStatus(st_FILELOADINFO* fli) return status; } - -WEAK void xFileSetUserData(tag_xFile* file, void* userdata) -{ - file->user_data = userdata; -} - -WEAK XFILE_READSECTOR_STATUS xFileReadAsyncStatus(S32 key, S32* amtToFar) -{ - return (XFILE_READSECTOR_STATUS)iFileReadAsyncStatus(key, amtToFar); -}