Skip to content

Commit

Permalink
Updating the ps1-packer documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasnoble committed Apr 4, 2024
1 parent 75deae6 commit 9ea89ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/Lua/binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ There is some support for handling PSX binaries in the Lua API. The `PCSX.Binary
- `'NTSC'`: NTSC region
- `'PAL'`: PAL region
- `PCSX.Binary.pack(src, dest, addr, pc, gp, sp, options)`: compresses the input binary stream into a self-decompressing stream. The input must be a `File` object, and the output must be a `File` object. The `addr` is the address that the binary will be loaded at. The `pc`, `gp`, and `sp` are the entry point, global pointer, and stack pointer of the binary. The `options` is an optional table with the following optional fields:
- `tload`: the address that the compressed binary will be loaded at. If not specified, it will be set to a suitable address. Not specifying this will generate an in-place decompression binary, which doesn't require much extra memory. When specifying this, the whole output stream needs to be loaded at this specific address, and the decompression code will be located at its beginning, meaning both the entry point and the loading addresses will be the same.
- `tload`: the address that the compressed binary will be loaded at. If not specified, it will be set to a suitable address. Not specifying this will generate an in-place decompression binary, which doesn't require much extra memory. When specifying this, the whole output stream will be loaded at this specific address, and the decompression code will be located at its beginning, meaning both the entry point and the loading addresses will be the same.
- `nopad`: the generated PS-EXE will not be padded to 2048 bytes. It will not be suitable to boot from cd-rom, as the BIOS requires binaries to be aligned to sector sizes, but many other tools like unirom+nops or caetla+catflap will be able to handle it properly.
- `booty`: a boolean specifying that the output stream will be suitable to boot as a PIO bytestream. Incompatible with `tload` or `raw`.
- `shell`: a boolean specifying that the output stream will attempt to reboot the machine and load the binary, which can be useful when resetting the kernel.
- `raw`: a boolean specifying that the output stream will be a raw binary, without a PS-EXE header. It doesn't make sense to use this without `tload`.
- `raw`: a boolean specifying that the output stream will be a raw binary, without a PS-EXE header. The generated binary will be completely position independent, and will not require any special loading address. It is up to the user to ensure no overlap can happen by loading the file to a high enough address. This option can be used to generate embedded binaries within others, or to be loaded by other means, and executed by jumping to it. The `tload` option will be ignored when this is specified.
- `PCSX.Binary.createExe(src, dest, addr, pc, gp, sp)`: creates a PS-EXE binary from the input binary stream. The input must be a `File` object, and the output must be a `File` object. The `addr` is the address that the binary will be loaded at. The `pc`, `gp`, and `sp` are the entry point, global pointer, and stack pointer of the binary.

The above methods can be used for example the following way:
Expand Down

0 comments on commit 9ea89ce

Please sign in to comment.