diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-06-21 02:47:18 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2010-06-21 02:47:18 +0000 |
| commit | 6aa1a8e80718d79663c4813a9d818821b1f2b0f3 (patch) | |
| tree | 6feb01136e963dc6baa449bb773c1afb5f016f9a | |
| parent | 8b3e743e6b8ecc1f95c3d681322c9e1fce0cc0e4 (diff) | |
| download | pcsxr-6aa1a8e80718d79663c4813a9d818821b1f2b0f3.tar.gz | |
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@53080 e17a0e51-4ae3-4d35-97c3-1a29b211df97
| -rw-r--r-- | ChangeLog | 22 | ||||
| -rw-r--r-- | libpcsxcore/psxbios.c | 12 | ||||
| -rw-r--r-- | libpcsxcore/psxbios.h | 2 | ||||
| -rw-r--r-- | libpcsxcore/psxcommon.c | 3 | ||||
| -rw-r--r-- | plugins/dfsound/freeze.c | 29 | ||||
| -rw-r--r-- | plugins/dfsound/spu.c | 42 | ||||
| -rw-r--r-- | po/Makefile.in.in | 1 |
7 files changed, 72 insertions, 39 deletions
@@ -1,14 +1,26 @@ +Jun 21, 2010 Wei Mingzhi <whistler_wmz@users.sf.net> + + * libpcsxcore/psxbios.c: Use a separate flag to identify whether we are + inside a softcall or not, as ra might be modified inside the interrupt + handler. + * libpcsxcore/psxbios.h: Likewise. + * libpcsxcore/psxcommon.c: Likewise. + * plugins/dfsound/spu.c: Moved initialization routine from SPUopen() into + SPUinit(). + * plugins/dfsound/freeze.c: Save spuAddr as well. + * po/Makefile.in.in: Silenced warning. + Jun 20, 2010 Wei Mingzhi <whistler_wmz@users.sf.net> * plugins/dfsound/freeze.c: Reset lastch when loading state, which fixes occasionally crash after state loading. * plugins/dfsound/spu.c: Likewise. -Jun 19, 2010 Wei Mingzhi <whistler_wmz@users.sf.net>
-
- * macosx/PcsxController.m: Do not simulate CD case open if user clicked
- Cancel in switch ISO dialog.
-
+Jun 19, 2010 Wei Mingzhi <whistler_wmz@users.sf.net> + + * macosx/PcsxController.m: Do not simulate CD case open if user clicked + Cancel in switch ISO dialog. + Jun 16, 2010 Wei Mingzhi <whistler_wmz@users.sf.net> * libpcsxcore/psxcommon.c: Do not allow hotkeys inside a softcall from HLE diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index 255cc19e..25313780 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -257,11 +257,17 @@ static TCB Thread[8]; static int CurThread = 0; static FileDesc FDesc[32]; +boolean hleSoftCall = FALSE; + static inline void softCall(u32 pc) { pc0 = pc; ra = 0x80001000; + hleSoftCall = TRUE; + while (pc0 != 0x80001000) psxCpu->ExecuteBlock(); + + hleSoftCall = FALSE; } static inline void softCall2(u32 pc) { @@ -269,8 +275,12 @@ static inline void softCall2(u32 pc) { pc0 = pc; ra = 0x80001000; + hleSoftCall = TRUE; + while (pc0 != 0x80001000) psxCpu->ExecuteBlock(); ra = sra; + + hleSoftCall = FALSE; } static inline void DeliverEvent(u32 ev, u32 spec) { @@ -2568,6 +2578,8 @@ void psxBiosInit() { // memory size 2 MB psxHu32ref(0x1060) = SWAPu32(0x00000b88); + + hleSoftCall = FALSE; } void psxBiosShutdown() { diff --git a/libpcsxcore/psxbios.h b/libpcsxcore/psxbios.h index 80881a39..635b35a5 100644 --- a/libpcsxcore/psxbios.h +++ b/libpcsxcore/psxbios.h @@ -43,6 +43,8 @@ extern void (*biosA0[256])(); extern void (*biosB0[256])(); extern void (*biosC0[256])(); +extern boolean hleSoftCall; + #ifdef __cplusplus } #endif diff --git a/libpcsxcore/psxcommon.c b/libpcsxcore/psxcommon.c index a173eceb..f118c2db 100644 --- a/libpcsxcore/psxcommon.c +++ b/libpcsxcore/psxcommon.c @@ -19,6 +19,7 @@ #include "psxcommon.h" #include "r3000a.h" +#include "psxbios.h" #include "cheat.h" #include "ppf.h" @@ -52,7 +53,7 @@ void EmuShutdown() { void EmuUpdate() { // Do not allow hotkeys inside a softcall from HLE BIOS - if (!Config.HLE || psxRegs.GPR.n.ra != 0x80001000) + if (!Config.HLE || !hleSoftCall) SysUpdate(); ApplyCheats(); diff --git a/plugins/dfsound/freeze.c b/plugins/dfsound/freeze.c index 2551e608..26094814 100644 --- a/plugins/dfsound/freeze.c +++ b/plugins/dfsound/freeze.c @@ -42,7 +42,7 @@ typedef struct {
unsigned short spuIrq;
uint32_t pSpuIrq;
- uint32_t dummy0;
+ uint32_t spuAddr;
uint32_t dummy1;
uint32_t dummy2;
uint32_t dummy3;
@@ -55,8 +55,8 @@ typedef struct void LoadStateV5(SPUFreeze_t * pF); // newest version
void LoadStateUnknown(SPUFreeze_t * pF); // unknown format
- -extern int lastch; +
+extern int lastch;
////////////////////////////////////////////////////////////////////////
// SPUFREEZE: called by main emu on savestate load/save
@@ -96,6 +96,9 @@ long CALLBACK SPUfreeze(uint32_t ulFreezeMode,SPUFreeze_t * pF) pFO->spuIrq=spuIrq;
if(pSpuIrq) pFO->pSpuIrq = (unsigned long)pSpuIrq-(unsigned long)spuMemC;
+ pFO->spuAddr=spuAddr; + if(pFO->spuAddr==0) pFO->spuAddr=0xffffffff;
+
for(i=0;i<MAXCHAN;i++)
{
memcpy((void *)&pFO->s_chan[i],(void *)&s_chan[i],sizeof(SPUCHAN));
@@ -125,14 +128,12 @@ long CALLBACK SPUfreeze(uint32_t ulFreezeMode,SPUFreeze_t * pF) xapGlobal=0;
- if(!strcmp(pF->szSPUName,"PBOSS") &&
- pF->ulFreezeVersion==5)
- LoadStateV5(pF);
+ if(!strcmp(pF->szSPUName,"PBOSS") && pF->ulFreezeVersion==5)
+ LoadStateV5(pF);
else LoadStateUnknown(pF);
- spuAddr = 0xffffffff; - lastch = -1; - + lastch = -1;
+
// repair some globals
for(i=0;i<=62;i+=2)
SPUwriteRegister(H_Reverb+i,regArea[(H_Reverb+i-0xc00)>>1]);
@@ -161,8 +162,14 @@ void LoadStateV5(SPUFreeze_t * pF) pFO=(SPUOSSFreeze_t *)(pF+1);
- spuIrq = pFO->spuIrq;
- if(pFO->pSpuIrq) pSpuIrq = pFO->pSpuIrq+spuMemC; else pSpuIrq=0;
+ spuIrq = pFO->spuIrq;
+ if(pFO->pSpuIrq) pSpuIrq = pFO->pSpuIrq+spuMemC; else pSpuIrq=NULL;
+
+ if(pFO->spuAddr) + { + spuAddr = pFO->spuAddr; + if (spuAddr == 0xffffffff) spuAddr = 0; + }
for(i=0;i<MAXCHAN;i++)
{
diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index 3670d458..efc32b1a 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -814,18 +814,6 @@ void CALLBACK SPUplayCDDAchannel(short *pcm, int nbytes) FeedCDDA((unsigned char *)pcm, nbytes); } -// INIT/EXIT STUFF - -// SPUINIT: this func will be called first by the main emu -long CALLBACK SPUinit(void) -{ - spuMemC=(unsigned char *)spuMem; // just small setup - memset((void *)s_chan,0,MAXCHAN*sizeof(SPUCHAN)); - memset((void *)&rvb,0,sizeof(REVERBInfo)); - InitADSR(); - return 0; -} - // SETUPTIMER: init of certain buffers and threads/timers void SetupTimer(void) { @@ -916,10 +904,14 @@ void RemoveStreams(void) CDDAStart = NULL; } -// SPUOPEN: called by main emu after init -long SPUopen(void) +// INIT/EXIT STUFF + +// SPUINIT: this func will be called first by the main emu +long CALLBACK SPUinit(void) { - if (bSPUIsOpen) return 0; // security for some stupid main emus + spuMemC = (unsigned char *)spuMem; // just small setup + memset((void *)&rvb, 0, sizeof(REVERBInfo)); + InitADSR(); iVolume = 3; iReverbOff = -1; @@ -934,11 +926,17 @@ long SPUopen(void) iSPUIRQWait = 1; ReadConfig(); // read user stuff + SetupStreams(); // prepare streaming - SetupSound(); // setup sound (before init!) + return 0; +} - SetupStreams(); // prepare streaming +// SPUOPEN: called by main emu after init +long CALLBACK SPUopen(void) +{ + if (bSPUIsOpen) return 0; // security for some stupid main emus + SetupSound(); // setup sound (before init!) SetupTimer(); // timer for feeding data bSPUIsOpen = 1; @@ -949,22 +947,22 @@ long SPUopen(void) // SPUCLOSE: called before shutdown long CALLBACK SPUclose(void) { - if (!bSPUIsOpen) return 0; // some security + if (!bSPUIsOpen) return 0; // some security - bSPUIsOpen = 0; // no more open + bSPUIsOpen = 0; // no more open RemoveTimer(); // no more feeding - RemoveSound(); // no more sound handling - RemoveStreams(); // no more streaming - return 0; } // SPUSHUTDOWN: called by main emu on final exit long CALLBACK SPUshutdown(void) { + SPUclose(); + RemoveStreams(); // no more streaming + return 0; } diff --git a/po/Makefile.in.in b/po/Makefile.in.in index 301bd358..95374696 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -26,6 +26,7 @@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ +datarootdir = @datarootdir@ libdir = @libdir@ localedir = $(libdir)/locale gnulocaledir = $(datadir)/locale |
