Subcodes only for CD+G ?

Ask anything your want about Mega/SegaCD programming.

Moderator: Mask of Destiny

Post Reply
KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Subcodes only for CD+G ?

Post by KanedaFr » Mon Jun 19, 2017 11:47 am

Hi,

While Nemesis started a subject about this 3 years ago, it didn't seem to answer this basic question : are the subcodes ONLY used for CD+G ?
I know R to W are used for CD+G (and CD TExt) but does the MegaCD use the P and Q ones ?
I mean, internally, to handle TOC/track (with Q Mode 1 ) or to detect data vs audio (even if I think it's handle more on the CD DSP side)

Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

Re: Subcodes only for CD+G ?

Post by Mask of Destiny » Mon Jun 19, 2017 7:56 pm

Are you asking about whether the BIOS itself uses subcode data or if the subcode data is used by the Mega CD in general? For the latter, the answer is trivially yes because it's the only place to get the TOC. It's encoded repeatedly in the subcode data inside the lead-in area. What I can't personally say is whether the BIOS gets the raw subcode data and interprets it or whether some part of the CD hardware handles decoding the TOC.

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Re: Subcodes only for CD+G ?

Post by KanedaFr » Mon Jun 19, 2017 9:04 pm

OK, so I'll need to get deeper on the BIOS. I asked before, to avoid losing time if anyone already did it ;)
Thanks

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Re: Subcodes only for CD+G ?

Post by Eke » Mon Jun 19, 2017 9:17 pm

D/M status, TOC and current Track infos are all retrieved/computed by dedicated 4-bit microprocessor using subcode Q data output by CD DSP on SUBQ pin (controlled by serial clock on SQCK pin).

D/M status bit is found in Q subchannel control field while TOC and current Track infos are found in q-data field respectively during Lead In and User Data / Lead Out areas.

Those infos are written back in CDD status words that can be read by software in ASIC registers. Additionaly, D/M status is provided to main ASIC to distinguish between CD-AUDIO/CD-ROM sectors data (also appears as a bit in one of the ASIC registers).

P subchannel is only accessible from subcodes buffer inside main ASIC. No software(including BIOS) seems to use P-Q subchannels data from this buffer (I don't emulate it by default unless a .sub file is found and it does not cause any issue).

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Re: Subcodes only for CD+G ?

Post by KanedaFr » Tue Jun 20, 2017 10:35 am

OK, so the CD DSP need it, not the ASIC (if we forget about CD+G)
If the SBSO line is flat, it won't bug the game ?

You said GX support .sub files.
Unfortunatly, they rarely come with game rip :(
What could I use to made a private rip including the .sub part ? (on windows)

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Re: Subcodes only for CD+G ?

Post by Eke » Tue Jun 20, 2017 12:08 pm

KanedaFr wrote:If the SBSO line is flat, it won't bug the game ?
It shouldn't affect software since, from my testing in emulator, neither games or BIOS care if the subcode interrupt never occurs
But it's possible it could lock the ASIC and thus the whole Mega CD hardware, depending how it was designed. Quite unlikely but you never know :wink:
KanedaFr wrote: Unfortunatly, they rarely come with game rip :(
Because for all released games (I don't count CD+G title as games), they don't hold any meaningful data (likely zeros) in Q-W subchannels and P-Q subchannels infos are standard infos that are easily recreated when burning the CD image or running it in an emulator.
KanedaFr wrote:What could I use to made a private rip including the .sub part ? (on windows)
I think CloneCD can do it but don't quote me on that. You should probably ask on redump forums.

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Re: Subcodes only for CD+G ?

Post by KanedaFr » Tue Jun 20, 2017 1:31 pm

Eke wrote:
KanedaFr wrote:If the SBSO line is flat, it won't bug the game ?
It shouldn't affect software since, from my testing in emulator, neither games or BIOS care if the subcode interrupt never occurs
But it's possible it could lock the ASIC and thus the whole Mega CD hardware, depending how it was designed. Quite unlikely but you never know :wink:
:evil: :(
Eke wrote:
KanedaFr wrote: Unfortunatly, they rarely come with game rip :(
Because for all released games (I don't count CD+G title as games), they don't hold any meaningful data (likely zeros) in Q-W subchannels and P-Q subchannels infos are standard infos that are easily recreated when burning the CD image or running it in an emulator.
yes, I see what you mean...
So perhaps I could just fake it the same way than to read a subchannel file...
KanedaFr wrote:What could I use to made a private rip including the .sub part ? (on windows)
I think CloneCD can do it but don't quote me on that. You should probably ask on redump forums.
It seems some software are able to dump CUE/BIN/SUB....else, yes, CloneCD (and Alcohol) seems to be able to handle it.
I recently discover it thanks to CDEmu

Huge
Very interested
Posts: 197
Joined: Sat Dec 13, 2008 11:50 pm

Re: Subcodes only for CD+G ?

Post by Huge » Thu Aug 10, 2017 12:35 pm

If you are on Windows, CD Manipulator can make clonecd compatible dumps with subcode included, and it is free:
http://www.storeroom.info/cdm/

It will write a "cdm" file instead of "ccd" but the format is the same, and it can be renamed and work the same.

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Re: Subcodes only for CD+G ?

Post by Nemesis » Wed Aug 29, 2018 12:34 am

I managed to get full subcode reading working on the LaserActive hardware through software. I found the bios routines were buggy and flawed. I had to partially bypass them and poke the hardware directly. Synchronization is also a problem. Subcode data arrives independently from sector data and unsynchronized with it, so it's usually off by a few sectors. It's certainly possible to read subcode data on the MegaCD/LD hardware though, with some effort.

Post Reply