notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gpu_neon: some hack to enhanced mode
[pcsx_rearmed.git]
/
plugins
/
dfsound
/
spu.c
diff --git
a/plugins/dfsound/spu.c
b/plugins/dfsound/spu.c
index
97f07aa
..
4dc762f
100644
(file)
--- a/
plugins/dfsound/spu.c
+++ b/
plugins/dfsound/spu.c
@@
-18,10
+18,6
@@
* *
***************************************************************************/
* *
***************************************************************************/
-#if !defined(_WIN32) && !defined(NO_OS)
-#include <sys/time.h> // gettimeofday in xa.c
-#define THREAD_ENABLED 1
-#endif
#include "stdafx.h"
#define _IN_SPU
#include "stdafx.h"
#define _IN_SPU
@@
-497,6
+493,8
@@
static void scan_for_irq(int ch, unsigned int *upd_samples)
pos = s_chan->spos;
sinc = s_chan->sinc;
end = pos + *upd_samples * sinc;
pos = s_chan->spos;
sinc = s_chan->sinc;
end = pos + *upd_samples * sinc;
+ if (s_chan->prevflags & 1) // 1: stop/loop
+ block = s_chan->pLoop;
pos += (28 - s_chan->iSBPos) << 16;
while (pos < end)
pos += (28 - s_chan->iSBPos) << 16;
while (pos < end)
@@
-818,6
+816,8
@@
static void do_channels(int ns_to)
mix_chan(spu.SSumLR, ns_to, s_chan->iLeftVolume, s_chan->iRightVolume);
}
mix_chan(spu.SSumLR, ns_to, s_chan->iLeftVolume, s_chan->iRightVolume);
}
+ MixXA(spu.SSumLR, RVB, ns_to, spu.decode_pos);
+
if (spu.rvb->StartAddr) {
if (do_rvb)
REVERBDo(spu.SSumLR, RVB, ns_to, spu.rvb->CurrAddr);
if (spu.rvb->StartAddr) {
if (do_rvb)
REVERBDo(spu.SSumLR, RVB, ns_to, spu.rvb->CurrAddr);
@@
-833,7
+833,7
@@
static void do_samples_finish(int *SSumLR, int ns_to,
// optional worker thread handling
// optional worker thread handling
-#if
defined(THREAD_ENABLED)
|| defined(WANT_THREAD_CODE)
+#if
P_HAVE_PTHREAD
|| defined(WANT_THREAD_CODE)
// worker thread state
static struct spu_worker {
// worker thread state
static struct spu_worker {
@@
-1070,6
+1070,7
@@
static void sync_worker_thread(int force)
work = &worker->i[worker->i_reaped & WORK_I_MASK];
thread_work_wait_sync(work, force);
work = &worker->i[worker->i_reaped & WORK_I_MASK];
thread_work_wait_sync(work, force);
+ MixXA(work->SSumLR, RVB, work->ns_to, work->decode_pos);
do_samples_finish(work->SSumLR, work->ns_to,
work->channels_silent, work->decode_pos);
do_samples_finish(work->SSumLR, work->ns_to,
work->channels_silent, work->decode_pos);
@@
-1088,7
+1089,7
@@
static void sync_worker_thread(int force) {}
static const void * const worker = NULL;
static const void * const worker = NULL;
-#endif //
THREAD_ENABLED
+#endif //
P_HAVE_PTHREAD || defined(WANT_THREAD_CODE)
////////////////////////////////////////////////////////////////////////
// MAIN SPU FUNCTION
////////////////////////////////////////////////////////////////////////
// MAIN SPU FUNCTION
@@
-1196,12
+1197,10
@@
static void do_samples_finish(int *SSumLR, int ns_to,
spu.decode_dirty_ch &= ~(1<<3);
}
spu.decode_dirty_ch &= ~(1<<3);
}
- MixXA(SSumLR, ns_to, decode_pos);
-
vol_l = vol_l * spu_config.iVolume >> 10;
vol_r = vol_r * spu_config.iVolume >> 10;
vol_l = vol_l * spu_config.iVolume >> 10;
vol_r = vol_r * spu_config.iVolume >> 10;
- if (!(spu.spuCtrl &
0x4000
) || !(vol_l | vol_r))
+ if (!(spu.spuCtrl &
CTRL_MUTE
) || !(vol_l | vol_r))
{
// muted? (rare)
memset(spu.pS, 0, ns_to * 2 * sizeof(spu.pS[0]));
{
// muted? (rare)
memset(spu.pS, 0, ns_to * 2 * sizeof(spu.pS[0]));
@@
-1369,7
+1368,7
@@
static void RemoveStreams(void)
/* special code for TI C64x DSP */
#include "spu_c64x.c"
/* special code for TI C64x DSP */
#include "spu_c64x.c"
-#elif
defined(THREAD_ENABLED)
+#elif
P_HAVE_PTHREAD
#include <pthread.h>
#include <semaphore.h>
#include <pthread.h>
#include <semaphore.h>
@@
-1468,7
+1467,7
@@
static void exit_spu_thread(void)
worker = NULL;
}
worker = NULL;
}
-#else // if !
THREAD_ENABLE
D
+#else // if !
P_HAVE_PTHREA
D
static void init_spu_thread(void)
{
static void init_spu_thread(void)
{
@@
-1485,6
+1484,7
@@
long CALLBACK SPUinit(void)
{
int i;
{
int i;
+ memset(&spu, 0, sizeof(spu));
spu.spuMemC = calloc(1, 512 * 1024);
InitADSR();
spu.spuMemC = calloc(1, 512 * 1024);
InitADSR();