Skip to content

Commit

Permalink
Merge pull request #17 from israpps/patch-1
Browse files Browse the repository at this point in the history
Enhanced IRX loader conditions
  • Loading branch information
Wolf3s authored Nov 9, 2023
2 parents 53d566a + 1cb7fb0 commit 5d3a70d
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions engine/src/ps2/irx/irx_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,29 +109,29 @@ int IrxLoader::applyRpcPatches() {
void IrxLoader::loadLibsd(const bool& verbose) {
if (verbose) TYRA_LOG("IRX: Loading libsd...");

int ret;
SifExecModuleBuffer(&libsd_irx, size_libsd_irx, 0, nullptr, &ret);
TYRA_ASSERT(ret >= 0, "Failed to load module: libsd_irx");
int ret, irx_id;
irx_id = SifExecModuleBuffer(&libsd_irx, size_libsd_irx, 0, nullptr, &ret);
TYRA_ASSERT(((ret != 1) || (irx_id < 0)), "Failed to load module: libsd_irx");

if (verbose) TYRA_LOG("IRX: Libsd loaded!");
}

void IrxLoader::loadUsbModules(const bool& verbose) {
if (verbose) TYRA_LOG("IRX: Loading usb modules...");

int ret;
int ret, irx_id;

SifExecModuleBuffer(&usbd_irx, size_usbd_irx, 0, nullptr, &ret);
TYRA_ASSERT(ret >= 0, "Failed to load module: usbd_irx");
irx_id = SifExecModuleBuffer(&usbd_irx, size_usbd_irx, 0, nullptr, &ret);
TYRA_ASSERT(((ret != 1) || (irx_id < 0)), "Failed to load module: usbd_irx ret:", ret, ", id:", irx_id);

SifExecModuleBuffer(&bdm_irx, size_bdm_irx, 0, nullptr, &ret);
TYRA_ASSERT(ret >= 0, "Failed to load module: bdm_irx");
irx_id = SifExecModuleBuffer(&bdm_irx, size_bdm_irx, 0, nullptr, &ret);
TYRA_ASSERT(((ret != 1) || (irx_id < 0)), "Failed to load module: bdm_irx ret:", ret, ", id:", irx_id);

SifExecModuleBuffer(&bdmfs_fatfs_irx, size_bdmfs_fatfs_irx, 0, nullptr, &ret);
TYRA_ASSERT(ret >= 0, "Failed to load module: bdmfs_fatfs");
irx_id = SifExecModuleBuffer(&bdmfs_fatfs_irx, size_bdmfs_fatfs_irx, 0, nullptr, &ret);
TYRA_ASSERT(((ret != 1) || (irx_id < 0)), "Failed to load module: bdmfs_fatfs ret:", ret, ", id:", irx_id);

SifExecModuleBuffer(&usbmass_bd_irx, size_usbmass_bd_irx, 0, nullptr, &ret);
TYRA_ASSERT(ret >= 0, "Failed to load module: usbmass");
irx_id = SifExecModuleBuffer(&usbmass_bd_irx, size_usbmass_bd_irx, 0, nullptr, &ret);
TYRA_ASSERT(((ret != 1) || (irx_id < 0)), "Failed to load module: usbmass ret:", ret, ", id:", irx_id);

waitUntilUsbDeviceIsReady();

Expand All @@ -141,29 +141,29 @@ void IrxLoader::loadUsbModules(const bool& verbose) {
void IrxLoader::loadAudsrv(const bool& verbose) {
if (verbose) TYRA_LOG("IRX: Loading audsrv...");

int ret;
SifExecModuleBuffer(&audsrv_irx, size_audsrv_irx, 0, nullptr, &ret);
TYRA_ASSERT(ret >= 0, "Failed to load module: audsrv_irx");
int ret, irx_id;
irx_id = SifExecModuleBuffer(&audsrv_irx, size_audsrv_irx, 0, nullptr, &ret);
TYRA_ASSERT(((ret != 1) || (irx_id < 0)), "Failed to load module: audsrv_irx ret:", ret, ", id:", irx_id);

if (verbose) TYRA_LOG("IRX: Audsrv loaded!");
}

void IrxLoader::loadSio2man(const bool& verbose) {
if (verbose) TYRA_LOG("IRX: Loading sio2man...");

int ret;
SifExecModuleBuffer(&sio2man_irx, size_sio2man_irx, 0, nullptr, &ret);
TYRA_ASSERT(ret >= 0, "Failed to load module: sio2man_irx");
int ret, irx_id;
irx_id = SifExecModuleBuffer(&sio2man_irx, size_sio2man_irx, 0, nullptr, &ret);
TYRA_ASSERT(((ret != 1) || (irx_id < 0)), "Failed to load module: sio2man_irx ret:", ret, ", id:", irx_id);

if (verbose) TYRA_LOG("IRX: Sio2man loaded!");
}

void IrxLoader::loadPadman(const bool& verbose) {
if (verbose) TYRA_LOG("IRX: Loading padman...");

int ret;
SifExecModuleBuffer(&padman_irx, size_padman_irx, 0, nullptr, &ret);
TYRA_ASSERT(ret >= 0, "Failed to load module: padman_irx");
int ret, irx_id;
irx_id = SifExecModuleBuffer(&padman_irx, size_padman_irx, 0, nullptr, &ret);
TYRA_ASSERT(((ret != 1) || (irx_id < 0)), "Failed to load module: padman_irx ret:", ret, ", id:", irx_id);

if (verbose) TYRA_LOG("IRX: Padman loaded!");
}
Expand Down

0 comments on commit 5d3a70d

Please sign in to comment.