aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRSDuck <RSDuck@users.noreply.github.com>2021-01-26 19:05:21 +0100
committerRSDuck <RSDuck@users.noreply.github.com>2021-01-26 19:05:21 +0100
commit4a2806829574c6661c342e60e9430edb6d8b49dd (patch)
tree22cc04db5b54d732336456c2f6a5fc6a3be09fca
parentaceabe92e617bab8ebe24981fabe6a5f48285527 (diff)
the rasteriser doesn't have to be done on line 144
thanks to the VRAM cache
-rw-r--r--src/GPU.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/GPU.cpp b/src/GPU.cpp
index 40334de..e31b239 100644
--- a/src/GPU.cpp
+++ b/src/GPU.cpp
@@ -1124,6 +1124,14 @@ void StartScanline(u32 line)
{
if (VCount == 192)
{
+ // in reality rendering already finishes at line 144
+ // and games might already start to modify texture memory.
+ // That doesn't matter for us because we cache the entire
+ // texture memory anyway and only update it before the start
+ //of the next frame.
+ // So we can give the rasteriser a bit more headroom
+ GPU3D::VCount144();
+
// VBlank
DispStat[0] |= (1<<0);
DispStat[1] |= (1<<0);
@@ -1144,10 +1152,6 @@ void StartScanline(u32 line)
if (Accelerated) GLCompositor::RenderFrame();
#endif
}
- else if (VCount == 144)
- {
- GPU3D::VCount144();
- }
}
NDS::ScheduleEvent(NDS::Event_LCD, true, HBLANK_CYCLES, StartHBlank, line);