diff options
| author | SND\shalma_cp <SND\shalma_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-09-28 14:07:40 +0000 |
|---|---|---|
| committer | SND\shalma_cp <SND\shalma_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-09-28 14:07:40 +0000 |
| commit | da14cf2c433e99eaa9ae14c7a1e589c20c93073b (patch) | |
| tree | 0aa0c5022860b52c5b7b20d844e1dc970f79797a /libpcsxcore/cdriso.c | |
| parent | f90c726e013a832cea1ce213e5251b9a013ad8a1 (diff) | |
| download | pcsxr-da14cf2c433e99eaa9ae14c7a1e589c20c93073b.tar.gz | |
Rayman, BIOS Music Player, GameShark Music Players
- cdriso.c: Forward + Backward (rewind) support, Data track wiping during audio play, GetStatus (time) fixes
- cdrom.c: CdlForward, CdlBackward, CdlID (auto boot Music CDs with BIOS), CdlStop, CdlPause, CdlPlay (support BIOS play + pause / resume), CdlGetlocP (timing, output results), REPPLAY (report play times - Rayman, BIOS) now work
- cdrom.h: Forward, Backward states; Larger result buffer
NOTE:
Must use iso images with subchannel data for Rayman and Music Players to work. And use latest PCSX-r PEOPS DSound plugin.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@57823 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore/cdriso.c')
| -rw-r--r-- | libpcsxcore/cdriso.c | 85 |
1 files changed, 66 insertions, 19 deletions
diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c index fbdb9eb1..cb6527d7 100644 --- a/libpcsxcore/cdriso.c +++ b/libpcsxcore/cdriso.c @@ -66,8 +66,8 @@ extern void *hCDRDriver; struct trackinfo { enum {DATA, CDDA} type; - char start[3]; // MSF-format - char length[3]; // MSF-format + u8 start[3]; // MSF-format + u8 length[3]; // MSF-format }; #define MAXTRACKS 100 /* How many tracks can a CD hold? */ @@ -161,8 +161,6 @@ static void *playthread(void *param) t = GetTickCount() + CDDA_FRAMETIME; - sec = cddaCurOffset / CD_FRAMESIZE_RAW;
-
if (subChanMixed) { s = 0; @@ -181,6 +179,8 @@ static void *playthread(void *param) else { s = fread(sndbuffer, 1, sizeof(sndbuffer), cddaHandle); + sec = cddaCurOffset / CD_FRAMESIZE_RAW;
+
if (subHandle != NULL) { fseek(subHandle, sec * SUB_FRAMESIZE, SEEK_SET); fread(subbuffer, 1, SUB_FRAMESIZE, subHandle); @@ -204,10 +204,53 @@ static void *playthread(void *param) } } + // wipe data track
+ if( subHandle || subChanInterleaved ) {
+ 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/4;
+
+#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/4;
+ 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
+ }
} #ifdef _WIN32 @@ -862,21 +905,25 @@ static unsigned char* CALLBACK ISOgetBufferSub(void) { } static long CALLBACK ISOgetStatus(struct CdrStat *stat) { - int sec; - - CDR__getStatus(stat); - - if (playing) { - stat->Type = 0x02; - stat->Status |= 0x80; - sec = cddaCurOffset / CD_FRAMESIZE_RAW; - sec2msf(sec, (char *)stat->Time); - } - else { - stat->Type = 0x01; - } - - 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);
+
+ if (subHandle != NULL || subChanInterleaved) {
+ stat->Type = ti[ ((struct SubQ *) subbuffer)->TrackNumber ].type;
+ }
+ else
+ stat->Type = ti[ cdr.CurTrack ].type;
+
+ return 0;
} void cdrIsoInit(void) { |
