diff options
| -rw-r--r-- | src/core/hw/gpu.cpp | 5 |
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 |
| 254 | void Update() { | 254 | void 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(); |