Implement G_QUAD for f3dex (#599)

* Update gfx_pc.cpp

* Update gfx_pc.cpp

* Update gbi.h

* Update f3dex.h
This commit is contained in:
MegaMech
2024-05-27 11:25:56 -04:00
committed by GitHub
parent c3103a357a
commit 0c9472eb5a
3 changed files with 10 additions and 3 deletions
+1
View File
@@ -113,6 +113,7 @@
#define G_TRI2 (G_IMMFIRST - 14)
#define G_BRANCH_Z (G_IMMFIRST - 15)
#define G_LOAD_UCODE (G_IMMFIRST - 16)
#define G_QUAD (G_IMMFIRST - 10)
#else
#define G_RDPHALF_CONT (G_IMMFIRST - 13)
#endif
+2 -1
View File
@@ -29,6 +29,7 @@ constexpr int8_t F3DEX_G_RDPHALF_CONT = OPCODE(G_IMMFIRST - 13);
constexpr int8_t F3DEX_G_TRI2 = OPCODE(G_IMMFIRST - 14);
constexpr int8_t F3DEX_G_BRANCH_Z = OPCODE(G_IMMFIRST - 15);
constexpr int8_t F3DEX_G_LOAD_UCODE = OPCODE(G_IMMFIRST - 16);
constexpr int8_t F3DEX_G_QUAD = OPCODE(G_IMMFIRST - 10);
// S2DEX
constexpr int8_t F3DEX_G_SPRITE2D_BASE = OPCODE(9);
@@ -149,4 +150,4 @@ constexpr int8_t F3DEX_G_OBJ_LOADTXTR = OPCODE(0xc1);
constexpr int8_t F3DEX_G_OBJ_LDTX_SPRITE = OPCODE(0xc2);
constexpr int8_t F3DEX_G_OBJ_LDTX_RECT = OPCODE(0xc3);
constexpr int8_t F3DEX_G_OBJ_LDTX_RECT_R = OPCODE(0xc4);
constexpr int8_t F3DEX_G_RDPHALF_0 = OPCODE(0xe4);
constexpr int8_t F3DEX_G_RDPHALF_0 = OPCODE(0xe4);
+7 -2
View File
@@ -3134,7 +3134,11 @@ bool gfx_quad_handler_f3dex2(F3DGfx** cmd0) {
}
bool gfx_quad_handler_f3dex(F3DGfx** cmd0) {
// TODO implement this command...
F3DGfx* cmd = *cmd0;
gfx_sp_tri1(C0(16, 8) / 2, C0(8, 8) / 2, C0(0, 8) / 2, false);
gfx_sp_tri1(C0(8, 8) / 2, C0(0, 8) / 2, C0(24, 0) / 2, false);
gfx_sp_tri1(C1(0, 8) / 2, C1(24, 8) / 2, C1(16, 8) / 2, false);
gfx_sp_tri1(C1(24, 8) / 2, C1(16, 8) / 2, C1(8, 8) / 2, false);
return false;
}
@@ -3744,7 +3748,8 @@ const static std::unordered_map<int8_t, const std::pair<const char*, GfxOpcodeHa
{ F3DEX_G_TRI2, { "G_TRI2", gfx_tri2_handler_f3dex } },
{ F3DEX_G_SPNOOP, { "G_SPNOOP", gfx_spnoop_command_handler_f3dex2 } },
{ F3DEX_G_RDPHALF_1, { "G_RDPHALF_1", gfx_stubbed_command_handler } },
{ OTR_G_MTX_OTR2, { "G_MTX_OTR2", gfx_mtx_otr_handler_custom_f3d } } // G_MTX_OTR2 (0x29) Is this the right code?
{ OTR_G_MTX_OTR2, { "G_MTX_OTR2", gfx_mtx_otr_handler_custom_f3d } }, // G_MTX_OTR2 (0x29) Is this the right code?
{ F3DEX_G_QUAD, { "G_QUAD", gfx_quad_handler_f3dex } }
};
const static std::unordered_map<int8_t, const std::pair<const char*, GfxOpcodeHandlerFunc>> f3dHandlers = {