From fbadacae7880a904f1250e5db4beda36b453ee38 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 28 Mar 2025 17:24:36 +1000 Subject: [PATCH] CDROM: Fudge track autopause hold position Fudge the hold position by 2 sectors to reduce the number of GetlocP's that will return a MSF in the old track. Works around the music hang in Fighting Force. --- src/core/cdrom.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/cdrom.cpp b/src/core/cdrom.cpp index d89f82766..9925632d7 100644 --- a/src/core/cdrom.cpp +++ b/src/core/cdrom.cpp @@ -3318,7 +3318,10 @@ void CDROM::DoSectorRead() } else if (subq.track_number_bcd != s_state.play_track_number_bcd) { - // we don't want to update the position if the track changes, so we check it before reading the actual sector. + // Fudge the hold position by 2 sectors to reduce the number of GetlocP's that will return a MSF in the old track. + // Works around the music hang in Fighting Force. + SetHoldPosition(std::min(s_state.current_lba + 2, s_reader.GetMedia()->GetLBACount() - 1), + s_state.current_subq_lba); DEV_LOG("Auto pause at the start of track {:02x} (LBA {})", subq.track_number_bcd, s_state.current_lba); StopReadingWithDataEnd(); return;