How to play CDDA

paul_met

Established Member
Greetings. I recently wondered how to play CDDA music. Using the example of commercial games, I learned that the audio track is launched directly by writing 16-bit values to the system addresses. An example of playing the audio track #2:
Code:
FFFE => 0x25890008 (Interrupt Status Register)
1000 => 0x25890018 (Command Register 1)
0200 (or 0201) => 0x2589001C (Command Register 2)
0F00 => 0x25890020 (Command Register 3)
0200 (or 0263) => 0x25890024 (Command Register 4)
This works in Yabause, but does not work in Mednafen and SSF. What else needs to be done to play the audio track in other emulators?
 
Originally when testing this out for myself, I'd only gotten this to do anything if I had loaded the game from the CD player menu, so I guessed that a few missing CD initializer calls was the problem here. After following Yabause's CD Block Documentation (the only source of documentation I can find on the CD Block, mind it's still very incomplete) I implemented some other CD calls, CDAbortFile (0x75) -> CDCDBInit (0x01) -> CDEndTransfer (0x06) -> CDResetSelector (0x48), then finally to PlayDisc (0x10). Unfortunately it didn't seen to actually change anything, even after trying to strap on CDAuth (for some reason not noted down as a command? it's only listed in some example code) Reset Selector and Connect Filter before PlayDisc didn't seem to even change anything behaviors, still only plays if booted from the CD player menu.

If anyone who knows more about this, what's missing before calling PlayDisc? Some call that's missing? Something SCSP related? (Guessing you have to latch it onto a PCM channel?)
 
Okay, after a bit more research, it looks like you have to set the volume of the CD Block's output, now I need to figure out how to do it and get it working...
 
Left and right CDDA are wired to SCSP's EFSDL and EFPAN registers 16 and 17 (lines EXTS 0 and 1 in the figure on p. 83 of SCSP manual).

So you have to set CDDA volume and pan on those registers to hear some sound. They are set by the multiplayer since it has the CDDA playback functionality.

The register naming is a bit confusing because despite EFSDL and EFPAN being effect registers, in fact those registers set the dry sound level and pan for CDDA because EXTS 0 and 1 don't go through the DSP and there's no EFREG 16 or 17.

The CDDA sound source EXTS can be read from a DSP program however. There's an example in dsams manual. In that case, the wet CDDA is output to an EFREG register.
 
Okay so after looking at Sega's Saturn Technical Bulletin #29 (CD-DA Volume) and trying to implement it myself, it didn't seem to sway that whatsoever, however it did seem to change if again, booted from the CD player menu.

Doing some memory viewing it seems that the CD Block is trying to output data to the SCSP, only this part is actually put through is this small bit here:
1769954502351.png


As opposed to what's normally passed through, including PCM data:

1769954856680.png


In other terms, I have a lot more SCSP reading up to do, once I figure out how to do some PCM/FM synthesis stuff with that I'll come back to this sometime later... (even if those components aren't directly related, knowing how it works is still important)
 
Last edited:
Okay so after looking at Sega's Saturn Technical Bulletin #29 (CD-DA Volume) and trying to implement it myself, it didn't seem to sway that whatsoever, however it did seem to change if again, booted from the CD player menu.

Doing some memory viewing it seems that the CD Block is trying to output data to the SCSP, only this part is actually put through is this small bit here:
View attachment 12043

As opposed to what's normally passed through, including PCM data:

View attachment 12044

In other terms, I have a lot more SCSP reading up to do, once I figure out how to do some PCM/FM synthesis stuff with that I'll come back to this sometime later... (even if those components aren't directly related, knowing how it works is still important)
Your 1st screen capture looks like incorrect emulation because starting at 05B00EE0 would be EFREG 16 and 17 which as I said don't exist.

From SCSP manual p. 33 :
1769967342789.png


EXTS 0 and 1 are going straight to the mixer (at the bottom, from SCSP manual p. 83) :
1769967596094.png
 
Last edited:
Back
Top