Mega CD Disc format (pregap, postgap, ...)
Posted: Sat May 19, 2012 11:55 am
As I was reading official docs (see attached pictures), I had some trouble figuring exactly how it was related to the TOC informations returned to the BIOS by CDD (CD drive processor).
From what I gathered:
1) there is a fixed 2 sec PREGAP (index 00) at the start of DATA track (track 01)
2) there should be a minimal 2 sec POSTGAP (index 02) at the end of DATA track (track 01)
3) there should be a minimal 2 sec PREGAP (index 00) at the start of each AUDIO track
4) there should be a minimal 2 sec POSTGAP (index 02) at the end of last AUDIO track
5) the first logical sector (LBA=0) starts at DATA track index 01 (00:02:00) and the last logical sector ends just before last AUDIO track POSTGAP (max. 60:01:74)
Is that correct ?
Now, I was wondering what effect it really had on the MSF informations returned by CDD on TOC reads (which I assume are directly retrieved from channel Q subcode data by the CDD processor) and especially:
1) does start of track returns the absolute time with or without PREGAP ? For the data track, it seems that emulators automatically add the 2s PREGAP and return 00:02:00 as track start MSF, but what about audio tracks ? Should be the same right ?
2) does track length includes POST-GAP for data track and last audio track ?
3) is total length the sum of all track length (without PREGAP) or does it includes PREGAP as well ?
I also tried to analyze various CUE image files coming from different places and it seems there are big discrepancies between TOC informations for a single CD image:
- none of the CUE files include DATA track PREGAP (i.e first track always starts at 00:00:00 which is inaccurate but it probably works because CD burn programs & emulators automatically add it anyway), DATA track or last AUDIO track POSTGAP (maybe directly included in the CD image file(s) through a bunch of zeros ?).
- some use PREGAP command, while some others use INDEX00: i believe the former indicates that the pause is not included in the image file but that it exists anyway, while the latter indicates that there are two indexes stored in the image file (with the first one always being filled by zeros ?). In fact, it seems that PREGAP is sometime only present for first audio track (track 02) which makes me think there is a confusion with Data track POSTGAP.
- some CUE files (mostly coming from redump.org) have PREGAP/ INDEX00 fields that are less than 2 seconds (generally 00:01:74): this does not respect the Red Book standard and I cannot believe there was so much different CD burners at this time to got inconsistencies like that. It seems to me it's a mistake from the CD drive when dumping the CD or a result of wrong method applied when dumping CD images (seems like the method posted on their forums involves playing with specific drive read offsets, though I am not sure to understand the theory behind this and if this is correct or not).
Can these discrepancies be explained by faulty or mis-configured CD dumping softwares ? Can all CD drives/software detect PREGAP/POSTGAP correctly using the track index (00,01,02,...) or other infos in the sub-code channels ?




From what I gathered:
1) there is a fixed 2 sec PREGAP (index 00) at the start of DATA track (track 01)
2) there should be a minimal 2 sec POSTGAP (index 02) at the end of DATA track (track 01)
3) there should be a minimal 2 sec PREGAP (index 00) at the start of each AUDIO track
4) there should be a minimal 2 sec POSTGAP (index 02) at the end of last AUDIO track
5) the first logical sector (LBA=0) starts at DATA track index 01 (00:02:00) and the last logical sector ends just before last AUDIO track POSTGAP (max. 60:01:74)
Is that correct ?
Now, I was wondering what effect it really had on the MSF informations returned by CDD on TOC reads (which I assume are directly retrieved from channel Q subcode data by the CDD processor) and especially:
1) does start of track returns the absolute time with or without PREGAP ? For the data track, it seems that emulators automatically add the 2s PREGAP and return 00:02:00 as track start MSF, but what about audio tracks ? Should be the same right ?
2) does track length includes POST-GAP for data track and last audio track ?
3) is total length the sum of all track length (without PREGAP) or does it includes PREGAP as well ?
I also tried to analyze various CUE image files coming from different places and it seems there are big discrepancies between TOC informations for a single CD image:
- none of the CUE files include DATA track PREGAP (i.e first track always starts at 00:00:00 which is inaccurate but it probably works because CD burn programs & emulators automatically add it anyway), DATA track or last AUDIO track POSTGAP (maybe directly included in the CD image file(s) through a bunch of zeros ?).
- some use PREGAP command, while some others use INDEX00: i believe the former indicates that the pause is not included in the image file but that it exists anyway, while the latter indicates that there are two indexes stored in the image file (with the first one always being filled by zeros ?). In fact, it seems that PREGAP is sometime only present for first audio track (track 02) which makes me think there is a confusion with Data track POSTGAP.
- some CUE files (mostly coming from redump.org) have PREGAP/ INDEX00 fields that are less than 2 seconds (generally 00:01:74): this does not respect the Red Book standard and I cannot believe there was so much different CD burners at this time to got inconsistencies like that. It seems to me it's a mistake from the CD drive when dumping the CD or a result of wrong method applied when dumping CD images (seems like the method posted on their forums involves playing with specific drive read offsets, though I am not sure to understand the theory behind this and if this is correct or not).
Can these discrepancies be explained by faulty or mis-configured CD dumping softwares ? Can all CD drives/software detect PREGAP/POSTGAP correctly using the track index (00,01,02,...) or other infos in the sub-code channels ?



