Skip to content

Commit

Permalink
Merge branch 'master' into settings
Browse files Browse the repository at this point in the history
  • Loading branch information
KrahJohlito committed Jul 30, 2021
2 parents 5202986 + 7b7b8ce commit a8c2125
Show file tree
Hide file tree
Showing 20 changed files with 252 additions and 131 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/compilation.yml
Expand Up @@ -177,3 +177,21 @@ jobs:
OPNPS2LD-VARIANTS-${{ steps.version.outputs.version }}.7z
OPNPS2LD.7z
OPNPS2LD-VARIANTS.7z
- name: Upload pre-release to Mega
if: github.ref == 'refs/heads/master'
uses: Difegue/action-megacmd@master
with:
args: put -c OPNPS2LD.7z /OPL/Pre-Release/${{ steps.version.outputs.version }}/
env:
USERNAME: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.PASSWORD }}

- name: Upload release to Mega
if: startsWith(github.ref, 'refs/tags/v')
uses: Difegue/action-megacmd@master
with:
args: put -c OPNPS2LD.7z /OPL/Release/${{ steps.version.outputs.version }}/
env:
USERNAME: ${{ secrets.USERNAME }}
PASSWORD: ${{ secrets.PASSWORD }}
8 changes: 7 additions & 1 deletion Makefile
Expand Up @@ -84,7 +84,7 @@ MISC_OBJS = icon_sys_A.o icon_sys_J.o icon_sys_C.o conf_theme_OPL.o \
boot.o cancel.o confirm.o cursor.o message.o transition.o

IOP_OBJS = iomanx.o filexio.o ps2fs.o usbd.o bdmevent.o \
bdm.o bdmfs_vfat.o usbmass_bd.o iLinkman.o IEEE1394_bd.o \
bdm.o bdmfs_vfat.o usbmass_bd.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 @@ -530,13 +530,19 @@ $(EE_ASM_DIR)usbmass_bd.s: $(PS2SDK)/iop/irx/usbmass_bd.irx | $(EE_ASM_DIR)

$(EE_ASM_DIR)IEEE1394_bd.s: $(PS2SDK)/iop/irx/IEEE1394_bd.irx | $(EE_ASM_DIR)
$(BIN2S) $< $@ IEEE1394_bd_irx

$(EE_ASM_DIR)mx4sio_bd.s: $(PS2SDK)/iop/irx/mx4sio_bd.irx | $(EE_ASM_DIR)
$(BIN2S) $< $@ mx4sio_bd_irx
else
# block device drivers without printf's
$(EE_ASM_DIR)usbmass_bd.s: $(PS2SDK)/iop/irx/usbmass_bd_mini.irx | $(EE_ASM_DIR)
$(BIN2S) $< $@ usbmass_bd_irx

$(EE_ASM_DIR)IEEE1394_bd.s: $(PS2SDK)/iop/irx/IEEE1394_bd_mini.irx | $(EE_ASM_DIR)
$(BIN2S) $< $@ IEEE1394_bd_irx

$(EE_ASM_DIR)mx4sio_bd.s: $(PS2SDK)/iop/irx/mx4sio_bd_mini.irx | $(EE_ASM_DIR)
$(BIN2S) $< $@ mx4sio_bd_irx
endif

modules/bdmevent/bdmevent.irx: modules/bdmevent
Expand Down
141 changes: 92 additions & 49 deletions README.md
@@ -1,106 +1,134 @@
# Open PS2 Loader

Copyright 2013, Ifcaro & jimmikaelkael
Licenced under Academic Free License version 3.0
Review LICENSE file for further details.
Licensed under Academic Free License version 3.0
Review the LICENSE file for further details.

