Skip to content

Commit 39dac40

Browse files
authored
MX4SIO Support (#20)
* initial commit * mx4sio: sync with master (#23) * Update main.c * implement config reading from MX4SIO * avoid embedding fileXio when not needed * make fatal error report togleable * fix some warnings & some tweaks * Update CI.yml * allow quick IRX replacement If an IRX of same name is pasted into `embed/iop/` compilation process will use it instead of PS2SDK stock one
1 parent dfe1bd1 commit 39dac40

File tree

7 files changed

+150
-40
lines changed

7 files changed

+150
-40
lines changed

.github/workflows/CI.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ jobs:
5050
run: |
5151
make release COMMIT_HASH=${GITHUB_SHA::7} BINDIR=PS2/ ${{ env.DEBUG }} PRINTF=${{ github.event.inputs.name }}
5252
53+
- name: Compile PS2 MX4SIO build
54+
run: |
55+
make release COMMIT_HASH=${GITHUB_SHA::7} BINDIR=PS2_MX4SIO/ MX4SIO=1 ${{ env.DEBUG }} PRINTF=${{ github.event.inputs.name }}
56+
5357
- name: Compile PSX build
5458
run: |
5559
make release COMMIT_HASH=${GITHUB_SHA::7} BINDIR=PSX/ PSX=1 ${{ env.DEBUG }} PRINTF=${{ github.event.inputs.name }}
@@ -69,6 +73,7 @@ jobs:
6973
mv PS2/ release/PS2/
7074
mv PSX/ release/PSX/
7175
mv PS2_HDD/ release/PS2_HDD/
76+
mv PS2_MX4SIO/ release/PS2_MX4SIO/
7277
7378
- name: pack release
7479
run: |

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"osdhistory.h": "c",
1414
"ps2_sio2man_driver.h": "c",
1515
"fcntl.h": "c",
16-
"siocookie.h": "c"
16+
"siocookie.h": "c",
17+
"compare": "c",
18+
"limits": "c",
19+
"new": "c"
1720
}
1821
}

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ HAS_EMBED_IRX = 1 # whether to embed or not non vital IRX (wich will be loaded f
1515
DEBUG ?= 0
1616
PSX ?= 0 # PSX DESR support
1717
HDD ?= 0 #wether to add internal HDD support
18+
MX4SIO ?= 0
1819
PROHBIT_DVD_0100 ?= 0 # prohibit the DVD Players v1.00 and v1.01 from being booted.
1920
XCDVD_READKEY ?= 0 # Enable the newer sceCdReadKey checks, which are only supported by a newer CDVDMAN module.
2021

@@ -61,7 +62,7 @@ EE_OBJS = main.o \
6162
EMBEDDED_STUFF = icon_sys_A.o icon_sys_J.o icon_sys_C.o
6263

6364
EE_CFLAGS = -Wall
64-
EE_CFLAGS += -fdata-sections -ffunction-sections
65+
EE_CFLAGS += -fdata-sections -ffunction-sections -DREPORT_FATAL_ERRORS
6566
EE_LDFLAGS += -L$(PS2SDK)/ports/lib
6667
EE_LDFLAGS += -Wl,--gc-sections -Wno-sign-compare
6768
EE_LIBS += -ldebug -lmc -lpatches
@@ -74,6 +75,13 @@ ifneq ($(VERBOSE), 1)
7475
.SILENT:
7576
endif
7677

78+
ifeq ($(MX4SIO), 1)
79+
HOMEBREW_IRX = 1
80+
FILEXIO_NEED = 1
81+
EE_OBJS += mx4sio_bd.o
82+
EE_CFLAGS += -DMX4SIO
83+
endif
84+
7785
ifneq ($(HOMEBREW_IRX), 0)
7886
$(info --- enforcing usage of homebrew IRX modules)
7987
USE_ROM_PADMAN = 0
@@ -229,7 +237,7 @@ $(EE_BIN_STRIPPED): $(EE_BIN)
229237
$(EE_BIN_PACKED): $(EE_BIN_STRIPPED)
230238
@echo " -- Compressing"
231239
ifneq ($(DEBUG),1)
232-
ps2-packer $< $@ > /dev/null
240+
ps2-packer $< $@
233241
else
234242
ps2-packer -v $< $@
235243
endif

