HDD (or flash) instead of a CD, questions...

For hardware talk only (please avoid ROM dumper stuff)
Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Mon Aug 01, 2011 1:34 am

TmEE co.(TM) wrote:There are 2 kinds of CDC used so the games that use HW directly have to have 2 pieces of code for each thing.
What were the two? I only seem to remember one offhand.
:?

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Mon Aug 01, 2011 8:17 pm

Chilly Willy wrote:
TmEE co.(TM) wrote:There are 2 kinds of CDC used so the games that use HW directly have to have 2 pieces of code for each thing.
What were the two? I only seem to remember one offhand.
:?
I implemented only one CDC in Gens so i think there is only one.
Problem is that i directly implemented a low level emulation because i though it would be the only way to assure a good compatibility...
However from some tests and debugging i done i would say a big majority of game only use BIOS functions to acces the CD.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Mon Aug 01, 2011 11:25 pm

It would seem to me that only games that came on cart that tried to use the CD would need to be able to handle the CDC directly... games like Pier Solar... of which there's only one - Pier Solar. All the rest can use the BIOS; I would see a CD game only bypassing the BIOS if it needed to do something that was buggy in a particular version of the BIOS. I seem to remember a couple tech bulletins from SEGA that mention certain things that CD games aren't allowed to do or they wouldn't be licensed - things like trying to use the interrupts already in use by the BIOS for things like the CDC.

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

Post by Nemesis » Tue Aug 02, 2011 6:26 am

I implemented only one CDC in Gens so i think there is only one.
Problem is that i directly implemented a low level emulation because i though it would be the only way to assure a good compatibility...
However from some tests and debugging i done i would say a big majority of game only use BIOS functions to acces the CD.
How much work was it to implement the CDC emulation? What did you use for documentation at the time?

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Tue Aug 02, 2011 7:41 am

X'eye is the weird machine which BIOSes fail on emulators and other machine BIOSes don't work on them. Though I am not exactly 100% sure is the difference is in CDC, but the hardware suggests so as it has different chips in it.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

notaz
Very interested
Posts: 193
Joined: Mon Feb 04, 2008 11:58 pm
Location: Lithuania

Post by notaz » Tue Aug 02, 2011 11:45 am

There is also this Flux cart that might do this but I never really investigated how it works.

http://www.youtube.com/watch?v=Oswpqv22TIg

TascoDLX
Very interested
Posts: 262
Joined: Tue Feb 06, 2007 8:18 pm

Post by TascoDLX » Tue Aug 02, 2011 12:07 pm

Some games use CD-DMA, which requires more than just BIOS interaction.
Chilly Willy wrote:It would seem to me that only games that came on cart that tried to use the CD would need to be able to handle the CDC directly... games like Pier Solar... of which there's only one - Pier Solar.
Nope. Pier Solar uses the BIOS.
I seem to remember a couple tech bulletins from SEGA that mention certain things that CD games aren't allowed to do or they wouldn't be licensed - things like trying to use the interrupts already in use by the BIOS for things like the CDC.
According to the bulletin, the Cinepak library was changed "to avoid certain interrupt problems that may occur". The older version hooked the CD decoder interrupt (INT5) in order to immediately process sectors as they were decoded. (Pier Solar does that, too ;))

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Tue Aug 02, 2011 7:07 pm

notaz wrote:There is also this Flux cart that might do this but I never really investigated how it works.

http://www.youtube.com/watch?v=Oswpqv22TIg
Cool, so there WAS something else that used the CD from a cart. That's a pretty slick program. :D

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Tue Aug 02, 2011 8:38 pm

Nemesis wrote:
I implemented only one CDC in Gens so i think there is only one.
Problem is that i directly implemented a low level emulation because i though it would be the only way to assure a good compatibility...
However from some tests and debugging i done i would say a big majority of game only use BIOS functions to acces the CD.
How much work was it to implement the CDC emulation? What did you use for documentation at the time?
It took me many time mainly because we didn't had any informations about CDC / CDD hardwares at this time. I did a lot of reverse engineering on the european Mega CD BIOS. Gens was the first with Ages (remember it ?) to have partial Mega CD support, Ages was even more advanced than Gens at some point and i asked the author (Quinneston) how CDD worked but he didn't helped me much as he wanted to keep the advantage here ;)

Hopefully i got a MegaCD 2 some time later (a guy named Red5 from Genesis Project sent me it for free with a megadrive 2 !) and i built my own test ISO file to test stuff. I was able to do RE the CDC / CDD hardware by sending him some commands and get its replies... It was a lot faster than disassembling the BIOS ;)

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

