From 6918e2917419417ec59ece8d9ab91843b13df65e Mon Sep 17 00:00:00 2001 From: shibbo Date: Wed, 30 Oct 2024 23:41:11 -0400 Subject: [PATCH] some GX fixes and match some of DVD --- config/RMGK01/splits.txt | 9 +++++---- configure.py | 6 +++--- libs/RVL_SDK/include/revolution/gd/GDBase.h | 8 ++++---- libs/RVL_SDK/include/revolution/gx/GXGeometry.h | 4 ++-- libs/RVL_SDK/include/revolution/gx/GXRegs.h | 12 ++++++++++-- libs/RVL_SDK/include/revolution/gx/GXVert.h | 8 ++++---- src/RVL_SDK/dvd/dvdfs.c | 4 ++-- 7 files changed, 30 insertions(+), 21 deletions(-) diff --git a/config/RMGK01/splits.txt b/config/RMGK01/splits.txt index 8c8f2454..63001c2d 100644 --- a/config/RMGK01/splits.txt +++ b/config/RMGK01/splits.txt @@ -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 diff --git a/configure.py b/configure.py index 753d9937..7a8e81cf 100644 --- a/configure.py +++ b/configure.py @@ -2401,11 +2401,11 @@ config.libs = [ 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") diff --git a/libs/RVL_SDK/include/revolution/gd/GDBase.h b/libs/RVL_SDK/include/revolution/gd/GDBase.h index 2f2daf18..389fe53c 100644 --- a/libs/RVL_SDK/include/revolution/gd/GDBase.h +++ b/libs/RVL_SDK/include/revolution/gd/GDBase.h @@ -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); @@ -46,4 +46,4 @@ void GDColor4u8(u8, u8, u8, u8); } #endif -#endif // GDBASE_H \ No newline at end of file +#endif // GDBASE_H diff --git a/libs/RVL_SDK/include/revolution/gx/GXGeometry.h b/libs/RVL_SDK/include/revolution/gx/GXGeometry.h index 8110cab2..8c725abc 100644 --- a/libs/RVL_SDK/include/revolution/gx/GXGeometry.h +++ b/libs/RVL_SDK/include/revolution/gx/GXGeometry.h @@ -22,7 +22,7 @@ void GXSetTexCoordGen2(GXTexCoordID, GXTexGenType, GXTexGenSrc, u32, GXBool, u32 void GXSetNumTexGens(u8); -static inline void GXEnd(void) { +static void GXEnd(void) { } @@ -39,4 +39,4 @@ void __GXSetViewport(void); } #endif -#endif // GXGEOMETRY_H \ No newline at end of file +#endif // GXGEOMETRY_H diff --git a/libs/RVL_SDK/include/revolution/gx/GXRegs.h b/libs/RVL_SDK/include/revolution/gx/GXRegs.h index 296a3883..7a635bd3 100644 --- a/libs/RVL_SDK/include/revolution/gx/GXRegs.h +++ b/libs/RVL_SDK/include/revolution/gx/GXRegs.h @@ -7,7 +7,11 @@ extern "C" { #include +#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; @@ -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); \ @@ -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) @@ -141,4 +149,4 @@ GX_DEFINE_GX_READ_COUNTER(MEM) } #endif -#endif // GXREGS_H \ No newline at end of file +#endif // GXREGS_H diff --git a/libs/RVL_SDK/include/revolution/gx/GXVert.h b/libs/RVL_SDK/include/revolution/gx/GXVert.h index d8b67305..035ff554 100644 --- a/libs/RVL_SDK/include/revolution/gx/GXVert.h +++ b/libs/RVL_SDK/include/revolution/gx/GXVert.h @@ -17,14 +17,14 @@ 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; \ @@ -32,7 +32,7 @@ volatile PPCWGPipe GXWGFifo; } #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; \ @@ -58,4 +58,4 @@ __GXCDEFX(GXTexCoord1x8, 1, u8) } #endif -#endif // GXVERT_H \ No newline at end of file +#endif // GXVERT_H diff --git a/src/RVL_SDK/dvd/dvdfs.c b/src/RVL_SDK/dvd/dvdfs.c index 4e0478f6..ff952d5b 100644 --- a/src/RVL_SDK/dvd/dvdfs.c +++ b/src/RVL_SDK/dvd/dvdfs.c @@ -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); } @@ -370,4 +370,4 @@ BOOL DVDReadDir(DVDDir* dir, DVDDirEntry* dirent) { BOOL DVDCloseDir(DVDDir* dir) { return TRUE; -} \ No newline at end of file +}