inital commit

This commit is contained in:
2026-07-12 15:06:31 -05:00
commit 75f1616cb3
77 changed files with 75469 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
#ifndef SCE_DEVVIF0_H
#define SCE_DEVVIF0_H
void sceDevVif0Reset();
#endif // SCE_DEVVIF0_H
+36
View File
@@ -0,0 +1,36 @@
#ifndef SCE_DEVVIF1_H
#define SCE_DEVVIF1_H
#include "typedefs.h"
typedef struct {
u_int row[4];
u_int col[4];
u_int mask;
u_int code;
u_int stat;
u_short itop;
u_short itops;
u_short base;
u_short offset;
u_short top;
u_short tops;
u_short mark;
u_short num;
u_char error;
u_char cl;
u_char wl;
u_char cmod;
u_char pad;
} sceDevVif1Cnd;
void sceDevVif1Reset(void);
int sceDevVif1Pause(int mode);
int sceDevVif1Continue(void);
u_int sceDevVif1PutErr(int interrupt, int miss1, int miss2);
u_int sceDevVif1GetErr(void);
int sceDevVif1GetCnd(sceDevVif1Cnd *);
int sceDevVif1PutFifo(u_long128 *addr, int n);
int sceDevVif1GetFifo(u_long128 *addr, int n);
#endif // SCE_DEVVIF1_H
+6
View File
@@ -0,0 +1,6 @@
#ifndef SCE_DEVVU0_H
#define SCE_DEVVU0_H
void sceDevVu0Reset();
#endif // SCE_DEVVU0_H
+63
View File
@@ -0,0 +1,63 @@
#ifndef SCE_LIBCDVD_H
#define SCE_LIBCDVD_H
#include "typedefs.h"
#define STMNBLK 0
#define STMBLK 1
#define SCECdINIT 0
#define SCECdINoD 1
#define SCECdEXIT 5
#define SCECdCD 1
#define SCECdDVD 2
#define SCECdSpinMax 0
#define SCECdSpinNom 1
#define SCECdSpinStm 0
#define SCECdSpinDvdDL0 0
#define SCECdSpinX1 2
#define SCECdSecS2048 0
#define SCECdSecS2328 1
#define SCECdSecS2340 2
typedef struct {
u_char stat;
u_char second;
u_char minute;
u_char hour;
u_char pad;
u_char day;
u_char month;
u_char year;
} sceCdCLOCK;
typedef struct {
u_char trycount;
u_char spindlctrl;
u_char datapattern;
u_char pad;
} sceCdRMode;
typedef struct {
u_int lsn;
u_int size;
char name[16];
u_char date[8];
u_int flag;
} sceCdlFILE;
int sceCdInit(int init_mode);
int sceCdMmode(int media);
int sceCdReadClock(sceCdCLOCK *rtc);
int sceCdStRead(u_int size, u_int *buf, u_int mode, u_int *err);
int sceCdStStop();
int sceCdDiskReady(int mode);
int sceCdStInit(u_int bufmax, u_int bankmax, u_int iop_bufaddr);
int sceCdSearchFile(sceCdlFILE *fp,const char *name);
int sceCdStStart(u_int lbn, sceCdRMode *mode);
#endif // SCE_LIBCDVD_H
+77
View File
@@ -0,0 +1,77 @@
#ifndef SCE_LIBDMA_H
#define SCE_LIBDMA_H
#include "typedefs.h"
typedef struct {
u_char sts;
u_char std;
u_char mfd;
u_char rcycle;
u_short express;
u_short notify;
u_short sqwc;
u_short tqwc;
void *rbadr;
u_int rbmsk;
} sceDmaEnv;
typedef struct {
unsigned DIR: 1;
unsigned p0 : 1;
unsigned MOD: 2;
unsigned ASP: 2;
unsigned TTE: 1;
unsigned TIE: 1;
unsigned STR: 1;
unsigned p1 : 7;
unsigned TAG:16;
} tD_CHCR;
typedef struct _sceDmaTag {
u_short qwc;
u_char mark;
u_char id;
struct _sceDmaTag *next;
u_int p[2];
} sceDmaTag __attribute__ ((aligned(16)));
typedef struct {
tD_CHCR chcr; u_int p0[3];
volatile void *madr; u_int p1[3];
volatile u_int qwc; u_int p2[3];
volatile sceDmaTag *tadr; u_int p3[3];
volatile void *as0; u_int p4[3];
volatile void *as1; u_int p5[3];
u_int p6[4];
u_int p7[4];
volatile void *sadr; u_int p8[3];
} sceDmaChan;
#define settag(t,i,a,q) (t)->id=(i),(t)->next=(sceDmaTag *)(a),(t)->qwc=(u_short)(q)
inline static void *sceDmaAddRef(sceDmaTag **tag, int qwc, void *addr)
{
settag(*tag,0x30,addr,qwc);
(*tag)++;
return(addr);
}
inline static void *sceDmaAddEnd(sceDmaTag **tag, int qwc, void *addr)
{
void *ret;
settag(*tag,0x70,addr,qwc);
ret = *tag+1;
(*tag) += qwc+1;
return(ret);
}
int sceDmaReset(int mode);
sceDmaEnv *sceDmaGetEnv(sceDmaEnv *env);
int sceDmaPutEnv(sceDmaEnv *env);
sceDmaChan *sceDmaGetChan(int id);
void sceDmaSend(sceDmaChan *d, void *tag);
int sceDmaSync(sceDmaChan *d, int mode, int timeout);
#endif // SCE_LIBDMA_H
+26
View File
@@ -0,0 +1,26 @@
#ifndef SCE_LIBGIFPK_H
#define SCE_LIBGIFPK_H
#include "typedefs.h"
typedef struct {
u_int *pCurrent;
u_long128 *pBase;
u_long128 *pDmaTag;
u_long *pGifTag;
} sceGifPacket;
u_long128 *sceGifPkTerminate(sceGifPacket *pPacket);
void sceGifPkCloseGifTag(sceGifPacket *pPacket);
void sceGifPkOpenGifTag(sceGifPacket *pPacket, u_long128 gifTag);
void sceGifPkAddGsAD(sceGifPacket *pPacket, u_int addr, u_long data);
void sceGifPkEnd(sceGifPacket *pPacket, u_int opt1, u_int opt2, u_int flag);
void sceGifPkReset(sceGifPacket *pPacket);
void sceGifPkInit(sceGifPacket *pPacket, u_long128 *pBase);
void sceGifPkReset(sceGifPacket *pPacket);
void sceGifPkCnt(sceGifPacket *pPacket, u_int opt1, u_int opt2, u_int flag);
u_int *sceGifPkReserve(sceGifPacket *pPacket, u_int count);
void sceGifPkRef(sceGifPacket *pPacket, u_long128 *pRef, u_int size, u_int opt1, u_int opt2, u_int flag);
#endif // SCE_LIBGIFPK_H
+191
View File
@@ -0,0 +1,191 @@
#ifndef SCE_LIBGRAPH_H
#define SCE_LIBGRAPH_H
#include "ee/eestruct.h"
#include "ee/eeregs.h"
#define SCE_GS_NOINTERLACE 0
#define SCE_GS_INTERLACE 1
#define SCE_GS_FIELD 0
#define SCE_GS_FRAME 1
#define SCE_GS_NTSC 2
#define SCE_GS_PAL 3
typedef struct {
long unsigned int NLOOP : 15;
long unsigned int EOP : 1;
long unsigned int pad16 : 16;
long unsigned int id : 14;
long unsigned int PRE : 1;
long unsigned int PRIM : 11;
long unsigned int FLG : 2;
long unsigned int NREG : 4;
long unsigned int REGS0 : 4;
long unsigned int REGS1 : 4;
long unsigned int REGS2 : 4;
long unsigned int REGS3 : 4;
long unsigned int REGS4 : 4;
long unsigned int REGS5 : 4;
long unsigned int REGS6 : 4;
long unsigned int REGS7 : 4;
long unsigned int REGS8 : 4;
long unsigned int REGS9 : 4;
long unsigned int REGS10 : 4;
long unsigned int REGS11 : 4;
long unsigned int REGS12 : 4;
long unsigned int REGS13 : 4;
long unsigned int REGS14 : 4;
long unsigned int REGS15 : 4;
} sceGifTag __attribute__((aligned(16)));
typedef struct {
long unsigned int SBP : 14;
long unsigned int pad14 : 2;
long unsigned int SBW : 6;
long unsigned int pad22 : 2;
long unsigned int SPSM : 6;
long unsigned int pad30 : 2;
long unsigned int DBP : 14;
long unsigned int pad46 : 2;
long unsigned int DBW : 6;
long unsigned int pad54 : 2;
long unsigned int DPSM : 6;
long unsigned int pad62 : 2;
} sceGsBitbltbuf;
typedef struct {
long unsigned int SSAX : 11;
long unsigned int pad11 : 5;
long unsigned int SSAY : 11;
long unsigned int pad27 : 5;
long unsigned int DSAX : 11;
long unsigned int pad43 : 5;
long unsigned int DSAY : 11;
long unsigned int DIR : 2;
long unsigned int pad61 : 3;
} sceGsTrxpos;
typedef struct {
long unsigned int RRW : 12;
long unsigned int pad12 : 20;
long unsigned int RRH : 12;
long unsigned int pad44 : 20;
} sceGsTrxreg;
typedef struct {
long unsigned int pad00;
} sceGsFinish;
typedef struct {
long unsigned int XDR : 2;
long unsigned int pad02 : 62;
} sceGsTrxdir;
typedef struct {
sceGifTag giftag0;
sceGsBitbltbuf bitbltbuf;
long bitbltbufaddr;
sceGsTrxpos trxpos;
long trxposaddr;
sceGsTrxreg trxreg;
long trxregaddr;
sceGsTrxdir trxdir;
long trxdiraddr;
sceGifTag giftag1;
} sceGsLoadImage __attribute__((aligned(16)));
typedef struct {
u_int vifcode[4];
sceGifTag giftag;
sceGsBitbltbuf bitbltbuf;
long bitbltbufaddr;
sceGsTrxpos trxpos;
long trxposaddr;
sceGsTrxreg trxreg;
long trxregaddr;
sceGsFinish finish;
long finishaddr;
sceGsTrxdir trxdir;
long trxdiraddr;
} sceGsStoreImage __attribute__((aligned(16)));
typedef struct {
sceGsFrame frame1;
u_long frame1addr;
sceGsZbuf zbuf1;
long zbuf1addr;
sceGsXyoffset xyoffset1;
long xyoffset1addr;
sceGsScissor scissor1;
long scissor1addr;
sceGsPrmodecont prmodecont;
long prmodecontaddr;
sceGsColclamp colclamp;
long colclampaddr;
sceGsDthe dthe;
long dtheaddr;
sceGsTest test1;
long test1addr;
} sceGsDrawEnv1 __attribute__((aligned(16)));
typedef struct {
sceGsTest testa;
long testaaddr;
sceGsPrim prim;
long primaddr;
sceGsRgbaq rgbaq;
long rgbaqaddr;
sceGsXyz xyz2a;
long xyz2aaddr;
sceGsXyz xyz2b;
long xyz2baddr;
sceGsTest testb;
long testbaddr;
} sceGsClear __attribute__((aligned(16)));
typedef struct {
tGS_PMODE pmode;
tGS_SMODE2 smode2;
tGS_DISPFB2 dispfb;
tGS_DISPLAY2 display;
tGS_BGCOLOR bgcolor;
} sceGsDispEnv;
typedef struct {
sceGsDispEnv disp[2];
sceGifTag giftag0;
sceGsDrawEnv1 draw0;
sceGsClear clear0;
sceGifTag giftag1;
sceGsDrawEnv1 draw1;
sceGsClear clear1;
} sceGsDBuff;
typedef struct { // 0x10
/* 0x0 */ short int sceGsInterMode;
/* 0x2 */ short int sceGsOutMode;
/* 0x4 */ short int sceGsFFMode;
/* 0x6 */ short int sceGsVersion;
/* 0x8 */ int (*sceGsVSCfunc)(int);
/* 0xc */ int sceGsVSCid;
} sceGsGParam __attribute__((aligned(16)));
void sceGsSetDefDBuff(sceGsDBuff *dp, short psm, short w, short h, short ztest, short zpsm, short clear);
void sceGsResetPath();
void sceGsResetGraph(short mode, short inter, short omode, short ffmode);
void sceGsPutDispEnv(sceGsDispEnv *disp);
int sceGsPutDrawEnv(sceGifTag *giftag);
void sceGsSetHalfOffset(sceGsDrawEnv1 *draw, short centerx, short centery, short halfoff);
int sceGsSyncV(int mode);
int sceGsSwapDBuff(sceGsDBuff *db, int id);
int sceGsSetDefStoreImage(sceGsStoreImage *sp, short sbp, short sbw, short spsm, short x, short y, short w, short h);
int sceGsExecStoreImage(sceGsStoreImage *sp, u_long128 *dstaddr);
int sceGsSyncPath(int mode, u_short timeout);
int sceGsSetDefLoadImage(sceGsLoadImage *lp, short dbp, short dbw, short dpsm, short x, short y, short w, short h);
int sceGsExecLoadImage(sceGsLoadImage *lp, u_long128 *srcaddr);
int sceGsSetDefDrawEnv(sceGsDrawEnv1 *draw, short psm, short w, short h, short ztest, short zpsm);
sceGsGParam *sceGsGetGParam();
#endif // SCE_LIBGRAPH_H
+22
View File
@@ -0,0 +1,22 @@
#ifndef SCE_LIBIPU_H
#define SCE_LIBIPU_H
#include "typedefs.h"
#define SCE_IPU_BCLR 0x00000000
#define sceIpuIsBusy() ((int)((int)DGET_IPU_CTRL() < 0))
#define sceIpuBCLR(bp) DPUT_IPU_CMD(SCE_IPU_BCLR | (bp))
typedef struct {
u_int d4madr;
u_int d4tadr;
u_int d4qwc;
u_int d4chcr;
u_int d3madr;
u_int d3qwc;
u_int d3chcr;
u_int ipubp;
u_int ipuctrl;
} sceIpuDmaEnv;
#endif // SCE_LIBIPU_H
+57
View File
@@ -0,0 +1,57 @@
#ifndef SCE_LIBMC_H
#define SCE_LIBMC_H
typedef int _iconVu0IVECTOR[4];
typedef float _iconVu0FVECTOR[4];
typedef struct
{
unsigned char Head[4];
unsigned short Reserv1;
unsigned short OffsLF;
unsigned int Reserv2;
unsigned int TransRate;
_iconVu0IVECTOR BgColor[4];
_iconVu0FVECTOR LightDir[3];
_iconVu0FVECTOR LightColor[3];
_iconVu0FVECTOR Ambient;
unsigned char TitleName[68];
unsigned char FnameView[64];
unsigned char FnameCopy[64];
unsigned char FnameDel[64];
unsigned char Reserve3[512];
} sceMcIconSys;
typedef struct
{
unsigned char Resv2,Sec,Min,Hour;
unsigned char Day,Month;
unsigned short Year;
} sceMcStDateTime;
typedef struct
{
sceMcStDateTime _Create;
sceMcStDateTime _Modify;
unsigned int FileSizeByte;
unsigned short AttrFile;
unsigned short Reserve1;
unsigned int Reserve2;
unsigned int PdaAplNo;
unsigned char EntryName[32];
} sceMcTblGetDir __attribute__((aligned (64)));
int sceMcInit();
int sceMcSync(int mode, int *cmd, int *result);
int sceMcDelete(int port, int slot, const char *name);
int sceMcFormat(int port, int slot);
int sceMcMkdir(int port, int slot, const char *name);
int sceMcGetInfo(int port, int slot, int *type, int *free, int *format);
int sceMcWrite(int fd, const void *buffer, int size);
int sceMcRead(int fd, void *buffer, int size);
int sceMcClose(int fd);
int sceMcOpen(int port, int slot, const char *name, int mode);
int sceMcGetDir(int port, int slot, const char *name, unsigned mode, int maxent, sceMcTblGetDir *table);
int sceMcGetInfo(int port, int slot, int *type, int *free, int *format);
#endif // SCE_LIBMC_H
+38
View File
@@ -0,0 +1,38 @@
#ifndef SCE_LIBPAD_H
#define SCE_LIBPAD_H
#define scePadDmaBufferMax (16)
int scePadPortOpen(int port, int slot, void* addr);
int scePadInit(int mode);
int scePadGetState(int port, int slot);
int scePadRead(int port, int slot, unsigned char* rdata);
int scePadGetState(int port, int slot);
int scePadInfoMode(int port, int slot, int term, int offs);
int scePadSetMainMode(int port, int slot, int offs, int lock);
int scePadInfoAct(int port, int slot, int actno, int term);
int scePadSetActAlign(int port, int slot, const unsigned char* data);
int scePadGetReqState(int port, int slot);
int scePadInfoPressMode(int port, int slot);
int scePadEnterPressMode(int port, int slot);
int scePadSetActDirect(int port, int slot, const unsigned char* data);
#define scePadStateDiscon (0)
#define scePadStateFindPad (1)
#define scePadStateFindCTP1 (2)
#define scePadStateExecCmd (5)
#define scePadStateStable (6)
#define scePadStateError (7)
#define scePadStateClosed (99)
#define scePadReqStateComplete (0)
#define scePadReqStateFaild (1)
#define scePadReqStateFailed (1)
#define scePadReqStateBusy (2)
#define InfoModeCurID (1)
#define InfoModeCurExID (2)
#define InfoModeCurExOffs (3)
#define InfoModeIdTable (4)
#endif // SCE_LIBPAD_H
+61
View File
@@ -0,0 +1,61 @@
#ifndef SCE_LIBPC_H
#define SCE_LIBPC_H
static inline int scePcGetCounter0(void) {
register int ctr0;
__asm__ volatile ("mfpc %0, 0": "=r" (ctr0));
return ctr0;
}
#define SCE_PC0_RESERVED (0 << 5)
#define SCE_PC0_CPU_CYCLE (1 << 5)
#define SCE_PC0_SINGLE_ISSUE (2 << 5)
#define SCE_PC0_BRANCH_ISSUED (3 << 5)
#define SCE_PC0_BTAC_MISS (4 << 5)
#define SCE_PC0_ITLB_MISS (5 << 5)
#define SCE_PC0_ICACHE_MISS (6 << 5)
#define SCE_PC0_DTLB_ACCESSED (7 << 5)
#define SCE_PC0_NONBLOCK_LOAD (8 << 5)
#define SCE_PC0_WBB_SINGLE_REQ (9 << 5)
#define SCE_PC0_WBB_BURST_REQ (10 << 5)
#define SCE_PC0_ADDR_BUS_BUSY (11 << 5)
#define SCE_PC0_INST_COMP (12 << 5)
#define SCE_PC0_NON_BDS_COMP (13 << 5)
#define SCE_PC0_COP2_COMP (14 << 5)
#define SCE_PC0_LOAD_COMP (15 << 5)
#define SCE_PC0_NO_EVENT (16 << 5)
#define SCE_PC1_LOW_BRANCH_ISSUED (0 << 15)
#define SCE_PC1_CPU_CYCLE (1 << 15)
#define SCE_PC1_DUAL_ISSUE (2 << 15)
#define SCE_PC1_BRANCH_MISS_PREDICT (3 << 15)
#define SCE_PC1_TLB_MISS (4 << 15)
#define SCE_PC1_DTLB_MISS (5 << 15)
#define SCE_PC1_DCACHE_MISS (6 << 15)
#define SCE_PC1_WBB_SINGLE_UNAVAIL (7 << 15)
#define SCE_PC1_WBB_BURST_UNAVAIL (8 << 15)
#define SCE_PC1_WBB_BURST_ALMOST (9 << 15)
#define SCE_PC1_WBB_BURST_FULL (10 << 15)
#define SCE_PC1_DATA_BUS_BUSY (11 << 15)
#define SCE_PC1_INST_COMP (12 << 15)
#define SCE_PC1_NON_BDS_COMP (13 << 15)
#define SCE_PC1_COP1_COMP (14 << 15)
#define SCE_PC1_STORE_COMP (15 << 15)
#define SCE_PC1_NO_EVENT (16 << 15)
#define SCE_PC_EXL0 (1 << 1)
#define SCE_PC_K0 (1 << 2)
#define SCE_PC_S0 (1 << 3)
#define SCE_PC_U0 (1 << 4)
#define SCE_PC_EVENT0 (31 << 5)
#define SCE_PC_EXL1 (1 << 11)
#define SCE_PC_K1 (1 << 12)
#define SCE_PC_S1 (1 << 13)
#define SCE_PC_U1 (1 << 14)
#define SCE_PC_EVENT1 (31 << 15)
#define SCE_PC_CTE (1 << 31)
void scePcStart(int control, int counter0, int counter1);
void scePcStop();
#endif // SCE_LIBPC_H
+7
View File
@@ -0,0 +1,7 @@
#ifndef SCE_LIBSDR_H
#define SCE_LIBSDR_H
int sceSdRemoteInit();
int sceSdRemote(int arg, ...);
#endif // SCE_LIBSDR_H
+37
View File
@@ -0,0 +1,37 @@
#ifndef SCE_LIBVU0_H
#define SCE_LIBVU0_H
#include "typedefs.h"
void sceVu0ScaleVectorXYZ(sceVu0FVECTOR v0, sceVu0FVECTOR v1, float s);
void sceVu0AddVector(sceVu0FVECTOR v0, sceVu0FVECTOR v1, sceVu0FVECTOR v2);
void sceVu0SubVector(sceVu0FVECTOR v0, sceVu0FVECTOR v1, sceVu0FVECTOR v2);
void sceVu0MulVector(sceVu0FVECTOR v0, sceVu0FVECTOR v1, sceVu0FVECTOR v2);
void sceVu0CopyVector(sceVu0FVECTOR v0, sceVu0FVECTOR v1);
void sceVu0Normalize(sceVu0FVECTOR v0, sceVu0FVECTOR v1);
float sceVu0InnerProduct(sceVu0FVECTOR v0, sceVu0FVECTOR v1);
void sceVu0OuterProduct(sceVu0FVECTOR v0, sceVu0FVECTOR v1, sceVu0FVECTOR v2);
void sceVu0UnitMatrix(sceVu0FMATRIX m);
void sceVu0TransposeMatrix(sceVu0FMATRIX m0, sceVu0FMATRIX m1);
void sceVu0CameraMatrix(sceVu0FMATRIX m, sceVu0FVECTOR p, sceVu0FVECTOR zd, sceVu0FVECTOR yd);
void sceVu0MulMatrix(sceVu0FMATRIX m0, sceVu0FMATRIX m1, sceVu0FMATRIX m2);
void sceVu0InversMatrix(sceVu0FMATRIX m0, sceVu0FMATRIX m1);
void sceVu0CopyMatrix(sceVu0FMATRIX m0, sceVu0FMATRIX m1);
void sceVu0RotMatrixZ(sceVu0FMATRIX m0, sceVu0FMATRIX m1, float rz);
void sceVu0ApplyMatrix(sceVu0FVECTOR v0, sceVu0FMATRIX m, sceVu0FVECTOR v1);
void sceVu0RotMatrixX(sceVu0FMATRIX m0, sceVu0FMATRIX m1, float rx);
void sceVu0RotMatrixY(sceVu0FMATRIX m0, sceVu0FMATRIX m1, float ry);
void sceVu0RotMatrix(sceVu0FMATRIX m0, sceVu0FMATRIX m1, sceVu0FVECTOR rot);
void sceVu0TransMatrix(sceVu0FMATRIX m0, sceVu0FMATRIX m1, sceVu0FVECTOR tv);
void sceVu0MulMatrix(sceVu0FMATRIX m0, sceVu0FMATRIX m1, sceVu0FMATRIX m2);
void sceVu0RotTransPers(sceVu0IVECTOR v0, sceVu0FMATRIX m0, sceVu0FVECTOR v1, int mode);
void sceVu0SubVector(sceVu0FVECTOR v0, sceVu0FVECTOR v1, sceVu0FVECTOR v2);
void sceVu0ScaleVector(sceVu0FVECTOR v0, sceVu0FVECTOR v1, float s);
void sceVu0RotTransPers(sceVu0IVECTOR v0, sceVu0FMATRIX m0, sceVu0FVECTOR v1, int mode);
void sceVu0RotTransPersN(sceVu0IVECTOR *v0, sceVu0FMATRIX m0, sceVu0FVECTOR *v1, int n, int mode);
void sceVu0DivVector(sceVu0FVECTOR v0, sceVu0FVECTOR v1, float q);
void sceVu0DivVectorXYZ(sceVu0FVECTOR v0, sceVu0FVECTOR v1, float q);
void sceVu0ClampVector(sceVu0FVECTOR v0, sceVu0FVECTOR v1, float min, float max);
void sceVu0InterVector(sceVu0FVECTOR v0, sceVu0FVECTOR v1, sceVu0FVECTOR v2, float r);
#endif // SCE_LIBVU0_H
+7
View File
@@ -0,0 +1,7 @@
#ifndef SCE_MISC_DIEI_H
#define SCE_MISC_DIEI_H
int EIntr();
int DIntr();
#endif // SCE_MISC_DIEI_H
+51
View File
@@ -0,0 +1,51 @@
#ifndef SCE_MPEG_AUDIODEC_H
#define SCE_MPEG_AUDIODEC_H
#include "typedefs.h"
#define VOLUME_MASTER_MAX 0x3fff
#define AU_STATE_INIT 0
#define AU_STATE_PRESET 1
#define AU_STATE_PLAY 2
#define AU_STATE_PAUSE 3
#define AUTODMA_CH 0
#define UNIT_SIZE 1024
typedef struct { // 0x20
/* 0x00 */ char id[4];
/* 0x04 */ int size;
/* 0x08 */ int type;
/* 0x0c */ int rate;
/* 0x10 */ int ch;
/* 0x14 */ int interSize;
/* 0x18 */ int loopStart;
/* 0x1c */ int loopEnd;
} SpuStreamHeader;
typedef struct { // 0x8
/* 0x0 */ char id[4];
/* 0x4 */ int size;
} SpuStreamBody;
typedef struct { // 0x5c
/* 0x00 */ int state;
/* 0x04 */ SpuStreamHeader sshd;
/* 0x24 */ SpuStreamBody ssbd;
/* 0x2c */ int hdrCount;
/* 0x30 */ u_char *data;
/* 0x34 */ int put;
/* 0x38 */ int count;
/* 0x3c */ int size;
/* 0x40 */ int totalBytes;
/* 0x44 */ int iopBuff;
/* 0x48 */ int iopBuffSize;
/* 0x4c */ int iopLastPos;
/* 0x50 */ int iopPausePos;
/* 0x54 */ int totalBytesSent;
/* 0x58 */ int iopZero;
} AudioDec;
#endif // SCE_MPEG_AUDIODEC_H
+38
View File
@@ -0,0 +1,38 @@
#ifndef SCE_MPEG_DEFS_H
#define SCE_MPEG_DEFS_H
#include "typedefs.h"
#ifdef BUILD_EU_VERSION
#define MAX_WIDTH 640
#define MAX_HEIGHT 448
#else
#define MAX_WIDTH 640
#define MAX_HEIGHT 480
#endif
// these are the same for both US and EU versions of the game
#define MPEG_DISP_WIDTH 640
#define MPEG_DISP_HEIGHT 480
#define bound(val, x) ((((val) + (x) - 1) / (x))*(x))
#define N_VOBUF 2
#define N_LDTAGS (MAX_WIDTH/16 * MAX_HEIGHT/16 * 6 + 10)
#define TS_NONE -1
static inline void *DmaAddr(void *val)
{
return (void*)((u_int)val & 0x0fffffff);
}
static inline void *UncAddr(void *val)
{
return (void*)(((u_int)val & 0x0fffffff) | 0x20000000);
}
void clearGsMem(int r, int g, int b, int disp_width, int disp_height);
#endif // SCE_MPEG_DEFS_H
+6
View File
@@ -0,0 +1,6 @@
#ifndef SCE_MPEG_DISP_H
#define SCE_MPEG_DISP_H
void clearGsMem(int r, int g, int b, int disp_width, int disp_height);
#endif // SCE_MPEG_DISP_H
+84
View File
@@ -0,0 +1,84 @@
#ifndef SCE_MPEG_LIBMPEG_H
#define SCE_MPEG_LIBMPEG_H
#include "typedefs.h"
#include "sce/mpeg/defs.h"
#define SCE_MPEG_BUFFER_SIZE(w, h) ((w)*(h)*9/2 + 512 + 24*64 + 8192)
typedef enum {
sceMpegCbError = 0,
sceMpegCbNodata = 1,
sceMpegCbStopDMA = 2,
sceMpegCbRestartDMA = 3,
sceMpegCbBackground = 4,
sceMpegCbTimeStamp = 5,
sceMpegCbStr = 6,
} sceMpegCbType;
typedef enum {
sceMpegStrM2V = 0,
sceMpegStrIPU = 1,
sceMpegStrPCM = 2,
sceMpegStrADPCM = 3,
sceMpegStrDATA = 4,
} sceMpegStrType;
typedef struct {
int width;
int height;
int frameCount;
long int pts;
long int dts;
u_long flags;
long int pts2nd;
long int dts2nd;
u_long flags2nd;
void *sys;
} sceMpeg;
typedef struct {
sceMpegCbType type;
char *errMessage;
} sceMpegCbDataError;
typedef struct {
sceMpegCbType type;
long int pts;
long int dts;
} sceMpegCbDataTimeStamp;
typedef struct {
sceMpegCbType type;
u_char *header;
u_char *data;
u_int len;
long int pts;
long int dts;
} sceMpegCbDataStr;
typedef union {
sceMpegCbType type;
sceMpegCbDataError error;
sceMpegCbDataTimeStamp ts;
sceMpegCbDataStr str;
} sceMpegCbData;
typedef struct {
u_int pix[256];
} sceIpuRGB32;
typedef int (*sceMpegCallback)(sceMpeg *mp, sceMpegCbData *cbData, void *anyData);
int sceMpegReset(sceMpeg *mp);
int sceMpegCreate(sceMpeg *mp, u_char *work_area, int work_area_size);
int sceMpegDelete(sceMpeg *mp);
int sceMpegGetPicture(sceMpeg *mp, sceIpuRGB32 *rgb32, int mbcount);
int sceMpegIsEnd(sceMpeg *mp);
int sceMpegIsRefBuffEmpty(sceMpeg *mp);
void sceMpegSetDecodeMode(sceMpeg *mp, int ni, int np, int nb);
sceMpegCallback sceMpegAddCallback(sceMpeg *mp, sceMpegCbType type, sceMpegCallback callback, void *anyData);
sceMpegCallback sceMpegAddStrCallback(sceMpeg *mp, sceMpegStrType strType, int ch, sceMpegCallback callback, void *anyData);
#endif // SCE_MPEG_LIBMPEG_H
+18
View File
@@ -0,0 +1,18 @@
#ifndef SCE_MPEG_READBUF_H
#define SCE_MPEG_READBUF_H
#include "typedefs.h"
#define READ_UNIT_SIZE (64*1024)
#define N_READ_UNIT 5
#define READBUF_BUFF_SIZE (N_READ_UNIT * READ_UNIT_SIZE)
typedef struct
{ // 0x5000c
/* 0x00000 */ u_char data[N_READ_UNIT * READ_UNIT_SIZE];
/* 0x50000 */ int put;
/* 0x50004 */ int count;
/* 0x50008 */ int size;
} ReadBuf;
#endif // SCE_MPEG_READBUF_H
+52
View File
@@ -0,0 +1,52 @@
#ifndef SCE_MPEG_VIBUF_H
#define SCE_MPEG_VIBUF_H
#include "typedefs.h"
#include "sce/libipu.h"
#define DMA_ID_REFE 0
#define DMA_ID_NEXT 2
#define DMA_ID_REF 3
#define VIBUF_ELM_SIZE 2048
#define VIBUF_SIZE 256
#define VIBUF_TS_SIZE (VIBUF_SIZE*2)
#define TAG_ADDR(i) ((u_int)DmaAddr(f->tag + i))
#define DATA_ADDR(i) ((u_int)f->data + VIBUF_ELM_SIZE * (i))
#define WRAP_ADDR(addr) ((u_int)(f->data) + (((u_int)(addr) - (u_int)(f->data)) % (VIBUF_ELM_SIZE * f->n)))
#define IsInRegion(i,start,len,n) ( (0 <= (((i) + (n) - (start)) % (n))) && ((((i) + (n) - (start)) % (n)) < (len)))
extern inline int IsPtsInRegion(int tgt, int pos, int len, int size)
{
int tgt1 = (tgt + size - pos) % size;
return tgt1 < len;
}
typedef struct { // 0x18
/* 0x00 */ long int pts;
/* 0x08 */ long int dts;
/* 0x10 */ int pos;
/* 0x14 */ int len;
} TimeStamp;
typedef struct { // 0x60
/* 0x00 */ u_long128 *data;
/* 0x04 */ u_long128 *tag;
/* 0x08 */ int n;
/* 0x0c */ int dmaStart;
/* 0x10 */ int dmaN;
/* 0x14 */ int readBytes;
/* 0x18 */ int buffSize;
/* 0x1c */ sceIpuDmaEnv env;
/* 0x40 */ int sema;
/* 0x44 */ int isActive;
/* 0x48 */ long int totalBytes;
/* 0x50 */ TimeStamp *ts;
/* 0x54 */ int n_ts;
/* 0x58 */ int count_ts;
/* 0x5c */ int wt_ts;
} ViBuf;
#endif // SCE_MPEG_VIBUF_H
+21
View File
@@ -0,0 +1,21 @@
#ifndef SCE_MPEG_VIDEODEC_H
#define SCE_MPEG_VIDEODEC_H
#include "sce/mpeg/libmpeg.h"
#include "sce/mpeg/vibuf.h"
#define VD_STATE_NORMAL 0
#define VD_STATE_ABORT 1
#define VD_STATE_FLUSH 2
#define VD_STATE_END 3
typedef struct { // 0xb8
/* 0x00 */ sceMpeg mpeg;
/* 0x48 */ ViBuf vibuf;
/* 0xa8 */ u_int state;
/* 0xac */ int sema;
/* 0xb0 */ int hid_endimage;
/* 0xb4 */ int hid_vblank;
} VideoDec;
#endif // SCE_MPEG_VIDEODEC_H
+32
View File
@@ -0,0 +1,32 @@
#ifndef SCE_MPEG_VOBUF_H
#define SCE_MPEG_VOBUF_H
#include "typedefs.h"
#include "sce/mpeg/libmpeg.h"
#define N_GSBUF 2
#define VOBUF_STATUS_ 0
#define VOBUF_STATUS_TOPDONE 1
#define VOBUF_STATUS_FULL 2
typedef struct {
u_char v[MAX_WIDTH * MAX_HEIGHT * 4];
} VoData;
typedef struct {
int status;
int dummy[15];
u_int v[N_VOBUF][bound((N_LDTAGS+100)*4, 64)];
} VoTag;
typedef struct {
VoData *data;
VoTag *tag;
volatile int write;
volatile int count;
int size;
} VoBuf;
#endif // SCE_MPEG_VOBUF_H
+18
View File
@@ -0,0 +1,18 @@
#ifndef SCE_SDMACRO_H
#define SCE_SDMACRO_H
#define SD_INIT_COLD 0
#define SD_TRANS_MODE_WRITE 0
#define SD_TRANS_MODE_READ 1
#define SD_TRANS_MODE_STOP 2
#define SD_TRANS_MODE_WRITE_FROM 3
#define SD_TRANS_BY_DMA (0x0<<3)
#define SD_TRANS_BY_IO (0x1<<3)
#define SD_BLOCK_ONESHOT (0<<4)
#define SD_BLOCK_LOOP (1<<4)
#define SD_BLOCK_HANDLER (1<<7)
#endif // SCE_SDMACRO_H
+8
View File
@@ -0,0 +1,8 @@
#ifndef SCE_SDRCMD_H
#define SCE_SDRCMD_H
#define rSdInit 0x8000
#define rSdVoiceTrans 0x80d0
#define rSdBlockTrans 0x80e0
#endif // SCE_SDRCMD_H
+14
View File
@@ -0,0 +1,14 @@
#ifndef SCE_SIF_H
#define SCE_SIF_H
typedef struct {
unsigned int data;
unsigned int addr;
unsigned int size;
unsigned int mode;
} sceSifDmaData;
int sceSifDmaStat(unsigned int id);
unsigned int sceSifSetDma(sceSifDmaData *sdd, int len);
#endif // SCE_SIF_H
+34
View File
@@ -0,0 +1,34 @@
#ifndef SCE_SIFDEV_H
#define SCE_SIFDEV_H
#define SCE_RDONLY 0x0001
#define SCE_WRONLY 0x0002
#define SCE_RDWR 0x0003
#define SCE_NBLOCK 0x0010
#define SCE_APPEND 0x0100
#define SCE_CREAT 0x0200
#define SCE_TRUNC 0x0400
#define SCE_EXCL 0x0800
#define SCE_NOBUF 0x4000
#define SCE_NOWAIT 0x8000
#define SCE_SEEK_SET 0
#define SCE_SEEK_CUR 1
#define SCE_SEEK_END 2
int sceOpen(const char *filename, int flag, ...);
int sceClose(int fd);
int sceRead(int fd, void *buf, int nbyte);
int sceWrite(int fd, const void *buf, int nbyte);
int sceLseek(int fd, int offset, int where);
int sceFsReset();
int sceSifInitIopHeap();
int sceSifFreeIopHeap(void *);
void *sceSifAllocIopHeap(unsigned int);
int sceSifRebootIop(const char *img);
int sceSifSyncIop();
int sceSifLoadModule(const char *filename, int args, const char *argp);
#endif // SCE_SIFDEV_H
+29
View File
@@ -0,0 +1,29 @@
#ifndef SCE_SIFRPC_H
#define SCE_SIFRPC_H
typedef struct _sif_rpc_data {
void *paddr;
unsigned int pid;
int tid;
unsigned int mode;
} sceSifRpcData;
typedef void (* sceSifEndFunc)(void *);
typedef struct _sif_client_data {
struct _sif_rpc_data rpcd;
unsigned int command;
void *buff;
void *gp;
sceSifEndFunc func;
void *para;
struct _sif_serve_data *serve;
} sceSifClientData;
void sceSifInitRpc(unsigned int mode);
int sceSifBindRpc(sceSifClientData *client, unsigned int rpc_number, unsigned int mode);
int sceSifCheckStatRpc(sceSifRpcData *cd);
int sceSifCallRpc(sceSifClientData *client, unsigned int rpc_number, unsigned int mode, void * send, int ssize, void * receive, int rsize, sceSifEndFunc end_function, void *end_param);
#endif // SCE_SIFRPC_H