git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@58936 e17a0e51-4ae3-4d35-97c3-1a29b211df97
This commit is contained in:
parent
35ab5b225b
commit
b224a1e794
|
@ -132,11 +132,11 @@ static long GetTickCount(void) {
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
u16 *iso_play_cdbuf;
|
||||
u16 iso_play_bufptr;
|
||||
|
||||
|
||||
|
||||
u16 *iso_play_cdbuf;
|
||||
u16 iso_play_bufptr;
|
||||
|
||||
|
||||
// this thread plays audio data
|
||||
#ifdef _WIN32
|
||||
static void playthread(void *param)
|
||||
|
@ -145,14 +145,14 @@ static void *playthread(void *param)
|
|||
#endif
|
||||
{
|
||||
long d, t, i, s;
|
||||
unsigned char tmp;
|
||||
unsigned char tmp;
|
||||
int sec;
|
||||
|
||||
t = GetTickCount();
|
||||
|
||||
iso_play_cdbuf = 0;
|
||||
iso_play_bufptr = 0;
|
||||
|
||||
iso_play_cdbuf = 0;
|
||||
iso_play_bufptr = 0;
|
||||
|
||||
while (playing) {
|
||||
d = t - (long)GetTickCount();
|
||||
if (d <= 0) {
|
||||
|
@ -187,8 +187,8 @@ static void *playthread(void *param)
|
|||
else {
|
||||
s = fread(sndbuffer, 1, sizeof(sndbuffer), cddaHandle);
|
||||
|
||||
sec = cddaCurOffset / CD_FRAMESIZE_RAW;
|
||||
|
||||
sec = cddaCurOffset / CD_FRAMESIZE_RAW;
|
||||
|
||||
if (subHandle != NULL) {
|
||||
fseek(subHandle, sec * SUB_FRAMESIZE, SEEK_SET);
|
||||
fread(subbuffer, 1, SUB_FRAMESIZE, subHandle);
|
||||
|
@ -212,59 +212,59 @@ static void *playthread(void *param)
|
|||
}
|
||||
}
|
||||
|
||||
// wipe data track
|
||||
if( subHandle || subChanMixed ) {
|
||||
if( ti[ ((struct SubQ *) subbuffer)->TrackNumber ].type == DATA )
|
||||
memset( sndbuffer, 0, s );
|
||||
}
|
||||
|
||||
// wipe data track
|
||||
if( subHandle || subChanMixed ) {
|
||||
if( ti[ ((struct SubQ *) subbuffer)->TrackNumber ].type == DATA )
|
||||
memset( sndbuffer, 0, s );
|
||||
}
|
||||
|
||||
SPU_playCDDAchannel((short *)sndbuffer, s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
cddaCurOffset += s;
|
||||
|
||||
|
||||
// BIOS CD Player: Fast forward / reverse seek
|
||||
if( cdr.FastForward ) {
|
||||
// ~+0.25 sec
|
||||
cddaCurOffset += CD_FRAMESIZE_RAW * 75 * 3;
|
||||
|
||||
#if 0
|
||||
// Bad idea: too much static
|
||||
if( subChanInterleaved )
|
||||
fseek( cddaHandle, s * (CD_FRAMESIZE_RAW + SUB_FRAMESIZE), SEEK_SET );
|
||||
else
|
||||
fseek( cddaHandle, s * CD_FRAMESIZE_RAW, SEEK_SET );
|
||||
#endif
|
||||
}
|
||||
else if( cdr.FastBackward ) {
|
||||
// ~-0.25 sec
|
||||
cddaCurOffset -= CD_FRAMESIZE_RAW * 75 * 3;
|
||||
if( cddaCurOffset & 0x80000000 ) {
|
||||
cddaCurOffset = 0;
|
||||
cdr.FastBackward = 0;
|
||||
|
||||
playing = 0;
|
||||
fclose(cddaHandle);
|
||||
cddaHandle = NULL;
|
||||
initial_offset = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Bad idea: too much static
|
||||
if( subChanInterleaved )
|
||||
fseek( cddaHandle, s * (CD_FRAMESIZE_RAW + SUB_FRAMESIZE), SEEK_SET );
|
||||
else
|
||||
fseek( cddaHandle, s * CD_FRAMESIZE_RAW, SEEK_SET );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// Vib Ribbon: decoded buffer IRQ
|
||||
iso_play_cdbuf = sndbuffer;
|
||||
iso_play_bufptr = 0;
|
||||
|
||||
|
||||
// BIOS CD Player: Fast forward / reverse seek
|
||||
if( cdr.FastForward ) {
|
||||
// ~+0.25 sec
|
||||
cddaCurOffset += CD_FRAMESIZE_RAW * 75 * 3;
|
||||
|
||||
#if 0
|
||||
// Bad idea: too much static
|
||||
if( subChanInterleaved )
|
||||
fseek( cddaHandle, s * (CD_FRAMESIZE_RAW + SUB_FRAMESIZE), SEEK_SET );
|
||||
else
|
||||
fseek( cddaHandle, s * CD_FRAMESIZE_RAW, SEEK_SET );
|
||||
#endif
|
||||
}
|
||||
else if( cdr.FastBackward ) {
|
||||
// ~-0.25 sec
|
||||
cddaCurOffset -= CD_FRAMESIZE_RAW * 75 * 3;
|
||||
if( cddaCurOffset & 0x80000000 ) {
|
||||
cddaCurOffset = 0;
|
||||
cdr.FastBackward = 0;
|
||||
|
||||
playing = 0;
|
||||
fclose(cddaHandle);
|
||||
cddaHandle = NULL;
|
||||
initial_offset = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Bad idea: too much static
|
||||
if( subChanInterleaved )
|
||||
fseek( cddaHandle, s * (CD_FRAMESIZE_RAW + SUB_FRAMESIZE), SEEK_SET );
|
||||
else
|
||||
fseek( cddaHandle, s * CD_FRAMESIZE_RAW, SEEK_SET );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// Vib Ribbon: decoded buffer IRQ
|
||||
iso_play_cdbuf = sndbuffer;
|
||||
iso_play_bufptr = 0;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@ -695,7 +695,7 @@ static int opensubfile(const char *isoname) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static long CALLBACK ISOinit(void) {
|
||||
long CALLBACK ISOinit(void) {
|
||||
assert(cdHandle == NULL);
|
||||
assert(subHandle == NULL);
|
||||
|
||||
|
@ -750,12 +750,12 @@ static long CALLBACK ISOopen(void) {
|
|||
else if (parsemds(GetIsoFile()) == 0) {
|
||||
SysPrintf("[+mds]");
|
||||
}
|
||||
else if (parsecue(GetIsoFile()) == 0) {
|
||||
SysPrintf("[+cue]");
|
||||
}
|
||||
else if (parsetoc(GetIsoFile()) == 0) {
|
||||
SysPrintf("[+toc]");
|
||||
}
|
||||
else if (parsecue(GetIsoFile()) == 0) {
|
||||
SysPrintf("[+cue]");
|
||||
}
|
||||
else if (parsetoc(GetIsoFile()) == 0) {
|
||||
SysPrintf("[+toc]");
|
||||
}
|
||||
|
||||
if (!subChanMixed && opensubfile(GetIsoFile()) == 0) {
|
||||
SysPrintf("[+sub]");
|
||||
|
@ -919,22 +919,22 @@ static unsigned char* CALLBACK ISOgetBufferSub(void) {
|
|||
}
|
||||
|
||||
static long CALLBACK ISOgetStatus(struct CdrStat *stat) {
|
||||
u32 sect;
|
||||
|
||||
CDR__getStatus(stat);
|
||||
|
||||
if (playing) {
|
||||
stat->Status |= 0x80;
|
||||
}
|
||||
|
||||
// relative -> absolute time
|
||||
sect = cddaCurOffset / CD_FRAMESIZE_RAW + 150;
|
||||
sec2msf(sect, (u8 *)stat->Time);
|
||||
|
||||
// BIOS - boot ID (CD type)
|
||||
stat->Type = ti[1].type;
|
||||
|
||||
return 0;
|
||||
u32 sect;
|
||||
|
||||
CDR__getStatus(stat);
|
||||
|
||||
if (playing) {
|
||||
stat->Status |= 0x80;
|
||||
}
|
||||
|
||||
// relative -> absolute time
|
||||
sect = cddaCurOffset / CD_FRAMESIZE_RAW + 150;
|
||||
sec2msf(sect, (u8 *)stat->Time);
|
||||
|
||||
// BIOS - boot ID (CD type)
|
||||
stat->Type = ti[1].type;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cdrIsoInit(void) {
|
||||
|
|
1238
libpcsxcore/cdrom.c
1238
libpcsxcore/cdrom.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user