diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index 504c97e1d..344369299 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -36,7 +36,6 @@ bool GPU::Initialize(HostDisplay* host_display, System* system, DMA* dma, Interr void GPU::UpdateSettings() { m_force_progressive_scan = m_system->GetSettings().display_force_progressive_scan; - UpdateCRTCConfig(); } void GPU::Reset() @@ -336,7 +335,6 @@ void GPU::UpdateCRTCConfig() const float vertical_frequency = static_cast(static_cast((u64(MASTER_CLOCK) * 11) / 7) / static_cast(ticks_per_frame)); m_system->SetThrottleFrequency(vertical_frequency); - m_tick_event->SetInterval(cs.horizontal_total); const u8 horizontal_resolution_index = m_GPUSTAT.horizontal_resolution_1 | (m_GPUSTAT.horizontal_resolution_2 << 2); cs.dot_clock_divider = dot_clock_dividers[horizontal_resolution_index]; @@ -431,6 +429,8 @@ void GPU::UpdateCRTCConfig() Log_DevPrintf("Padding: Left=%u, Top=%u, Right=%u, Bottom=%u", cs.active_display_left, cs.active_display_top, cs.visible_display_width - cs.active_display_width - cs.active_display_left, cs.visible_display_height - cs.active_display_height - cs.active_display_top); + + UpdateSliceTicks(); } static TickCount GPUTicksToSystemTicks(TickCount gpu_ticks) @@ -563,14 +563,9 @@ void GPU::Execute(TickCount ticks) // switch fields for interlaced modes if (m_GPUSTAT.vertical_interlace) - { m_GPUSTAT.interlaced_field ^= true; - m_crtc_state.current_scanline = BoolToUInt32(!m_GPUSTAT.interlaced_field); - } else - { m_GPUSTAT.interlaced_field = false; - } } } @@ -666,8 +661,8 @@ void GPU::WriteGP1(u32 value) { const bool disable = ConvertToBoolUnchecked(value & 0x01); Log_DebugPrintf("Display %s", disable ? "disabled" : "enabled"); + m_tick_event->InvokeEarly(); m_GPUSTAT.display_disable = disable; - UpdateCRTCConfig(); } break; diff --git a/src/core/system.cpp b/src/core/system.cpp index dd2b08862..e9d40ea2c 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -2,6 +2,7 @@ #include "bios.h" #include "bus.h" #include "cdrom.h" +#include "common/audio_stream.h" #include "common/log.h" #include "common/state_wrapper.h" #include "controller.h" @@ -457,8 +458,6 @@ void System::UpdateThrottlePeriod() { m_throttle_period = static_cast(1000000000.0 / static_cast(m_throttle_frequency) / static_cast(GetSettings().emulation_speed)); - m_last_throttle_time = 0; - m_throttle_timer.Reset(); } void System::Throttle() @@ -486,6 +485,7 @@ void System::Throttle() #endif m_last_throttle_time = 0; m_throttle_timer.Reset(); + m_host_interface->GetAudioStream()->EmptyBuffers(); } else if (sleep_time >= MINIMUM_SLEEP_TIME && sleep_time <= m_throttle_period) {