Skip to content

Commit

Permalink
sf
Browse files Browse the repository at this point in the history
  • Loading branch information
KrahJohlito committed Sep 18, 2024
1 parent 99152f0 commit 363a407
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/iopcore/cdvdman/device-bdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 363a407

Please sign in to comment.