From 7f9d9b81aaaa1e2c58c93732997c4ad3745e888c Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Tue, 12 Jul 2022 15:33:11 +0200 Subject: [PATCH] gdrom: don't reset current cdda sector on cd_play if already playing Issue #690 --- core/hw/gdrom/gdromv3.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/hw/gdrom/gdromv3.cpp b/core/hw/gdrom/gdromv3.cpp index d6ed9d1a2..f06ca1ee7 100644 --- a/core/hw/gdrom/gdromv3.cpp +++ b/core/hw/gdrom/gdromv3.cpp @@ -841,11 +841,8 @@ void gd_process_spi_cmd() if (param_type == 1 || param_type == 2) { - cdda.status = cdda_t::Playing; - SecNumber.Status = GD_PLAY; - bool min_sec_frame = param_type == 2; - cdda.StartAddr.FAD = cdda.CurrAddr.FAD = GetFAD(&packet_cmd.data_8[2], min_sec_frame); + cdda.StartAddr.FAD = GetFAD(&packet_cmd.data_8[2], min_sec_frame); cdda.EndAddr.FAD = GetFAD(&packet_cmd.data_8[8], min_sec_frame); if (cdda.EndAddr.FAD == 0) { @@ -856,6 +853,11 @@ void gd_process_spi_cmd() cdda.EndAddr.FAD = ses_inf[3] << 16 | ses_inf[4] << 8 | ses_inf[5]; } cdda.repeats = packet_cmd.data_8[6] & 0xF; + if (cdda.status == cdda_t::Terminated || cdda.CurrAddr.FAD < cdda.StartAddr.FAD || cdda.CurrAddr.FAD > cdda.EndAddr.FAD) + cdda.CurrAddr.FAD = cdda.StartAddr.FAD; + cdda.status = cdda_t::Playing; + SecNumber.Status = GD_PLAY; + GDStatus.DSC = 1; } else if (param_type == 7)