TOC reading

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
User avatar
evilo
Posts: 230
Joined: Thu Apr 22, 2004 8:40 pm
Contact:

TOC reading

Post 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
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post 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().
User avatar
evilo
Posts: 230
Joined: Thu Apr 22, 2004 8:40 pm
Contact:

Post 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
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

This issue you're running into is probably what keeps VCDs from working on the PS2 as well.
Post Reply