From 2c724834447b012caa25b64380b3e7c4426a0a3c Mon Sep 17 00:00:00 2001 From: SlyCooperReloadCoded Date: Fri, 22 Nov 2024 20:19:39 -0500 Subject: [PATCH 1/4] Matched ResetGsb --- src/P2/gs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/P2/gs.c b/src/P2/gs.c index db3af4a3..c344b463 100644 --- a/src/P2/gs.c +++ b/src/P2/gs.c @@ -38,7 +38,11 @@ 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); From 7863fa090cc3c94099647f91f8b6267792c5205a Mon Sep 17 00:00:00 2001 From: SlyCooperReloadCoded Date: Sat, 23 Nov 2024 18:47:31 -0500 Subject: [PATCH 2/4] Matched ClearFchts --- src/P2/joy.c | 11 +++++------ src/P2/transition.c | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/P2/joy.c b/src/P2/joy.c index 30e562b0..909e1e93 100644 --- a/src/P2/joy.c +++ b/src/P2/joy.c @@ -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) diff --git a/src/P2/transition.c b/src/P2/transition.c index 58a34c75..6ce04faa 100644 --- a/src/P2/transition.c +++ b/src/P2/transition.c @@ -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; From 3b47122f1424e4bd3023a7ebaa9351a84ab2e475 Mon Sep 17 00:00:00 2001 From: SlyCooperReloadCoded Date: Sat, 23 Nov 2024 19:04:03 -0500 Subject: [PATCH 3/4] Matched CPvDl__FP2DL --- config/sly1.yaml | 2 +- config/symbol_addrs.txt | 2 +- src/P2/dl.c | 16 +++++++++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/config/sly1.yaml b/config/sly1.yaml index 4bfe66c4..faec49ac 100644 --- a/config/sly1.yaml +++ b/config/sly1.yaml @@ -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] diff --git a/config/symbol_addrs.txt b/config/symbol_addrs.txt index 1b82b8fa..854a6369 100644 --- a/config/symbol_addrs.txt +++ b/config/symbol_addrs.txt @@ -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 diff --git a/src/P2/dl.c b/src/P2/dl.c index 303b94cd..03278399 100644 --- a/src/P2/dl.c +++ b/src/P2/dl.c @@ -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; +} From 05d80a65cda6015f2b407fa2c1db1f04d0413bc8 Mon Sep 17 00:00:00 2001 From: Zac Date: Sun, 24 Nov 2024 00:11:47 +0000 Subject: [PATCH 4/4] Delete blank line --- src/P2/gs.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/P2/gs.c b/src/P2/gs.c index c344b463..da795be8 100644 --- a/src/P2/gs.c +++ b/src/P2/gs.c @@ -39,7 +39,6 @@ void InitGsb(GSB *pgsb, int igsMin, int igsMax) } void ResetGsb(GSB* pGsb) - { pGsb->igsMac = pGsb->igsMin; }