Re: CHD Disk Image Format (MAME)
Posted: October 26th, 2022, 3:43 am
Programming, Homebrew, Reverse Engineering, Hacks, Mods and Net Yaroze
https://www.psxdev.net/forum/
Code: Select all
CHCD Metadata (94Ch bytes, plus 10h-byte metadata header)
000h 4 Number of tracks (N) (1..99)
004h N*18h Track entries
... .. Zeropadding to 94Ch-byte size (when less than 99 tracks)
Track entries:
000h 4 Track Type (0..7, CHCD=# in table below) (eg. 6=MODE2_RAW)
004h 4 Subchannel Type (0=RW, 1=RW_RAW, 2=None)
008h 4 Sector Size (800h, 914h, 920h or 930h)
00Ch 4 Subchannel Size (0 or 60h)
010h 4 Number of Frames (aka number of sectors)
014h 4 Padding Frames (0..3) (to make Total Frames a multiple of 4)
Code: Select all
For TYPE and PGTYPE (and CHCD numeric type 0..7):
"MODE1/2048" or "MODE1" CHCD=0 800h-byte ;\Data Mode1
"MODE1/2352" or "MODE1_RAW" CHCD=1 930h-byte ;/
"MODE2/2336" or "MODE2" ;\dupe? CHCD=2 920h-byte ;\.
"MODE2/2336" or "MODE2_FORM_MIX" ;/ CHCD=5 920h-byte ;
"MODE2/2048" or "MODE2_FORM1" CHCD=3 800h-byte ; Data Mode2
"MODE2/2324" or "MODE2_FORM2" CHCD=4 914h-byte ;
"MODE2/2352" or "MODE2_RAW" or "CDI/2352" CHCD=6 930h-byte ;/
"AUDIO" (stored as big-endian samples!!!) CHCD=7 930h-byte ;-Audio CD-DA
Code: Select all
00 00 00 00 00 00 00 00 00 00 00 00 ;P
01 01 01 00 00 00 00 00 02 00 5A 28 ;Q (for first sector at 00:02:00)
00 00 00 00 00 00 00 00 00 00 00 00 ;R
00 00 00 00 00 00 00 00 00 00 00 00 ;S
00 00 00 00 00 00 00 00 00 00 00 00 ;T
00 00 00 00 00 00 00 00 00 00 00 00 ;U
00 00 00 00 00 00 00 00 00 00 00 00 ;V
00 00 00 00 00 00 00 00 00 00 00 00 ;W
Code: Select all
"RW" normal "cooked" 96 bytes per sector
"RW_RAW" raw uninterleaved 96 bytes per sector
Code: Select all
RW: packed R-W sub-channel data (96 bytes, L-EC data will be generated if required),
RW_RAW: raw R-W sub-channel data (interleaved and L-EC data already calculated, 96 bytes).
If you mean like the .SBI, I guess it's not possible. You need some external file, you cannot store it inside the .CHD.nocash wrote: Do you know a way to create or test CHD files with subchannel data?
http://wiki.recalbox.com/en/tutorials/u ... ion/chdmanwiki.recalbox.com wrote: For PS1 games protected by LibCrypt, normally you have SBI (Subchannel Information) files, you keep them and put them with the CHDs, otherwise your games will not pass.
I guess the difference is the sub-header?nocash wrote: For tracks, is there a difference between "MODE2" and "MODE2_FORM_MIX"?
The sentence "including the sub-header" is just there for confusion (it's pretty much impossible not to include the sub-header in those sectors). The sub-header is stored twice in MODE2 sectors (as sub-header, and copy of sub-header):null wrote: October 27th, 2022, 5:31 pm I guess the difference is the sub-header?
In the CDRDAO.
MODE2:2336 bytes
MODE2_FORM_MIX:2336 bytes including the sub-header
Not that! That seems to be for album covers or streaming service or MP3 tags or whatever. CDROM sub-headers are 4-byte tall (most importantly used to distinguish between normal data sectors and XA-ADPCM audio sectors):null wrote: October 27th, 2022, 5:31 pm Sub-Headers
http://www.musoware.com/wiki/index.php? ... ub-Headers
It's not only the Index 0 sectors that are lost, it's also the whole Lead-In area that's missing, and that can contain things like Disc Type, First and Last Track number, Lead-Out location, Session info, CATALOG, ISRC, CD-TEXT, those are rarely needed, but any half-decent CDROM format is able to store that information. Some formats are also storing Error flags (I've never dealt with that, but it might be important for some consoles other than PSX).null wrote: October 27th, 2022, 5:31 pm So for now we can classify CHD as a lossy compression format until they fix the bug for the audio track indexes beyond 01 in the extracted .CUE?
That would require a good understanding of what is on CD, how is it stored on a CD, what can be dumped, how is that info stored in CUE/CCD/NRG/TOC/MDS/etc. files. Plus, they cannot know what is currently stored in CHD files (until I've finished writing the documentation for them). And, where they are now is that they don't even know how to compile the CHDMAN source code without linking in unneccessary crap (the EXE should be 250Kbytes max and work on any computer).null wrote: October 27th, 2022, 5:31 pm I don't know why they're not alarmed by this bug, looks like the team knew about it and still not fixing it since CHDv3? How come they can tolerate it if the purpose of MAME is about preserving things?
http://www.gnu.org/software/ccd2cue/man ... _0029.htmlGNU Compact Disc fields wrote: Value/Description
AUDIO - Audio/Music (2352 — 588 samples)
CDG - Karaoke CD+G (2448)
MODE1/2048 - CD-ROM Mode 1 Data (cooked)
MODE1/2352 - CD-ROM Mode 1 Data (raw)
MODE2/2048 - CD-ROM XA Mode 2 Data (form 1) *
MODE2/2324 - CD-ROM XA Mode 2 Data (form 2) *
MODE2/2336 - CD-ROM XA Mode 2 Data (form mix)
MODE2/2352 - CD-ROM XA Mode 2 Data (raw)
CDI/2336 - CDI Mode 2 Data
CDI/2352 - CDI Mode 2 Data
The modes marked with ‘*’ are not defined in the original CUE sheet format specification.
nocash wrote: For tracks, is there a difference between "MODE2" and "MODE2_FORM_MIX"?
According to claunia's source code MODE2 is FORMLESS while the MODE2_FORM_MIX is mixed forms. And there's some info in the Google Patents CDROM Decoder page tells that FORMLESS replaces the subheader with the 2336 bytes user data next to header. So technically there's no subheader for MODE2_FORMLESS, only MODE2_FORM_MIX have it.nocash wrote: The sentence "including the sub-header" is just there for confusion (it's pretty much impossible not to include the sub-header in those sectors).
Ah, yes, that might be where the two "different" formats came from...null wrote: November 8th, 2022, 1:35 am the Google Patents CDROM Decoder page tells that FORMLESS ...
Code: Select all
MODE2 "formless" --> subheader MAY contain FORM1 or FORM2 or WHATEVER info (the recording tool didn't care about that)
MODE2_FORM_MIX --> subheader SHALL contain FORM1 or FORM2 info (the recording tool did think/know/verify that)
No change, just says missing KERNEL32.DLL:AddVectoredExceptionHandler as ever since.
Does that help as test case? I mean, you will need some solid criminal energy to find or create a test case. Like, intentionally creating a CHD file with some kind of broken or nonstandard subchannel data, and then checking if any emulators do respond as expected when reading the corresponding sectors.null wrote: November 2nd, 2022, 12:19 am Looks like the beta prototypes in hidden palace uses CloneCD with SUB you can test some of those demos. You can download it directly in their site.
I can't read the bug report on the github page... and the post that you've quoted doesn't mention any bugs?null wrote: November 3rd, 2022, 3:40 am Some bugs about the CDI.
[CDI/2352]/redump (CD-i) #2784
http://github.com/mamedev/mame/issues/2784http://www.gnu.org/software/ccd2cue/man ... _0029.htmlGNU Compact Disc fields wrote: Value/Description
AUDIO - Audio/Music (2352 — 588 samples)
CDG - Karaoke CD+G (2448)
MODE1/2048 - CD-ROM Mode 1 Data (cooked)
MODE1/2352 - CD-ROM Mode 1 Data (raw)
MODE2/2048 - CD-ROM XA Mode 2 Data (form 1) *
MODE2/2324 - CD-ROM XA Mode 2 Data (form 2) *
MODE2/2336 - CD-ROM XA Mode 2 Data (form mix)
MODE2/2352 - CD-ROM XA Mode 2 Data (raw)
CDI/2336 - CDI Mode 2 Data
CDI/2352 - CDI Mode 2 Data
The modes marked with ‘*’ are not defined in the original CUE sheet format specification.
The CHDMAN didn't want to accept the CDI/2352 track in a CUE. The error message is "ERROR: Unknown track type [CDI/2352]. Contact MAMEDEV". The workaround is to change the CDI/2352 to MODE2/2352 they say but it looks no one tested it yet so I can't proved if this is a working FIX solution. The issue is still open so there's no hard-coded fix yet in the latest CHDMAN. It's just a minor bug anyway but still a bug.nocash wrote: I can't read the bug report on the github page... and the post that you've quoted doesn't mention any bugs?
About the MAME v0.255 DVD support, they classified PSP's UMD as DVD.MAME History wrote: MAME v0.255 - Add DVD support
MAME v0.262 - Added support for Zstandard compression
MAME v0.265 - Added multi-session disc support (thanks WindyFairy)
zlib/DEFLATE and Zstandard both have the same compression ratio but zstd wins in compression/decompression speed.PPSSPP wrote: PSP .ISO to .CHD
chdman createdvd -hs 2048 -i game.iso -o game.chd
PSP .ISO to .CHD only with Zstandard compression
chdman createdvd -hs 2048 -i game.iso -o game.chd -c zstd
PSP .CHD to .ISO
chdman extractdvd -hs 2048 -i game.chd -o game.iso
Code: Select all
REM SESSION 010203...
Yes, they convert some of their multi-disc PSX games into a single .PBP for PSP's POPS. Like Final Fantasy series, Metal Gear Solid, Resident Evil, etc. They upload it on their online store PSN as PSP Eboot.pbp.nocash wrote: the .PBP PSX games have multi-session?