Skip to content

Commit

Permalink
Merge pull request #126 from SlyCooperReloadCoded/working
Browse files Browse the repository at this point in the history
Matched ResetGsb
  • Loading branch information
TheOnlyZac authored Nov 24, 2024
2 parents 4f5d128 + 05d80a6 commit d2e46dd
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/sly1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ segments:

- [0x529e0, c, P2/difficulty]
- [0x53438, c, P2/dl]

- [0x5380C, asm, dl_padding] # Needed to align dmas
- [0x53810, c, P2/dmas]
- [0x53E28, asm, P2/dsp]
#- [0x, asm, P2/dysh]
Expand Down
2 changes: 1 addition & 1 deletion config/symbol_addrs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ g_abRenderLoopStack = 0x6056d0; // size:0x20000
__11CTransition = 0x1E4E38; // type:func
Set__11CTransitionPc3OIDT2i = 0x1E4E80; // type:func
Execute__11CTransition = 0x1e4ea8; // type:func
ResetWorld__F6TRANS = 0x1E5278; // type:func
ResetWorld__F6FTRANS = 0x1E5278; // type:func
transition__static_initialization_and_destruction_0 = 0x1E5328; // type:func
_GLOBAL_$I$g_transition = 0x1E5358; // type:func

Expand Down
16 changes: 15 additions & 1 deletion src/P2/dl.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,18 @@ bool FIsDlEmpty(DL *pdl)

INCLUDE_ASM(const s32, "P2/dl", MergeDl__FP2DLT0);

INCLUDE_ASM(const s32, "P2/dl", CPvDl__FP2DL);
int CPvDl(DL* pdl)
{
void* pCurItem = pdl->head;
int iCount = 0;

if (pCurItem != 0) {
while(pCurItem) {
DLE* pDle = (DLE*)((unsigned char*)pCurItem + pdl->ibDle);

pCurItem = pDle->next;
iCount++;
}
}
return iCount;
}
5 changes: 4 additions & 1 deletion src/P2/gs.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ void InitGsb(GSB *pgsb, int igsMin, int igsMax)
pgsb->igsMax = igsMax;
}

INCLUDE_ASM(const s32, "P2/gs", ResetGsb__FP3GSB);
void ResetGsb(GSB* pGsb)
{
pGsb->igsMac = pGsb->igsMin;
}

INCLUDE_ASM(const s32, "P2/gs", IgsAllocGsb__FP3GSBi);

Expand Down
11 changes: 5 additions & 6 deletions src/P2/joy.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,11 @@ void _MatchCodes(JOY *pjoy, GRFBTN button)

INCLUDE_ASM(const s32, "P2/joy", UpdateCodes__Fv);

INCLUDE_ASM(const s32, "P2/joy", ClearFchts__Fv);
// void ClearFchts()
// {
// g_grfcht = FCHT_None;
// ResetWorld(FTRANS_None);
// }
void ClearFchts(void)
{
g_grfcht = FCHT_None;
ResetWorld(FTRANS_None);
}

INCLUDE_ASM(const s32, "P2/joy", AddFcht__Fi);
// void AddFcht(int nParam)
Expand Down
2 changes: 1 addition & 1 deletion src/P2/transition.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void CTransition::Set(char *pchzWorld, OID oidWarp, OID oidWarpContext, GRFTRANS
INCLUDE_ASM(const s32, "P2/transition", Execute__11CTransition);
// Matching, blocked by broken references in joy.c
INCLUDE_ASM(const s32, "P2/transition", ResetWorld__F6TRANS);
INCLUDE_ASM(const s32, "P2/transition", ResetWorld__F6FTRANS);
// void ResetWorld(FTRANS ftrans)
// {
// GRFTRANS grftrans;
Expand Down

0 comments on commit d2e46dd

Please sign in to comment.