Page 1 of 1

TOC reading

Posted: Thu Sep 01, 2005 2:54 am
by evilo
Hi all,

I'm trying to read a cd TOC without using the CdGetToc() functions,

so concretely, instead of doing :
unsigned char raw_toc[1024];

CdGetToc(raw_toc);
that is actually working, i'm doing :
unsigned char raw_toc[2352];

cd_read_mode_t mode;


mode.trycount = 32;
mode.spindlctrl = CdSpinNom;
mode.datapattern = CdSecS2048;
mode.pad = 0;

CdDiskReady(0);

// read first sector at sector 0
CdReadCdda(0, 1, &raw_toc[0], &mode);

CdSync(0);
I then ouptut the buffer content, but it always return blank after the call to CdReadCdda. Ah and yes, I'm using CdReadCdda because I'm reading from a CDDA disc (so CdRead doesn't work with that type of disc).

Anyone has an idea of what's wrong here, and how it could be achieved properly ?

thanks beforehand,
evilo

Posted: Mon Sep 05, 2005 7:30 am
by J.F.
The TOC isn't part of the normal CD data. CDDA reads the data in tracks identified by the TOC. It won't read the TOC itself. Drives have a special command to do that, and the only access to that special command on the PS2 is with CdGetTOC().

Posted: Mon Sep 05, 2005 9:04 am
by evilo
hi JF,

yes that's what Pixel explained me also... I just thougth it was at sector 0... I was wrong..

I wanted to do that for people swapping, as CDDA tracks are not working for them (in neocd), so I was thinking to do that to "manually" get the TOC of the CD currently present in the tray and get back the tracks informations (instead of having the "cached" TOC),

no luck !

Thank you,
evilo

Posted: Sat Sep 10, 2005 12:34 pm
by J.F.
This issue you're running into is probably what keeps VCDs from working on the PS2 as well.