Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ jobs:
bdmstuff: ["EXFAT=0", "EXFAT=1", "EXFAT=1 MX4SIO=1"]
ds34: ["DS34=0", "DS34=1"]
mmce: ["MMCE=0", "MMCE=1"]
hdd: ["HDD=APA", "HDD=BDM"]
exclude:
- hdd: "HDD=BDM"
bdmstuff: "EXFAT=0"
- bdmstuff: "EXFAT=1 MX4SIO=1"
mmce: "MMCE=1"
runs-on: ubuntu-latest
Expand All @@ -36,12 +39,12 @@ jobs:

- name: Compile wLaunchELF
run: |
make rebuild ${{ matrix.eth }} ${{ matrix.mmce }} ${{ matrix.bdmstuff }} ${{ matrix.ds34 }} ${{ matrix.xfrom }} ${{ github.event.inputs.make_args }}
make rebuild ${{ matrix.eth }} ${{ matrix.mmce }} ${{ matrix.bdmstuff }} ${{ matrix.ds34 }} ${{ matrix.xfrom }} ${{ matrix.hdd }} ${{ github.event.inputs.make_args }}

- name: Upload variants artifact ELF
uses: actions/upload-artifact@v4
with:
name: "WLE-${{ matrix.eth }}-${{ matrix.mmce }}-${{ matrix.bdmstuff }}-${{ matrix.ds34 }}-${{ matrix.xfrom }}"
name: "WLE-${{ matrix.eth }}-${{ matrix.mmce }}-${{ matrix.bdmstuff }}-${{ matrix.ds34 }}-${{ matrix.xfrom }}-${{ matrix.hdd }}"
path: |
BOOT*.ELF

Expand Down
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
MMCE ?= 0
DS34 ?= 0
SMB ?= 0
HDD ?= APA# APA/BDM/NONE (NONE: To be implemented)
TMANIP ?= 1
ETH ?= 1
EXFAT ?= 0
Expand All @@ -14,13 +15,13 @@ UDPTTY ?= 0
MX4SIO ?= 0
SIO2MAN ?= 0
PPC_UART ?= 0
SIO_DEBUG ?= 0
SIO_DEBUG ?= 1
DEBUG ?= 0
LCDVD ?= LEGACY#or LATEST
# ----------------------------- #
.SILENT:

BIN_NAME = $(HAS_EXFAT)$(HAS_DS34)$(HAS_ETH)$(HAS_MX4SIO)$(HAS_MMCE)$(HAS_SMB)$(HAS_DVRP)$(HAS_XFROM)$(HAS_EESIO)$(HAS_UDPTTY)$(HAS_PPCTTY)$(HAS_IOP_RESET)
BIN_NAME = $(HAS_EXFAT)$(HAS_DS34)$(HAS_ETH)$(HAS_MX4SIO)$(HAS_MMCE)$(HAS_SMB)$(HAS_BDMATAD)$(HAS_DVRP)$(HAS_XFROM)$(HAS_EESIO)$(HAS_UDPTTY)$(HAS_PPCTTY)$(HAS_IOP_RESET)
ifeq ($(DEBUG), 0)
EE_BIN = UNC-BOOT$(BIN_NAME).ELF
EE_BIN_PKD = BOOT$(BIN_NAME).ELF
Expand All @@ -44,6 +45,14 @@ EE_CFLAGS := -mgpopt -G10240 -G0 -DNEWLIB_PORT_AWARE -D_EE

BIN2S = @bin2s


ifeq ($(HDD),BDM)
ifneq ($(EXFAT),1)
$(error BDM ATAD Requested on build without BDM)
endif
HAS_BDMATAD = -BDMHDD
EE_CFLAGS += -DATA_BDM
endif
ifeq ($(SMB),1)
EE_OBJS += smbman.o
HAS_SMB = -SMB
Expand Down Expand Up @@ -153,7 +162,7 @@ endif

