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

For hardware talk only (please avoid ROM dumper stuff)
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 » Thu Jun 29, 2017 10:11 am

First approach:
Image
BCLK = 16MHz / 8. Yes, audio bit clock is 2.1168MHz (16.9344 / 8). 2 116 800 Hz / 48 = 44 100 Hz.

Audio CD loading and then playback it:
Image
Note that some data is break thru to the DAC, but Mute not allow them to output. I think it is maybe the TOC. Then I push PLAY and Mute is off. Little bit closer:
Image
I think we've done with audio output, right? Everything as expected with it.
Last edited by HardWareMan on Thu Jun 29, 2017 10:59 am, edited 3 times in total.

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 » Thu Jun 29, 2017 10:34 am

Same here (no audio disk -> audio disk load -> audio disc play):
Image
A little bit closer while playing:
Image
SCOR period: 1/75 sec. SCOR pulse is right one WFCK clock period. EXCK/SBSO active only when WFCK is low and they push only 8 bits at once (1 byte at once):
Image
Image
Subchannel data is quite periodical to full sector:
Image
You can use my captured data to decode playing time and other control data. Just for practice.

Now, I can capture all of these signals at once, but do you really want it?

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 » Thu Jun 29, 2017 11:41 am

I forgot control channel. Here is power up:
Image
Little bit closer at reset:
Image
Image
Image
Shortest nIRQ period is 6.334 ms.
Image
The rest periods seems to be multiple to shortest one (I guess it is just skipping).

Captured data while power up, open tray, close tray, disc load, next track, play modes.

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 » Thu Jun 29, 2017 12:01 pm

HardWareMan wrote: Did you saw this diagrams before (they come from Mega CD 1 manual)?
Sure it was my first source of info ;)
and the Mega CD2 manual got some more
HardWareMan wrote: It seems that 48 bits in transaction, 24 bit for every channel and it is use 16 bit with right align and sign extend (D16...D23 is copy of D15).
yes, 16bits with MSB 2's complement
HardWareMan wrote:
Also, there would be nice to know what this means:
Image
[/quote]

BLCK = bit clock
DATA = signal data
LRCK = Left Right ??? clock
C2PO = error flag
SCOR = Subcode Chunk
SBSO - Subcode data
WFCK - Frame Clock
EXCK - XXX clock
GND
16MHz - DF xxx clock (modulation ?)

CDCK - CD mechacon clock
HOCK - host CPU clock
GND
DBx - Data Bus X
IRQ - IRQ Request
SGND - ???
RESET - CD hard reset

which is what you'll find on your previous post, extracted from the MCD 2 manual ;)

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 » Thu Jun 29, 2017 12:05 pm

Anyway, what about capture data?

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 » Thu Jun 29, 2017 12:19 pm

I've got it. The CD track is kind of tape with 74/80/99 minutes of play, digitally. So, when it carries an audio data, there no need a perfect sync, so rough time coordinate is M:S:F format in subchannel. When they turn the audio CD to the data CD, there must be more accurate sync to the "tape". So, they use subchannel to mark an sector start and format sector with data sync (00-FF-FF...FF-00), data itself (2048 bytes) and ECC at the tail. Every stereo audio sample treated as 4 bytes of data (2x16bit). As result, same I2S interface used for audio and data transfer, but player mute DAC when it transfer digitall data.
I also remember old CD players, that plays data track as audio since they was made before the Data CD was introduced.

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 » Thu Jun 29, 2017 1:58 pm

HardWareMan wrote:I've got it. The CD track is kind of tape with 74/80/99 minutes of play, digitally. So, when it carries an audio data, there no need a perfect sync, so rough time coordinate is M:S:F format in subchannel. When they turn the audio CD to the data CD, there must be more accurate sync to the "tape". So, they use subchannel to mark an sector start and format sector with data sync (00-FF-FF...FF-00), data itself (2048 bytes) and ECC at the tail. Every stereo audio sample treated as 4 bytes of data (2x16bit). As result, same I2S interface used for audio and data transfer, but player mute DAC when it transfer digitall data.
I also remember old CD players, that plays data track as audio since they was made before the Data CD was introduced.
Yes, DATA is send like audio (2352bytes) and the D/M flag mute it
It was the conclusion of Eke back when l_oliveira told us MCD used i2s..
So, your capture data prove it !
Anyway, what about capture data?
I'm at the office ;)
not easy to spy BIG pictures w/o being noticed ;)
Can't wait to be back at home to check all of this !

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 » Thu Jun 29, 2017 2:08 pm

OK. I think we can do first approach to make FLASH player of CD image. The only thing is still undiscovered is set of commands and statuses on control 4 bit bus.

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 » Thu Jun 29, 2017 2:10 pm

