Skip to content

Commit

Permalink
some GX fixes and match some of DVD
Browse files Browse the repository at this point in the history
  • Loading branch information
shibbo committed Oct 31, 2024
1 parent 64b582f commit 6918e29
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 21 deletions.
9 changes: 5 additions & 4 deletions config/RMGK01/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10562,23 +10562,24 @@ RVL_SDK/gx/GXTransform.c:

RVL_SDK/gx/GXPerf.c:
.text start:0x804C0AD4 end:0x804C13B4
.data start:0x805FE540 end:0x805FE6F8
.data start:0x805FE540 end:0x805FE630

RVL_SDK/dvd/dvdfs.c:
.text start:0x804C13B4 end:0x804C2128
.data start:0x805FE6F8 end:0x805FE818
.data start:0x805FE630 end:0x805FE7D0
.sdata start:0x806B2B60 end:0x806B2B70
.sbss start:0x806B78D0 end:0x806B7900

RVL_SDK/dvd/dvd.c:
.text start:0x804C2128 end:0x804C6E38
.data start:0x805FE818 end:0x805FEB78
.bss start:0x80667180 end:0x8066BE60
.data start:0x805FE7D0 end:0x805FEB78
.bss start:0x80667180 end:0x8066BE30
.sdata start:0x806B2B70 end:0x806B2B90
.sbss start:0x806B7900 end:0x806B7998

RVL_SDK/dvd/dvdqueue.c:
.text start:0x804C6E38 end:0x804C7090
.bss start:0x8066BE30 end:0x8066BE60

