Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IRX load assertion #18

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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