From 4a6195440153ecdd706492b95e7ad1f0a4d3a61f Mon Sep 17 00:00:00 2001 From: weirdbeardgame Date: Mon, 10 Aug 2026 19:47:51 -0500 Subject: [PATCH] Working on matching File --- config/kuon.yaml | 2 +- include/common.h | 1 - src/cs4/Seimei/src/Binder.c | 3 --- src/cs4/Seimei/src/Binder.h | 7 ++++++- src/cs4/Seimei/src/Cdvd.h | 3 +++ src/cs4/Seimei/src/File.c | 5 +++++ src/cs4/Seimei/src/Model.h | 2 ++ src/cs4/Seimei/src/My.h | 8 ++++++++ 8 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 src/cs4/Seimei/src/My.h diff --git a/config/kuon.yaml b/config/kuon.yaml index 1959519..dcdc47a 100644 --- a/config/kuon.yaml +++ b/config/kuon.yaml @@ -235,7 +235,7 @@ segments: - [0x032110, asmtu, cs4/Seimei/src/Camera] - [0x034930, asmtu, cs4/Seimei/src/Debug] - [0x034D10, asmtu, cs4/Seimei/src/Draw] - - [0x038710, asmtu, cs4/Seimei/src/File] + - [0x038710, c, cs4/Seimei/src/File] - [0x038D00, asmtu, cs4/Seimei/src/Game] - [0x039A00, asmtu, cs4/Seimei/src/Load] - [0x03A380, asmtu, cs4/Seimei/src/Main] diff --git a/include/common.h b/include/common.h index 96480c8..6f8adef 100644 --- a/include/common.h +++ b/include/common.h @@ -11,7 +11,6 @@ typedef volatile s16 vs16; typedef volatile s32 vs32; typedef volatile s64 vs64; - typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; diff --git a/src/cs4/Seimei/src/Binder.c b/src/cs4/Seimei/src/Binder.c index 9f3de5d..ca9b2a5 100644 --- a/src/cs4/Seimei/src/Binder.c +++ b/src/cs4/Seimei/src/Binder.c @@ -5,9 +5,6 @@ #include "common.h" #include "sce/libcdvd.h" -// Belongs in CDVD.c -unsigned int GlobalLoadTimer; - void GetAllBindInfo(char *fname /* r2 */, unsigned int *lsn /* r2 */, unsigned int *size /* r2 */) { // Range: 0x15E2E0 -> 0x15E440 diff --git a/src/cs4/Seimei/src/Binder.h b/src/cs4/Seimei/src/Binder.h index 43a4aa8..d7c2596 100644 --- a/src/cs4/Seimei/src/Binder.h +++ b/src/cs4/Seimei/src/Binder.h @@ -1,6 +1,6 @@ #ifndef BINDER_H #define BINDER_H - +#include "typedefs.h" // Range: 0x15E440 -> 0x15E760 // total size: 0x10 @@ -88,5 +88,10 @@ static inline unsigned int foo_fn(char* fname) { void GetAllBindInfo(char * fname /* r2 */, unsigned int * lsn /* r2 */, unsigned int * size /* r2 */); +void SetAllBindInfo(void); +unsigned int GetBindNum(LPBINDHEAD *lpBindHead /* r2 */); +unsigned int GetBindOffsetByName(LPBINDHEAD *lpBindHead, char *fname); +unsigned int GetBindOffsetByIndex(LPBINDHEAD *lpBindHead, u_short Index); +void RemapBinderFile(void *lpBuf /* r2 */); #endif // BINDER_H \ No newline at end of file diff --git a/src/cs4/Seimei/src/Cdvd.h b/src/cs4/Seimei/src/Cdvd.h index 6ac765c..c7e6bcd 100644 --- a/src/cs4/Seimei/src/Cdvd.h +++ b/src/cs4/Seimei/src/Cdvd.h @@ -122,4 +122,7 @@ static LPCDVDREAD *lpCdvdRead; static CDVDREADST CdvdReadSt[256]; extern unsigned int GlobalLoadTimer; // size: 0x4, address: 0x257894 +signed int CdvdRead(char * filename /* r4 */, signed int size /* r20 */, unsigned char * * lpBuf /* r19 */, unsigned char bSynch /* r18 */, signed int index /* r17 */, signed int filetype /* r16 */, unsigned int align /* r21 */); + + #endif // CDVD_H diff --git a/src/cs4/Seimei/src/File.c b/src/cs4/Seimei/src/File.c index a422641..4b4e70d 100644 --- a/src/cs4/Seimei/src/File.c +++ b/src/cs4/Seimei/src/File.c @@ -1,7 +1,9 @@ #include "File.h" +#include "Binder.h" #include "Cdvd.h" #include "Game.h" #include "Model.h" +#include "My.h" #include "Tex.h" #include "Unk.h" #include "common.h" @@ -12,6 +14,9 @@ unsigned char ScePath[128]; // size: 0x80, address: 0x3254B0 unsigned char RootPath[128]; // size: 0x80, address: 0x325530 +// Belongs in CDVD.c +unsigned int GlobalLoadTimer; + void AfterFileReadFunc(u8 *lpAddr, s32 index, s32 fileType, s32 size) { switch (fileType) { case 0x0: diff --git a/src/cs4/Seimei/src/Model.h b/src/cs4/Seimei/src/Model.h index 1fc544d..f8697df 100644 --- a/src/cs4/Seimei/src/Model.h +++ b/src/cs4/Seimei/src/Model.h @@ -148,4 +148,6 @@ typedef struct _mdlmng { extern MDLMNG MdlMng[770]; // size: 0x54380, address: 0x6A0E50 + +void SetMdlBndFile(signed int Index /* r17 */); #endif // MODEL_H diff --git a/src/cs4/Seimei/src/My.h b/src/cs4/Seimei/src/My.h new file mode 100644 index 0000000..bacdc11 --- /dev/null +++ b/src/cs4/Seimei/src/My.h @@ -0,0 +1,8 @@ +#ifndef MY_H +#define MY_H + + + +void MyAppear(signed int MyNo /* r2 */, struct _mdlmng * lpMy /* r18 */, float * Pos /* r16 */, float AngY /* r20 */); + +#endif // MY_H \ No newline at end of file