CDDA

GaRlic

New Member
alright so im trying to get cdda working, this is what i have so far

Code:
// CDDA CODE include files

#include <stdlib.h>

#include <sgl.h>

#include <sgl_cd.h>

#include "sddrvs.dat"

#define MAX_FILE 128

Sint32 dirwork[SLCD_WORK_SIZE(MAX_FILE) /sizeof (Sint32)];

//Just leave sddrvs and this:

Uint8 sdmap[]= {

	0x00,0x00,0xB0,0x00,0x00,0x00,0x80,0x00,

	0x10,0x01,0x30,0x00,0x00,0x00,0x10,0x00,

	0x11,0x01,0x40,0x00,0x00,0x00,0x20,0x00,

	0x20,0x01,0x60,0x00,0x00,0x00,0x06,0x00,

	0x21,0x01,0x68,0x00,0x00,0x00,0x06,0x00,

	0x22,0x01,0x70,0x00,0x00,0x00,0x06,0x00,

	0x23,0x01,0x78,0x00,0x00,0x00,0x06,0x00,

	0x24,0x01,0x80,0x00,0x00,0x00,0x06,0x00,

	0x01,0x01,0x86,0x00,0x00,0x04,0x00,0x00,

	0x30,0x05,0xA0,0x00,0x00,0x02,0x00,0x00,

	0xFF,0xFF

};

// Main

void ss_main(void)

{

Sint32 ndir;

CDHN cdhn;

CDBUF buf[2];

CDKEY key[2];

//CDWIN win; doesnt work.. doesnt seem to do shit anyway

Sint32 stat;

// Setup Display/sound/cdda/cd

slInitSystem(TV_320x224, NULL, 1);

slInitSound(sddrvstsk, sizeof(sddrvstsk), sdmap, sizeof(sdmap));

slCDDAOn(127, 127, 0, 0);

ndir = slCdInit(MAX_FILE, dirwork);

// Open Track one CDKEY struct defined in SGL_CD.h and called key in main

key[0].cn=CDKEY_NONE;

key[0].sm=CDKEY_NONE;

key[0].ci=CDKEY_NONE;

key[1].cn=CDKEY_TERM;

cdhn=slCdOpen ("cdda1",key);

// Load CDDA file

buf[0].type=CDBUF_COPY;

buf[0].trans.copy.addr=NULL;

buf[0].trans.copy.unit=CDBUF_FORM1;

buf[0].trans.copy.size=0;

slCdLoadFile (cdhn,buf);

while (1)

{

	slSynch();

	stat=slCdGetStatus(cdhn, NULL);

	if (stat==CDSTAT_COMPLETED) break;

}

while (1)

;

}
i think get the following errors:

main.c:63: undefined reference to `slCdInit'

main.c(.text+0xc0): undefined reference to `slCdOpen'

main.c(.text+0xc8): undefined reference to `slCdLoadFile'

main.c(.text+0xd0): undefined reference to `slCdGetStatus'

i cant figure out whats wrong with them. also CDWIN doesnt seem to work.. but i dont think its needed.

any ideas?

thanks
 

GaRlic

New Member
thanks, i just found another thread with the same problem, he got it working though im not sure how.. i included the sgl cd lib but now i get

Code:
../../lib\libcd.a(sgl_cd.o)(.text+0x71c):sgl_cd.c: undefined reference to `SetCD

Func'

../../lib\libcd.a(sgl_cd.o)(.text+0x96c):sgl_cd.c: undefined reference to `SetCD

Func'

../../lib\libcd.a(GFS_TRN.O)(.text+0x540):gfs_trn.c: undefined reference to `DMA

_ScuSetPrm'

../../lib\libcd.a(GFS_TRN.O)(.text+0x544):gfs_trn.c: undefined reference to `DMA

_ScuStart'

../../lib\libcd.a(GFS_TRN.O)(.text+0x548):gfs_trn.c: undefined reference to `CSH

_Purge'

../../lib\libcd.a(GFS_TRN.O)(.text+0x578):gfs_trn.c: undefined reference to `DMA

_ScuGetStatus'

