mrkotfw
Mid Boss
hey guys, i was wondering if you guys can explain to me how CDDA works, whats in there... if theres a compression thingy in the file and how to use it on the sega saturn... and how to create them
for some reason it doesn't really play (i use girigiri)
ok for those of you who dont want to read, this is what i want to do and/or know how to do:
1. what is CDDA
2. how do i create CDDA
3. how do i use CDDA on the Sega Saturn?
4. Reading Audio Files from CD in Sega Saturn
Thanks guys.........
and BTW, i dont understand why i got to have an char array for SOUND
can anyone explain that
for some reason it doesn't really play (i use girigiri)
ok for those of you who dont want to read, this is what i want to do and/or know how to do:
1. what is CDDA
2. how do i create CDDA
3. how do i use CDDA on the Sega Saturn?
4. Reading Audio Files from CD in Sega Saturn
Code:
#include "sgl.h"
#include "sgl_cd.h"
#include "sddrvs.dat"
#include "level1.c"
#include "sclfunc.c"
#include "sprite.c"
#define MAX_FILE 128
extern TEXTURE texture[];
extern PICTURE sprite[];
extern SPR_ATTR sprite_attr[];
extern FIXED pos[][];
extern FIXED ang[];
extern unsigned short sspal[];
extern unsigned short sprite_pal[];
PerAnalog * ana_pre;
Uint16 data;
Sint32 dirwork[SLCD_WORK_SIZE(MAX_FILE)];
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
};
int ss_main(void){
Sint32 ndir;
CDHN cdhn;
CDBUF buf[2];
CDKEY key[2];
Sint32 stat;
FIXED scrollx=toFIXED(0.0);
FIXED scrolly=toFIXED(0.0);
slInitSystem(TV_320x240,texture,1);
slInitSound(sddrvstsk,sizeof(sddrvstsk),sdmap,sizeof(sdmap));
slCDDAOn(127,127,0,0);
slTVOff();
slColRAMMode(CRM16_1024);
slBack1ColSet((void *)VDP2_VRAM_A1+0x1fffe,0);
ndir=slCdInit(MAX_FILE,dirwork);
key[0].cn=CDKEY_NONE;
key[0].sm=CDKEY_NONE;
key[0].ci=CDKEY_NONE;
key[1].cn=CDKEY_TERM;
cdhn=slCdOpen("CDDA1.CDA",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);
LoadSprite(sprite,2);
slInitBitMap(bmNBG1,BM_512x256,(void *)VDP2_VRAM_B0);
slBMPaletteNbg1(1);
slBMPut(-160,-120,159,119,level1);
slScrPosNbg1(scrollx,scrolly);
slScrAutoDisp(NBG0ON|NBG1ON);
Pal2CRAM((Uint16 *)sspal,(void *)VDP2_COLRAM,256);
Pal2CRAM((Uint16 *)sprite_pal,(void *)VDP2_COLRAM,256);
slTVOn();
while(1){
pos[0][1]=toFIXED(59.0);
data=Smpc_Peripheral[0].data;
if(!(data & PER_DGT_KR)){
pos[0][0]+=toFIXED(10.0);
}
if(!(data & PER_DGT_KL)){
pos[0][0]-=toFIXED(10.0);
}
DisplaySprite(0);
stat=slCdGetStatus(cdhn,NULL);
if(stat==CDSTAT_COMPLETED){
slPrint("CDDA1 Track Loaded!",slLocate(1,1));
}
slSynch();
}
}
Thanks guys.........
and BTW, i dont understand why i got to have an char array for SOUND
Code:
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
};
can anyone explain that