Open PS2 Loader (OPL)

repository·master·Indexed 25 days ago

https://github.com/ps2homebrew/open-ps2-loader

An open-source game and application loader for PS2 and PS3 that enables loading games from USB mass storage, MX4SIO, iLink, SMBv1 shares, and ATA/IDE HDDs. It supports ISO, ZSO, and ELF formats, featuring a built-in NBD server for sharing internal HDDs with a PC, cheat support via .cht files, and tools for ISO compression.

Tokens
2.2K
Snippets
6
Records
14
Agent score
84%

What's inside Open PS2 Loader

  1. Understand Open PS2 Loader (OPL) device and file support

    master

    Open PS2 Loader (OPL) is an open-source game and application loader for PS2 and PS3. It supports the following storage devices:

    1. USB mass storage devices
    2. MX4SIO (SD card via memory card port adapter)
    3. iLink (SBP2 compliant storage via IEE1394)
    4. SMBv1 shares
    5. ATA/IDE HDDs

    Supported file formats include:

    • ISO
    • ZSO (Compressed ISO)
    • USB Extreme (ul)
    • Homebrews (Apps) in ELF format
    • HDDs (supports HDLoader format)
  2. Configure OPL directory structure

    master

    OPL uses a specific directory tree structure across HDD, SMB, and USB modes. OPL will automatically create these directories the first time you launch it and enable a device:

    FolderDescription
    CDGames on CD media (e.g., blue-bottom discs)
    DVDDVD5 and DVD9 images (requires filesystem supporting +4GB files)
    VMCVirtual Memory Card images (8MB to 64MB)
    CFGPer-game configuration files
    ARTGame art images
    THMThemes
    LNGTranslation support
    CHTCheat files
    APPSELF files (Homebrews)
  3. Configure OPL HDD partitions (MBR/GPT/exFAT)

    master

    For HDDs using the exFAT filesystem:

    • MBR partitioning: Supports up to 2TB.
    • GPT partitioning: Supports unlimited capacity.
    • Important: When formatting for exFAT, set the Allocation unit size to Default.
    • Fragmentation: Files should be added contiguously (e.g., drag and drop one at a time) to avoid fragmentation.
  4. Add apps using the legacy conf_apps.cfg method

    master

    To add ELF applications using the legacy method, create a conf_apps.cfg file in the OPL folder on your MemoryCard or at the root of your storage device.

    Each entry follows the format: DisplayName=DeviceID:PathToElf.

    Device IDs:

    • mass: (USB)
    • mc: (MemoryCard)

    Example:

    OPL=mass:APPS/OPNPS2LD.ELF

    Note: OPL is case sensitive.

  5. Configure OPL HDD partitions (APA/PFS)

    master

    For HDDs using the APA partition scheme with the PFS filesystem (up to 2TB):

    • OPL creates a +OPL partition by default.
    • To use a different partition, create a text file at hdd0:__common:pfs:OPL/conf_hdd.txt containing the preferred partition name (e.g., __common).
    • All partitions created by OPL are 128MB. Do not attempt to enlarge them manually as it breaks LBAs; instead, remove and recreate them using uLaunchELF if a larger size is required.
  6. Add apps using the title.cfg method

    master

    To add ELF applications using the title.cfg method, follow these steps:

    1. In the APPS folder, create a new folder named after the application.
    2. Place the ELF file inside that folder.
    3. Create a title.cfg file in the same folder as the ELF.
    4. Add the following content to title.cfg:
    title=Your App Name
    boot=YOURAPP.ELF

    Example structure: APPS/Open PS2 Loader/title.cfg and APPS/Open PS2 Loader/OPNPS2LD.ELF

    title=Open PS2 Loader
    boot=OPNPS2LD.ELF

    Note: OPL is case sensitive.

  7. Use cheats in OPL

    master

    OPL supports .cht files in PS2RD format. Store these in the CHT directory on your device. You can activate cheats via the OPL graphical interface under game settings.

    Cheat Modes:

    • Auto Select Cheats: Automatically enables and applies all codes in the .cht file.
    • Select Game Cheats: Opens a menu when launching a game, allowing you to enable/disable specific cheats for that session. (Note: Mastercodes cannot be disabled).
  8. Add new language strings for developers

    master

    When adding a new language string to the source code, you must first propose the change in lng_tmpl/_base.yml with appropriate comments.

    For example, to add _STR_NETWORK_STARTUP_ERROR, update the base file with a structure like this:

    - comment: Generic network error message.
      label: NETWORK_STARTUP_ERROR
      string: '%d: Network startup error.'

    After updating the base template, run make languages to update the files in lng_src, then propose those changes to the Open-PS2-Loader-lang repository.

    Warning: Do not rename or remove existing strings, as this requires manual updates to all language .yml files.

  9. Use the NBD server to share the PS2 HDD

    master

    OPL can act as an NBD (Network Block Device) server to share the internal hard drive with a PC.

    Setup:

    1. Ensure OPL has an IP address (Static or DHCP).
    2. In the OPL menu, select "Start NBD server". The screen will display "NBD Server running...".

    Client Usage Examples:

    nbd-client (Linux/WSL)

    • List exports: nbd-client -l 192.168.1.45
    • Connect: nbd-client 192.168.1.45 /dev/nbd1
    • Disconnect: nbd-client -d /dev/nbd1

    nbdfuse (Linux/WSL2)

    • List exports: nbdinfo --list nbd://192.168.1.45
    • Connect: mkdir ps2 && nbdfuse ps2/ nbd://192.168.1.45 &
    • Disconnect: umount ps2

    wnbd (Windows)

    • Connect (Run PowerShell as Administrator): wnbd-client.exe map hdd0 192.168.1.22
    • Disconnect: wnbd-client.exe unmap hdd0
    nbd-client 192.168.1.45 /dev/nbd1
  10. Compress/Decompress ISOs to ZSO format

    master

    OPL (v1.2.0+) supports compressed ZSO files. Use the ziso.py script (located in the pc folder of the repository) to manage these files. Requires Python 3 and the lz4 library.

    Install dependency:

    pip install lz4

    Compress ISO to ZSO:

    python ziso.py -c 2 "input.iso" "output.zso"

    Decompress ZSO to ISO:

    python ziso.py -c 0 "input.zso" "output.iso"
    python ziso.py -c 2 "input.iso" "output.zso"
  11. Translate Open PS2 Loader strings

    master

    All translation files are managed in a separate repository: https://github.com/ps2homebrew/Open-PS2-Loader-lang. To translate strings, ensure your .yml file does not contain untranslated strings in the following format:

      MENU:
      - untranslated
      - original: Menu

    Instead, provide the direct translation:

      MENU: Menu_on_your_language

    To test your changes locally:

    1. Run make download_lng to fetch language files.
    2. Make changes in lng_src/*.yml.
    3. Run make languages to generate the language files.
    4. Test the generated file located at lng/lang_*.lng.
  12. Troubleshoot OPL startup and freezing issues

    master

    OPL Freezes on logo or grey screen

    This may be caused by config files from older OPL builds. Fix: Hold START while OPL initializes to skip config loading, then save your new settings.

    Game freezes on white screen

    This usually means the main game executable could not be found. Causes: The game is fragmented or the image is corrupted.

    OPL does not display anything on boot

    You may have selected a Video Mode that your TV does not support. Fix: Hold Triangle and Cross while OPL initializes to reset your video mode to "Auto".