ifeq ($(EXFAT),1)
EE_OBJS += bdm_irx.o bdmfs_fatfs_irx.o usbmass_bd_irx.o
EE_CFLAGS += -DEXFAT
EE_CFLAGS += -DEXFAT -DBDM
HAS_EXFAT = -EXFAT
else
EE_OBJS += usbhdfsd_irx.o
Expand Down
10 changes: 7 additions & 3 deletions embed.make
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ else # if we have mx4sio use newer IRX to avoid deadlocks when opening common me
SIO2MAN_SOURCE = iop/__precompiled/sio2man.irx
endif


ifeq ($(HDD),BDM)
ATAD_SOURCE = iop/__precompiled/ata_bd.irx
else
ATAD_SOURCE = $(PS2SDK)/iop/irx/ps2atad.irx
endif

#---{ MC }---#
$(EE_ASM_DIR)mcman_irx.s: $(MCMAN_SOURCE) | $(EE_ASM_DIR)
Expand Down Expand Up @@ -95,10 +99,10 @@ endif
iop/ps2ftpd.irx: iop/oldlibs/ps2ftpd
$(MAKE) -C $<

$(EE_ASM_DIR)ps2atad_irx.s: $(PS2SDK)/iop/irx/ps2atad.irx | $(EE_ASM_DIR)
$(EE_ASM_DIR)ps2atad_irx.s: $(ATAD_SOURCE) | $(EE_ASM_DIR)
$(BIN2S) $< $@ ps2atad_irx

$(EE_ASM_DIR)ps2hdd_irx.s: $(PS2SDK)/iop/irx/ps2hdd-osd.irx | $(EE_ASM_DIR)
$(EE_ASM_DIR)ps2hdd_irx.s: $(PS2SDK)/iop/irx/ps2hdd.irx | $(EE_ASM_DIR)# before: ps2hdd-osd.irx
$(BIN2S) $< $@ ps2hdd_irx

$(EE_ASM_DIR)ps2fs_irx.s: $(PS2SDK)/iop/irx/ps2fs.irx | $(EE_ASM_DIR)
Expand Down
17 changes: 16 additions & 1 deletion include/launchelf.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,22 @@ extern int Check_ESR_Disc(void);

#define USB_MASS_MAX_DRIVES 10

extern char USB_mass_ix[10];
enum bdmtypes {
BD_UNKNOWN = 0,
BD_USB,
BD_MX4SIO,
BD_IEEE1394,
BD_UDPBD,
BD_ATAD,

BD_COUNT,
};

extern const char* bdmnames[BD_COUNT];
extern char* bdmpaths[BD_COUNT];
extern int bdmpathsindx[BD_COUNT];
extern char USB_mass_ix[USB_MASS_MAX_DRIVES];
extern char USB_mass_bx[USB_MASS_MAX_DRIVES];
extern int USB_mass_max_drives;
extern u64 USB_mass_scan_time;
extern int USB_mass_scanned;
Expand Down
Binary file added iop/__precompiled/ata_bd.irx
Binary file not shown.
86 changes: 61 additions & 25 deletions src/filer.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ char mountedDVRPParty[MOUNT_LIMIT][MAX_NAME];
int latestDVRPMount = -1;
#endif

#ifdef MX4SIO
int mx4sio_idx = -1; // To keep track of wich mass#:/ device represents MX4SIO
#endif

int file_show = 1; //dlanor: 0==name_only, 1==name+size+time, 2==title+size+time
int file_sort = 1; //dlanor: 0==none, 1==name, 2==title, 3==mtime
Expand Down Expand Up @@ -170,7 +167,35 @@ typedef struct
int PSU_content; //Used to count PSU content headers for the main header

//USB_mass definitions for multiple drive usage
char USB_mass_ix[10] = {'0', 0, 0, 0, 0, 0, 0, 0, 0, 0};
char USB_mass_ix[USB_MASS_MAX_DRIVES] = {'0', 0, 0, 0, 0, 0, 0, 0, 0, 0};
char USB_mass_bx[USB_MASS_MAX_DRIVES] = {BD_UNKNOWN, BD_UNKNOWN, BD_UNKNOWN, BD_UNKNOWN, BD_UNKNOWN, BD_UNKNOWN, BD_UNKNOWN, BD_UNKNOWN, BD_UNKNOWN, BD_UNKNOWN};

