Skip to content

Commit

Permalink
Couple matches, improved match for zMenuLoop
Browse files Browse the repository at this point in the history
  • Loading branch information
escape209 committed Sep 2, 2024
1 parent 7454f55 commit 13c50dc
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 61 deletions.
10 changes: 3 additions & 7 deletions src/SB/Core/gc/iScrFX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,18 @@ S32 iScrFxMotionBlurOpen(RwCamera* camera)
return 0;
}

#if 0
// Something strange going one here.
S32 iScrFxCameraDestroyed(RwCamera* pCamera)
{
GCMB_KillFrameBufferCopy();
bool ret = sMBD.motionBlurFrontBuffer != NULL;
if (ret)
if (sMBD.motionBlurFrontBuffer != NULL)
{
RwRasterDestroy(sMBD.motionBlurFrontBuffer);
sMBD.motionBlurFrontBuffer = NULL;
return 1;
}
return ret;
return 0;
}

#endif

#if 0
// WIP.
void iScrFxMotionBlurRender(RwCamera* camera, U32 col)
Expand Down
2 changes: 0 additions & 2 deletions src/SB/Core/gc/isavegame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ S32 iSGShutdown()
return 1;
}

#if 0
// WIP
char* iSGMakeName(en_NAMEGEN_TYPE type, const char* base, S32 idx)
{
Expand Down Expand Up @@ -74,7 +73,6 @@ char* iSGMakeName(en_NAMEGEN_TYPE type, const char* base, S32 idx)

return use_buf;
}
#endif

#if 0
// Struct definition is screwed up.
Expand Down
18 changes: 4 additions & 14 deletions src/SB/Core/x/xJSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,16 @@ RpAtomic* CountAtomicCB(RpAtomic* atomic, U32* param_2)
return atomic;
}

#if 0
RpMesh* AddMeshCB(RpMesh* mesh, RpMeshHeader* header, RwV3d** param_3)
static RpMesh* AddMeshCB(RpMesh* mesh, RpMeshHeader* header, void* param_3)
{
U32 i = 0;
S32 counter = 0;

// the loop looks accurate, but it seems like
// the original function uses much more of the stack?
while (i < mesh->numIndices)
for (int i = 0; i < mesh->numIndices; i++)
{
**param_3 = sCurrVert[*mesh->indices + counter];

counter = counter + 2;
i = i + 1;
*param_3 = *param_3 + 1;
**(RwV3d**)(param_3) = sCurrVert[mesh->indices[i]];
*((S32*)(param_3)) += sizeof(RwV3d);
}

return mesh;
}
#endif

#if 0
// ¯\_(ツ)_/¯
Expand Down
10 changes: 3 additions & 7 deletions src/SB/Game/zLightEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,12 @@ void zLightOn(_zLight* zl, S32 on)
}
}

#if 0
// WIP.
F32 leGetRandom()
static F32 leGetRandom()
{
U32 rnd = rand();
return ((float)(rnd & 0xffff) - lbl_803CDB68) / lbl_803CDB60;
F32 ret = (U16)rand() / (F32)0xffff;
return ret;
}

#endif

void zLightEffectInitStrobe(_zLight* zlight)
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/SB/Game/zLightEffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ typedef void (*lightInitFunc)(_zLight*);

void zLightEffectSet(_zLight* zlight, S32 idx);
void zLightOn(_zLight* zl, S32 on);
F32 leGetRandom();
static F32 leGetRandom();
void zLightEffectInitStrobe(_zLight* zlight);
void zLightEffectInitDim(_zLight* zlight);
void zLightEffectInitHalfDim(_zLight* zlight);
Expand Down
6 changes: 1 addition & 5 deletions src/SB/Game/zMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,13 @@ U32 zMenuLoop()

if (globals.sceneCur->pendingPortal)
{
// NOTE (Square): The original compiler emitted a seemingly redundant clrlwi r0,r5,24
// instruction before storing src[0] in tgt[3]. This is confusing because the
// upper 24 bits should already be zero. There may be a different way of doing
// this byte swap.
char* src = (char*)&globals.sceneCur->pendingPortal->passet->sceneID;
char* tgt = (char*)&s;
tgt[0] = src[3];
tgt[1] = src[2];
tgt[2] = src[1];
tgt[3] = src[0];
if (src[0] < '0' || src[0] > '9')
if (tgt[3] < '0' || tgt[3] > '9')
{
memcpy(tgt, src, sizeof(U32));
}
Expand Down
31 changes: 14 additions & 17 deletions src/SB/Game/zNPCMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ void zNPCMgr_Startup()

#endif

#if 0
// Doesn't set r4 to 1 before calling the delete operator...
void zNPCMgr_Shutdown()
{
Expand All @@ -53,8 +52,6 @@ void zNPCMgr_Shutdown()
}
}

#endif

void zNPCMgr_scenePrepare(S32 npccnt)
{
zNPCMgrSelf()->ScenePrepare(npccnt);
Expand Down Expand Up @@ -131,30 +128,30 @@ void zNPCMgr::ScenePrepare(S32 npccnt)

#endif

#if 0
// Yeah good luck getting it to spit out an li instead of doing a shift.
S32 zNPCMgr_OrdComp_npcid(void* vkey, void* vitem)
{
U32 key = *(U32*)vkey;
U32 item = *(U32*)vitem;
S32 rc;
U32 item;
U32 key;

key = *(U32*)vkey;
item = *(U32*)vitem;
if (key < item)
{
return -1;
rc = -1;
}
else if (key > item)
{
rc = 1;
}
else
{
if (key > item)
{
return 1;
}
else
{
return 0;
}
rc = 0;
}

return rc;
}

#endif

zNPCMgr::zNPCMgr()
{
Expand Down
2 changes: 0 additions & 2 deletions src/SB/Game/zNPCTypeDuplotron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ void ZNPC_Destroy_Duplotron(xFactoryInst* inst)
delete inst;
}

#if 0
// 100% match that needs the full vtable to be filled out
// because it induces vtable generation
void zNPCDuplotron::SelfSetup()
Expand All @@ -86,7 +85,6 @@ void zNPCDuplotron::SelfSetup()
psy->BrainEnd();
psy->SetSafety(0x4E474430);
}
#endif

#if 0
// non-matching: scheduling?
Expand Down
10 changes: 4 additions & 6 deletions src/SB/Game/zSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <types.h>
#include <string.h>

#include "xMath.h"

extern volatile S32 sMapperCount;
extern zMaterialMapAsset* sMapper[1];

Expand Down Expand Up @@ -137,18 +139,14 @@ U8 zSurfaceOutOfBounds(const xSurface& s)
return 0;
}

#if 0
// Float issues
F32 zSurfaceGetSlideStartAngle(const xSurface* surf)
{
if (surf->moprops)
{
return (lbl_803CDEE0 * ((zSurfaceProps*)surf->moprops)->asset->sld_start - lbl_803CDEE4) /
lbl_803CDEF0;
return ((((zSurfaceProps*)surf->moprops)->asset->sld_start) * PI) / 176.0f;
}
return lbl_803CDEE8;
return PI / 9;
}
#endif

U32 zSurfaceGetMatchOrient(const xSurface* surf)
{
Expand Down

0 comments on commit 13c50dc

Please sign in to comment.