From dcf5444accd771e31caaef00144127ade397c86d Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Sun, 2 Feb 2020 21:15:53 +0100 Subject: [PATCH] stop cdda when reading sector --- core/hw/gdrom/gdromv3.cpp | 7 +++---- core/reios/gdrom_hle.cpp | 3 +++ core/reios/gdrom_hle.h | 5 ----- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/core/hw/gdrom/gdromv3.cpp b/core/hw/gdrom/gdromv3.cpp index 0ba77f87b..62ce31f98 100644 --- a/core/hw/gdrom/gdromv3.cpp +++ b/core/hw/gdrom/gdromv3.cpp @@ -432,7 +432,7 @@ void gd_process_ata_cmd() break; default: - die("Unknown ATA command..."); + ERROR_LOG(GDROM, "Unknown ATA command %x", ata_cmd.command); break; }; } @@ -505,9 +505,7 @@ void gd_process_spi_cmd() printf_spicmd("SPI_TEST_UNIT"); GDStatus.CHECK=SecNumber.Status==GD_BUSY; // Drive is ready ;) -// sns_key=0; -// sns_asc=0; -// sns_ascq=0; + cdda.playing = false; gd_set_state(gds_procpacketdone); break; @@ -523,6 +521,7 @@ void gd_process_spi_cmd() { #define readcmd packet_cmd.GDReadBlock + cdda.playing = false; u32 sector_type=2048; if (readcmd.head ==1 && readcmd.subh==1 && readcmd.data==1 && readcmd.expdtype==3 && readcmd.other==0) sector_type=2340; diff --git a/core/reios/gdrom_hle.cpp b/core/reios/gdrom_hle.cpp index 58d9e6c66..28b3115a3 100644 --- a/core/reios/gdrom_hle.cpp +++ b/core/reios/gdrom_hle.cpp @@ -286,14 +286,17 @@ static void GD_HLE_Command(u32 cc) DEBUG_LOG(REIOS, "GDROM: CMD INIT"); gd_hle_state.multi_callback = 0; gd_hle_state.multi_read_count = 0; + cdda.playing = false; break; case GDCC_PIOREAD: GDROM_HLE_ReadPIO(); SecNumber.Status = GD_STANDBY; + cdda.playing = false; break; case GDCC_DMAREAD: + cdda.playing = false; if (gd_hle_state.xfer_end_time == 0) GDROM_HLE_ReadDMA(); if (gd_hle_state.xfer_end_time > 0) diff --git a/core/reios/gdrom_hle.h b/core/reios/gdrom_hle.h index 0c70f78c3..b2ed3f1fd 100644 --- a/core/reios/gdrom_hle.h +++ b/core/reios/gdrom_hle.h @@ -44,11 +44,6 @@ #define MISC_INIT 0x00 #define MISC_SETVECTOR 0x01 -#define CTOC_LBA(n) (n) -#define CTOC_ADR(n) ((n)<<24) -#define CTOC_CTRL(n) ((n)<<28) -#define CTOC_TRACK(n) ((n)<<16) - void gdrom_hle_op(); typedef enum { BIOS_ERROR = -1, BIOS_INACTIVE, BIOS_ACTIVE, BIOS_COMPLETED, BIOS_DATA_AVAIL } gd_bios_status;