superg / redumper

Low level CD dumper utility
GNU General Public License v3.0
216 stars 19 forks source link

Add PS4 system to info #151

Closed Deterous closed 4 months ago

Deterous commented 4 months ago

Adds PS4 as a supported system by redumper info Prints version and serial of the disc:

PS4 [track.iso]:
  version: 01.00
  serial: CUSA12345

More info: https://www.psdevwiki.com/ps4/Param.sfo

This is very similar to the PS3 SFO parsing, however the first sector of data in param.sfo is skipped. Additionally, PS4 discs do not have a SFB file.

Ragowit commented 4 months ago

Why is PS3 data altered by adding a dash (BLUS12345 gets altered into BLUS-12345), but PS4 isn't altered? (CUSA12345 stays as CUSA12345 instead of being altered into CUSA-12345).

This behavior feels inconsistently. Imho, you either alter all data, or none. Do not mix. As I stated in https://github.com/superg/redumper/issues/93#issuecomment-1793385805, I'm in favor of not modifying any data. But I'm fine with whatever path is taken, as long it's not mixed as it is right now.

superg commented 4 months ago

@Ragowit , can you provide an example of PS4 disc where there is no dash in the serial? Do such discs exist?

Ragowit commented 4 months ago

@superg, on the physical PS3/PS4/PS5 disc they are always with a dash. But in the .sfo file, they are never with a dash.

EDIT: And on the spine, they are on separate lines, like: BLUS 12345

CUSA 12345

superg commented 4 months ago

I'm confused then, I thought that SFO always has a dash. We should definitely standardize internal serial for all PlayStation consoles.

Ragowit commented 4 months ago

I popped in a PS3 disc now just to make sure I'm not saying wrong things.

PS3 discs have both a .sfb file, and a .sfo file. The .sfb file actually has the dash: BLES-01288 The .sfo does not: BLES01288

PS4 discs have only .sfo file. No dash: CUSA40400

fuzz6001 commented 4 months ago

PS3

.sfb

00000220  42 43 4A 53 2D 33 30 30 32 32 00 00 00 00 00 00  BCJS-30022......

.sfo

000003D0  00 00 00 00 00 00 00 00 42 43 4A 53 33 30 30 32  ........BCJS3002
000003E0  32 00 00 00 00 00 00 00 30 31 2E 30 30 00 00 00  2.......01.00...

PS4

.sfo

000009B0  00 00 00 00 43 55 53 41 30 36 30 32 37 00 00 00  ....CUSA06027...
000009C0  30 31 2E 30 31 00 00 00                          01.01...

PS5

.json

00000260  50 50 53 41 30 32 32 36 39 00 00 00 00 00 00 00  PPSA02269.......
  "disc": [
    {
      "masterDataId": "PPSA02269",
      "role": "Play Disc"
    }
  ],
superg commented 4 months ago

Ok. let me get to the bottom of it and I'll bring it all to the common denominator.

Deterous commented 4 months ago

Redump uses the internal serial from the SFB file for PS3 discs, which has a dash. There is good reason for preferring SFB over SFO (multi-game discs). PS4 and PS5 do not have an SFB. The serial in their SFO do not have a dash. I'm not aware of any PS3 disc that do not have a serial in their SFB file. And a PS3 disc without a SFB file is out-of-standard and not a real PS3 disc. The "altering" only occurs in the case where the serial does not exist in the SFB file (no known discs like this exist). In this case, the serial is taken from the SFO and a dash is added to be consistent with the rest of the PS3 set.