aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/GPU.cpp6
-rw-r--r--src/GPU2D.cpp8
-rw-r--r--src/GPU2D.h1
3 files changed, 13 insertions, 2 deletions
diff --git a/src/GPU.cpp b/src/GPU.cpp
index 5b9bf33..0e11af8 100644
--- a/src/GPU.cpp
+++ b/src/GPU.cpp
@@ -692,6 +692,12 @@ void StartScanline(u32 line)
// (TODO, eventually: emulate it properly)
NDS::CheckDMAs(0, 0x04);
+ if (line == 0)
+ {
+ GPU2D_A->VBlankEnd();
+ GPU2D_B->VBlankEnd();
+ }
+
// draw
GPU2D_A->DrawScanline(line);
GPU2D_B->DrawScanline(line);
diff --git a/src/GPU2D.cpp b/src/GPU2D.cpp
index 3717cf5..55c3e94 100644
--- a/src/GPU2D.cpp
+++ b/src/GPU2D.cpp
@@ -426,12 +426,16 @@ void GPU2D::DrawScanline(u32 line)
void GPU2D::VBlank()
{
+ CaptureCnt &= ~(1<<31);
+}
+
+void GPU2D::VBlankEnd()
+{
+ // TODO: find out the exact time this happens
BGXRefInternal[0] = BGXRef[0];
BGXRefInternal[1] = BGXRef[1];
BGYRefInternal[0] = BGYRef[0];
BGYRefInternal[1] = BGYRef[1];
-
- CaptureCnt &= ~(1<<31);
}
diff --git a/src/GPU2D.h b/src/GPU2D.h
index acbe967..9a0d102 100644
--- a/src/GPU2D.h
+++ b/src/GPU2D.h
@@ -38,6 +38,7 @@ public:
void DrawScanline(u32 line);
void VBlank();
+ void VBlankEnd();
void BGExtPalDirty(u32 base);
void OBJExtPalDirty();