Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

PSXPackager PSP

From GameBrew
Revision as of 02:19, 17 Haziran 2024 by Hyatt (talk | contribs)
PSXPackager
Psxpackagerpsp.png
General
AuthorRupertAvery
TypeFile Operation
Version1.6.3
LicenseMIT License
Last Updated2023/10/13
Links
Download
Website
Source
Support Author

PSXPackager is a utility that allows you to convert Playstation disc images in various formats to PBP format and back. It is a port of the popstation-md C source to C#. There is a command-line executable available for Windows, Linux, and OSX, and a Windows-only GUI. The GUI allows you to select and process several images in a queue (Batch mode).

Features

  • Convert .BIN + .CUE or .IMG to .PBP
  • Extract .PBP to .BIN + .CUE file
  • Supports conversion of .7z, .zip, .rar files to .PBP
  • Supports merging of single-disc, multi-track .BIN + .CUE into one .BIN + .CUE
  • Supports writing multi-track CUE information to PBP for audio
  • PBP Compression levels from 0 to 9
  • Supports writing multi-disc PBP using .m3u files
  • Supports extracting multi-disc PBP
  • Windows/Linux/OSX CLI
  • GUI with PSX2PSP-like interface and batch processing

Usage

PSXPackager requires .NET 6.0 Runtime or above.

The basic usage of PSXPackager accepts the file or path to convert.

psxpackager -i <input_path_or_file> [-o <output_path_or_file>]
Copy

The -i or input parameter is required. It specifies a path to a file, or a directory and a wildcard expression. If a wildcard expression is used, it will process all matching files in the directory.

The application will assume that you want to convert any image to a PBP, and any PBP to a .BIN + .CUE.

The command:

psxpackager -i "Final Fantasy VII - Disc 1.cue"
Copy

will process Final Fantasy VII - Disc 1.bin and Final Fantasy VII - Disc 1.cue and output Final Fantasy VII - Disc 1.pbp.

The -o or output parameter is optional. It specifies the folder where the the converted or extracted files will be placed. If not specified, the folder specified on the input is ued.

If the input is a file and the output is also a file, the output will be renamed, instead of reusing the input filename.

Options

  -i, --input                (Group: input) The input file or path to convert. The filename may contain wildcards.

  -o, --output               The output path where the converted file(s) will be written.

  -l, --level                (Default: 5) Set compression level 0-9, default 5.

  -r, --recursive            Recurse subdirectories

  -d, --discs                A comma-separated list of disc numbers to extract from a PBP.

  -v, --verbosity            (Default: 3) Set level of output messages. 1 = Files, Errors and Warnings only, 2 = No
                             Info-level messages, 3 = All messages (default), 4 = Include timestamps

  -x                         If specified, overwrite a file if it exists, otherwise ask confirmation.

  -s, --skip                 If specified, will skip existing files.

  -f, --format               (Default: %FILENAME%) Specify the filename format e.g. [%GAMEID%] [%MAINGAMEID%] %TITLE%
                             (%REGION%) or %FILENAME%

  -g, --log                  If specified, log messages to a file.

  --extract                  If specified, extract resources using the path specified by resource-format. See README for
                             more details.

  --import                   If specified, import resources using the path specified by resource-format. See README for
                             more details.

  --generate                 If specified, create empty resources folder specified by resource-format. See README for
                             more details.

  --resource-format          The format to use with extract/import/generate. See README for more details.

  --resource-root            The path where resource folders will be located. If not specified, the path will be the
                             same as the input file

  --help                     Display this help screen.

  --version                  Display version information.
Copy

Convert a .BIN, .CUE, .ISO, .IMG or archive to a .PBP

PSXPackager supports several input formats. Simply pass the path to the archive, CUE sheet, or image with the -i parameter.

psxpackager -i <path_to_file> [-o <output_path>] [-l <compression_level>] [-y]
Copy

The output path is optional. If not specified, the path of the input file will be used.

PSXPackager will prompt if a file exists before overwriting it. Use the -x argument to overwrite all files in the output directory.

Set the compression level to a value from 0 to 9, with 0 being no compression and 9 being the highest compression level. If not specified, it will default to 5.

PSXPackager can automatically extract files from compressed files (archives) anc convert the contents into a PBP. The following formats are supported:

  • .zip
  • .7z
  • .rar
  • .tar
  • .gz

Archives will be decompressed to a temporary folder in %TEMP%\PSXPackager, and will be cleaned up on exit.

Extract a .PBP to a .BIN + .CUE

PSXPackager checks the file extension to decide whether to extract or convert, so the syntax remains the same. The output will always be a .bin + .cue.

Extracting from Multi-disc PBPs are supported. Specify the discs to extract with the -d or --disc option, which takes a comma-separated list of disc numbers to extract, e.g. -d 1,2. If this option is not specified, all discs will be extracted.