RVL_SDK/dvd/dvderror.c:
.text start:0x804C7090 end:0x804C7994
Expand Down
6 changes: 3 additions & 3 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2401,11 +2401,11 @@ def JSysLib(lib_name: str, objects: List[Object]) -> Dict[str, Any]:
SDKLib(
"dvd",
[
Object(NonMatching, "RVL_SDK/dvd/dvdfs.c"),
Object(Matching, "RVL_SDK/dvd/dvdfs.c"),
Object(NonMatching, "RVL_SDK/dvd/dvd.c"),
Object(NonMatching, "RVL_SDK/dvd/dvdqueue.c"),
Object(Matching, "RVL_SDK/dvd/dvdqueue.c"),
Object(NonMatching, "RVL_SDK/dvd/dvderror.c"),
Object(NonMatching, "RVL_SDK/dvd/dvdidutils.c"),
Object(Matching, "RVL_SDK/dvd/dvdidutils.c"),
Object(NonMatching, "RVL_SDK/dvd/dvdFatal.c"),
Object(NonMatching, "RVL_SDK/dvd/dvdDeviceError.c"),
Object(NonMatching, "RVL_SDK/dvd/dvd_broadway.c")
Expand Down
8 changes: 4 additions & 4 deletions libs/RVL_SDK/include/revolution/gd/GDBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ void GDWrite_f32(f32);

void GDOverflowed(void);

static inline void GDOverflowCheck(u32 size) {
static void GDOverflowCheck(u32 size) {
if (__GDCurrentDL->ptr + size > __GDCurrentDL->top) {
GDOverflowed();
}
}

static inline void __GDWrite(u8 data) { *__GDCurrentDL->ptr++ = data; }
static void __GDWrite(u8 data) { *__GDCurrentDL->ptr++ = data; }

static inline void GDPosition3f32(f32 x, f32 y, f32 z) {
static void GDPosition3f32(f32 x, f32 y, f32 z) {
GDWrite_f32(x);
GDWrite_f32(y);
GDWrite_f32(z);
Expand All @@ -46,4 +46,4 @@ void GDColor4u8(u8, u8, u8, u8);
}
#endif

#endif // GDBASE_H
#endif // GDBASE_H
4 changes: 2 additions & 2 deletions libs/RVL_SDK/include/revolution/gx/GXGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void GXSetTexCoordGen2(GXTexCoordID, GXTexGenType, GXTexGenSrc, u32, GXBool, u32
void GXSetNumTexGens(u8);


static inline void GXEnd(void) {
static void GXEnd(void) {

}

Expand All @@ -39,4 +39,4 @@ void __GXSetViewport(void);
}
#endif

#endif // GXGEOMETRY_H
#endif // GXGEOMETRY_H
12 changes: 10 additions & 2 deletions libs/RVL_SDK/include/revolution/gx/GXRegs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ extern "C" {

#include <revolution/base/PPCWGPipe.h>

#ifdef __MWERKS__
extern volatile PPCWGPipe gxfifo : 0xCC008000;
#else
extern volatile PPCWGPipe gxfifo;
#endif
extern volatile void *__piReg;
extern volatile void *__cpReg;
extern volatile void *__peReg;
Expand Down Expand Up @@ -101,8 +105,9 @@ extern volatile void *__memReg;
GX_WRITE_U32((reg));\
}

#ifdef __MWERKS__
#define GX_DEFINE_GX_READ_COUNTER(unit) \
inline u32 __GXRead##unit##CounterU32( u32 regAddrL, u32 regAddrH ) \
u32 __GXRead##unit##CounterU32( u32 regAddrL, u32 regAddrH ) \
{ \
u32 ctrH0, ctrH1, ctrL; \
ctrH0 = GX_##unit##_REG_READ_U16(regAddrH); \
Expand All @@ -114,6 +119,9 @@ extern volatile void *__memReg;
} while ( ctrH0 != ctrH1 ); \
return ((ctrH0 << 16) | ctrL); \
}
#else
#define GX_DEFINE_GX_READ_COUNTER(unit)
#endif

GX_DEFINE_GX_READ_COUNTER(CP)
GX_DEFINE_GX_READ_COUNTER(PE)
Expand Down Expand Up @@ -141,4 +149,4 @@ GX_DEFINE_GX_READ_COUNTER(MEM)
}
#endif

#endif // GXREGS_H
#endif // GXREGS_H
8 changes: 4 additions & 4 deletions libs/RVL_SDK/include/revolution/gx/GXVert.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ volatile PPCWGPipe GXWGFifo;
#define __GXCDEFX(func,n,t) __GXCDEF##n(func,t,t)

#define __GXCDEF1(func,ts,td) \
static inline void func(const ts x) \
static void func(const ts x) \
{ \
GXWGFifo.td = (td) x; \
return; \
}

#define __GXCDEF2(func,ts,td) \
static inline void func(const ts x, const ts y) \
static void func(const ts x, const ts y) \
{ \
GXWGFifo.td = (td) x; \
GXWGFifo.td = (td) y; \
return; \
}

#define __GXCDEF3(func,ts,td) \
static inline void func(const ts x, const ts y, const ts z) \
static void func(const ts x, const ts y, const ts z) \
{ \
GXWGFifo.td = (td) x; \
GXWGFifo.td = (td) y; \
Expand All @@ -58,4 +58,4 @@ __GXCDEFX(GXTexCoord1x8, 1, u8)
}
#endif

#endif // GXVERT_H
#endif // GXVERT_H
4 changes: 2 additions & 2 deletions src/RVL_SDK/dvd/dvdfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static BOOL DVDConvertEntrynumToPath(s32 entrynum, char* path, u32 maxlen) {
return TRUE;
}

BOOL DVDGetCurrentDir(char* path, u32 maxlen) {
static BOOL DVDGetCurrentDir(char* path, u32 maxlen) {
return DVDConvertEntrynumToPath((s32)currentDirectory, path, maxlen);
}

Expand Down Expand Up @@ -370,4 +370,4 @@ BOOL DVDReadDir(DVDDir* dir, DVDDirEntry* dirent) {

BOOL DVDCloseDir(DVDDir* dir) {
return TRUE;
}
}

0 comments on commit 6918e29

Please sign in to comment.