[![CI](https://github.com/ifcaro/Open-PS2-Loader/workflows/CI/badge.svg)](https://github.com/ifcaro/Open-PS2-Loader/actions?query=workflow%3ACI)
[![Discord](https://img.shields.io/discord/652861436992946216?style=flat&logo=Discord)](https://discord.gg/CVFUa9xh6B)
[![Mega](https://img.shields.io/badge/Mega-%23D90007.svg?style=flat&logo=Mega&logoColor=white)](https://mega.nz/folder/Ndwi1bAK#oLWNhH_g-h0p4BoT4c556A)

## Introduction

Open PS2 Loader (OPL) is a 100% Open source game and application loader for
the PS2 and PS3 units. It supports three categories of devices : USB mass
the PS2 and PS3 units. It supports three categories of devices: USB mass
storage devices, SMB shares and the PlayStation 2 HDD unit. USB devices and
SMB shares support USBExtreme and \*.ISO formats while PS2 HDD supports HDLoader
format. It's now the most compatible homebrew loader.

OPL is also developed continuously - anyone can contribute improvements to
the project due to its open source nature.
the project due to its open-source nature.

You can visit the Open PS2 Loader forum at:

https://www.psx-place.com/forums/open-ps2-loader-opl.77/
<https://www.psx-place.com/forums/open-ps2-loader-opl.77/>

You can report compatibility game problems at:

https://www.psx-place.com/threads/open-ps2-loader-game-bug-reports.19401/
<https://www.psx-place.com/threads/open-ps2-loader-game-bug-reports.19401/>

For updated compatibility list, you can visit OPL-CL site at:
For an updated compatibility list, you can visit the OPL-CL site at:

http://sx.sytes.net/oplcl/games.aspx
<http://sx.sytes.net/oplcl/games.aspx>

## Release types
<details>
<summary> <b> Release types </b> </summary>
<p>

Open PS2 Loader bundle included several types of the same OPL version. These
types come with more or less features included.
types come with more or fewer features included.

| Type (can be a combination) | Description |
| --------------------------- | ---------------------------------------------------------------------------------------------- |
| "Release" | Regular OPL release with GSM, IGS, PADEMU, VMC, PS2RD Cheat Engine & Parental Controls. |
| "DTL_T10000" | OPL for TOOLs (DevKit PS2) |
| "IGS" | OPL with InGame Screenshot feature. |
| "PADEMU" | OPL with Pad Emulation for DS3 & DS4. |
| "RTL" | OPL with right to left language suppport. |
| Type (can be a combination) | Description |
| --------------------------- | --------------------------------------------------------------------------------------- |
| `Release` | Regular OPL release with GSM, IGS, PADEMU, VMC, PS2RD Cheat Engine & Parental Controls. |
| `DTL_T10000` | OPL for TOOLs (DevKit PS2) |
| `IGS` | OPL with InGame Screenshot feature. |
| `PADEMU` | OPL with Pad Emulation for DS3 & DS4. |
| `RTL` | OPL with the right to left language support. |

## How to use
</p>
</details>

<details>
<summary> <b> How to use </b> </summary>
<p>

OPL uses the following directory tree structure across HDD, SMB, and
USB modes:

| Folder | Description | Modes |
| ------ | ----------- | ----- |
| "CD" | for games on CD media - i.e. blue-bottom discs | USB and SMB |
| "DVD" | for DVD5 and DVD9 images if using the NTFS file system on USB or SMB ; DVD9 images must be split and placed into the device root if using the FAT32 file system on USB or SMB | USB and SMB |
| "VMC" | for Virtual Memory Card images - from 8MB up to 64MB | all |
| "CFG" | for saving per-game configuration files | all |
| "ART" | for game art images | all |
| "THM" | for themes support | all |
| "LNG" | for translation support | all |
| "CHT" | for cheats files | all |

OPL will automatically create the above directory structure the first time you launch it and enable your favourite device.

For HDD users, OPL will read hdd0:__common/OPL/conf_hdd.cfg for the config entry "hdd_partition" to use as your OPL partition.
If not found a config file and a 128Mb +OPL partition will be created, you can edit the config if you wish to use/create a different partition.
| Folder | Description | Modes |
| ------ | ---------------------------------------------------- | ----------- |
| `CD` | for games on CD media - i.e. blue-bottom discs | USB and SMB |
| `DVD` | for DVD5 and DVD9 images if using the NTFS file system on USB or SMB; DVD9 images must be split and placed into the device root if using the FAT32 file system on USB or SMB | USB and SMB |
| `VMC` | for Virtual Memory Card images - from 8MB up to 64MB | all |
| `CFG` | for saving per-game configuration files | all |
| `ART` | for game art images | all |
| `THM` | for themes support | all |
| `LNG` | for translation support | all |
| `CHT` | for cheats files | all |

OPL will automatically create the above directory structure the first time you launch it and enable your favorite device.

For HDD users, OPL will read hdd0:\_\_common/OPL/conf_hdd.cfg for the config entry "hdd_partition" to use as your OPL partition.
If not found a config file and a 128Mb +OPL partition will be created. You can edit the config if you wish to use/create a different partition.
All partitions created by OPL will be 128Mb (it is not recommended to enlarge partitions as it will break LBAs, instead remove and recreate manually with uLaunchELF at a larger size if needed).

## USB
</p>
</details>

<details>
<summary> <b> USB </b> </summary>
<p>

Game files on USB must be perfectly defragmented either file by file or
by whole drive, and Dual Layer DVD9 images must be split to avoid the 4GB
limitations of the FAT32 file system. We recommend Auslogics Disk Defrag
for best defragging results.

http://www.auslogics.com/en/software/disk-defrag/
limitations of the FAT32 file system. We do not recommend using any programs.
The best way for defragmenting - copy all files to pc, format USB, copy all files back.
Repeat it once you faced defragmenting problem again.

You also need a PC program to convert or split games into USB Advance/Extreme
format, such as USBUtil 2.0.

## SMB
</p>
</details>

For loading games by SMB protocol you need to share a folder (ex: PS2SMB)
<details>
<summary> <b> SMB </b> </summary>
<p>

For loading games by SMB protocol, you need to share a folder (ex: PS2SMB)
on the host machine or NAS device and make sure that it has full read and
write permissions. USB Advance/Extreme format is optional - \*.ISO images
are supported using the folder structure above with the added bonus that
are supported using the folder structure above with the bonus that
DVD9 images don't have to be split if your SMB device uses the NTFS or
EXT3/4 file system.

## HDD
</p>
</details>

<details>
<summary> <b> HDD </b> </summary>
<p>

For PS2, 48-bit LBA internal HDDs up to 2TB are supported. They have to be
formatted with either HDLoader or uLaunchELF (uLaunchELF is recommended).

To launch OPL, you can use any of the existing methods for loading an
executable elf.

## PS3
</p>
</details>

<details>
<summary> <b> PS3 </b> </summary>
<p>

On PS3, you need an original SwapMagic 3.6+ or 3.8 disc (at the moment
there aren't any other options). The steps for loading OPL on a PS3 are:

1. Rename OPNPS2LD.ELF to SMBOOT0.ELF
2. Make a folder in root of USB device called SWAPMAGIC and copy SMBOOT0.ELF to it.
3. Launch SwapMagic in PS3 and press UP+L1 then Open PS2 Loader should start.
1. Rename OPNPS2LD.ELF to SMBOOT0.ELF
2. Make a folder in the root of a USB device called SWAPMAGIC and copy SMBOOT0.ELF to it.
3. Launch SwapMagic in PS3 and press UP+L1 then Open PS2 Loader should start.

There are 4 forms for launching elfs in SwapMagic.

Expand All @@ -111,8 +139,23 @@ SMBOOT3.ELF = UP + R2

Note: on PS3, only USB and SMB modes are supported.

## Some notes for devs
</p>
</details>

<details>
<summary> <b> Some notes for DEVS </b> </summary>
<p>

Open PS2 Loader needs the [**latest PS2SDK**](https://github.com/ps2dev/ps2sdk)

</p>
</details>

<details>
<summary> <b> OPL Archive </b> </summary>
<p>

Open PS2 Loader needs the latest PS2SDK:
Since 05/07/2021 every OPL build dispatched to the release section of this repository will be uploaded to a mega account, you can access the archive by clicking the mega badge on top of this readme

https://github.com/ps2dev/ps2sdk
</p>
</details>
1 change: 1 addition & 0 deletions ee_core/include/ee_core.h
Expand Up @@ -72,6 +72,7 @@ extern char GameID[16];
extern int GameMode;
enum GAME_MODE {
BDM_ILK_MODE,
BDM_M4S_MODE,
BDM_USB_MODE,
ETH_MODE,
HDD_MODE,
Expand Down
3 changes: 3 additions & 0 deletions ee_core/include/modules.h
Expand Up @@ -13,6 +13,9 @@ enum OPL_MODULE_ID {
OPL_MODULE_ID_ILINK,
OPL_MODULE_ID_ILINKBD,

// mx4sio mode modules
OPL_MODULE_ID_MX4SIOBD,

// SMB mode modules
OPL_MODULE_ID_SMSTCPIP,
OPL_MODULE_ID_SMAP,
Expand Down
3 changes: 3 additions & 0 deletions ee_core/src/iopmgr.c
Expand Up @@ -133,6 +133,9 @@ static void ResetIopSpecial(const char *args, unsigned int arglen)
LoadOPLModule(OPL_MODULE_ID_ILINK, 0, 0, NULL);
LoadOPLModule(OPL_MODULE_ID_ILINKBD, 0, 0, NULL);
break;
case BDM_M4S_MODE:
LoadOPLModule(OPL_MODULE_ID_MX4SIOBD, 0, 0, NULL);
break;
};
}

Expand Down
2 changes: 2 additions & 0 deletions ee_core/src/main.c
Expand Up @@ -53,6 +53,8 @@ static int eecoreInit(int argc, char **argv)
p = _strtok(argv[i], " ");
if (!_strncmp(argv[i], "BDM_ILK_MODE", 12))
GameMode = BDM_ILK_MODE;
else if (!_strncmp(argv[i], "BDM_M4S_MODE", 12))
GameMode = BDM_M4S_MODE;
else if (!_strncmp(p, "BDM_USB_MODE", 12))
GameMode = BDM_USB_MODE;
else if (!_strncmp(p, "ETH_MODE", 8))
Expand Down
1 change: 1 addition & 0 deletions include/config.h
Expand Up @@ -88,6 +88,7 @@ enum CONFIG_INDEX {
#define CONFIG_OPL_ETH_MODE "eth_mode"
#define CONFIG_OPL_APP_MODE "app_mode"
#define CONFIG_OPL_ENABLE_FW "enable_firewire"
#define CONFIG_OPL_ENABLE_MX4SIO "enable_mx4sio"
#define CONFIG_OPL_SWAP_SEL_BUTTON "swap_select_btn"
#define CONFIG_OPL_PARENTAL_LOCK_PWD "parental_lock_password"
#define CONFIG_OPL_SFX "enable_sfx"
Expand Down
3 changes: 3 additions & 0 deletions include/dialogs.h
Expand Up @@ -35,6 +35,7 @@ enum UI_ITEMS {
CFG_ETHMODE,
CFG_APPMODE,
CFG_ENABLEFW,
CFG_ENABLEMX4SIO,
CFG_LASTPLAYED,
CFG_LBL_AUTOSTARTLAST,
CFG_AUTOSTARTLAST,
Expand All @@ -43,6 +44,7 @@ enum UI_ITEMS {
CFG_BDMPREFIX,
CFG_ETHPREFIX,
CFG_HDDSPINDOWN,
BLOCKDEVICE_BUTTON,

ABOUT_TITLE,
ABOUT_BUILD_DETAILS,
Expand Down Expand Up @@ -192,5 +194,6 @@ extern struct UIItem diaAbout[];
extern struct UIItem diaVMC[];
extern struct UIItem diaNetCompatUpdate[];
extern struct UIItem diaParentalLockConfig[];
extern struct UIItem diaBlockDevicesConfig[];

#endif
3 changes: 3 additions & 0 deletions include/extern_irx.h
Expand Up @@ -148,6 +148,9 @@ extern int size_resetspu_irx;
extern void *sio2man_irx;
extern int size_sio2man_irx;

extern void *mx4sio_bd_irx;
extern int size_mx4sio_bd_irx;

extern void *smap_irx;
extern int size_smap_irx;

Expand Down
1 change: 1 addition & 0 deletions include/lang.h
Expand Up @@ -284,6 +284,7 @@ enum _STR_IDS {
_STR_INFO_DEVELOPER,
_STR_INFO_DESCRIPTION,
_STR_BDM_GAMES,
_STR_BLOCKDEVICE_SETTINGS,
_STR_CONTROLLER_SETTINGS,

LANG_STR_COUNT
Expand Down
1 change: 1 addition & 0 deletions include/opl.h
Expand Up @@ -115,6 +115,7 @@ extern int gETHStartMode;
extern int gAPPStartMode;

extern int gEnableFW;
extern int gEnableMX4SIO;

extern int gAutosort;
extern int gAutoRefresh;
Expand Down
1 change: 1 addition & 0 deletions lng/lang_English.lng
Expand Up @@ -301,4 +301,5 @@ Release
Developer
Description
BDM Games
Select Block Devices
Controller Settings
10 changes: 10 additions & 0 deletions src/bdmsupport.c
Expand Up @@ -24,6 +24,7 @@ static base_game_info_t *bdmGames;
static char bdmDriver[5];

static int fireWireModLoaded = 0;
static int mx4sioModLoaded = 0;

// forward declaration
static item_list_t bdmGameList;
Expand Down Expand Up @@ -78,6 +79,13 @@ static void bdmLoadBlockDeviceModules(void)

fireWireModLoaded = 1;
}

if (gEnableMX4SIO && !mx4sioModLoaded) {
// Load MX4SIO Block Device drivers
sysLoadModuleBuffer(&mx4sio_bd_irx, size_mx4sio_bd_irx, 0, NULL);

mx4sioModLoaded = 1;
}
}

void bdmLoadModules(void)
Expand Down Expand Up @@ -378,6 +386,8 @@ static void bdmLaunchGame(int id, config_set_t *configSet)
sysLaunchLoaderElf(filename, "BDM_USB_MODE", irx_size, irx, size_mcemu_irx, &bdm_mcemu_irx, EnablePS2Logo, compatmask);
else if (!strcmp(bdmDriver, "sd") && strlen(bdmDriver) == 2)
sysLaunchLoaderElf(filename, "BDM_ILK_MODE", irx_size, irx, size_mcemu_irx, &bdm_mcemu_irx, EnablePS2Logo, compatmask);
else if (!strcmp(bdmDriver, "sdc") && strlen(bdmDriver) == 3)
sysLaunchLoaderElf(filename, "BDM_M4S_MODE", irx_size, irx, size_mcemu_irx, &bdm_mcemu_irx, EnablePS2Logo, compatmask);
}

static config_set_t *bdmGetConfig(int id)
Expand Down

0 comments on commit a8c2125

Please sign in to comment.