Post by KanedaFr » Fri Aug 05, 2011 9:57 pm

I looked at the MegaCD shema, LC8951 doc and some internals (if error on zoom, rename .JPG in .jpg)

I now understand what you said about Hardware or Software.
Let see if I don't make a mistake
1/ you can hook the LC89515<-->MCD interface (intercept command write, status read and data transfert between the 2) => hardware mod and complexe "bus pirate" (LC89515 simulation)
2/ you can hook the data from the flat ribbon (good luck!) => easy hardware mod with a very complexe "bus pirate" (CD drive simulation)
3/ you can write you own bios to use the lines used to connect with the LC89515 to send you own data => complexe software mod, hardware mod and easier bus pirate. (data simulation)

I just don't understand yet how the audio CD is handled.....

l_oliveira
Very interested
Posts: 53
Joined: Mon Mar 07, 2011 12:58 am

Post by l_oliveira » Tue Aug 20, 2013 11:26 pm

Hi there !

As you know already, what the CDC do is collect data "frames" from the CD align it on a SRAM buffer, apply a layer of error correction (on top of the very basic one the CD drive does by itself already) then serve it to the host computer in "bursts" of parallel data...

What you might not know is that it does so through a I2S bus (a special custom version of I2C serial bus which is used for transmission of digital audio data).

What is done when audio is played: The I2S signal is routed to the DA converter on the analog board by the big SEGA ASIC instead of being sent to the CDC.

There's two DAC chips on the analog board. The smaller one is for the Ricoh sampler chip and the bigger one is for the CD drive. That way they can play samples on top of of the CD music without have to do complicated stuff like interpolation and digital mixing.

Since DSPs got cheaper a few years after MEGA-CD released, newer stuff (PS1 and newer) only use a single DAC as output and have a complex DSP doing mixing from several internal sources.

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

Post by Eke » Wed Aug 21, 2013 8:05 pm

l_oliveira wrote:
What you might not know is that it does so through a I2S bus (a special custom version of I2C serial bus which is used for transmission of digital audio data).

What is done when audio is played: The I2S signal is routed to the DA converter on the analog board by the big SEGA ASIC instead of being sent to the CDC.
Are you sure about that ? I have studied the Service Manual schematics that were released some time ago and it seems to me that CD serial data (SDATA) coming from the CD DSP always go directly to the CDC serial input, as well as the needed serial clocks (BCLK and LRCLK), so audio is still sent to it (although nothing is done from it).

The serial input of the CD Audio DAC however is indeed connected to the main ASIC (ODATA) , which probably routes CD serial data (SDATA) depending on D/M input coming from CDD (indicates music or cd-rom data).

As for X-Eye BIOS incompatibilty in emulators discussed earlier, i don't think it's caused by different CDC because I got it working fine with CD games in Genesis Plus GX by having BRAM mapped to $FD0000-$FDFFFF. It seems they might have been different CDC versions but they were very likely compatible (i have seen L8951 in first model, L89513 in MultiMega/Aiwa CD player, L89515 in other ones), emulating L8951 features at least worked with all known BIOS for me.

l_oliveira
Very interested
Posts: 53
Joined: Mon Mar 07, 2011 12:58 am

Post by l_oliveira » Wed Aug 21, 2013 9:03 pm

On a talk I had with Tiido about the Wondermega2 BIOS, apparently the problem was something related to the Mega Drive side of it being different from the normal units.

Your observation about the BRAM could be exactly what was causing the issue. It will likely help me too with hacking the Wondermega2/ X' EYE BIOS for region free, without having to source a unit. ;)


Now, your comment about the I2S bus is interesting. Is the MEGA-CD using the CDC to extract the audio level peak information from the audio stream for the dashboard CD PLAYER ?

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Aug 21, 2013 9:11 pm

There's already a region-free hack to the WonderMega and X'Eye BIOSes. I forget where they were posted... AssemblerGames or maybe SonicRetro...

Anywho, if you want them, you can PM me.

l_oliveira
Very interested
Posts: 53
Joined: Mon Mar 07, 2011 12:58 am

Post by l_oliveira » Wed Aug 21, 2013 9:12 pm

Chilly Willy wrote:There's already a region-free hack to the WonderMega and X'Eye BIOSes. I forget where they were posted... AssemblerGames or maybe SonicRetro...

Anywho, if you want them, you can PM me.
I know, I made most of them. :oops:

Anyway I just copied Raq's idea ... lol 8)

the problem with X'Eye and Wondermega2 bioses is that I was not able to test them at all and I got reports that they don't work from testers.

Post Reply