-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Niko
committed
Feb 24, 2025
1 parent
92ff4f6
commit d73031c
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
decompile/General/COLL/COLL_15_FIXED_QUADBLK_LoadScratchpadVerts.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters