diff options
author | StapleButter <thetotalworm@gmail.com> | 2017-04-10 20:24:41 +0200 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2017-04-10 20:24:41 +0200 |
commit | 8bbcc83771fb466aabb751be86e0c593e45313ae (patch) | |
tree | 93a81a23a6cb7767fad4dc337ace6ab0763b1351 /src/GPU3D_Soft.cpp | |
parent | f2622c047b957c6562089c0e953334845e23fec6 (diff) |
* always render normal BG/OBJ graphics (even if they're not getting displayed, they can still be fed to the capture unit)
* fix 3D viewport calculation
* keep track of the clearbuffer attributes before VBlank
Diffstat (limited to 'src/GPU3D_Soft.cpp')
-rw-r--r-- | src/GPU3D_Soft.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/GPU3D_Soft.cpp b/src/GPU3D_Soft.cpp index f15761c..dc94130 100644 --- a/src/GPU3D_Soft.cpp +++ b/src/GPU3D_Soft.cpp @@ -781,12 +781,12 @@ void RenderPolygon(Polygon* polygon) void RenderFrame(Vertex* vertices, Polygon* polygons, int npolys) { - u32 polyid = (ClearAttr1 >> 24) & 0x3F; + u32 polyid = (RenderClearAttr1 >> 24) & 0x3F; if (DispCnt & (1<<14)) { - u8 xoff = (ClearAttr2 >> 16) & 0xFF; - u8 yoff = (ClearAttr2 >> 24) & 0xFF; + u8 xoff = (RenderClearAttr2 >> 16) & 0xFF; + u8 yoff = (RenderClearAttr2 >> 24) & 0xFF; for (int y = 0; y < 256*192; y += 256) { @@ -818,16 +818,16 @@ void RenderFrame(Vertex* vertices, Polygon* polygons, int npolys) else { // TODO: confirm color conversion - u32 r = (ClearAttr1 << 1) & 0x3E; if (r) r++; - u32 g = (ClearAttr1 >> 4) & 0x3E; if (g) g++; - u32 b = (ClearAttr1 >> 9) & 0x3E; if (b) b++; - u32 a = (ClearAttr1 >> 16) & 0x1F; + u32 r = (RenderClearAttr1 << 1) & 0x3E; if (r) r++; + u32 g = (RenderClearAttr1 >> 4) & 0x3E; if (g) g++; + u32 b = (RenderClearAttr1 >> 9) & 0x3E; if (b) b++; + u32 a = (RenderClearAttr1 >> 16) & 0x1F; u32 color = r | (g << 8) | (b << 16) | (a << 24); - u32 z = ((ClearAttr2 & 0x7FFF) * 0x200) + 0x1FF; + u32 z = ((RenderClearAttr2 & 0x7FFF) * 0x200) + 0x1FF; if (z >= 0x10000 && z < 0xFFFFFF) z++; - polyid |= ((ClearAttr1 & 0x8000) >> 7); + polyid |= ((RenderClearAttr1 & 0x8000) >> 7); for (int i = 0; i < 256*192; i++) { |