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

For hardware talk only (please avoid ROM dumper stuff)
Post Reply
Mask of Destiny
Very interested
Posts: 615
Joined: Thu Nov 30, 2006 6:30 am

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

Post by Mask of Destiny » Thu Jun 15, 2017 6:18 pm

KanedaFr wrote:Since Bourricot made me ask if the hack I planned was the right one, I thought about the BIOS hack.
We already talked about it on this thread but it was about modding the BIOS, hack nterface, etc....
What about the all-in-a-cart way ?
since we know (look at Everdrive) it's possible to load a bios from the cart.
would it be possible to get a cart with BIOS, SD reader (using /TIME) and audio player (SR/SL) included ?
It would be awesome : no hardware to mod, only a plug and play hack!

I'm not enough aware of the way data is loaded from MCD which could be a problem (DMA?)
Any feeback on the do-ability of this idea ?
I think there are a couple obstacles with this. The big one is that the part of the BIOS that handles CD access is on the Sub CPU, which has no access to any hardware on the cartridge slot. Games have too much low-level control over the comm registers and the main CPU to get away with doing a remote procedure call of sorts to the main CPU for SD card access.

The other issue is indeed DMA. In part for performance reasons and in part because at least in some games, the hardware isn't completely abstracted by the BIOS. I was never an expert on the CD hardware and it's been a long time since I looked at it, but I believe while CDC access is completely abstracted behind the BIOS, the same is not true for the CDD.

I think the best options are either to go with the existing route of having a device that replaces the hardware on the other side of the ribbon cable or to replace the Sega CD completely with an FPGA hanging off the expansion slot. The first option has to deal with the annoyance of 3 different drive designs (Model 1, Model 2 Sony, Model 2 Funai), but is probably the least amount of work overall. The second gives some additional flexibility for enhancements.

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

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

Post by KanedaFr » Fri Jun 16, 2017 11:18 am

Thanks MoD, I'll stay on my first idea then.

If anyone could share the way the CD part is connected to the main board on the MegaCD2, I'm in !
I'm looking for the connections between the 315-5548 and the couple uPD75006/CXD1167Q (Funai) or CXP5084/CXD2500 (Sony)
I know it's a 25pin FCC on MCD1 so easy to hook but on MCD2 ?! direct connection, at least on Funai...don't know on Sony...

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

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

Post by KanedaFr » Sun Jun 18, 2017 10:28 pm

The SDATA is killing me !

