first try to draw first logo

This commit is contained in:
Lurs
2026-02-20 21:13:50 +01:00
parent 8020eb64ba
commit a41c3d59b4
26 changed files with 517 additions and 65 deletions
+18
View File
@@ -16,15 +16,27 @@ inline void J3DFifoWriteXFCmdHdr(u16 addr, u8 len) {
}
inline void J3DFifoLoadIndx(u8 cmd, u16 indx, u16 addr) {
#ifdef TARGET_PC
GXCmd1u8(cmd);
GXCmd1u16(indx);
GXCmd1u16(addr);
#else
GXWGFifo.u8 = cmd;
GXWGFifo.u16 = indx;
GXWGFifo.u16 = addr;
#endif
}
inline void J3DFifoWriteCPCmd(u8 cmd, u32 param) {
#ifdef TARGET_PC
GXCmd1u8(GX_LOAD_CP_REG);
GXCmd1u8(cmd);
GXCmd1u32(param);
#else
GXWGFifo.u8 = GX_LOAD_CP_REG;
GXWGFifo.u8 = cmd;
GXWGFifo.u32 = param;
#endif
}
inline void J3DFifoLoadCPCmd(u8 reg, u32 value) {
@@ -34,9 +46,15 @@ inline void J3DFifoLoadCPCmd(u8 reg, u32 value) {
}
inline void J3DFifoWriteXFCmd(u16 cmd, u16 len) {
#ifdef TARGET_PC
GXCmd1u8(GX_LOAD_XF_REG);
GXCmd1u16(len - 1);
GXCmd1u16(cmd);
#else
GXWGFifo.u8 = GX_LOAD_XF_REG;
GXWGFifo.u16 = (len - 1);
GXWGFifo.u16 = cmd;
#endif
}
inline void J3DFifoLoadXFCmdHdr(u16 addr, u8 len) {
+2 -2
View File
@@ -18,8 +18,8 @@ public:
void setFovy(f32 fovy) { mFovY = fovy; }
void setAspect(f32 aspect) { mAspect = aspect; }
void setNear(f32 near) { mNear = near; }
void setFar(f32 far) { mFar = far; }
void setNear(f32 near_) { mNear = near_; }
void setFar(f32 far_) { mFar = far_; }
f32 getFar() { return mFar; }
+8
View File
@@ -36,7 +36,11 @@ typedef struct _GXColorS10 {
} GXColorS10;
typedef struct _GXTexObj {
#ifdef TARGET_PC
u32 dummy[22]; // Aurora's GXTexObj_ contains std::shared_ptr + many fields (~80 bytes)
#else
u32 dummy[8];
#endif
} GXTexObj;
typedef struct _GXLightObj {
@@ -48,7 +52,11 @@ typedef struct _GXTexRegion {
} GXTexRegion;
typedef struct _GXTlutObj {
#ifdef TARGET_PC
u32 dummy[4]; // Aurora's GXTlutObj_ contains std::shared_ptr (8+ bytes)
#else
u32 dummy[3];
#endif
} GXTlutObj;
typedef struct _GXTlutRegion {
+38 -2
View File
@@ -4,9 +4,45 @@
#ifdef __REVOLUTION_SDK__
#include <revolution/gx/GXVert.h>
#elif defined(TARGET_PC)
// On PC, use Aurora's GXVert declarations (extern functions implemented in
// GXVert.cpp, no hardware FIFO writes to 0xCC008000)
// On PC, include Aurora's GXVert for GXPosition/GXNormal/GXColor/GXTexCoord/GXEnd
// (extern functions implemented in Aurora's GXVert.cpp, stream-based vertex buffers)
#include "../../../extern/aurora/include/dolphin/gx/GXVert.h"
// Aurora's GXVert.h does not provide GXCmd, GXParam, GXMatrixIndex, or a valid
// GXWGFifo target. J3D code uses these for low-level display list writes.
// We declare them as extern (implemented in stubs.cpp) and provide a dummy
// GXWGFifo that writes into a throw-away buffer so direct FIFO writes don't crash.
// Replace Aurora's GXWGFifo macro (pointing to 0xCC008000) with an extern variable
#undef GXWGFifo
#ifdef __cplusplus
extern "C" {
#endif
// PPCWGPipe is already typedef'd by Aurora's GXVert.h above.
// Dummy FIFO sink: direct GXWGFifo writes in J3DFifo.h land here harmlessly.
extern volatile PPCWGPipe GXWGFifo;
void GXCmd1u8(const u8 x);
void GXCmd1u16(const u16 x);
void GXCmd1u32(const u32 x);
void GXParam1u8(const u8 x);
void GXParam1u16(const u16 x);
void GXParam1u32(const u32 x);
void GXParam1s8(const s8 x);
void GXParam1s16(const s16 x);
void GXParam1s32(const s32 x);
void GXParam1f32(const f32 x);
void GXParam3f32(const f32 x, const f32 y, const f32 z);
void GXParam4f32(const f32 x, const f32 y, const f32 z, const f32 w);
void GXMatrixIndex1u8(const u8 x);
#ifdef __cplusplus
}
#endif
#else
#include <dolphin/types.h>
#include <dolphin/os.h>