summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2014-08-05 23:29:38 -0400
committerGravatar bunnei2014-08-06 18:20:01 -0400
commit7ada2625fe78b7bb75232282ead77786ca215d6e (patch)
treed5727af668a1f8b5311b898feda7ab705ee8cc81
parentThread: Added more descriptive comment to WaitCurrentThread. (diff)
downloadyuzu-7ada2625fe78b7bb75232282ead77786ca215d6e.tar.gz
yuzu-7ada2625fe78b7bb75232282ead77786ca215d6e.tar.xz
yuzu-7ada2625fe78b7bb75232282ead77786ca215d6e.zip
GPU: Updated horizontal sync line counter to use framebuffer height.
-rw-r--r--src/core/hw/gpu.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp
index 93b871470..7fb208e57 100644
--- a/src/core/hw/gpu.cpp
+++ b/src/core/hw/gpu.cpp
@@ -252,17 +252,18 @@ template void Write<u8>(u32 addr, const u8 data);
252 252
253/// Update hardware 253/// Update hardware
254void Update() { 254void Update() {
255 auto& framebuffer_top = g_regs.Get<Regs::FramebufferTop>();
255 u64 current_ticks = Core::g_app_core->GetTicks(); 256 u64 current_ticks = Core::g_app_core->GetTicks();
256 257
257 // Synchronize line... 258 // Synchronize line...
258 if ((current_ticks - g_last_ticks) >= GPU::kFrameTicks / 400) { 259 if ((current_ticks - g_last_ticks) >= GPU::kFrameTicks / framebuffer_top.height) {
259 GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PDC0); 260 GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PDC0);
260 g_cur_line++; 261 g_cur_line++;
261 g_last_ticks = current_ticks; 262 g_last_ticks = current_ticks;
262 } 263 }
263 264
264 // Synchronize frame... 265 // Synchronize frame...
265 if (g_cur_line >= 400) { 266 if (g_cur_line >= framebuffer_top.height) {
266 g_cur_line = 0; 267 g_cur_line = 0;
267 GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PDC1); 268 GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PDC1);
268 VideoCore::g_renderer->SwapBuffers(); 269 VideoCore::g_renderer->SwapBuffers();