psxpackager -i <path_to_pbp> [-o <output_path>] [-d <list_of_discs>]
Copy

Filename formatting

Use the -f or format option to specify the format of the output filename based on the information found on the disc (Sony GameID) and the gameInfo.db file.

This allows you to generate standardized output filenames that can include the GameID e.g SCUS-94163, the region (NTSC/PAL) and the game name.

By default, it will use %FILENAME%, i.e. the input filename as the output filename.

See Formatting for more info.

Merging Multi-Track Games

Some games such as Tomb Raider use audio tracks as background music. These are usually extracted by disc rippers as separate .bin files. They usually come with a .cue file that lists the .bins in order and specifies how long each track is.

PSXPackager will automatically merge multi-bin discs before converting to PBP as long as you pass in the .cue file (not the first .bin file). Previously you would need to use CDMage or some other tool to merge multi-bins.

The resulting PBP file will contain the audio tracks as disc tracks and you will be able to play your game on your PSP or emulator with music.

Creating Multi-disc PBPs

The PBP format can contain more than one disc, and this is supported by PSXPackager. This allows you to merge a multi-disc game such as Final Fantasy VII (3 discs) into a single PBP.

To do this from the command line, first create an .m3u file containing a list of the discs in the order you wish them to appear in the PBP.

For example, create a text file with the following contents and save as Final Fantasy VIII.m3u

Final Fantasy VIII - Disc 1.cue
Final Fantasy VIII - Disc 2.cue
Final Fantasy VIII - Disc 3.cue
Copy

Call psxpackager with the .m3u as the input file.

psxpackager -i "Final Fantasy VIII.m3u" [-o <output_path>]
Copy

The file Final Fantasy VIII.PBP will be created which contains the three discs in one file.

Batch Conversion

Wildcards are now supported using the -i argument

psxpackager -i <path_containing_files>\<wildcard_filter> [-o <output_path>]
Copy

This will process all supported files in the folder C:\Roms. Use with caution, as you may be overwriting files that exist.

psxpackager -i "C:\Roms\*.*"
Copy

This will extract all PBP files in the folder C:\Roms to BIN+CUE.

psxpackager -i "C:\Roms\*.PBP"
Copy

This will convert all files matching Legend of Dragoon - Disc ?.bin in the folder C:\Roms to PBP.

psxpackager -i "C:\Roms\Legend of Dragoon - Disc ?.bin"
Copy

If you want faster batch conversion, use the GUI, as it supports multi-threaded processing.

Customizing PBPs with Resources

Resource files are PBP-specific embedded resources that are normally used by the PSP, PSVita or PS3 to display an image or play audio on the XMB when the game is selected. These files usually named ICON0.PNG, PIC0.PNG, PIC1.PNG and SND0.AT3.

PSXPackager can extract (--extract) or embed (--import) resource files for a single conversion or batch conversion. To do the latter, the resource files must be located in a specific location.

There are two options that let you set how and where the resource files are found.

The --resource-format option lets you match a folder based on filename, gameid and other formats. See Formatting. omitting this option defaults the format to %FILENAME%, meaning the input filename without the extension will be used.

The --resource-root option sets the root path of your resource folders. This allows you to separate your disc images from your resource folders. You can omit this option to use the same folder as the input file as the root path of your resource folder.

Extract Resources

Extracts resources from a PBP.

psxpackager -i <path_to_file> --extract [--resource-format <resource format>] [--resource-root <resource root folder>] [-o <output_path>]
Copy

--resource-format - the format of the folder name to extract the embedded resources to. See Formatting. If not specified, the default value will be %FILENAME%\%RESOURCE%.%EXT%

--resource-root - the root folder where to place the resource folders. Do not specify to place the resource folder next to the input file.

For example, if you extract the resources from a Final Fantasy VII (DISC 1).PBP file using the commande below:

psxpackager -i "Final Fantasy VII (DISC 1).PBP" --extract --resource-path %GAMEID%\%RESOURCE%.%EXT%
Copy

You would have extracted the following files:

SCUS-94163\ICON0.PNG
SCUS-94163\PIC0.PNG
SCUS-94163\PIC1.PNG
Copy

Import Resources

Imports custom resources into PBP.

psxpackager -i <path_to_file> --import [--resource-format <resource format>] [--resource-folder <resource root folder>] [-o <output_path>]
Copy

--resource-format - the format of the folder name to import the embedded resources from. See Formatting. If not specified, the default value will be %FILENAME%\%RESOURCE%.%EXT%

--resource-root - the root folder where to start searching for the resource folders. Do not specify to look for the resource folder next to the input file.

For example, if you want to build a PBP from a BIN+CUE file and you have the resources next to the file in a folder such as below:

