diff options
| author | SND\shalma_cp <SND\shalma_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-11-15 23:28:56 +0000 |
|---|---|---|
| committer | SND\shalma_cp <SND\shalma_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-11-15 23:28:56 +0000 |
| commit | 1b3bf63d4a5a234f130e78ddb653a879a38209a2 (patch) | |
| tree | 1eda9cdc5f48b74372ff86fc059ea42574ee24ec /libpcsxcore | |
| parent | 7f674a04a2603d010f9cf08618f014a7c8c683b4 (diff) | |
| download | pcsxr-1b3bf63d4a5a234f130e78ddb653a879a38209a2.tar.gz | |
Silhouette Mirage - cdrom.c / r3000a.c
- check cdda autopause
- fix looping music
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@59671 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
| -rw-r--r-- | libpcsxcore/cdrom.c | 76 | ||||
| -rw-r--r-- | libpcsxcore/cdrom.h | 1 | ||||
| -rw-r--r-- | libpcsxcore/r3000a.c | 7 | ||||
| -rw-r--r-- | libpcsxcore/r3000a.h | 3 |
4 files changed, 85 insertions, 2 deletions
diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index e6c23150..08d4c87f 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -144,6 +144,12 @@ extern SPUregisterCallback SPU_registerCallback; psxRegs.intCycle[PSXINT_CDRLID].sCycle = psxRegs.cycle; \ } +#define CDRPLAY_INT(eCycle) { \
+ psxRegs.interrupt |= (1 << PSXINT_CDRPLAY); \
+ psxRegs.intCycle[PSXINT_CDRPLAY].cycle = eCycle; \
+ psxRegs.intCycle[PSXINT_CDRPLAY].sCycle = psxRegs.cycle; \
+}
+
#define StartReading(type, eCycle) { \ cdr.Reading = type; \ cdr.FirstSector = 1; \ @@ -489,6 +495,41 @@ void Set_Track() } +void cdrPlayInterrupt()
+{
+ if( !cdr.Play ) return;
+
+
+ if( CDR_getStatus(&stat) != -1) {
+ subq = (struct SubQ *)CDR_getBufferSub();
+
+ if (subq != NULL ) {
+#ifdef CDR_LOG
+ CDR_LOG( "CDDA IRQ - %X:%X:%X\n",
+ subq->AbsoluteAddress[0], subq->AbsoluteAddress[1], subq->AbsoluteAddress[2] );
+#endif
+
+ /*
+ CDDA Autopause
+
+ Silhouette Mirage ($3)
+ Tomb Raider 1 ($7)
+ */
+
+ if( (cdr.Mode & 0x02) && cdr.CurTrack < btoi( subq->TrackNumber ) ) {
+ StopCdda();
+ }
+ }
+ }
+
+
+ CDRPLAY_INT( cdReadTime );
+
+
+ Check_Shell(0);
+}
+
+
void cdrRepplayInterrupt() { if( !cdr.Play ) return;
@@ -717,6 +758,11 @@ void cdrInterrupt() { if ((cdr.Mode & 0x5) == 0x5) { CDREPPLAY_INT( cdReadTime ); } +
+ // autopause cdda
+ if ((cdr.Mode & 0x3) == 0x3) {
+ CDRPLAY_INT( cdReadTime );
+ }
break; case CdlForward: @@ -1905,9 +1951,37 @@ void cdrReset() { int cdrFreeze(gzFile f, int Mode) { uintptr_t tmp; - +
+
+ if( Mode == 0 ) {
+ StopCdda();
+ }
+ if( Mode == 1 ) {
+ // get restart time
+ if( cdr.Play && CDR_getStatus(&stat) != -1 ) {
+ cdr.SetSectorPlay[0] = stat.Time[0];
+ cdr.SetSectorPlay[1] = stat.Time[1];
+ cdr.SetSectorPlay[2] = stat.Time[2];
+ }
+ }
+
+
gzfreeze(&cdr, sizeof(cdr)); +
+ if( Mode == 0 ) {
+ // resume cdda
+ if( cdr.Play ) {
+ Set_Track();
+ Find_CurTrack();
+ ReadTrack( cdr.SetSectorPlay );
+
+ CDR_play( cdr.SetSectorPlay );
+ }
+ }
+
+
+
if (Mode == 1) tmp = cdr.pTransfer - cdr.Transfer; diff --git a/libpcsxcore/cdrom.h b/libpcsxcore/cdrom.h index 3ab4336d..9b826786 100644 --- a/libpcsxcore/cdrom.h +++ b/libpcsxcore/cdrom.h @@ -105,6 +105,7 @@ void cdrInterrupt(); void cdrReadInterrupt(); void cdrRepplayInterrupt();
void cdrLidSeekInterrupt();
+void cdrPlayInterrupt();
unsigned char cdrRead0(void); unsigned char cdrRead1(void); unsigned char cdrRead2(void); diff --git a/libpcsxcore/r3000a.c b/libpcsxcore/r3000a.c index 6f766e8b..d0f59c4b 100644 --- a/libpcsxcore/r3000a.c +++ b/libpcsxcore/r3000a.c @@ -214,6 +214,13 @@ void psxBranchTest() { cdrLidSeekInterrupt();
}
}
+
+ if (psxRegs.interrupt & (1 << PSXINT_CDRPLAY)) { // cdr play timing
+ if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_CDRPLAY].sCycle) >= psxRegs.intCycle[PSXINT_CDRPLAY].cycle) {
+ psxRegs.interrupt &= ~(1 << PSXINT_CDRPLAY);
+ cdrPlayInterrupt();
+ }
+ }
} } diff --git a/libpcsxcore/r3000a.h b/libpcsxcore/r3000a.h index 3486ea11..870fbcd9 100644 --- a/libpcsxcore/r3000a.h +++ b/libpcsxcore/r3000a.h @@ -157,7 +157,8 @@ enum { PSXINT_CDRDMA,
PSXINT_CDREPPLAY,
PSXINT_CDRDBUF,
- PSXINT_CDRLID
+ PSXINT_CDRLID,
+ PSXINT_CDRPLAY
}; typedef struct { |
