mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 06:10:03 -06:00
* perspective-correct Z interpolation
* fix depth buffering. support W-buffer mode. * 3D/2D blending. doesn't do much yet, but the code is here.
This commit is contained in:
15
GPU3D.cpp
15
GPU3D.cpp
@ -50,6 +50,8 @@
|
||||
// formula for clear depth: (GBAtek is wrong there)
|
||||
// clearZ = (val * 0x200) + 0x1FF;
|
||||
// if (clearZ >= 0x010000 && clearZ < 0xFFFFFF) clearZ++;
|
||||
//
|
||||
// alpha is 5-bit
|
||||
|
||||
|
||||
namespace GPU3D
|
||||
@ -195,6 +197,7 @@ u32 NumVertices, NumPolygons;
|
||||
u32 CurRAMBank;
|
||||
|
||||
u32 FlushRequest;
|
||||
u32 FlushAttributes, CurFlushAttributes;
|
||||
|
||||
|
||||
|
||||
@ -1307,7 +1310,7 @@ void ExecuteCommand()
|
||||
TexPalette = ExecParams[0] & 0x1FFF;
|
||||
break;
|
||||
|
||||
case 0x40:
|
||||
case 0x40: // begin polygons
|
||||
PolygonMode = ExecParams[0] & 0x3;
|
||||
VertexNum = 0;
|
||||
VertexNumInPoly = 0;
|
||||
@ -1316,8 +1319,9 @@ void ExecuteCommand()
|
||||
CurPolygonAttr = PolygonAttr;
|
||||
break;
|
||||
|
||||
case 0x50:
|
||||
FlushRequest = 1;//0x80000000 | (ExecParams[0] & 0x3);
|
||||
case 0x50: // flush
|
||||
FlushRequest = 1;
|
||||
FlushAttributes = ExecParams[0] & 0x3;
|
||||
CycleCount = 392;
|
||||
break;
|
||||
|
||||
@ -1383,7 +1387,7 @@ void VBlank()
|
||||
{
|
||||
if (FlushRequest)
|
||||
{
|
||||
SoftRenderer::RenderFrame(CurVertexRAM, CurPolygonRAM, NumPolygons);
|
||||
SoftRenderer::RenderFrame(CurFlushAttributes, CurVertexRAM, CurPolygonRAM, NumPolygons);
|
||||
|
||||
CurRAMBank = CurRAMBank?0:1;
|
||||
CurVertexRAM = &VertexRAM[CurRAMBank ? 6144 : 0];
|
||||
@ -1393,10 +1397,11 @@ void VBlank()
|
||||
NumPolygons = 0;
|
||||
|
||||
FlushRequest = 0;
|
||||
CurFlushAttributes = FlushAttributes;
|
||||
}
|
||||
}
|
||||
|
||||
u8* GetLine(int line)
|
||||
u32* GetLine(int line)
|
||||
{
|
||||
return SoftRenderer::GetLine(line);
|
||||
}
|
||||
|
Reference in New Issue
Block a user