Skip to content

Commit

Permalink
Report a successful registration of cdrom_stm IOMAN driver.
Browse files Browse the repository at this point in the history
Allows proper initialization of CDVD ST module.
  • Loading branch information
jpd002 committed Oct 16, 2024
1 parent e70ee16 commit d2419ab
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions Source/iop/Iop_Ioman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,14 +517,30 @@ int32 CIoman::AddDrv(CMIPS& context)
auto deviceName = device->namePtr ? reinterpret_cast<const char*>(m_ram + device->namePtr) : nullptr;
FRAMEWORK_MAYBE_UNUSED auto deviceDesc = device->descPtr ? reinterpret_cast<const char*>(m_ram + device->descPtr) : nullptr;
CLog::GetInstance().Print(LOG_NAME, "Requested registration of device '%s'.\r\n", deviceName);
//We only support "cdfs" & "dev9x" for now
if(!deviceName || (strcmp(deviceName, "cdfs") && strcmp(deviceName, "dev9x")))
if(!deviceName)
{
return -1;
}
m_userDevices.insert(std::make_pair(deviceName, devicePtr));
InvokeUserDeviceMethod(context, devicePtr, offsetof(Ioman::DEVICEOPS, initPtr), devicePtr);
return 0;

//We only allow "cdfs" & "dev9x" for now
static std::set<std::string> allowedDevices = {"cdfs", "dev9x"};
if(allowedDevices.count(deviceName))
{
m_userDevices.insert(std::make_pair(deviceName, devicePtr));
InvokeUserDeviceMethod(context, devicePtr, offsetof(Ioman::DEVICEOPS, initPtr), devicePtr);
return 0;
}

//We will report to "cdrom_stm" that registration succeeded, but we don't actually
//add it to our device list.
static std::set<std::string> silentDevices = {"cdrom_stm"};
if(silentDevices.count(deviceName))
{
return 0;
}

//If we get here, we failed.
return -1;
}

uint32 CIoman::DelDrv(uint32 drvNamePtr)
Expand Down

0 comments on commit d2419ab

Please sign in to comment.