ZeroSPU2: Reformat zerospu2.cpp & h so that they are readable. Change a few unneccessary case statements into if statements.

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@505 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
arcum42 2008-12-26 14:25:22 +00:00 committed by Gregory Hainaut
parent 6ba8e669e7
commit 4531a1406f
3 changed files with 1734 additions and 1640 deletions

View File

@ -34,19 +34,13 @@ int AlsaSetupSound()
snd_pcm_hw_params_t *hwparams; snd_pcm_hw_params_t *hwparams;
snd_pcm_sw_params_t *swparams; snd_pcm_sw_params_t *swparams;
snd_pcm_status_t *status; snd_pcm_status_t *status;
unsigned int pspeed; unsigned int pspeed = 48000;
int pchannels; int pchannels = 2;
snd_pcm_format_t format; snd_pcm_format_t format = SND_PCM_FORMAT_S16_LE;
unsigned int buffer_time, period_time; unsigned int buffer_time = SOUNDSIZE;
unsigned int period_time= buffer_time / 4;
int err; int err;
pchannels=2;
pspeed = 48000;
format = SND_PCM_FORMAT_S16_LE;
buffer_time = SOUNDSIZE;
period_time = buffer_time / 4;
err = snd_pcm_open(&handle, "default", SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK); err = snd_pcm_open(&handle, "default", SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK);
if(err < 0) { if(err < 0) {
printf("Audio open error: %s\n", snd_strerror(err)); printf("Audio open error: %s\n", snd_strerror(err));

File diff suppressed because it is too large Load Diff

View File

@ -148,6 +148,29 @@ extern __forceinline void pcsx2_aligned_free(void* pmem)
#endif #endif
// Atomic Operations
#if defined (_WIN32)
#ifndef __x86_64__
extern "C" LONG __cdecl _InterlockedExchangeAdd(LPLONG volatile Addend, LONG Value);
#endif
#pragma intrinsic (_InterlockedExchangeAdd)
#define InterlockedExchangeAdd _InterlockedExchangeAdd
#else
typedef void* PVOID;
__forceinline long InterlockedExchangeAdd(long volatile* Addend, long Value)
{
__asm__ __volatile__(".intel_syntax\n"
"lock xadd [%0], %%eax\n"
".att_syntax\n" : : "r"(Addend), "a"(Value) : "memory" );
}
#endif
//////////////////// ////////////////////
// SPU2 Registers // // SPU2 Registers //
//////////////////// ////////////////////