Skip to content

Commit

Permalink
usbmass_bd single device irx test
Browse files Browse the repository at this point in the history
  • Loading branch information
KrahJohlito committed Sep 19, 2024
1 parent b11c091 commit 6f29ec6
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 8 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion ee_core/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions include/extern_irx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Binary file added modules/usbmass_bd_mini_single.irx
Binary file not shown.
Binary file added modules/usbmass_bd_single.irx
Binary file not shown.
5 changes: 4 additions & 1 deletion src/bdmsupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
18 changes: 13 additions & 5 deletions src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6f29ec6

Please sign in to comment.