Database Formats
To display downloadable content, PKGi PS3 parses plain text files stored in /dev_hdd0/game/NP00PKGI3/USRDIR/. Because memory on the PS3 is highly constrained (the app allocates a strict 32MB buffer for the database), the parsing engine is designed to be lightweight, fast, and strict.
File Categorization
You can split your content into separate files to keep things organized. The application automatically assigns the Content Type based on the filename:
| Filename | Internal Content Type ID | UI Tab |
|---|---|---|
pkgi.txt |
Variable (defined per line) | General / Mixed |
pkgi_games.txt |
1 | Games |
pkgi_dlcs.txt |
2 | DLCs |
pkgi_themes.txt |
3 | Themes |
pkgi_avatars.txt |
4 | Avatars |
pkgi_demos.txt |
5 | Demos |
pkgi_updates.txt |
6 | Updates |
pkgi_emulators.txt |
7 | Emulators |
pkgi_apps.txt |
8 | Apps |
pkgi_tools.txt |
9 | Tools |
Note: The application assumes that every database file uses the exact same format structure.
Default Database Format
By default, PKGi PS3 expects a simple CSV format (comma-separated). The first line of the file is ignored (treated as a header). Every subsequent line represents one item.
contentid,type,name,description,rap,url,size,checksum
Column Definitions
contentid(string): The full 36-character content ID of the item (e.g.,UP0000-NPXX99999_00-0000112223333000).- Edge Case: If this is left empty, the parser (
generate_contentid()) will inject a dummy ID:X00000-X{increment}_00-0000000000000000. type(integer): A number defining the content type (1-9, matching the table above). Set to0if unknown. If placed in a specific file (e.g.,pkgi_games.txt), this column is overridden by the file's inherent type.name(string): The display name of the item. Crucial restriction: Cannot contain commas or newlines.description(string): A short description. Cannot contain commas or newlines.rap(hex string): The 16 hex byte string for the RAP file (exactly 32 characters). Leave empty if the item is DRM-free (like an update or demo).url(string): The direct HTTP, HTTPS, FTP, or FTPS link to the.pkgfile. Must begin with a valid protocol.size(integer): Size of the.pkgin bytes. Used for the UI and space-checking. Use0if unknown.checksum(hex string): SHA256 digest of the.pkgfile (64 characters). Used in Direct Download mode to verify file integrity. Leave empty to skip the check.
Example Line
EP0001-FILEMANAG_00-0000000000000000,8,FileManager v1.40,File Manager,,http://github.com/Zarh/ManaGunZ/releases/download/1.40/FileManager_v1.40.pkg,12171120,FAF680636B18AD0B70AA61F48A78C5E42D6972F795F1B82CC434BE3DDE60F00F
Customizing the Format (dbformat.txt)
If you have a preexisting database (e.g., exported from a spreadsheet or another tool) that uses a different delimiter or column order, you do not need to reformat your massive text file.
Instead, you can define a custom parser using a file named dbformat.txt placed in the USRDIR directory.
dbformat.txt Structure
This configuration file must contain exactly two lines:
- Line 1: The delimiter character. (e.g.,
;,|,\t). - Line 2: The column layout, separated by the delimiter defined in Line 1. You must use the exact column tags from the default format (
contentid,type,name,description,rap,url,size,checksum).
Any tag name not matching the internal list is treated as "ColumnUnknown" and silently ignored during parsing.
Example 1: Pipe Delimiter with Ignored Columns
If your main file looks like this:
USA|NPUB31154|My Game|http://link.com/game.pkg||UP0000-NPUB31154_00-0000000000000000|2023|game.pkg|1024|
Your dbformat.txt should look like this:
|
REGION|TITLE|name|url|rap|contentid|DATE|PKG FILENAME|size|checksum
Result: The parser will split the line by |. It will ignore the REGION, TITLE, DATE, and PKG FILENAME columns, successfully capturing the required data.
Example 2: Semicolon Delimiter
;
name;TITLE ID;REGION;description;AUTHOR;type;url;rap;size
Parsing Limits
- Maximum Columns: The parser supports a maximum of 32 columns (
MAX_DB_COLUMNS). - Maximum Items: The hard limit for database entries is 131,072 (
MAX_DB_ITEMS 0x20000), bounded by the 32MB total allocation (MAX_DB_SIZE). If your database exceeds this, the app will log an error:list is too large....