handle changed VCount+threaded rasteriser more gracefully
This commit is contained in:
parent
f86ba0fcb3
commit
f792d3e6a1
|
@ -1061,6 +1061,12 @@ void FinishFrame(u32 lines)
|
||||||
AssignFramebuffers();
|
AssignFramebuffers();
|
||||||
|
|
||||||
TotalScanlines = lines;
|
TotalScanlines = lines;
|
||||||
|
|
||||||
|
if (GPU3D::AbortFrame)
|
||||||
|
{
|
||||||
|
GPU3D::RestartFrame();
|
||||||
|
GPU3D::AbortFrame = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartScanline(u32 line)
|
void StartScanline(u32 line)
|
||||||
|
@ -1180,6 +1186,7 @@ void SetVCount(u16 val)
|
||||||
// 3D engine seems to give up on the current frame in that situation, repeating the last two scanlines
|
// 3D engine seems to give up on the current frame in that situation, repeating the last two scanlines
|
||||||
// TODO: also check the various DMA types that can be involved
|
// TODO: also check the various DMA types that can be involved
|
||||||
|
|
||||||
|
GPU3D::AbortFrame |= NextVCount != val;
|
||||||
NextVCount = val;
|
NextVCount = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -275,6 +275,8 @@ u32 FlushAttributes;
|
||||||
|
|
||||||
std::unique_ptr<GPU3D::Renderer3D> CurrentRenderer = {};
|
std::unique_ptr<GPU3D::Renderer3D> CurrentRenderer = {};
|
||||||
|
|
||||||
|
bool AbortFrame;
|
||||||
|
|
||||||
bool Init()
|
bool Init()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -380,6 +382,8 @@ void Reset()
|
||||||
ResetRenderingState();
|
ResetRenderingState();
|
||||||
|
|
||||||
RenderXPos = 0;
|
RenderXPos = 0;
|
||||||
|
|
||||||
|
AbortFrame = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoSavestate(Savestate* file)
|
void DoSavestate(Savestate* file)
|
||||||
|
@ -621,6 +625,8 @@ void DoSavestate(Savestate* file)
|
||||||
|
|
||||||
file->Bool32(&UseShininessTable);
|
file->Bool32(&UseShininessTable);
|
||||||
file->VarArray(ShininessTable, 128*sizeof(u8));
|
file->VarArray(ShininessTable, 128*sizeof(u8));
|
||||||
|
|
||||||
|
file->Bool32(&AbortFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2611,6 +2617,8 @@ u32 ScrolledLine[256];
|
||||||
|
|
||||||
u32* GetLine(int line)
|
u32* GetLine(int line)
|
||||||
{
|
{
|
||||||
|
if (!AbortFrame)
|
||||||
|
{
|
||||||
u32* rawline = CurrentRenderer->GetLine(line);
|
u32* rawline = CurrentRenderer->GetLine(line);
|
||||||
|
|
||||||
if (RenderXPos == 0) return rawline;
|
if (RenderXPos == 0) return rawline;
|
||||||
|
@ -2633,6 +2641,11 @@ u32* GetLine(int line)
|
||||||
for (; i < 256; i++)
|
for (; i < 256; i++)
|
||||||
ScrolledLine[i] = 0;
|
ScrolledLine[i] = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
memset(ScrolledLine, 0, 256*4);
|
||||||
|
}
|
||||||
|
|
||||||
return ScrolledLine;
|
return ScrolledLine;
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,6 +97,8 @@ extern u16 RenderXPos;
|
||||||
extern std::array<Polygon*,2048> RenderPolygonRAM;
|
extern std::array<Polygon*,2048> RenderPolygonRAM;
|
||||||
extern u32 RenderNumPolygons;
|
extern u32 RenderNumPolygons;
|
||||||
|
|
||||||
|
extern bool AbortFrame;
|
||||||
|
|
||||||
extern u64 Timestamp;
|
extern u64 Timestamp;
|
||||||
|
|
||||||
bool Init();
|
bool Init();
|
||||||
|
|
Loading…
Reference in New Issue