Final Fantasy VII (Disc-1).bin
Final Fantasy VII (Disc-1).cue
SCUS-94163\ICON0.PNG
SCUS-94163\PIC0.PNG
SCUS-94163\PIC1.PNG
Copy

You can build your PBP using the following command:

psxpackager -i "Final Fantasy VII (Disc-1).cue" --import --resource-path %GAMEID%\%RESOURCE%.%EXT%
Copy

Generate Resource Folders

This option is provided for the following scenario:

You have a bunch of images you want to convert to PBP, and you want to customize all of them. To do this, you will need to generate resource folders, where you will later place the icons and backgrounds you want.

This option will create empty folders using the specified format.

psxpackager -i <path_to_file> --generate [--resource-format <resource format>] [--resource-folder <resource root folder>]
Copy

--resource-format - the format of the folder name to generate. See Formatting. If not specified, the default value will be %FILENAME%

For example, this will generate the empty folder SCUS-94163:

psxpackager -i "Final Fantasy VII (Disc-1).cue" --generate --resource-path %GAMEID%
Copy

Formatting

%FILENAME%   - The input filename
 
%GAMEID%     - The GAMEID of the disc. For multi-disc games, each disc will have a differnt GAMEID. 

%MAINGAMEID% - The GAMEID of the first disc in a multi-disc game.

%TITLE%      - The Disc Title of the game. This will contain the Disc number or other identifier in a mult-disc game.

%MAINTITLE%  - The Main title of the game. This will be the actual title of the game.

%REGION%     - The game region, i.e. NTSC or PAL.

%RESOURCE%   - The resource type. (ICON0, ICON1, PIC0, PIC1, SND0). Only used for resource files

%EXT%        - The resource extension. (PNG, AT3). Only used for resource files

Copy

For example, processing Final Fantasy VIII - Disc 1.iso with the following format:

[%GAMEID%] %TITLE% (%REGION%)
Copy

will generate the filename

[SLUS00892] Final Fantasy VIII - Disc 1 (NTSC).pbp
Copy

Note that when extracting from a multi-disc PBP PSXPackager will append the disc number to the file format.

Multi-track .CUE files (Audio tracks)

If the input or compressed file has a .cue with multiple tracks, PSXPackager will merge the .bins into a single file in a temporary folder.

A new CUE sheet will also be created with all tracks under the merged .bin, and index positions will be updated.

This merged .cue file will be used to create a TOC (Table of Contents) for the PBP ISO. This allows audio tracks to be correctly read from the PBP.

Temporary files will be deleted when conversion is complete, if the conversion is cancelled, or if an error occurs.

The temporary folder location is %TEMP%\PSXPackager.

Screenshots

psxpackagerpsp-01.png

psxpackagerpsp-02.png

Changelog

v1.6.3

  • Update SharpCompress from 0.33.0 to 0.34.1
  • Specify FileStream mode (Fixes #52)

v1.6.2

  • This version fixes some issues most notably the missing gameInfo.db file.

v1.6.1

  • The framework requirement has been lowered back to .NET 6.0 as this is more prevalent on popular distros as of now.
  • A bug when the output folder name has a dot has been fixed

v1.6.0

  • Updated to .NET 7.0, please install the necessary runtime for your OS
  • Fixed the bugs introduced in 1.5 that made the CLI not convert anything at all
  • Added checkboxes in GUI Batch list to let you select which files you want to convert
  • changed how resource-related command line options, see README.MD for more information
  • Linux CLI release, tested in WSL Ubuntu
  • OSX CLI release, untested

v1.4.1

  • Fix null ScannerID returned for dummy GameEntry for when gameID is not found.

v1.4.0

  • Fixed bug where converting to PBP with no CUE would result in a TOC with an index of 00:02:01 from the default PSAR
  • Change to SevenZipSharp for notifications during extraction
  • Get DiscID from PBP Disc Entry
  • Add output file to tempfiles so cancelling will delete as well
  • Added option to format filename
  • Add option to generate log
  • Add option for verbosity levels
  • Processing now continues if there are errors

v1.3.1

  • This release fixes problems when extracting PBPs with more than two discs, as well as error handling when a file does not exist, or when a relative path contains no directory.

v1.2

  • This version has a bug when extracting a PBP with more than 2 discs. Please get the next release.

v0.3

  • Bug fixes
  • Support writing CUE to TOC - audio tracks on multi-bin + CUE files now work
  • Support extracting TOC to CUE when extracting PBP to BIN

v0.2

  • Compression level can now be set at the command line. Default is 5.
  • Compressed files now work as single input (-i parameter) not just for batch inputs
  • PBP Extraction now shows progress rate
  • PBP Extraction uses input filename for output as input.bin instead of dummy.img

External links

Advertising: