by Alex Free
This is a C library that can be used in your program to:
1) Ensure validity of a PlayStation 1 or 2 CD disc image in MODE2/2352 format.
2) Get the boot file name (i.e. SLUS_XXX.XX) in the disc image.
3) Identify different disc images that share the same boot file name by checking revision differences.
An example has been included (example.c) that uses this library as well as my EzRe build system. The example is portable to many operating systems (see how to build) and simply uses all 3 functions mentioned above:
Homepage | GitHub | PSX-Place Thread | GBATemp Thread |
int is_ps_cd(FILE *bin);
returns 1 if bin
is a PlayStation 1 or 2 CD image in MODE2/2352 format. Returns 0 if it is not. Should be called before any of the functions below.
int get_boot_file_name(FILE *bin);
Returns boot file name in bin
as char boot_file[11];
.
int id_rev(FILE *bin, const unsigned int difference_offset, const unsigned char old_byte, const unsigned char new_byte);
Returns 0 if bin
has old_byte
at difference_offset
. Returns 1 if bin
has new_byte
at difference_offset
. Returns 2 if neither are found at different_offset
.
Please see example.c
in the source directory for implementation.
Lib PS-CD-ID is released with the 3-BSD license, see the license for more info.