Closed i30817 closed 9 years ago
To be honest, I don't know well how subchannel data is typically stored.
At a high level, typically cds have 2352 byte sectors, I think. Outside the 2048 data bytes, the rest are used for error correction. This is "Mode 1". PS1 games use those extra bytes for data, afaik, so they're "Mode 2". Normally these bytes are just stored on the ISO, not separate.
Currently, maxcso only supports power-of-two block sizes. It makes things simpler, but it's doable to support arbitrary sizes. FWIW, PPSSPP/Play!/pcsx2 only support power-of-two sizes also.
The actual subchannel data is an additional 98 (really 96) bytes that are also stored with these sectors. AFAIK, this is typically stored into a separate file, although there's nothing stopping it from being interleaved I guess. Depends on whether it's read together or separately, really.
How best to compress these really depends on how they're read - can I read two sectors and skip the subchannel data? Is subchannel reading a separate operation?
As far as audio, pretty sure this is "just data", so it's just as compressible.
A lot of ps1 emulators are closed source, though...
-[Unknown]
I think epsxe (closed source) now supports a compression format that is the reversed 'official' Sony format (.pbp) with built in support for subchannel data - which they used in their PSNetwork Ps1 emulators. I guess a solution like that would not be reversible like cso (cue + img + sub files into a single format - not to mention that there are as many subchannel formats as there are backup tools. One for alcohol120 one for cdrecord, etc). Converting multiple formats, even if lossy only won't be easy.
But saturn for example, i don't think uses subchannel data, just cue+bin for the audio tracks.
Actually it's pcsxr saying it supports .pbp, i need to get informed in how to convert. And it looks like most conversion tools just pretend the subchannel data doesn't exist (only take isos or bin), so things are probably not quite 'reversed' enough.
I also found this about CDDA tracks in pbps: https://github.com/Hykem/psxtract/issues/9 and this for subchanneldata/ECC in pbps https://github.com/Hykem/psxtract/issues/3 The project is working on a decompressor to play the PSNetwork games on pc emulators so i think they're the ones that understand how sony uses it the best so i asked there how to best compress pbp to support subchannel data. Still, the question remains if cso is appropriate for the Sega Saturn, Mega Cd or Dreamcast.
Mmmm on second thought cso might not be a good fit for those consoles since they typically had quite a few multidisc games unlike the PSP or Ps2. PBP single file standard for multidisc games is a good thing (if only emulators hacked the bios to allow switching immediately when checked it would be perfect).
That's true, a single-file format designed for multiple discs does seem more appropriate for PS1 when you say it that way for sure. I don't really know Sega consoles well, but I can imagine it's the same with them as well.
I'll close this for now, but if there's more info please feel free to still comment.
-[Unknown]
I noticed you added support for cso to pcsx2 and play! besides PPSSPP. Any chance of adding the same to Yabuse / reincast / pcsxr ?
If i recall correctly some of these older consoles used subchannel data as copy protection and that is usually represented as a additional file outside of the iso and also some used CD audio tracks, which might ruin the locality of io reads, so i'm not sure if this is even a good idea in principle - close if you think it's not worthwhile.