embed.make

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,60 @@
11
BIN2S = @bin2s
2+
vpath %.irx embed/iop/
3+
vpath %.irx $(PS2SDK)/iop/irx/
24
# ---{ IOP BINARIES }--- #
35
$(EE_ASM_DIR)ioprp.s: embed/ioprp.img | $(EE_ASM_DIR)
46
$(BIN2S) $< $@ psx_ioprp
57

6-
$(EE_ASM_DIR)sio2man_irx.s: $(PS2SDK)/iop/irx/sio2man.irx | $(EE_ASM_DIR)
8+
$(EE_ASM_DIR)sio2man_irx.s: sio2man.irx | $(EE_ASM_DIR)
79
$(BIN2S) $< $@ sio2man_irx
810

9-
$(EE_ASM_DIR)mcman_irx.s: $(PS2SDK)/iop/irx/mcman.irx | $(EE_ASM_DIR)
11+
$(EE_ASM_DIR)mcman_irx.s: mcman.irx | $(EE_ASM_DIR)
1012
$(BIN2S) $< $@ mcman_irx
1113

12-
$(EE_ASM_DIR)mcserv_irx.s: $(PS2SDK)/iop/irx/mcserv.irx | $(EE_ASM_DIR)
14+
$(EE_ASM_DIR)mcserv_irx.s: mcserv.irx | $(EE_ASM_DIR)
1315
$(BIN2S) $< $@ mcserv_irx
1416

15-
$(EE_ASM_DIR)padman_irx.s: $(PS2SDK)/iop/irx/freepad.irx | $(EE_ASM_DIR)
17+
$(EE_ASM_DIR)padman_irx.s: freepad.irx | $(EE_ASM_DIR)
1618
$(BIN2S) $< $@ padman_irx
1719

18-
$(EE_ASM_DIR)usbd_irx.s: $(PS2SDK)/iop/irx/usbd.irx | $(EE_ASM_DIR)
20+
$(EE_ASM_DIR)usbd_irx.s: usbd.irx | $(EE_ASM_DIR)
1921
$(BIN2S) $< $@ usbd_irx
2022

21-
$(EE_ASM_DIR)usbhdfsd_irx.s: $(PS2SDK)/iop/irx/usbhdfsd.irx | $(EE_ASM_DIR)
23+
$(EE_ASM_DIR)usbhdfsd_irx.s: usbhdfsd.irx | $(EE_ASM_DIR)
2224
$(BIN2S) $< $@ usb_mass_irx
2325

24-
$(EE_ASM_DIR)bdm_irx.s: $(PS2SDK)/iop/irx/bdm.irx | $(EE_ASM_DIR)
26+
$(EE_ASM_DIR)bdm_irx.s: bdm.irx | $(EE_ASM_DIR)
2527
$(BIN2S) $< $@ bdm_irx
2628

27-
$(EE_ASM_DIR)bdmfs_fatfs_irx.s: $(PS2SDK)/iop/irx/bdmfs_fatfs.irx | $(EE_ASM_DIR)
29+
$(EE_ASM_DIR)bdmfs_fatfs_irx.s: bdmfs_fatfs.irx | $(EE_ASM_DIR)
2830
$(BIN2S) $< $@ bdmfs_fatfs_irx
2931

30-
$(EE_ASM_DIR)usbmass_bd_irx.s: $(PS2SDK)/iop/irx/usbmass_bd.irx | $(EE_ASM_DIR)
32+
$(EE_ASM_DIR)usbmass_bd_irx.s: usbmass_bd.irx | $(EE_ASM_DIR)
3133
$(BIN2S) $< $@ usbmass_bd_irx
3234

