mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 06:10:03 -06:00
* 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
This commit is contained in:
@ -57,6 +57,10 @@
|
||||
// (the idea is that each position matrix has an associated vector matrix)
|
||||
//
|
||||
// TODO: check if translate works on the vector matrix? seems pointless
|
||||
//
|
||||
// viewport Y coordinates are upside-down
|
||||
//
|
||||
// clear color/depth/bitmap/etc registers (04000350/04000354) are double-buffered
|
||||
|
||||
|
||||
namespace GPU3D
|
||||
@ -237,6 +241,7 @@ Polygon* RenderPolygonRAM;
|
||||
u32 RenderNumPolygons;
|
||||
|
||||
u32 ClearAttr1, ClearAttr2;
|
||||
u32 RenderClearAttr1, RenderClearAttr2;
|
||||
|
||||
u32 FlushRequest;
|
||||
u32 FlushAttributes;
|
||||
@ -1634,10 +1639,11 @@ void ExecuteCommand()
|
||||
break;
|
||||
|
||||
case 0x60: // viewport x1,y1,x2,y2
|
||||
// note: viewport Y coordinates are upside-down
|
||||
Viewport[0] = ExecParams[0] & 0xFF;
|
||||
Viewport[1] = (ExecParams[0] >> 8) & 0xFF;
|
||||
Viewport[1] = 191 - (ExecParams[0] >> 24);
|
||||
Viewport[2] = ((ExecParams[0] >> 16) & 0xFF) - Viewport[0] + 1;
|
||||
Viewport[3] = (ExecParams[0] >> 24) - Viewport[1] + 1;
|
||||
Viewport[3] = (191 - ((ExecParams[0] >> 8) & 0xFF)) - Viewport[1] + 1;
|
||||
break;
|
||||
|
||||
case 0x70: // box test
|
||||
@ -1725,6 +1731,9 @@ void VBlank()
|
||||
RenderPolygonRAM = CurPolygonRAM;
|
||||
RenderNumPolygons = NumPolygons;
|
||||
|
||||
RenderClearAttr1 = ClearAttr1;
|
||||
RenderClearAttr2 = ClearAttr2;
|
||||
|
||||
CurRAMBank = CurRAMBank?0:1;
|
||||
CurVertexRAM = &VertexRAM[CurRAMBank ? 6144 : 0];
|
||||
CurPolygonRAM = &PolygonRAM[CurRAMBank ? 2048 : 0];
|
||||
|
Reference in New Issue
Block a user