only start display capture on first line

fixes Spearpillar in Pokemon D/P/Pt
also fixes #782 and #474
This commit is contained in:
RSDuck 2020-12-09 22:45:16 +01:00
parent b6de3cc638
commit e34ce013df
3 changed files with 10 additions and 2 deletions

View File

@ -581,7 +581,11 @@ void GPU2D::UpdateMosaicCounters(u32 line)
void GPU2D::VBlank()
{
CaptureCnt &= ~(1<<31);
if (CaptureLatch)
{
CaptureCnt &= ~(1<<31);
CaptureLatch = false;
}
DispFIFOReadPtr = 0;
DispFIFOWritePtr = 0;

View File

@ -110,6 +110,7 @@ protected:
u8 EVA, EVB;
u8 EVY;
bool CaptureLatch;
u32 CaptureCnt;
u16 MasterBrightness;

View File

@ -213,6 +213,9 @@ void GPU2D_Soft::DrawScanline(u32 line)
}
}
if (line == 0 && CaptureCnt & (1 << 31))
CaptureLatch = true;
// always render regular graphics
DrawScanline_BGOBJ(line);
UpdateMosaicCounters(line);
@ -278,7 +281,7 @@ void GPU2D_Soft::DrawScanline(u32 line)
}
// capture
if ((Num == 0) && (CaptureCnt & (1<<31)))
if ((Num == 0) && CaptureLatch)
{
u32 capwidth, capheight;
switch ((CaptureCnt >> 20) & 0x3)