GPU: Use correct clocks for NTSC region

Fixes sync drift in Bust-a-Move 1/2.
This commit is contained in:
Connor McLaughlin
2020-06-07 17:36:45 +10:00
parent abc627de9c
commit b4e45e865a
4 changed files with 76 additions and 17 deletions

View File

@ -170,11 +170,8 @@ public:
bool ConvertScreenCoordinatesToBeamTicksAndLines(s32 window_x, s32 window_y, u32* out_tick, u32* out_line) const;
protected:
static constexpr TickCount GPUTicksToSystemTicks(TickCount gpu_ticks)
{
// convert to master clock, rounding up as we want to overshoot not undershoot
return static_cast<TickCount>((static_cast<u32>(gpu_ticks) * 7u + 10u) / 11u);
}
TickCount GPUTicksToSystemTicks(TickCount gpu_ticks, TickCount fractional_ticks) const;
TickCount SystemTicksToGPUTicks(TickCount sysclk_ticks, TickCount* fractional_ticks) const;
// Helper/format conversion functions.
static constexpr u8 Convert5To8(u8 x5) { return (x5 << 3) | (x5 & 7); }
@ -326,6 +323,8 @@ protected:
void SoftReset();
// Sets dots per scanline
float ComputeHorizontalFrequency() const;
float ComputeVerticalFrequency() const;
void UpdateCRTCConfig();
void UpdateCRTCDisplayParameters();
@ -572,6 +571,7 @@ protected:
s32 y;
} m_drawing_offset = {};
bool m_console_is_pal = false;
bool m_set_texture_disable_mask = false;
bool m_drawing_area_changed = false;
bool m_force_progressive_scan = false;