diff --git a/Makefile b/Makefile index cb8ec1008..181fdc635 100644 --- a/Makefile +++ b/Makefile @@ -68,7 +68,7 @@ FRONTEND_OBJS = pad.o xparam.o fntsys.o renderman.o menusys.o OSDHistory.o syste appsupport.o gui.o guigame.o textures.o opl.o atlas.o nbns.o httpclient.o gsm.o cheatman.o sound.o ps2cnf.o IOP_OBJS = iomanx.o filexio.o ps2fs.o usbd.o bdmevent.o \ - bdm.o bdmfs_fatfs.o usbmass_bd.o iLinkman.o IEEE1394_bd.o mx4sio_bd.o \ + bdm.o bdmfs_fatfs.o usbmass_bd.o usbmass_bd_single.o iLinkman.o IEEE1394_bd.o mx4sio_bd.o \ ps2atad.o hdpro_atad.o poweroff.o ps2hdd.o xhdd.o genvmc.o lwnbdsvr.o \ ps2dev9.o smsutils.o ps2ip.o smap.o isofs.o nbns-iop.o \ sio2man.o padman.o mcman.o mcserv.o \ @@ -520,6 +520,9 @@ ifeq ($(DEBUG),1) $(EE_ASM_DIR)usbmass_bd.c: $(PS2SDK)/iop/irx/usbmass_bd.irx | $(EE_ASM_DIR) $(BIN2C) $< $@ $(*F)_irx +$(EE_ASM_DIR)usbmass_bd_single.c: modules/usbmass_bd_single.irx | $(EE_ASM_DIR) + $(BIN2C) $< $@ $(*F)_irx + $(EE_ASM_DIR)IEEE1394_bd.c: $(PS2SDK)/iop/irx/IEEE1394_bd.irx | $(EE_ASM_DIR) $(BIN2C) $< $@ $(*F)_irx @@ -530,6 +533,9 @@ else $(EE_ASM_DIR)usbmass_bd.c: $(PS2SDK)/iop/irx/usbmass_bd_mini.irx | $(EE_ASM_DIR) $(BIN2C) $< $@ $(*F)_irx +$(EE_ASM_DIR)usbmass_bd_single.c: modules/usbmass_bd_mini_single.irx | $(EE_ASM_DIR) + $(BIN2C) $< $@ $(*F)_irx + $(EE_ASM_DIR)IEEE1394_bd.c: $(PS2SDK)/iop/irx/IEEE1394_bd_mini.irx | $(EE_ASM_DIR) $(BIN2C) $< $@ $(*F)_irx diff --git a/ee_core/src/main.c b/ee_core/src/main.c index 2d517589c..fcc47e7e8 100644 --- a/ee_core/src/main.c +++ b/ee_core/src/main.c @@ -45,7 +45,7 @@ static int eecoreInit(int argc, char **argv) config->GameMode = BDM_ILK_MODE; else if (!_strncmp(config->GameModeDesc, "BDM_M4S_MODE", 12)) config->GameMode = BDM_M4S_MODE; - else if (!_strncmp(config->GameModeDesc, "BDM_USB_MODE", 12)) + else if (!_strncmp(config->GameModeDesc, "BDM_USB_MODE0", 12) || !_strncmp(config->GameModeDesc, "BDM_USB_MODE1", 12)) config->GameMode = BDM_USB_MODE; else if (!_strncmp(config->GameModeDesc, "ETH_MODE", 8)) config->GameMode = ETH_MODE; diff --git a/include/extern_irx.h b/include/extern_irx.h index 04bea09b1..d855762a0 100644 --- a/include/extern_irx.h +++ b/include/extern_irx.h @@ -132,6 +132,8 @@ IMPORT_BIN2C(usbd_irx); IMPORT_BIN2C(usbmass_bd_irx); +IMPORT_BIN2C(usbmass_bd_single_irx); + IMPORT_BIN2C(usb_pademu_irx); IMPORT_BIN2C(xhdd_irx); diff --git a/modules/usbmass_bd_mini_single.irx b/modules/usbmass_bd_mini_single.irx new file mode 100644 index 000000000..7cd6dac45 Binary files /dev/null and b/modules/usbmass_bd_mini_single.irx differ diff --git a/modules/usbmass_bd_single.irx b/modules/usbmass_bd_single.irx new file mode 100644 index 000000000..207825909 Binary files /dev/null and b/modules/usbmass_bd_single.irx differ diff --git a/src/bdmsupport.c b/src/bdmsupport.c index c353fbe26..eb75912ba 100644 --- a/src/bdmsupport.c +++ b/src/bdmsupport.c @@ -506,7 +506,10 @@ void bdmLaunchGame(item_list_t *itemList, int id, config_set_t *configSet) LOG("bdm pre sysLaunchLoaderElf\n"); if (!strcmp(bdmCurrentDriver, "usb")) { settings->common.fakemodule_flags |= FAKE_MODULE_FLAG_USBD; - sysLaunchLoaderElf(filename, "BDM_USB_MODE", irx_size, irx, size_mcemu_irx, bdm_mcemu_irx, EnablePS2Logo, compatmask); + if (settings->bdDeviceId == 0) + sysLaunchLoaderElf(filename, "BDM_USB_MODE0", irx_size, irx, size_mcemu_irx, bdm_mcemu_irx, EnablePS2Logo, compatmask); + else + sysLaunchLoaderElf(filename, "BDM_USB_MODE1", irx_size, irx, size_mcemu_irx, bdm_mcemu_irx, EnablePS2Logo, compatmask); } else if (!strcmp(bdmCurrentDriver, "sd") && strlen(bdmCurrentDriver) == 2) { settings->common.fakemodule_flags |= 0 /* TODO! fake ilinkman ? */; sysLaunchLoaderElf(filename, "BDM_ILK_MODE", irx_size, irx, size_mcemu_irx, bdm_mcemu_irx, EnablePS2Logo, compatmask); diff --git a/src/system.c b/src/system.c index b1bbcdd1c..bc238f284 100644 --- a/src/system.c +++ b/src/system.c @@ -464,12 +464,15 @@ static unsigned int sendIrxKernelRAM(const char *startup, const char *mode_str, irxtab_t *irxtable; irxptr_t *irxptr_tab; void *irxptr, *ioprp_image; - int i, modcount; + int i, modcount, devId = 0; unsigned int curIrxSize, size_ioprp_image, total_size; - if (!strcmp(mode_str, "BDM_USB_MODE")) + if (!strcmp(mode_str, "BDM_USB_MODE0")) modules |= CORE_IRX_USB; - else if (!strcmp(mode_str, "BDM_ILK_MODE")) + else if (!strcmp(mode_str, "BDM_USB_MODE1")) { + modules |= CORE_IRX_USB; + devId = 1; + } else if (!strcmp(mode_str, "BDM_ILK_MODE")) modules |= CORE_IRX_ILINK; else if (!strcmp(mode_str, "BDM_M4S_MODE")) modules |= CORE_IRX_MX4SIO; @@ -507,8 +510,13 @@ static unsigned int sendIrxKernelRAM(const char *startup, const char *mode_str, irxptr_tab[modcount++].ptr = (void *)&usbd_irx; } if (modules & CORE_IRX_USB) { - irxptr_tab[modcount].info = size_usbmass_bd_irx | SET_OPL_MOD_ID(OPL_MODULE_ID_USBMASSBD); - irxptr_tab[modcount++].ptr = (void *)&usbmass_bd_irx; + if (devId) { + irxptr_tab[modcount].info = size_usbmass_bd_irx | SET_OPL_MOD_ID(OPL_MODULE_ID_USBMASSBD); + irxptr_tab[modcount++].ptr = (void *)&usbmass_bd_irx; + } else { + irxptr_tab[modcount].info = size_usbmass_bd_single_irx | SET_OPL_MOD_ID(OPL_MODULE_ID_USBMASSBD); + irxptr_tab[modcount++].ptr = (void *)&usbmass_bd_single_irx; + } } if (modules & CORE_IRX_ILINK) { irxptr_tab[modcount].info = size_iLinkman_irx | SET_OPL_MOD_ID(OPL_MODULE_ID_ILINK);