GPU2D: hardware renders sprites one scanline in advance.

fixes #375 (midframe OAM update)
This commit is contained in:
Arisotura
2019-06-10 03:05:26 +02:00
parent 9ab331c6dd
commit d28035674a
3 changed files with 63 additions and 120 deletions

View File

@ -871,12 +871,24 @@ void StartHBlank(u32 line)
GPU2D_B->DrawScanline(line);
}
// sprites are pre-rendered one scanline in advance
if (line < 191)
{
GPU2D_A->DrawSprites(line+1);
GPU2D_B->DrawSprites(line+1);
}
NDS::CheckDMAs(0, 0x02);
}
else if (VCount == 215)
{
GPU3D::VCount215();
}
else if (VCount == 262)
{
GPU2D_A->DrawSprites(0);
GPU2D_B->DrawSprites(0);
}
if (DispStat[0] & (1<<4)) NDS::SetIRQ(0, NDS::IRQ_HBlank);
if (DispStat[1] & (1<<4)) NDS::SetIRQ(1, NDS::IRQ_HBlank);