We know the CXD2500AQ uses i2s.
OK, for audio, LRCK is here to send Left then Right 16bit data (2's complement)
but for data ?! does it send 2x 16bit data too (like seems to say the C2PO part on datasheet, page 18) or 2x24bits (full capacity) ?

And what exactly is sent "serialized" ?
The 2352 bytes on Audio mode (= 588 stereo sample = 1/75 second)
The 2048 bytes in CDROM mode 1
The 2336 bytes in CDROM mode 2

or

2352 bytes in any mode (so including header and error on CDRom mode)

EDIT : according the LC8951, it seems to be the 2nd answer, so it only left the i2s for CD Rom data stuff... is it a "hack" on the not-yet-called-i2s protocol ?

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

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

Post by TmEE co.(TM) » Mon Jun 19, 2017 6:54 am

There's always 3 lines, Bit Clock, LR Clock and Serial Data. Bit Clock is what everything is synchronized to and it tells when there's a new bit in the stream on Serial Data, LR clock tells when data starts/ends.

Image
(this image is illustrative, LRCLK polarity is probably wrong and I'm not sure if data changes on rising edge or falling edge of BCLK)

These lines can carry any data, originally they were for audio but with CD-ROM there's non audio stuff. This is why on actual CD players you'll hear all kind of noises when you put a data CD in the player. (MegaCD and game consoles in general mute output in data tracks as they know what data tracks are).
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

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

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

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

TmEE co.(TM) wrote: ...
These lines can carry any data, originally they were for audio but with CD-ROM there's non audio stuff. This is why on actual CD players you'll hear all kind of noises when you put a data CD in the player. (MegaCD and game consoles in general mute output in data tracks as they know what data tracks are).
Thanks, it was exactly the kind of answer I was looking for !!!
It so explains why the D/M is sent back to the 515-5548, as is the SDATA : it sends SDATA to LC7883 only if audio.
I wonder why they didn't do the same for the data : SDATA is sent what ever is D/M to the LC8951x

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

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

Post by TmEE co.(TM) » Mon Jun 19, 2017 1:24 pm

To clarify, only SDATA can carry any data. BCLK and LRCLK are always retaining their function. LRCLK length can vary, allowing different word lengths on SDATA.
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

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

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

Post by Eke » Mon Jun 19, 2017 7:43 pm

KanedaFr wrote: I wonder why they didn't do the same for the data : SDATA is sent what ever is D/M to the LC8951x
Because that's the only way software can access sector data from the CD. This might not seem really useful for CD audio data but internal CD player for example uses it to display VU meter while playing audio.

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

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

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

So it access the Audio RAW data (16 bit sample) like it would access binary data...
It could be how Flux works (or WonderMega Library)

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

Re:

Post by KanedaFr » Wed Jun 21, 2017 1:05 am

TmEE co.(TM) wrote:the 16MHz is 16.934400MHz, which is CDDA bitclock.
I don't understand where this value come from....

HardWareMan
Very interested
Posts: 745
Joined: Sat Dec 15, 2007 7:49 am
Location: Kazakhstan, Pavlodar

Re: Re:

Post by HardWareMan » Wed Jun 21, 2017 3:35 am

KanedaFr wrote:
TmEE co.(TM) wrote:the 16MHz is 16.934400MHz, which is CDDA bitclock.
I don't understand where this value come from....
16 934 400 / 44 100 / 2 / 16 = 12.

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

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

Post by Mask of Destiny » Wed Jun 21, 2017 6:10 am

Yeah, I don't get that clock either. Even after CIRC, EFM and all that you only end up with 588 bits per channel-data frame. There are 98 channel data frames per timecode frame and there are 75 timecode frames per second. That gives you a bit clock of 4.321800 MHz and that's only if we're talking about the raw EFM bitstream from the disc.

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

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

Post by KanedaFr » Wed Jun 21, 2017 8:11 am

I made some research tonight (ZZZZZzzzz...)
It's about oversampling, for a better Digital-to-Analog result and reduce noise

16 934 400 = 44 100 *384
384 is the oversampling factor
now, I need to find where this 384 come from

It seems to be the value required by the LC7883 (on datasheet overview, you could read "The LC7883...support different serial data rates - 384Fs and 392Fs for CD"...where Fs = 44100) but why these values, I don't (still?) know
Every I read say it"s "industry standard" :(

Not sure it's needed to replace the CD drive but how could I know....

HardWareMan
Very interested
Posts: 745
Joined: Sat Dec 15, 2007 7:49 am
Location: Kazakhstan, Pavlodar

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

Post by HardWareMan » Wed Jun 21, 2017 11:22 am

Again: 384 / 2 / 16 = 12. Because 2 channels with 16bit in each. 12x oversampling for one bit Delta-Sigma DAC.

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

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

Post by KanedaFr » Wed Jun 21, 2017 12:08 pm

HardWareMan wrote:Again: 384 / 2 / 16 = 12. Because 2 channels with 16bit in each. 12x oversampling for one bit Delta-Sigma DAC.
OK, thanks Hardwareman.
Sorry but your first post was a mistery, like..."yes 12...and so ?" ;)

thanks again

HardWareMan
Very interested
Posts: 745
Joined: Sat Dec 15, 2007 7:49 am
Location: Kazakhstan, Pavlodar

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

Post by HardWareMan » Wed Jun 21, 2017 2:41 pm

KanedaFr wrote:Sorry but your first post was a mistery, like..."yes 12...and so ?" ;)
Quite round integer after division, isn't it? I just was want to show this fact. The rest you should have guessed yourself. In fact, there tons of frequencies that pretty multiples to each other. With integer multiplier.

Post Reply