../../lib\libcd.a(GFS_TRN.O)(.text+0x628):gfs_trn.c: undefined reference to `slD

MAStatus'
there must be something i forgot to include or something
 

GaRlic

New Member
alright, since the error codes really dont help me i just went through it by hand

slCDDAOn (127, 127, 0, 0);

// ndir=slCdInit(128, dirwork);

key[0].cn=CDKEY_NONE;

key[0].sm=CDKEY_NONE;

key[0].ci=CDKEY_NONE;

key[1].cn=CDKEY_TERM;

// cdhn=slCdOpen("cdda1",key);

buf[0].type=CDBUF_COPY;

buf[0].trans.copy.addr=NULL;

buf[0].trans.copy.unit=CDBUF_FORM1;

buf[0].trans.copy.size=0;

buf[1].type=CDBUF_TERM;

// slCdLoadFile(cdhn,buf);

if i do this, it compiles fine. obviously if i actually want to load a file this aint gonna work. so why on earth do i get

Code:
../../lib\libcd.a(sgl_cd.o)(.text+0x71c):sgl_cd.c: undefined reference to `SetCD

Func'

../../lib\libcd.a(sgl_cd.o)(.text+0x96c):sgl_cd.c: undefined reference to `SetCD

Func'

../../lib\libcd.a(GFS_TRN.O)(.text+0x540):gfs_trn.c: undefined reference to `DMA

_ScuSetPrm'

../../lib\libcd.a(GFS_TRN.O)(.text+0x544):gfs_trn.c: undefined reference to `DMA

_ScuStart'

../../lib\libcd.a(GFS_TRN.O)(.text+0x548):gfs_trn.c: undefined reference to `CSH

_Purge'

../../lib\libcd.a(GFS_TRN.O)(.text+0x578):gfs_trn.c: undefined reference to `DMA

_ScuGetStatus'

../../lib\libcd.a(GFS_TRN.O)(.text+0x628):gfs_trn.c: undefined reference to `slD

MAStatus'

make: *** [sl.coff] Error 1
when these lines are included? i'm using libcd so i just dont get whats wrong.

also can someone please expalin the proper way naming of cdda tracks? is it really just "cdda1" as sega says?

thanks
 

GaRlic

New Member
This just in.. IM A TOTAL MORON.

include the damn libcd before libsgl for the love of god if you have this problem
 

RockinB

Staff member
Has anyone managed to get CDDA to work?

I could verify the SGL CDDA demo with Amok which contains these "cdda1" named dummy files on track 1.

The barrier is that I was not able to create these dummy files for myself on my own MineSweeper CD... .

Anyone knows of a powerful CD-image layout software that could handle this? Have allready tried the Playstation CDGenerator, but the conversion to .CTI files does not support all functionality.

There must be other possibilities to get normal CDDA to work. Remind the CDC-lib demo in the DEMO directory of SGL. But I haven't tried it jet.

Will we ever get CDDA to work?

The Rockin'-B
 

Reinhart

New Member
I manage once to play track1 of KoF'96 after uploading the sgl sample via the par.

Add the CdUnlock function to the CDDA sample of the SGL (the one who play cdda1, if I remember right).

Upload the binary trough the PAR and listen how Hero's team BGM rocks :cool:

Now what i'm wondering is how to create a cd with cdda tracks on it ...
 

RockinB

Staff member
Dear Rockin'-B,

I heard you wanted to know if we will ever be able to playback CDDA on our beloved SEGA Saturn... .

Then listen patiently:

Take da mutha****ing CDDA_SGL in DEMO folder of SGL and put it where your other projects are.

Now look into the main.c...

...and do this

#include "sddrvs.dat"
...and this

//extern char sddrvs[];

//extern char sddrvs_end[];
...and this

// slInitSound(sddrvs , (sddrvs_end-sddrvs) , (Uint8 *)map , (4));

slInitSound(sddrvstsk , sizeof(sddrvstsk) , (Uint8 *)map , (4));
Got it? Good, then look into OBJECTS...

...and do this

SYSOBJS = $(CMNDIR)/cinit.o $(SGLLDR)/sglarea.o #src/sdata.o
Don't forget to save both files, little B!

Make an ISO from this with buildcd.exe and stripiso.exe. Look into some finished project to quickly get a MAKEISO.BAT, a .CTI and a IP.BIN. Don't forget to check the source path names in .CTI file.

Now take some .wav file with 44kHz and 16 bits resolution, maybe that of VBT's contest entry. Oooh, then click on the SegaCueMaker.exe that you've clicked so often for ripping, right?

Whoa, now it's getting hot: burn the ISO and wav file using .CUE file and maybe CDRWIN.

Now we are almost finished... .

Launch up SSF with the CD-R you've burned and turn on the speakers and listen.....

And now little B, if you don't allready know, I'll tell you the answer:

YES, WE WILL! :cheers

What a great evening, isn't it?

The Rockin'-B
 
Top