mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 21:37:42 -07:00
fix that bug where NSMB's backgrounds lagged one frame behind
This commit is contained in:
parent
08a634371a
commit
cc86aa57ae
@ -692,6 +692,12 @@ void StartScanline(u32 line)
|
|||||||
// (TODO, eventually: emulate it properly)
|
// (TODO, eventually: emulate it properly)
|
||||||
NDS::CheckDMAs(0, 0x04);
|
NDS::CheckDMAs(0, 0x04);
|
||||||
|
|
||||||
|
if (line == 0)
|
||||||
|
{
|
||||||
|
GPU2D_A->VBlankEnd();
|
||||||
|
GPU2D_B->VBlankEnd();
|
||||||
|
}
|
||||||
|
|
||||||
// draw
|
// draw
|
||||||
GPU2D_A->DrawScanline(line);
|
GPU2D_A->DrawScanline(line);
|
||||||
GPU2D_B->DrawScanline(line);
|
GPU2D_B->DrawScanline(line);
|
||||||
|
@ -426,12 +426,16 @@ void GPU2D::DrawScanline(u32 line)
|
|||||||
|
|
||||||
void GPU2D::VBlank()
|
void GPU2D::VBlank()
|
||||||
{
|
{
|
||||||
|
CaptureCnt &= ~(1<<31);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GPU2D::VBlankEnd()
|
||||||
|
{
|
||||||
|
// TODO: find out the exact time this happens
|
||||||
BGXRefInternal[0] = BGXRef[0];
|
BGXRefInternal[0] = BGXRef[0];
|
||||||
BGXRefInternal[1] = BGXRef[1];
|
BGXRefInternal[1] = BGXRef[1];
|
||||||
BGYRefInternal[0] = BGYRef[0];
|
BGYRefInternal[0] = BGYRef[0];
|
||||||
BGYRefInternal[1] = BGYRef[1];
|
BGYRefInternal[1] = BGYRef[1];
|
||||||
|
|
||||||
CaptureCnt &= ~(1<<31);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ public:
|
|||||||
|
|
||||||
void DrawScanline(u32 line);
|
void DrawScanline(u32 line);
|
||||||
void VBlank();
|
void VBlank();
|
||||||
|
void VBlankEnd();
|
||||||
|
|
||||||
void BGExtPalDirty(u32 base);
|
void BGExtPalDirty(u32 base);
|
||||||
void OBJExtPalDirty();
|
void OBJExtPalDirty();
|
||||||
|
Loading…
Reference in New Issue
Block a user