diff options
Diffstat (limited to 'backends/platform/ps2/irxboot.cpp')
-rw-r--r-- | backends/platform/ps2/irxboot.cpp | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/backends/platform/ps2/irxboot.cpp b/backends/platform/ps2/irxboot.cpp index 91c45294c6..fa3e047bf6 100644 --- a/backends/platform/ps2/irxboot.cpp +++ b/backends/platform/ps2/irxboot.cpp @@ -33,54 +33,53 @@ #include "backends/platform/ps2/irxboot.h" #include "backends/platform/ps2/ps2debug.h" +#include "ps2temp.h" + static const char hddArg[] = "-o" "\0" "8" "\0" "-n" "\0" "20"; static const char pfsArg[] = "-m" "\0" "2" "\0" "-o" "\0" "32" "\0" "-n" "\0" "72"; // "\0" "-debug"; +static const char netArg[] = "192.168.0.10" "\0" "255.255.255.0" "\0" "192.168.0.1"; IrxFile irxFiles[] = { { "SIO2MAN", BIOS, NOTHING, NULL, 0 }, - { "MCMAN", BIOS, NOTHING, NULL, 0 }, + { "MCMAN", BIOS, NOTHING, NULL, 0 }, { "MCSERV", BIOS, NOTHING, NULL, 0 }, { "PADMAN", BIOS, NOTHING, NULL, 0 }, { "LIBSD", BIOS, NOTHING, NULL, 0 }, - { "IOMANX.IRX", SYSTEM /*| NOT_HOST*/, NOTHING, NULL, 0 }, // already loaded by ps2link + { "IOMANX.IRX", SYSTEM, NOTHING, NULL, 0 }, { "FILEXIO.IRX", SYSTEM, NOTHING, NULL, 0 }, { "CODYVDFS.IRX", SYSTEM, NOTHING, NULL, 0 }, { "SJPCM.IRX", SYSTEM, NOTHING, NULL, 0 }, { "USBD.IRX", USB | OPTIONAL | DEPENDANCY, USB_DRIVER, NULL, 0 }, + { "USB_MASS.IRX", USB | OPTIONAL, MASS_DRIVER, NULL, 0 }, { "PS2MOUSE.IRX", USB | OPTIONAL, MOUSE_DRIVER, NULL, 0 }, { "RPCKBD.IRX", USB | OPTIONAL, KBD_DRIVER, NULL, 0 }, - { "USBHDFSD.IRX", USB | OPTIONAL, MASS_DRIVER, NULL, 0 }, - { "PS2DEV9.IRX", HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, NULL, 0 }, + { "POWEROFF.IRX", HDD | OPTIONAL | NOT_HOST | DEPENDANCY, HDD_DRIVER, NULL, 0 }, + { "PS2DEV9.IRX", HDD | OPTIONAL | NOT_HOST | DEPENDANCY, HDD_DRIVER, NULL, 0 }, { "PS2ATAD.IRX", HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, NULL, 0 }, { "PS2HDD.IRX", HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, hddArg, sizeof(hddArg) }, { "PS2FS.IRX", HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, pfsArg, sizeof(pfsArg) }, - { "POWEROFF.IRX", HDD | OPTIONAL | DEPENDANCY, HDD_DRIVER, NULL, 0 } + { "PS2IP.IRX", NET | NOT_HOST, NET_DRIVER, NULL, 0 }, + { "PS2SMAP.IRX", NET | NOT_HOST, NET_DRIVER, netArg, sizeof(netArg) }, + { "PS2HOST.IRX", NET | NOT_HOST, NET_DRIVER, NULL, 0 } }; static const int numIrxFiles = sizeof(irxFiles) / sizeof(irxFiles[0]); -BootDevice detectBootPath(const char *elfPath, char *bootPath) { - - BootDevice device; - - if (strncasecmp(elfPath, "cdrom0:", 7) == 0) - device = CDROM; - else if (strncasecmp(elfPath, "host", 4) == 0) - device = HOST; - else - device = OTHER; +PS2Device detectBootPath(const char *elfPath, char *bootPath) { - sioprintf("elf path: %s, device %d\n", elfPath, device); + PS2Device device = _getDev(elfPath); + printf("elf path: %s, device %d\n", elfPath, device); + strcpy(bootPath, elfPath); char *pathPos = bootPath; char seperator; - if (device == CDROM) { + if (device == CD_DEV) { // CDVD uses '\' as seperator while (*pathPos) { if (*pathPos == '/') @@ -102,7 +101,7 @@ BootDevice detectBootPath(const char *elfPath, char *bootPath) { pathPos = strchr(bootPath, ':'); if (pathPos) { - if ((pathPos[0] == ':') && (device == CDROM)) { + if ((pathPos[0] == ':') && (device == CD_DEV)) { pathPos[1] = '\\'; pathPos[2] = '\0'; } else @@ -111,19 +110,19 @@ BootDevice detectBootPath(const char *elfPath, char *bootPath) { } else { sioprintf("path not recognized, default to host.\n"); strcpy(bootPath, "host:"); - device = UNKNOWN; + device = HOST_DEV; // UNKNOWN; } return device; } -int loadIrxModules(int device, const char *irxPath, IrxReference **modules) { +int loadIrxModules(int device, const char *irxPath, IrxReference **modules) { IrxReference *resModules = (IrxReference *)malloc(numIrxFiles * sizeof(IrxReference)); IrxReference *curModule = resModules; for (int i = 0; i < numIrxFiles; i++) { curModule->fileRef = irxFiles + i; - if ((device == HOST) && (irxFiles[i].flags & NOT_HOST)) + if ((device == HOST_DEV) && (irxFiles[i].flags & NOT_HOST)) continue; if ((irxFiles[i].flags & TYPEMASK) == BIOS) { @@ -139,7 +138,7 @@ int loadIrxModules(int device, const char *irxPath, IrxReference **modules) { curModule->loc = IRX_BUFFER; curModule->path = (char *)malloc(256); - sprintf(curModule->path, "%s%s%s", irxPath, irxFiles[i].name, (device == CDROM) ? ";1" : ""); + sprintf(curModule->path, "%s%s%s", irxPath, irxFiles[i].name, (device == CD_DEV) ? ";1" : ""); int fd = fioOpen(curModule->path, O_RDONLY); if (fd < 0) { // IRX not found @@ -159,7 +158,7 @@ int loadIrxModules(int device, const char *irxPath, IrxReference **modules) { // we simply can't find it. sioprintf("Can't open %s: %d\n", curModule->path, fd); // restore the path where we originally expected the file, for error message (later, after boot up) - sprintf(curModule->path, "%s%s%s", irxPath, irxFiles[i].name, (device == CDROM) ? ";1" : ""); + sprintf(curModule->path, "%s%s%s", irxPath, irxFiles[i].name, (device == CD_DEV) ? ";1" : ""); } } } |