From 2f9b1d406ec9555f56e70b6aa69d0a0c83e1a362 Mon Sep 17 00:00:00 2001 From: Colin Miller Date: Sun, 20 Apr 2025 00:55:04 -0400 Subject: [PATCH 1/6] Ported iScrFX and iTRC from the bfbb repo --- .vscode/c_cpp_properties.json | 34 ++ .vscode/settings.json | 6 +- .../MSL/MSL_C/MSL_Common/Include/stdio.h | 11 +- src/SB/Core/gc/iScrFX.cpp | 117 +++++++ src/SB/Core/gc/iScrFX.h | 39 +++ src/SB/Core/gc/iTRC.cpp | 296 ++++++++++++++++++ src/SB/Core/gc/iTRC.h | 75 +++++ 7 files changed, 569 insertions(+), 9 deletions(-) create mode 100644 .vscode/c_cpp_properties.json create mode 100644 src/SB/Core/gc/iScrFX.h create mode 100644 src/SB/Core/gc/iTRC.h diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..a398cf5 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,34 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/include", + "${workspaceFolder}/include/bink", + "${workspaceFolder}/include/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include", + "${workspaceFolder}/include/PowerPC_EABI_Support/MSL/MSL_C++/MSL_Common/Include", + "${workspaceFolder}/include/inline", + "${workspaceFolder}/include/rwsdk", + "${workspaceFolder}/src/SB/Core/gc", + "${workspaceFolder}/src/SB/Core/x", + "${workspaceFolder}/src/SB/Game" + ], + "defines": [ + "__MWERKS__", + "GAMECUBE" + ], + "compilerPath": "", + "cStandard": "c99", + "cppStandard": "c++98", + "intelliSenseMode": "linux-clang-x64", + "configurationProvider": "ms-vscode.makefile-tools", + "browse": { + "path": [ + "${workspaceFolder}/include" + ], + "limitSymbolsToIncludedHeaders": false + } + } + ], + "version": 4 +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 09e36b5..861363e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,11 +1,11 @@ { "[c]": { "files.encoding": "utf8", - "editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd" + "editor.defaultFormatter": "xaver.clang-format" }, "[cpp]": { "files.encoding": "utf8", - "editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd" + "editor.defaultFormatter": "xaver.clang-format" }, "[python]": { "editor.defaultFormatter": "ms-python.black-formatter" @@ -19,5 +19,5 @@ ".clangd": "yaml" }, // Disable C/C++ IntelliSense, use clangd instead - "C_Cpp.intelliSenseEngine": "disabled", + "C_Cpp.intelliSenseEngine": "default", } diff --git a/include/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/stdio.h b/include/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/stdio.h index 5174e18..ff5a515 100644 --- a/include/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/stdio.h +++ b/include/PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Include/stdio.h @@ -5,9 +5,8 @@ extern "C" { #endif -typedef struct _FILE -{ - U8 pad[0x50]; +typedef struct _FILE { + unsigned char pad[0x50]; } FILE; extern FILE __files[4]; @@ -16,9 +15,9 @@ extern FILE __files[4]; #define stdout &(__files[1]) #define stderr &(__files[2]) -int sprintf(char* s, const char* format, ...); -void printf(const char* format, ...); -int fprintf(FILE* stream, const char* format, ...); +int sprintf(char *s, const char *format, ...); +void printf(const char *format, ...); +int fprintf(FILE *stream, const char *format, ...); #ifdef __cplusplus } diff --git a/src/SB/Core/gc/iScrFX.cpp b/src/SB/Core/gc/iScrFX.cpp index e69de29..004f6af 100644 --- a/src/SB/Core/gc/iScrFX.cpp +++ b/src/SB/Core/gc/iScrFX.cpp @@ -0,0 +1,117 @@ +// ported from bfbb repo +#include "iScrFX.h" + +#include + +extern RwRaster *g_rast_gctapdance; +extern S32 g_alreadyTriedAlloc; +extern _iMotionBlurData sMBD; +extern U32 sMotionBlurEnabled; +extern F32 lbl_803CE168; // 0.0f +extern F32 lbl_803CE174; // 1.0f +extern F32 lbl_803CE178; // 0.5f +extern F32 lbl_803CE17C; // 254f + +void iScrFxInit() {} + +void iScrFxBegin() { + RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void *)rwFILTERNEAREST); + RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void *)rwFOGTYPENAFOGTYPE); + RwRenderStateSet(rwRENDERSTATEZTESTENABLE, NULL); + RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, NULL); + RwRenderStateSet(rwRENDERSTATETEXTURERASTER, NULL); + RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)true); + RwRenderStateSet(rwRENDERSTATESRCBLEND, (void *)rwBLENDSRCALPHA); + RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDINVSRCALPHA); +} + +void iScrFxEnd() { + RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void *)rwFOGTYPENAFOGTYPE); + RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void *)true); + RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)true); + RwRenderStateSet(rwRENDERSTATETEXTURERASTER, NULL); + RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)false); + RwRenderStateSet(rwRENDERSTATESRCBLEND, (void *)rwBLENDONE); + RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDZERO); +} + +void iCameraMotionBlurActivate(U32 activate) { sMotionBlurEnabled = activate; } + +// The instructions regarding the setting of sMotionBlurEnabled and +// sMBD.motionBlurAlpha are in the wrong order. +void iCameraSetBlurriness(F32 amount) { + if (amount <= lbl_803CE168) { + sMotionBlurEnabled = 0; + } else { + if (amount > lbl_803CE174) { + amount = lbl_803CE174; + } + sMotionBlurEnabled = 1; + sMBD.motionBlurAlpha = (S32)(lbl_803CE17C * amount + lbl_803CE178); + } +} + +// Instructions in the wrong order. +void iScrFxCameraCreated(RwCamera *pCamera) { + sMBD.motionBlurAlpha = 0x90; + sMBD.motionBlurFrontBuffer = NULL; + sMBD.index[0] = 0; + sMBD.index[1] = 1; + sMBD.index[2] = 2; + sMBD.index[3] = 0; + sMBD.index[4] = 2; + sMBD.index[5] = 3; + iScrFxMotionBlurOpen(pCamera); +} + +void iScrFxCameraEndScene(RwCamera *pCamera) { + if ((sMotionBlurEnabled != 0) && (sMBD.motionBlurAlpha != 0)) { + iScrFxMotionBlurRender(pCamera, sMBD.motionBlurAlpha & 0xff); + } +} + +void iScrFxPostCameraEnd(RwCamera *pCamera) { GCMB_SiphonFrameBuffer(pCamera); } + +RwRaster *FBMBlur_DebugIntervention(RwCamera *camera, RwRaster *ras) { + return ras; +} + +S32 iScrFxMotionBlurOpen(RwCamera *camera) { return 0; } + +S32 iScrFxCameraDestroyed(RwCamera *pCamera) { + GCMB_KillFrameBufferCopy(); + if (sMBD.motionBlurFrontBuffer != NULL) { + RwRasterDestroy(sMBD.motionBlurFrontBuffer); + sMBD.motionBlurFrontBuffer = NULL; + return 1; + } + return 0; +} + +// WIP. +void iScrFxMotionBlurRender(RwCamera *camera, U32 col) { + if (sMBD.motionBlurFrontBuffer != NULL) { + RwRGBA col; + col.alpha = 0xf8; + iCameraOverlayRender(camera, (RwRaster *)sMBD.motionBlurFrontBuffer, col); + } +} + +void GCMB_MakeFrameBufferCopy(const RwCamera *camera) {} + +void GCMB_KillFrameBufferCopy() { + if (g_rast_gctapdance != NULL) { + RwRasterDestroy(g_rast_gctapdance); + } + g_rast_gctapdance = NULL; + g_alreadyTriedAlloc = 0; +} + +void GCMB_SiphonFrameBuffer(const RwCamera *camera) { + if ((g_rast_gctapdance == NULL) && (g_alreadyTriedAlloc == 0)) { + GCMB_MakeFrameBufferCopy(camera); + } + if (g_rast_gctapdance != NULL) { + RwGameCubeCameraTextureFlush(g_rast_gctapdance, 0); + } +} diff --git a/src/SB/Core/gc/iScrFX.h b/src/SB/Core/gc/iScrFX.h new file mode 100644 index 0000000..b132fec --- /dev/null +++ b/src/SB/Core/gc/iScrFX.h @@ -0,0 +1,39 @@ +// ported from bfbb repo +#ifndef ISCRFX_H +#define ISCRFX_H + +#include +#include + +struct _iMotionBlurData { + S32 motionBlurAlpha; + RwRaster *motionBlurFrontBuffer; + // RwSky2DVertex vertex[4]; This doesn't seem right... Due to how the data is + // used, it only makes sense for this to be 96 only. + U8 vertex[96]; + U16 index[6]; + U32 w; + U32 h; + U8 unk[10]; // There is something here to make this structure 0x88. +}; + +void iScrFxInit(); +void iScrFxBegin(); +void iScrFxEnd(); +void iScrFxDrawBox(F32 x1, F32 y1, F32 x2, F32 y2, U8 red, U8 green, U8 blue, + U8 alpha); +void iCameraMotionBlurActivate(U32 activate); +void iCameraSetBlurriness(F32 amount); +void iScrFxCameraCreated(RwCamera *pCamera); +void iScrFxCameraEndScene(RwCamera *pCamera); +void iScrFxPostCameraEnd(RwCamera *pCamera); +void iCameraOverlayRender(RwCamera *pcamera, RwRaster *ras, RwRGBA col); +RwRaster *FBMBlur_DebugIntervention(RwCamera *camera, RwRaster *ras); +S32 iScrFxMotionBlurOpen(RwCamera *camera); +S32 iScrFxCameraDestroyed(RwCamera *pCamera); +void iScrFxMotionBlurRender(RwCamera *camera, U32 col); +void GCMB_MakeFrameBufferCopy(const RwCamera *camera); +void GCMB_KillFrameBufferCopy(); +void GCMB_SiphonFrameBuffer(const RwCamera *camera); + +#endif diff --git a/src/SB/Core/gc/iTRC.cpp b/src/SB/Core/gc/iTRC.cpp index e69de29..978778d 100644 --- a/src/SB/Core/gc/iTRC.cpp +++ b/src/SB/Core/gc/iTRC.cpp @@ -0,0 +1,296 @@ +#include "iTRC.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define FONT_MATRIX_ID 0x1E +#define TEXTBOX_MAX_TEXT_LENGTH 256 + +extern void GXPosition3s16(S32, S32, S32); +extern void GXTexCoord2s16(S32, S32); + +namespace ROMFont { +OSFontHeader *mFontData; +void *mXFBs[2]; +void *mCurrentFrameBuffer; +GXRenderModeObj *mRenderMode; +bool mFirstFrame = true; +} // namespace ROMFont + +namespace ResetButton { +bool mResetEnabled = 1; +BOOL mWasResetButtonPressed; +void (*mSndKill)(); +} // namespace ResetButton + +namespace iTRCDisk { +char mMessage[256]; + +void (*mSndSuspend)(); +void (*mSndResume)(); +void (*mPadStopRumbling)(); +void (*mSndKill)(); +void (*mMovieSuspendFunction)(); +void (*mMovieResumeFunction)(); +} // namespace iTRCDisk + +BOOL ROMFont::Init() { + if (OSGetFontEncode() == 1) { + ROMFont::mFontData = + (OSFontHeader *)OSAllocFromHeap(__OSCurrHeap, 0xF00 + 0x12); + } else { + ROMFont::mFontData = + (OSFontHeader *)OSAllocFromHeap(__OSCurrHeap, 0x2 + 0x120); + } + + return OSInitFont(ROMFont::mFontData); +} + +void ROMFont::InitGX() { + U16 scaledHeight; + GXSetViewport(0.0f, 0.0f, mRenderMode->fbWidth, mRenderMode->efbHeight, 0.0f, + 1.0f); + GXSetScissor(0, 0, mRenderMode->fbWidth, mRenderMode->efbHeight); + + scaledHeight = GXSetDispCopyYScale( + GXGetYScaleFactor(mRenderMode->efbHeight, mRenderMode->xfbHeight)); + GXSetDispCopySrc(0, 0, mRenderMode->fbWidth, mRenderMode->efbHeight); + GXSetDispCopyDst(mRenderMode->fbWidth, scaledHeight); + + GXSetCopyFilter(mRenderMode->aa, mRenderMode->sample_pattern, TRUE, + mRenderMode->vfilter); + + if (mRenderMode->aa != FALSE) { + GXSetPixelFmt(GX_PF_RGB565_Z16, GX_ZC_LINEAR); + } else { + GXSetPixelFmt(GX_PF_RGB8_Z24, GX_ZC_LINEAR); + } + + GXCopyDisp(mCurrentFrameBuffer, 1); + GXSetDispCopyGamma(GX_GM_1_0); + GXSetCullMode(GX_CULL_NONE); +} + +void ROMFont::InitVI() { + VISetNextFrameBuffer(mXFBs[0]); + mCurrentFrameBuffer = mXFBs[1]; + VIFlush(); + VIWaitForRetrace(); + if (mRenderMode->viTVmode & 1) { + VIWaitForRetrace(); + } +} + +void ROMFont::RenderBegin() { + if (mRenderMode->field_rendering != FALSE) { + GXSetViewportJitter(0.0f, 0.0f, mRenderMode->fbWidth, + mRenderMode->efbHeight, 0.0f, 1.0f, VIGetNextField()); + } else { + GXSetViewport(0.0f, 0.0f, mRenderMode->fbWidth, mRenderMode->efbHeight, + 0.0f, 1.0f); + } + + GXInvalidateVtxCache(); + GXInvalidateTexAll(); +} + +void ROMFont::RenderEnd() { + GXSetZMode(TRUE, GX_LEQUAL, TRUE); + GXSetColorUpdate(TRUE); + GXCopyDisp(mCurrentFrameBuffer, TRUE); + GXDrawDone(); + SwapBuffers(); +} + +void ROMFont::SwapBuffers() { + void *buffer; + + VISetNextFrameBuffer(mCurrentFrameBuffer); + + if (mFirstFrame != false) { + VISetBlack(TRUE); + mFirstFrame = false; + } else { + VISetBlack(FALSE); + } + + VIFlush(); + VIWaitForRetrace(); + + mCurrentFrameBuffer = mCurrentFrameBuffer == mXFBs[0] ? mXFBs[1] : mXFBs[0]; +} + +// FIXME: Revisit after GXTexCoord2s16 and GXPosition3s16 have been decompiled, +// looks like they were inlined +void ROMFont::DrawCell(S32 param_1, S32 param_2, S32 param_3, S32 param_4) { + U16 uVar1; + U16 uVar2; + S16 sVar3; + S32 iVar4; + S32 iVar5; + S32 iVar6; + + uVar1 = mFontData->cellWidth; + uVar2 = mFontData->cellHeight; + iVar5 = (int)(short)(param_1 + uVar1); + iVar4 = (int)(short)(param_2 + uVar2); + + GXBegin(GX_LINESTRIP, GX_VTXFMT0, 4); + + GXPosition3s16((int)param_1, (int)param_2, 0); + GXTexCoord2s16((int)param_3, param_4); + + GXPosition3s16(iVar5, (int)param_2, 0); + + iVar6 = (int)(short)(param_3 + uVar1); + + GXTexCoord2s16(iVar6, param_4); + GXPosition3s16(iVar5, iVar4, 0); + + sVar3 = param_4 + uVar2; + + GXTexCoord2s16(iVar6, sVar3); + GXPosition3s16((int)param_1, iVar4, 0); + GXTexCoord2s16((int)param_3, sVar3); + + GXEnd(); +} + +void ROMFont::LoadSheet(void *image_ptr) { + GXAnisotropy max_aniso; + GXTexObj GStack_68; + F32 afStack_48[3][4]; + U32 uStack_14; + U32 uStack_c; + + max_aniso = GX_ANISO_1; + GXInitTexObj(&GStack_68, image_ptr, mFontData->sheetWidth, + mFontData->sheetHeight, (GXTexFmt)mFontData->sheetFormat, + GX_CLAMP, GX_CLAMP, NULL); + GXInitTexObjLOD(&GStack_68, GX_LINEAR, GX_LINEAR, 0.0f, 0.0f, 0.0f, FALSE, + FALSE, max_aniso); + GXLoadTexObj(&GStack_68, GX_TEXMAP0); + uStack_14 = mFontData->sheetWidth; + uStack_c = mFontData->sheetHeight; + PSMTXScale(afStack_48, 1.0f / uStack_14, 1.0f / uStack_c, 1.0f); + GXLoadTexMtxImm(afStack_48, FONT_MATRIX_ID, GX_MTX2x4); + GXSetNumTexGens(1); + GXSetTexCoordGen(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_TEX0, FONT_MATRIX_ID); +} + +S32 ROMFont::DrawString(S32 param_1, S32 param_2, char *string) { + S32 iVar1; + S32 x; + S32 y; + S32 width; + void *image[3]; + + iVar1 = 0; + while (*string != '\0') { + string = + OSGetFontTexture(string, image, (s32 *)&x, (s32 *)&y, (s32 *)&width); + ROMFont::LoadSheet(image[0]); + ROMFont::DrawCell(param_1 + iVar1, param_2, x, y); + iVar1 = iVar1 + width; + } + return iVar1; +} + +S32 ROMFont::GetWidth(char *string) { + S32 iVar1; + void *image[1]; + S32 x; + S32 y; + S32 width; + + iVar1 = 0; + while (*string != '\0') { + string = + OSGetFontTexture(string, image, (s32 *)&x, (s32 *)&y, (s32 *)&width); + iVar1 = iVar1 + width; + } + return iVar1; +} + +void ROMFont::DrawTextBox(S32 param_1, S32 param_2, S32 param_3, S32 param_4, + char *str) { + char *tokenizedString; + S32 baseWidth; + S32 tokWidth; + S32 iVar4; + S32 iVar5; + char acStack_128[TEXTBOX_MAX_TEXT_LENGTH]; + + if (str != NULL) { + RenderBegin(); + strcpy(acStack_128, str); + tokenizedString = strtok(acStack_128, " "); + baseWidth = GetWidth(" "); + iVar4 = param_2 + param_4; + iVar5 = param_1; + while ((tokenizedString != NULL && (param_2 < iVar4))) { + tokWidth = GetWidth(tokenizedString); + if (param_1 + param_3 < iVar5 + tokWidth) { + param_2 = param_2 + mFontData->cellHeight; + iVar5 = param_1; + } + DrawString(iVar5, param_2, tokenizedString); + tokenizedString = strtok(NULL, " "); + iVar5 = tokWidth + baseWidth + iVar5; + } + RenderEnd(); + } +} + +void ResetButton::EnableReset() { ResetButton::mResetEnabled = 1; } + +void ResetButton::DisableReset() { ResetButton::mResetEnabled = 0; } + +void ResetButton::SetSndKillFunction(void (*Func)()) { + ResetButton::mSndKill = Func; +} + +void ResetButton::CheckResetButton() {} + +bool iTRCDisk::Init(void) { return ROMFont::Init(); } + +void iTRCDisk::SetErrorMessage(const char *message) { + strcpy(mMessage, message); +} + +void iTRCDisk::ResetMessage() { memset(mMessage, 0, 0x100); } + +void iTRCDisk::SetPadStopRumblingFunction(void (*Func)()) { + mPadStopRumbling = Func; +} + +void iTRCDisk::SetSndSuspendFunction(void (*Func)()) { mSndSuspend = Func; } + +void iTRCDisk::SetSndResumeFunction(void (*Func)()) { mSndResume = Func; } + +void iTRCDisk::SetSndKillFunction(void (*Func)()) { mSndKill = Func; } + +void iTRCDisk::SetMovieSuspendFunction(void (*Func)()) { + mMovieSuspendFunction = Func; +} + +void iTRCDisk::SetMovieResumeFunction(void (*Func)()) { + mMovieResumeFunction = Func; +} + +bool iTRCDisk::IsDiskIDed() { return false; } + +void iTRCDisk::DisplayErrorMessage() {} + +void iTRCDisk::SetDVDState() {} + +bool iTRCDisk::CheckDVDAndResetState() { return false; } diff --git a/src/SB/Core/gc/iTRC.h b/src/SB/Core/gc/iTRC.h new file mode 100644 index 0000000..3a189f7 --- /dev/null +++ b/src/SB/Core/gc/iTRC.h @@ -0,0 +1,75 @@ +#ifndef ITRC_H +#define ITRC_H + +#include +#include +#include +#include +#include + +// Copied from bfbb repo + +//#include "xPad.h" + +// struct _tagiTRCPadInfo { +// _tagPadInit pad_init; +// }; + +namespace ROMFont { +extern OSFontHeader *mFontData; +extern void *mXFBs[2]; +extern void *mCurrentFrameBuffer; +extern GXRenderModeObj *mRenderMode; +extern bool mFirstFrame; + +BOOL Init(); +void InitGX(); +void InitVI(); +void RenderBegin(); +void RenderEnd(); +void SwapBuffers(); +void DrawCell(S32 param_1, S32 param_2, S32 param_3, S32 param_4); +void LoadSheet(void *image_ptr); +S32 DrawString(S32 param_1, S32 param_2, char *string); +S32 GetWidth(char *string); +void DrawTextBox(S32 param_1, S32 param_2, S32 param_3, S32 param_4, char *str); +} // namespace ROMFont + +// Yes, this is a namespace, not a class. +namespace iTRCDisk { +extern char mMessage[256]; +extern void (*mSndSuspend)(); +extern void (*mSndResume)(); +extern void (*mPadStopRumbling)(); +extern void (*mSndKill)(); +extern void (*mMovieSuspendFunction)(); +extern void (*mMovieResumeFunction)(); + +void SetPadStopRumblingFunction(void (*)(void)); +void SetSndSuspendFunction(void (*)(void)); +void SetSndResumeFunction(void (*)(void)); +void SetSndKillFunction(void (*)(void)); +void SetMovieSuspendFunction(void (*)(void)); +void SetMovieResumeFunction(void (*)(void)); +bool CheckDVDAndResetState(); +bool Init(); +void ResetMessage(); +void DisplayErrorMessage(); +void SetDVDState(); +void SetErrorMessage(const char *); +bool IsDiskIDed(); +} // namespace iTRCDisk + +namespace ResetButton { +extern bool mResetEnabled; +extern BOOL mWasResetButtonPressed; +extern void (*mSndKill)(); + +void EnableReset(); +void DisableReset(); +void SetSndKillFunction(void (*func)()); +void CheckResetButton(); + +} // namespace ResetButton + +#endif From 103fc73e76c9f20d9b0a3b8d9f29c0c902a7cff6 Mon Sep 17 00:00:00 2001 From: Colin Miller Date: Sun, 20 Apr 2025 17:31:16 -0400 Subject: [PATCH 2/6] TESTING --- src/SB/Game/zWadNME.cpp | 8 ++++++++ src/SB/Game/zWadNME.h | 45 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 src/SB/Game/zWadNME.h diff --git a/src/SB/Game/zWadNME.cpp b/src/SB/Game/zWadNME.cpp index e69de29..95d5aa5 100644 --- a/src/SB/Game/zWadNME.cpp +++ b/src/SB/Game/zWadNME.cpp @@ -0,0 +1,8 @@ +#include "zWadNME.h" + +S32 zNMEGoalDenDamage::Exit(float dt, void* ctxt) +{ + //something = -1.0f + dt = -1.0f; // NOT CORRECT, FOR TESTING + return 0; +} diff --git a/src/SB/Game/zWadNME.h b/src/SB/Game/zWadNME.h new file mode 100644 index 0000000..204d1b5 --- /dev/null +++ b/src/SB/Game/zWadNME.h @@ -0,0 +1,45 @@ +#ifndef ZWadNME_h +#define ZWadNME_h + +#include + +// change to zNMEGoalDenDamage : zNMEGoalCommon +// temp for testing +struct zNMEGoalDenDamage +{ + // S32 GoalHandleMail(NMEMsg* mail); + //S32 ChkExistence(zNMEDennis* npc, float32 dt, int32& nextgoal, en_trantype& trantype); + // S32 Process(en_trantype* trantype, float32 dt, void* ctxt); + S32 Exit(float, void*); + S32 Enter(); +}; + +// change to zNMEGoalCommon : xGoal +// temp for testing +struct zNMEGoalCommon +{ + U32 anid_played; + struct + { + S32 flg_npcgauto : 8; + S32 flg_npcgable : 16; + S32 bul_entered : 1; + S32 bul_resumed : 1; + S32 bul_unused : 6; + }; + struct + { + S32 flg_info : 16; + S32 flg_user : 16; + }; + + S32 CollReview(); + S32 GoalHandleMail(); + void Clear(); + S32 Enter(); + S32 Resume(); + //S32 Process(en_trantype* trantyp, F32 dt, void* ctxt); + // erroring cus of en_trantype +}; + +#endif From eb530bc018954a0c6962197480111c6e195d9977 Mon Sep 17 00:00:00 2001 From: Colin Miller Date: Sun, 20 Apr 2025 19:01:46 -0400 Subject: [PATCH 3/6] TEST --- src/SB/Game/zWadNME.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SB/Game/zWadNME.cpp b/src/SB/Game/zWadNME.cpp index 95d5aa5..343286c 100644 --- a/src/SB/Game/zWadNME.cpp +++ b/src/SB/Game/zWadNME.cpp @@ -1,8 +1,10 @@ #include "zWadNME.h" -S32 zNMEGoalDenDamage::Exit(float dt, void* ctxt) +S32 zNMEGoalDenDamage::Exit(float dt, void* ctxt) //POSSIBLY RIGHT, NEEDS DOUBLE CHECKED { //something = -1.0f dt = -1.0f; // NOT CORRECT, FOR TESTING return 0; } + +//TEST From 9f472424eb08210a2823154b0bd38f4c79f6bfc0 Mon Sep 17 00:00:00 2001 From: Colin Miller Date: Sun, 20 Apr 2025 19:18:29 -0400 Subject: [PATCH 4/6] CI fix --- tools/download_tool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/download_tool.py b/tools/download_tool.py index c447916..6d95110 100644 --- a/tools/download_tool.py +++ b/tools/download_tool.py @@ -94,7 +94,7 @@ def ok_url(tag: str) -> str: "objdiff-cli": objdiff_cli_url, "sjiswrap": sjiswrap_url, "wibo": wibo_url, - "ok": ok_url, + "OK": ok_url, } From 4d6b168a74e93027e828b76de1c0f3b982b7c700 Mon Sep 17 00:00:00 2001 From: Colin Miller Date: Sun, 20 Apr 2025 19:27:37 -0400 Subject: [PATCH 5/6] CI fix 2 --- tools/download_tool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/download_tool.py b/tools/download_tool.py index 6d95110..63ee35e 100644 --- a/tools/download_tool.py +++ b/tools/download_tool.py @@ -94,7 +94,7 @@ def ok_url(tag: str) -> str: "objdiff-cli": objdiff_cli_url, "sjiswrap": sjiswrap_url, "wibo": wibo_url, - "OK": ok_url, + "OK": ok_url } From 4526af0d0f914b34aadbf6277c35a23b0c04b025 Mon Sep 17 00:00:00 2001 From: Colin Miller Date: Sun, 20 Apr 2025 19:35:45 -0400 Subject: [PATCH 6/6] CI fix3 --- src/SB/Game/zWadNME.cpp | 12 ++++++------ tools/download_tool.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/SB/Game/zWadNME.cpp b/src/SB/Game/zWadNME.cpp index 343286c..4e13f28 100644 --- a/src/SB/Game/zWadNME.cpp +++ b/src/SB/Game/zWadNME.cpp @@ -1,10 +1,10 @@ #include "zWadNME.h" -S32 zNMEGoalDenDamage::Exit(float dt, void* ctxt) //POSSIBLY RIGHT, NEEDS DOUBLE CHECKED -{ - //something = -1.0f - dt = -1.0f; // NOT CORRECT, FOR TESTING - return 0; -} +// S32 zNMEGoalDenDamage::Exit(float dt, void* ctxt) //POSSIBLY RIGHT, NEEDS DOUBLE CHECKED +// { +// //something = -1.0f +// dt = -1.0f; // NOT CORRECT, FOR TESTING +// return 0; +// } //TEST diff --git a/tools/download_tool.py b/tools/download_tool.py index 63ee35e..2994175 100644 --- a/tools/download_tool.py +++ b/tools/download_tool.py @@ -94,7 +94,7 @@ def ok_url(tag: str) -> str: "objdiff-cli": objdiff_cli_url, "sjiswrap": sjiswrap_url, "wibo": wibo_url, - "OK": ok_url + "OK ": ok_url }