const char* bdmnames[BD_COUNT] = {
"",
"usb",
"sdc",
"sd",
"udp",
"ata",
};

char* bdmpaths[BD_COUNT] = {
"mass?",
"usb?:",
"mx4sio?:",
"iLink?:",
"udpbd?:",
"bdm_hdd?",
};
int bdmpathsindx[BD_COUNT] = {
4,
3,
6,
5,
5,
7,
};

int USB_mass_max_drives = USB_MASS_MAX_DRIVES;
u64 USB_mass_scan_time = 0;
int USB_mass_scanned = 0; //0==Not_found_OR_No_Multi 1==found_Multi_mass_once
Expand Down Expand Up @@ -1292,36 +1317,40 @@ int readXFROM(const char *path, FILEINFO *info, int max)
#endif
void scan_USB_mass(void)
{
#ifdef MX4SIO
#ifdef BDM
static char DEVID[5];
#endif
int i, dd;
int i, dd, x;
iox_stat_t chk_stat;
char mass_path[8] = "mass0:/";
if ((USB_mass_max_drives < 2) //No need for dynamic lists with only one drive
|| (USB_mass_scanned && ((Timer() - USB_mass_scan_time) < 5000)))
return;

#ifdef MX4SIO
mx4sio_idx = -1; //assume none is mx4sio // this MUST ALWAYS be after the USB_mass_scan_time check
#endif

for (i = 0; i < USB_mass_max_drives; i++) {
mass_path[4] = '0' + i;
#ifdef BDM
USB_mass_bx[i] = BD_UNKNOWN;
#endif
if (fileXioGetStat(mass_path, &chk_stat) < 0) {
USB_mass_ix[i] = 0;
continue;
}
#ifdef MX4SIO
#ifdef BDM
if ((dd = fileXioDopen(mass_path)) >= 0) {
int *intptr_ctl = (int *)DEVID;
*intptr_ctl = fileXioIoctl(dd, USBMASS_IOCTL_GET_DRIVERNAME, "");
fileXioDclose(dd);
if (!strncmp(DEVID, "sdc", 3))
{
mx4sio_idx = i;
DPRINTF("%s: Found MX4SIO device at mass%d:/\n", __func__, i);
}
for (x = BD_USB; x < BD_COUNT; x++)
{
if (!strcmp(DEVID, bdmnames[x]))
{
USB_mass_bx[x] = i;
DPRINTF("%s: Found %s device at mass%d:/\n", __func__, bdmnames[x], i);
break;
}
}

}
#endif
USB_mass_ix[i] = '0' + i;
Expand Down Expand Up @@ -4370,19 +4399,26 @@ int getFilePath(char *out, int cnfmode)
else if ((file_show == 2) && files[top + i].title[0] != 0) {
mcTitle = files[top + i].title;
} else { //Show normal file/folder names
#ifdef MX4SIO
#ifdef BDM
if (path[0] == 0) { // we are on root. apply the unique "alias" here
if ((!strncmp(files[top + i].name, "mass", 4)) //
&& (files[top + i].name[4] == ('0' + mx4sio_idx) || (mx4sio_idx == 0 && files[top + i].name[4] == ':')) //index corresponds to mx4sio index, also assume that if device path index 4 is equal to ':' then it is index 0
)
strcpy(tmp, "mx4sio:");
if ((!strncmp(files[top + i].name, "mass", 4))) {
int msindex = 0;
if (isdigit(files[top + i].name[4]))
msindex = files[top + i].name[4] - '0';

if (USB_mass_bx[msindex] > BD_UNKNOWN) {
bdmpaths[USB_mass_bx[msindex]][bdmpathsindx[USB_mass_bx[msindex]]] = '0'+msindex;
strcpy(tmp, bdmpaths[msindex]);
} else
strcpy(tmp, files[top + i].name);
}
else
strcpy(tmp, files[top + i].name);
} else {
strcpy(tmp, files[top + i].name);
}
} else {
strcpy(tmp, files[top + i].name);
}
#else
strcpy(tmp, files[top + i].name);
strcpy(tmp, files[top + i].name);
#endif
if (file_show > 0) { //Does display mode include file details ?
name_limit = 43 * 8;
Expand Down