Match File.c
This commit is contained in:
committed by
Timothy O'Barr
parent
003c02e2be
commit
df2d091622
+1
-1
@@ -235,7 +235,7 @@ segments:
|
|||||||
- [0x032110, asmtu, cs4/Seimei/src/Camera]
|
- [0x032110, asmtu, cs4/Seimei/src/Camera]
|
||||||
- [0x034930, asmtu, cs4/Seimei/src/Debug]
|
- [0x034930, asmtu, cs4/Seimei/src/Debug]
|
||||||
- [0x034D10, asmtu, cs4/Seimei/src/Draw]
|
- [0x034D10, asmtu, cs4/Seimei/src/Draw]
|
||||||
- [0x038710, asmtu, cs4/Seimei/src/File]
|
- [0x038710, c, cs4/Seimei/src/File]
|
||||||
- [0x038D00, c, cs4/Seimei/src/Game]
|
- [0x038D00, c, cs4/Seimei/src/Game]
|
||||||
- [0x039A00, asmtu, cs4/Seimei/src/Load]
|
- [0x039A00, asmtu, cs4/Seimei/src/Load]
|
||||||
- [0x03A380, asmtu, cs4/Seimei/src/Main]
|
- [0x03A380, asmtu, cs4/Seimei/src/Main]
|
||||||
|
|||||||
@@ -969,7 +969,7 @@ SinTable = 0x00324EC0; // can_referenc
|
|||||||
SetPointLightPacket = 0x00135F90; // can_reference:False size:0x298 visibility:local
|
SetPointLightPacket = 0x00135F90; // can_reference:False size:0x298 visibility:local
|
||||||
DrawVmdObject = 0x00136850; // can_reference:False size:0x6B0 visibility:local
|
DrawVmdObject = 0x00136850; // can_reference:False size:0x6B0 visibility:local
|
||||||
__FUNCTION__$962 = 0x00252FE8; // can_reference:False size:0xF visibility:local
|
__FUNCTION__$962 = 0x00252FE8; // can_reference:False size:0xF visibility:local
|
||||||
@1203 = 0x00253068; // can_reference:False size:0x9 visibility:local allow_duplicated:True
|
@1203 = 0x00253068; // can_reference:False size:0x9 type:char visibility:local allow_duplicated:True
|
||||||
RootPath = 0x00325530; // can_reference:False size:0x80 visibility:local
|
RootPath = 0x00325530; // can_reference:False size:0x80 visibility:local
|
||||||
ScePath = 0x003254B0; // can_reference:False size:0x80 visibility:local
|
ScePath = 0x003254B0; // can_reference:False size:0x80 visibility:local
|
||||||
@1193 = 0x00253058; // can_reference:False size:0xD visibility:local
|
@1193 = 0x00253058; // can_reference:False size:0xD visibility:local
|
||||||
|
|||||||
@@ -5,6 +5,45 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "sce/libcdvd.h"
|
#include "sce/libcdvd.h"
|
||||||
|
|
||||||
|
static unsigned int AllBindDataNum; // size: 0x4, address: 0x257964
|
||||||
|
|
||||||
|
static BINDINFO AllBindInfo[3200];
|
||||||
|
|
||||||
|
static inline unsigned int foo_fn(char* fname) {
|
||||||
|
unsigned int hash = 0;
|
||||||
|
int i = 0;
|
||||||
|
int foo[32] = {
|
||||||
|
0x02, 0x03, 0x05, 0x07,
|
||||||
|
0x0B, 0x0D, 0x11, 0x13,
|
||||||
|
0x17, 0x1D, 0x1F, 0x25,
|
||||||
|
0x29, 0x2B, 0x2F, 0x35,
|
||||||
|
0x3B, 0x3D, 0x43, 0x47,
|
||||||
|
0x49, 0x4F, 0x53, 0x59,
|
||||||
|
0x61, 0x65, 0x67, 0x6B,
|
||||||
|
0x6D, 0x71, 0x7F, 0x83
|
||||||
|
};
|
||||||
|
|
||||||
|
int bar[32] = {
|
||||||
|
0x007F, 0x0161, 0x025F, 0x036D,
|
||||||
|
0x0481, 0x05AD, 0x06CD, 0x080F,
|
||||||
|
0x0943, 0x0A81, 0x0BB9, 0x0D0F,
|
||||||
|
0x0E4B, 0x0FA1, 0x10E7, 0x1237,
|
||||||
|
0x1391, 0x1511, 0x1645, 0x17B3,
|
||||||
|
0x18E5, 0x1A6B, 0x1BC5, 0x1D53,
|
||||||
|
0x1EA1, 0x201D, 0x2197, 0x22E5,
|
||||||
|
0x244D, 0x25AB, 0x2719, 0x2875
|
||||||
|
};
|
||||||
|
|
||||||
|
for (; *fname != 0; fname++) {
|
||||||
|
|
||||||
|
if (++i >= 32u) {
|
||||||
|
do { } while( 1 );
|
||||||
|
}
|
||||||
|
hash += bar[i] * foo[i] * *fname;
|
||||||
|
}
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
void GetAllBindInfo(char *fname /* r2 */, unsigned int *lsn /* r2 */,
|
void GetAllBindInfo(char *fname /* r2 */, unsigned int *lsn /* r2 */,
|
||||||
unsigned int *size /* r2 */) {
|
unsigned int *size /* r2 */) {
|
||||||
// Range: 0x15E2E0 -> 0x15E440
|
// Range: 0x15E2E0 -> 0x15E440
|
||||||
|
|||||||
@@ -46,47 +46,6 @@ typedef struct /* @anon5 */ {
|
|||||||
unsigned int hash; // offset 0x88, size 0x4
|
unsigned int hash; // offset 0x88, size 0x4
|
||||||
} BINDINFO;
|
} BINDINFO;
|
||||||
|
|
||||||
static unsigned int AllBindDataNum; // size: 0x4, address: 0x257964
|
|
||||||
|
|
||||||
static BINDINFO AllBindInfo[3200];
|
|
||||||
|
|
||||||
static inline unsigned int foo_fn(char* fname) {
|
|
||||||
unsigned int hash = 0;
|
|
||||||
int i = 0;
|
|
||||||
int foo[32] = {
|
|
||||||
0x02, 0x03, 0x05, 0x07,
|
|
||||||
0x0B, 0x0D, 0x11, 0x13,
|
|
||||||
0x17, 0x1D, 0x1F, 0x25,
|
|
||||||
0x29, 0x2B, 0x2F, 0x35,
|
|
||||||
0x3B, 0x3D, 0x43, 0x47,
|
|
||||||
0x49, 0x4F, 0x53, 0x59,
|
|
||||||
0x61, 0x65, 0x67, 0x6B,
|
|
||||||
0x6D, 0x71, 0x7F, 0x83
|
|
||||||
};
|
|
||||||
|
|
||||||
int bar[32] = {
|
|
||||||
0x007F, 0x0161, 0x025F, 0x036D,
|
|
||||||
0x0481, 0x05AD, 0x06CD, 0x080F,
|
|
||||||
0x0943, 0x0A81, 0x0BB9, 0x0D0F,
|
|
||||||
0x0E4B, 0x0FA1, 0x10E7, 0x1237,
|
|
||||||
0x1391, 0x1511, 0x1645, 0x17B3,
|
|
||||||
0x18E5, 0x1A6B, 0x1BC5, 0x1D53,
|
|
||||||
0x1EA1, 0x201D, 0x2197, 0x22E5,
|
|
||||||
0x244D, 0x25AB, 0x2719, 0x2875
|
|
||||||
};
|
|
||||||
|
|
||||||
for (; *fname != 0; fname++) {
|
|
||||||
|
|
||||||
if (++i >= 32u) {
|
|
||||||
do { } while( 1 );
|
|
||||||
}
|
|
||||||
hash += bar[i] * foo[i] * *fname;
|
|
||||||
}
|
|
||||||
return hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void GetAllBindInfo(char * fname /* r2 */, unsigned int * lsn /* r2 */, unsigned int * size /* r2 */);
|
void GetAllBindInfo(char * fname /* r2 */, unsigned int * lsn /* r2 */, unsigned int * size /* r2 */);
|
||||||
void SetAllBindInfo(void);
|
void SetAllBindInfo(void);
|
||||||
unsigned int GetBindNum(LPBINDHEAD *lpBindHead /* r2 */);
|
unsigned int GetBindNum(LPBINDHEAD *lpBindHead /* r2 */);
|
||||||
|
|||||||
@@ -115,11 +115,6 @@ typedef struct /* @anon3 */ {
|
|||||||
unsigned char * lpDmyData; // offset 0x148, size 0x4
|
unsigned char * lpDmyData; // offset 0x148, size 0x4
|
||||||
} LPCDVD; // size: 0x4, address: 0x257528
|
} LPCDVD; // size: 0x4, address: 0x257528
|
||||||
|
|
||||||
static LPCDVD *lpCdvd;
|
|
||||||
static LPSETCDVD *lpSetCdvd;
|
|
||||||
static LPLASTCDVD *lpLastCdvd;
|
|
||||||
static LPCDVDREAD *lpCdvdRead;
|
|
||||||
static CDVDREADST CdvdReadSt[256];
|
|
||||||
extern unsigned int GlobalLoadTimer; // size: 0x4, address: 0x257894
|
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 */);
|
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 */);
|
||||||
|
|||||||
+38
-39
@@ -17,6 +17,43 @@ unsigned char ScePath[128]; // size: 0x80, address: 0x3254B0
|
|||||||
// Belongs in CDVD.c
|
// Belongs in CDVD.c
|
||||||
unsigned int GlobalLoadTimer;
|
unsigned int GlobalLoadTimer;
|
||||||
|
|
||||||
|
void InitFileSystem() {
|
||||||
|
/* anonymous block */
|
||||||
|
// Range: 0x138C20 -> 0x138C78
|
||||||
|
|
||||||
|
sceSifInitRpc(0);
|
||||||
|
sceSifInitIopHeap();
|
||||||
|
sceSifLoadFileReset();
|
||||||
|
sceFsReset();
|
||||||
|
while (!sceCdInit(0)) {
|
||||||
|
}
|
||||||
|
sceCdMmode(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ReadRootPath() {
|
||||||
|
memset(RootPath, 0, 0x80);
|
||||||
|
memset(ScePath, 0, 0x80);
|
||||||
|
sprintf((char *)RootPath, "cdrom0:\\");
|
||||||
|
sprintf((char *)ScePath, "cdrom0:\\");
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char *GetRootPath() { return RootPath; }
|
||||||
|
|
||||||
|
void InitFileRead(void) { InitCdvdRead(); }
|
||||||
|
|
||||||
|
signed int FileRead(char *filename /* r2 */, signed int size /* r2 */,
|
||||||
|
unsigned char **lpBuf /* r2 */,
|
||||||
|
unsigned char bSynch /* r2 */, signed int index /* r2 */,
|
||||||
|
signed int filetype /* r2 */, unsigned int align /* r2 */) {
|
||||||
|
return CdvdRead(filename, size, lpBuf, bSynch, index, filetype, align);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FileReadControl(int bDraw) { CdvdAsyncProc(bDraw); }
|
||||||
|
|
||||||
|
void FileBackReadControl(void) { CdvdBackReadProc(); }
|
||||||
|
|
||||||
|
int FileCheckAsyncBusy(void) { return CdvdCheckAsyncBusy(); }
|
||||||
|
|
||||||
void AfterFileReadFunc(u8 *lpAddr, s32 index, s32 fileType, s32 size) {
|
void AfterFileReadFunc(u8 *lpAddr, s32 index, s32 fileType, s32 size) {
|
||||||
switch (fileType) {
|
switch (fileType) {
|
||||||
case 0x0:
|
case 0x0:
|
||||||
@@ -61,8 +98,7 @@ void AfterFileReadFunc(u8 *lpAddr, s32 index, s32 fileType, s32 size) {
|
|||||||
case 0x7:
|
case 0x7:
|
||||||
RemapMdlLink(lpAddr);
|
RemapMdlLink(lpAddr);
|
||||||
SetTexList(lpAddr, 2);
|
SetTexList(lpAddr, 2);
|
||||||
FsFontSetTexBuf(2,
|
FsFontSetTexBuf(2, GetTexMngByName(GetGameTexList(), "iconfont.tm2")->lpTm2);
|
||||||
GetTexMngByName(GetGameTexList(), "iconfont.tm2")->lpTm2);
|
|
||||||
ItemMng_CallBack_FinishLoadFile_ItemList();
|
ItemMng_CallBack_FinishLoadFile_ItemList();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -193,40 +229,3 @@ void AfterFileReadFunc(u8 *lpAddr, s32 index, s32 fileType, s32 size) {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int FileCheckAsyncBusy(void) { return CdvdCheckAsyncBusy(); }
|
|
||||||
|
|
||||||
void FileBackReadControl(void) { CdvdBackReadProc(); }
|
|
||||||
|
|
||||||
void FileReadControl(int bDraw) { CdvdAsyncProc(bDraw); }
|
|
||||||
|
|
||||||
signed int FileRead(char *filename /* r2 */, signed int size /* r2 */,
|
|
||||||
unsigned char **lpBuf /* r2 */,
|
|
||||||
unsigned char bSynch /* r2 */, signed int index /* r2 */,
|
|
||||||
signed int filetype /* r2 */, unsigned int align /* r2 */) {
|
|
||||||
return CdvdRead(filename, size, lpBuf, bSynch, index, filetype, align);
|
|
||||||
}
|
|
||||||
|
|
||||||
void InitFileRead(void) { InitCdvdRead(); }
|
|
||||||
|
|
||||||
unsigned char *GetRootPath() { return RootPath; }
|
|
||||||
|
|
||||||
void ReadRootPath() {
|
|
||||||
memset(RootPath, 0, 0x80);
|
|
||||||
memset(ScePath, 0, 0x80);
|
|
||||||
sprintf((char *)RootPath, "cdrom0:\\");
|
|
||||||
sprintf((char *)ScePath, "cdrom0:\\");
|
|
||||||
}
|
|
||||||
|
|
||||||
void InitFileSystem() {
|
|
||||||
/* anonymous block */
|
|
||||||
// Range: 0x138C20 -> 0x138C78
|
|
||||||
|
|
||||||
sceSifInitRpc(0);
|
|
||||||
sceSifInitIopHeap();
|
|
||||||
sceSifLoadFileReset();
|
|
||||||
sceFsReset();
|
|
||||||
while (!sceCdInit(0)) {
|
|
||||||
}
|
|
||||||
sceCdMmode(2);
|
|
||||||
}
|
|
||||||
@@ -18,9 +18,9 @@ typedef struct /* @anon0 */
|
|||||||
float st[4][4]; // offset 0x90, size 0x40
|
float st[4][4]; // offset 0x90, size 0x40
|
||||||
};
|
};
|
||||||
|
|
||||||
TEX0 tex0;
|
sceGsTex0 tex0;
|
||||||
TEX1 tex1;
|
sceGsTex1 tex1;
|
||||||
TEST test;
|
sceGsTest test;
|
||||||
} SPDATA;
|
} SPDATA;
|
||||||
|
|
||||||
typedef struct /* @anon10 */ {
|
typedef struct /* @anon10 */ {
|
||||||
@@ -38,9 +38,9 @@ typedef struct /* @anon10 */ {
|
|||||||
float st[4][4]; // offset 0x90, size 0x40
|
float st[4][4]; // offset 0x90, size 0x40
|
||||||
};
|
};
|
||||||
|
|
||||||
TEX0 tex0;
|
sceGsTex0 tex0;
|
||||||
TEX1 tex1;
|
sceGsTex1 tex1;
|
||||||
TEST test;
|
sceGsTest test;
|
||||||
} LPSP;
|
} LPSP;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+31
-49
@@ -1,58 +1,40 @@
|
|||||||
#ifndef TEX_H
|
#ifndef TEX_H
|
||||||
#define TEX_H
|
#define TEX_H
|
||||||
|
|
||||||
// total size: 0x8
|
#include "common.h"
|
||||||
typedef struct /* @anon16 */
|
#include "ee/eestruct.h"
|
||||||
{
|
|
||||||
|
// total size: 0x20
|
||||||
|
typedef struct /* @anon1 */ {
|
||||||
// Members
|
// Members
|
||||||
u_long ATE : 1; // offset 0x0, size 0x4
|
unsigned int size; // offset 0x0, size 0x4
|
||||||
u_long ATST : 3; // offset 0x0, size 0x4
|
unsigned int wnum; // offset 0x4, size 0x4
|
||||||
u_long AREF : 8; // offset 0x0, size 0x4
|
unsigned char dummy[5]; // offset 0x8, size 0x5
|
||||||
u_long AFAIL : 2; // offset 0x0, size 0x4
|
unsigned char compare; // offset 0xD, size 0x1
|
||||||
u_long DATE : 1; // offset 0x0, size 0x4
|
unsigned short tex_id; // offset 0xE, size 0x2
|
||||||
u_long DATM : 1; // offset 0x0, size 0x4
|
// total size: 0x8
|
||||||
u_long ZTE : 1; // offset 0x0, size 0x4
|
sceGsTex0 tex0; // offset 0x10, size 0x8
|
||||||
u_long ZTST : 2; // offset 0x0, size 0x4
|
// total size: 0x8
|
||||||
u_long pad19 : 45; // offset 0x0, size 0x4
|
sceGsTex1 tex1; // offset 0x18, size 0x8
|
||||||
} TEST; // offset 0xE0, size 0x8
|
} TM2;
|
||||||
|
|
||||||
// total size: 0x8
|
typedef struct /* @anon0 */ {
|
||||||
typedef struct /* @anon21 */ {
|
|
||||||
// Members
|
// Members
|
||||||
u_long TBP0 : 14; // offset 0x0, size 0x4
|
unsigned char bUse; // offset 0x0, size 0x1
|
||||||
u_long TBW : 6; // offset 0x0, size 0x4
|
unsigned char unused0; // offset 0x1, size 0x1
|
||||||
u_long PSM : 6; // offset 0x0, size 0x4
|
unsigned short id; // offset 0x2, size 0x2
|
||||||
u_long TW : 4; // offset 0x0, size 0x4
|
// total size: 0x20
|
||||||
u_long TH : 4; // offset 0x0, size 0x4
|
TM2 * lpTm2; // offset 0x4, size 0x4
|
||||||
u_long TCC : 1; // offset 0x0, size 0x4
|
void * lpTexList; // offset 0x8, size 0x4
|
||||||
u_long TFX : 2; // offset 0x0, size 0x4
|
signed int unused1[1]; // offset 0xC, size 0x4
|
||||||
u_long CBP : 14; // offset 0x0, size 0x4
|
unsigned char texName[32]; // offset 0x10, size 0x20
|
||||||
u_long CPSM : 4; // offset 0x0, size 0x4
|
unsigned char texNameBase[32]; // offset 0x30, size 0x20
|
||||||
u_long CSM : 1; // offset 0x0, size 0x4
|
signed int texW; // offset 0x50, size 0x4
|
||||||
u_long CSA : 5; // offset 0x0, size 0x4
|
signed int texH; // offset 0x54, size 0x4
|
||||||
u_long CLD : 3; // offset 0x0, size 0x4
|
signed int texTBW; // offset 0x58, size 0x4
|
||||||
}
|
signed int texPSM; // offset 0x5C, size 0x4
|
||||||
TEX0; // offset 0xD0, size 0x8
|
} TEXMNG;
|
||||||
|
|
||||||
// total size: 0x8
|
|
||||||
typedef struct /* @anon25 */
|
|
||||||
{
|
|
||||||
// Members
|
|
||||||
u_long LCM : 1; // offset 0x0, size 0x4
|
|
||||||
u_long pad01 : 1; // offset 0x0, size 0x4
|
|
||||||
u_long MXL : 3; // offset 0x0, size 0x4
|
|
||||||
u_long MMAG : 1; // offset 0x0, size 0x4
|
|
||||||
u_long MMIN : 3; // offset 0x0, size 0x4
|
|
||||||
u_long MTBA : 1; // offset 0x0, size 0x4
|
|
||||||
u_long pad10 : 9; // offset 0x0, size 0x4
|
|
||||||
u_long L : 2; // offset 0x0, size 0x4
|
|
||||||
u_long pad21 : 11; // offset 0x0, size 0x4
|
|
||||||
u_long K : 12; // offset 0x0, size 0x4
|
|
||||||
u_long pad44 : 20; // offset 0x0, size 0x4
|
|
||||||
} TEX1; // offset 0xD8, size 0x8
|
|
||||||
|
|
||||||
|
|
||||||
void ReadTexList(char * filename /* r2 */, void * * lplpBuf /* r2 */, signed int filetype /* r2 */, signed int index /* r2 */);
|
|
||||||
|
|
||||||
|
TEXMNG* GetTexMngByName(void * lpTexList /* r18 */, char * texname /* r17 */);
|
||||||
|
|
||||||
#endif // TEX_H
|
#endif // TEX_H
|
||||||
|
|||||||
Reference in New Issue
Block a user