Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Niko committed Feb 24, 2025
1 parent 92ff4f6 commit d73031c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
31 changes: 31 additions & 0 deletions decompile/General/COLL/COLL_15_FIXED_QUADBLK_LoadScratchpadVerts.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <common.h>

void DECOMP_COLL_FIXED_QUADBLK_LoadScratchpadVerts(struct ScratchpadStruct* sps)
{
// rigged to $t8/$t9 by naughty dog
register int t8 asm("t8");
register int t9 asm("t9");

struct LevVertex* ptrVert = t8;
struct QuadBlock* ptrQuad = t9;
struct BspSearchVertex* bsv;
struct LevVertex* vertCurr;
short* index;

bsv = &sps->bspSearchVert[0];

for (
index = &ptrQuad->index[0];
index < &ptrQuad->index[9];
index++, bsv++
)
{
vertCurr = &ptrVert[*index];
bsv->pLevelVertex = vertCurr;
*(int*)&bsv->pos[0] = *(int*)&vertCurr->pos[0];
*(int*)&bsv->pos[2] = *(int*)&vertCurr->pos[2];
}

t8 = ptrVert;
t9 = ptrQuad;
}
2 changes: 1 addition & 1 deletion decompile/buildList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ common, exe, COLL_FIXED_BotsSearch, 0x0, General/COLL/COLL_03
//common, exe, COLL_FIXED_BSPLEAF_TestQuadblocks, 0x0, General/COLL/COLL_12_FIXED_BSPLEAF_TestQuadblocks.c //over budget, but assumed working
//common, exe, COLL_FIXED_QUADBLK_GetNormVecs_LoLOD, 0x0, General/COLL/COLL_13_FIXED_QUADBLK_GetNormVecs_LoLOD.c //over budget, but assumed working
//common, exe, COLL_FIXED_QUADBLK_GetNormVecs_HiLOD, 0x0, General/COLL/COLL_14_FIXED_QUADBLK_GetNormVecs_HiLOD.c //over budget, but assumed working
//common, exe, COLL_FIXED_QUADBLK_LoadScratchpadVerts, 0x0, General/COLL/COLL_15_FIXED_QUADBLK_LoadScratchpadVerts.c //TODO
//common, exe, COLL_FIXED_QUADBLK_LoadScratchpadVerts, 0x0, General/COLL/COLL_15_FIXED_QUADBLK_LoadScratchpadVerts.c //TODO, breaks asm-optimized ND
//common, exe, COLL_MOVED_TRIANGL_ReorderNormals, 0x0, General/COLL/COLL_16_MOVED_TRIANGL_ReorderNormals.c //TODO
//common, exe, COLL_MOVED_TRIANGL_TestPoint, 0x0, General/COLL/COLL_17_MOVED_TRIANGL_TestPoint.c //TODO
//common, exe, COLL_MOVED_QUADBLK_TestTriangles, 0x0, General/COLL/COLL_18_MOVED_QUADBLK_TestTriangles.c //over budget, but assumed working
Expand Down

0 comments on commit d73031c

Please sign in to comment.