mirror of
https://github.com/encounter/aurora.git
synced 2026-07-09 18:19:33 -07:00
Add GXSetProjectionFull extension
This commit is contained in:
@@ -66,6 +66,14 @@ void GXSetScissorRender(u32 left, u32 top, u32 wd, u32 ht) {
|
||||
GX_WRITE_U32(ht);
|
||||
}
|
||||
|
||||
void GXSetProjectionFull(const void* mtx) {
|
||||
const f32* values = reinterpret_cast<const f32*>(mtx);
|
||||
GX_WRITE_AURORA(GX_AURORA_LOAD_PROJECTION_FULL);
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
GX_WRITE_F32(values[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void GX2SetPolygonOffset(f32 mFrontOffset, f32 mFrontScale, f32 mBackOffset, f32 mBackScale, f32 mClamp) {
|
||||
GX_WRITE_AURORA(GX2_SET_POLYGON_OFFSET);
|
||||
GX_WRITE_F32(mFrontOffset);
|
||||
|
||||
@@ -1741,6 +1741,16 @@ void handle_aurora(const u8* data, u32& pos, u32 size, bool bigEndian) {
|
||||
const int32_t height = static_cast<int32_t>(read_u32(data + pos, bigEndian));
|
||||
pos += 4;
|
||||
set_render_scissor({left, top, width, height});
|
||||
} else if (subCmd == GX_AURORA_LOAD_PROJECTION_FULL) {
|
||||
CHECK(pos + 64 <= size, "GX_AURORA_LOAD_PROJECTION_FULL read overrun");
|
||||
auto& proj = g_gxState.proj;
|
||||
for (int r = 0; r < 4; ++r) {
|
||||
for (int c = 0; c < 4; ++c) {
|
||||
proj[r][c] = read_f32(data + pos, bigEndian);
|
||||
pos += 4;
|
||||
}
|
||||
}
|
||||
g_gxState.stateDirty = true;
|
||||
} else if (subCmd >= GX_AURORA_LOAD_ARRAYBASE && subCmd <= (GX_AURORA_LOAD_ARRAYBASE | 0x0f)) {
|
||||
CHECK(pos + 13 <= size, "GX_AURORA_LOAD_ARRAYBASE read overrun");
|
||||
u32 attrIdx = subCmd - GX_AURORA_LOAD_ARRAYBASE + GX_VA_POS;
|
||||
|
||||
Reference in New Issue
Block a user