From 363a4079aa85ea3df82dc02a103546a7964a0c10 Mon Sep 17 00:00:00 2001 From: KrahJohlito Date: Wed, 18 Sep 2024 14:34:15 +0930 Subject: [PATCH] sf --- modules/iopcore/cdvdman/device-bdm.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/iopcore/cdvdman/device-bdm.c b/modules/iopcore/cdvdman/device-bdm.c index a2e1c2567..544e6c67f 100644 --- a/modules/iopcore/cdvdman/device-bdm.c +++ b/modules/iopcore/cdvdman/device-bdm.c @@ -14,7 +14,7 @@ extern struct cdvdman_settings_bdm cdvdman_settings; static struct block_device *g_bd = NULL; static u32 g_bd_sectors_per_sector = 4; -static int bdm_io_sema; +static int bdm_io_sema, deviceReady; extern struct irx_export_table _exp_bdm; @@ -76,7 +76,8 @@ void DeviceDeinit(void) int DeviceReady(void) { - // DPRINTF("%s\n", __func__); + DPRINTF("%s\n", __func__); + deviceReady = (g_bd == NULL) ? 0 : 1; return (g_bd == NULL) ? SCECdNotReady : SCECdComplete; } @@ -115,7 +116,7 @@ int DeviceReadSectors(u32 lsn, void *buffer, unsigned int sectors) // DPRINTF("%s(%u, 0x%p, %u)\n", __func__, (unsigned int)lsn, buffer, sectors); - if (g_bd == NULL || bd->devNr != cdvdman_settings.bdDeviceId) + if (g_bd == NULL || deviceReady) return SCECdErTRMOPN; WaitSema(bdm_io_sema);