PSF2Format

HomePage :: Categories :: Login

PSF2 Format


This is a variant of the PSF Format, using a version byte of 0x02, for Playstation 2 music. Due to the flexibility of the format, PSF2 can handle either sequenced or streamed music.

Contents


Program section: Not used. May be ignored, removed, etc.
Reserved section: Contains a PSF2 Virtual Filesystem.

File Extensions



Description


A PSF2 file consists of a virtual filesystem located entirely in the Reserved section. The Program section is unused.

Playing a PSF2 file begins by loading the "psf2.irx" IOP module from the virtual filesystem. Loading and executing this module should perform all necessary hardware setup and play the music.

PSF2 files are limited to playing sequenced music using the IOP and hardware (SPU2) synthesis only. Software synthesis, generally performed by the EE, is not considered.

Runtime Environment


IOP modules in a PSF2 may link to the following libraries. The version number may be no later than the listed version.

  Name       Ver.   Name       Ver.   Name       Ver.
  --------------    --------------    --------------
  dmacman    102    sifman     101    thmsgbx    101
  excepman   101    ssbusc     101    thrdman    102
  heaplib    101    stdio      103    thsemap    101
  intrman    102    sysclib    103    thvpool    101
  ioman      104    sysmem     101    timrman    103
  loadcore   103    thbase     102    vblank     101
  modload    106    thevent    101
  sifcmd     101    thfpool    101


IOP modules should use the following technique to access files in the PSF2 virtual filesystem:

  1. Take argv[0] and cut it off directly after the rightmost separator, defined as either a forward slash, backward slash or colon (/ \ :). This string becomes the "device prefix".
  2. Append the name of the desired file to the device prefix.
  3. Use the resulting string in standard calls such as open or LoadModule.

For instance, Highly Experimental may call psf2.irx with an argv[0] such as "hefile:/psf2.irx". In this case, the device prefix is "hefile:/". You might use the following code to open a file named "test.file":

  char full_pathname[256];
 
  strcpy(full_pathname, device_prefix); // may be for example "hefile:/"
  strcat(full_pathname, "test.file");

  fd = open(full_pathname, O_RDONLY); // in this example, "hefile:/test.file"
 


Different players or environments may use different device prefixes, so don't always use "hefile:/". Your PSF2 may be run under a variety of environments. The device prefix may even be something like "cdrom0:/".

IOP modules, as a rule, should not attempt any contact with hardware which is unnecessary for music playing. This includes, but is not limited to: SIF, CD/DVD, USB, iLink, ATA, pad, memory card, and network hardware. This hardware may be emulated minimally but is not guaranteed to work.

IOP modules should use a minimal amount of memory, and make good use of the virtual filesystem to keep large amounts of data rather than try to fit them all in an IRX data section.

MiniPSF2


PSF2 filesystems may be combined using the _lib, _lib2, ... tags, in a manner similar to the MiniPSF format. However, the loading procedure is slightly different.

For more details, see MiniPSF2.

Refresh Rate


The _refresh tag can be used to specify the refresh rate in Hz (50 or 60), just as with PSF1.


CategoryPSF