HardWareMan wrote:Same here (no audio disk -> audio disk load -> audio disc play)
so subchannel data is sent even when SCOR occurs, thanks !

What I can't explain is why SCORE is ONE WFCK only and not TWO (S0 & S1)
i don't understand...
You can use my captured data to decode playing time and other control data. Just for practice.
What did you use to render them ?
it seems really useful to mesure time and freq as well...
Now, I can capture all of these signals at once, but do you really want it?
Like I said, I'd like to confirm if there is any link between comm, sub and data....or they're totally independant
so could you measure IRQ / WFCK / LRCK on the same timing ?

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 » Thu Jun 29, 2017 2:15 pm

HardWareMan wrote:OK. I think we can do first approach to make FLASH player of CD image. The only thing is still undiscovered is set of commands and statuses on control 4 bit bus.
I think it's not that hard... difficult for someone like me who'll need to learn VHDL & FPGA at the same time (in progress...very interesting) but, from what I see, doable

and (a part of) the set commands are available, thanks to emu authors : Stef & Eke
http://gendev.spritesmind.net/page-megasd.html (see CDC command)

To find the others one, you'll need to compare DATA sent from HOST to µC to DATA send from µC to DSP
but to do this, you'll need a ROM which would send every kind of commands and not only the ones knowns (currently in progress, based on Chilly Mode 1 sample)

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 » Thu Jun 29, 2017 2:20 pm

HardWareMan wrote:I forgot control channel. Here is power up
OHHH !!!
IRQ is not sent EVERY 1/75s ?!!!

Does it mean the next IRQ is sent only when command received is proceeded ?
to be able to sent result on next IRQ ?
it would answer my question about sync how comm / sub / data

I would then mean

Code: Select all

IRQ
status = xxx
command = Play CD 
move to track
...
..
...
CD DSP confirm it starts send data
IRQ
status = playing
command = none
wait
IRQ
status = playing
command = none
wait
....
in that case, IRQ should be in sync with start of LRCK, when audio start (D/M false)

so does it mean it's 1/75 unless µC is busy ?

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 » Thu Jun 29, 2017 2:32 pm

KanedaFr wrote:Like I said, I'd like to confirm if there is any link between comm, sub and data....or they're totally independant
so could you measure IRQ / WFCK / LRCK on the same timing ?
Here we come. Power up and boot Earthworm Jim CD:
Image
Some closeups with nIRQ is active:
Image
Image
Image
I think they must be independent, but still within 16MHz (DFCK) clock domain. It makes sense to synchronize only I2C and sub-channel. Their flow can be synchronous, because they are read linearly from the CD matrix. Control section don't require to be synced to I2S and subchannel. I think the nIRQ timing was done by DFCK division.

It's like a nIRQ not synced to any of signal. As I said before, this signal has 6,33ms period time slot. But it don't fire up at every slot (6,33ms), some slots a skipped (when drive controller busy?).
BTW, 6,33ms is ~157Hz. Maybe it is 2x 1/75? 75*2=150Hz and I got just measurement error?
Last edited by HardWareMan on Thu Jun 29, 2017 2:42 pm, edited 1 time in total.

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 » Thu Jun 29, 2017 2:42 pm

THANKS !!!
awesome !!!


so, for me, the only question still here (for now) is why SCOR is only 1 frame and not 2 like it should be :
A sector is 98 frames, with 2 frames for S0/S1 synchronisation word and 96 frames for subcode = 96bit for P, 96bit for Q,......
so where is the second frame ?!

oh, and is the subcode really useful for MCD...does it use it for TOC or not ?
in this case, subcode "emulation" is only needed for CD+G

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 » Thu Jun 29, 2017 2:47 pm

KanedaFr wrote:THANKS !!!
awesome !!!
You're welcome.
KanedaFr wrote: so, for me, the only question still here (for now) is why SCOR is only 1 frame and not 2 like it should be :
A sector is 98 frames, with 2 frames for S0/S1 synchronisation word and 96 frames for subcode = 96bit for P, 96bit for Q,......
so where is the second frame ?!
It is quite logical. When reader detect S1 (while S0 already in internal buffer/register) it set SCOR for one subcode byte. And reset it on first non Sx subcode. It is not necessary to set it for 2.
Image
Last edited by HardWareMan on Thu Jun 29, 2017 2:48 pm, edited 1 time in total.

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 » Thu Jun 29, 2017 2:48 pm

HardWareMan wrote:SCOR period: 1/75 sec.
which prove MCD is 1x CD drive

and you do understand why I wanted to check fi SCOR was in sync with IRQ which 1/75sec too

Post Reply