Parcourir la source

GPU: Updated horizontal sync line counter to use framebuffer height.

bunnei il y a 12 ans
Parent
commit
7ada2625fe
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      src/core/hw/gpu.cpp

+ 3 - 2
src/core/hw/gpu.cpp

@@ -252,17 +252,18 @@ template void Write<u8>(u32 addr, const u8 data);
 
 /// Update hardware
 void Update() {
+    auto& framebuffer_top = g_regs.Get<Regs::FramebufferTop>();
     u64 current_ticks = Core::g_app_core->GetTicks();
 
     // Synchronize line...
-    if ((current_ticks - g_last_ticks) >= GPU::kFrameTicks / 400) {
+    if ((current_ticks - g_last_ticks) >= GPU::kFrameTicks / framebuffer_top.height) {
         GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PDC0);
         g_cur_line++;
         g_last_ticks = current_ticks;
     }
 
     // Synchronize frame...
-    if (g_cur_line >= 400) {
+    if (g_cur_line >= framebuffer_top.height) {
         g_cur_line = 0;
         GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::PDC1);
         VideoCore::g_renderer->SwapBuffers();