35+
$(EE_ASM_DIR)mx4sio_bd.s: mx4sio_bd.irx | $(EE_ASM_DIR)
36+
$(BIN2S) $< $@ mx4sio_bd_irx
37+
3338
#HDD
34-
$(EE_ASM_DIR)poweroff_irx.s: $(PS2SDK)/iop/irx/poweroff.irx | $(EE_ASM_DIR)
39+
$(EE_ASM_DIR)poweroff_irx.s: poweroff.irx | $(EE_ASM_DIR)
3540
$(BIN2S) $< $@ poweroff_irx
3641

37-
$(EE_ASM_DIR)iomanx_irx.s: $(PS2SDK)/iop/irx/iomanX.irx | $(EE_ASM_DIR)
42+
$(EE_ASM_DIR)iomanx_irx.s: iomanX.irx | $(EE_ASM_DIR)
3843
$(BIN2S) $< $@ iomanX_irx
3944

40-
$(EE_ASM_DIR)filexio_irx.s: $(PS2SDK)/iop/irx/fileXio.irx | $(EE_ASM_DIR)
45+
$(EE_ASM_DIR)filexio_irx.s: fileXio.irx | $(EE_ASM_DIR)
4146
$(BIN2S) $< $@ fileXio_irx
4247

43-
$(EE_ASM_DIR)ps2dev9_irx.s: $(PS2SDK)/iop/irx/ps2dev9.irx | $(EE_ASM_DIR)
48+
$(EE_ASM_DIR)ps2dev9_irx.s: ps2dev9.irx | $(EE_ASM_DIR)
4449
$(BIN2S) $< $@ ps2dev9_irx
4550

46-
$(EE_ASM_DIR)ps2atad_irx.s: $(PS2SDK)/iop/irx/ps2atad.irx | $(EE_ASM_DIR)
51+
$(EE_ASM_DIR)ps2atad_irx.s: ps2atad.irx | $(EE_ASM_DIR)
4752
$(BIN2S) $< $@ ps2atad_irx
4853

49-
$(EE_ASM_DIR)ps2hdd_irx.s: $(PS2SDK)/iop/irx/ps2hdd-osd.irx | $(EE_ASM_DIR)
54+
$(EE_ASM_DIR)ps2hdd_irx.s: ps2hdd-osd.irx | $(EE_ASM_DIR)
5055
$(BIN2S) $< $@ ps2hdd_irx
5156

52-
$(EE_ASM_DIR)ps2fs_irx.s: $(PS2SDK)/iop/irx/ps2fs.irx | $(EE_ASM_DIR)
57+
$(EE_ASM_DIR)ps2fs_irx.s: ps2fs.irx | $(EE_ASM_DIR)
5358
$(BIN2S) $< $@ ps2fs_irx
5459
#HDD
5560

include/common.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ enum
55
SOURCE_MC0 = 0,
66
SOURCE_MC1,
77
SOURCE_MASS,
8+
#ifdef MX4SIO
9+
SOURCE_MX4SIO,
10+
#endif
811
#ifdef HDD
912
SOURCE_HDD,
1013
#endif
@@ -17,14 +20,17 @@ enum
1720

1821
static const char* SOURCES[SOURCE_COUNT] =
1922
{
20-
"mc0:",
21-
"mc1:",
22-
"mass:",
23+
"mc0",
24+
"mc1",
25+
"usb",
26+
#ifdef MX4SIO
27+
"mx4sio",
28+
#endif
2329
#ifdef HDD
24-
"hdd0:",
30+
"hdd",
2531
#endif
2632
#ifdef XFROM
27-
"xfrom0:",
33+
"xfrom",
2834
#endif
2935
"NOT FOUND",
3036
};

0 commit comments

Comments
 (0)