Sound buffer adjustment.

svn-id: r13269
This commit is contained in:
Marcus Comstedt 2004-03-14 13:14:03 +00:00
parent bdb14cbad9
commit 3be01c0560
2 changed files with 4 additions and 3 deletions

View File

@ -32,7 +32,7 @@ void initSound()
stop_sound();
do_sound_command(CMD_SET_FREQ_EXP(FREQ_22050_EXP));
do_sound_command(CMD_SET_STEREO(1));
do_sound_command(CMD_SET_BUFFER(3));
do_sound_command(CMD_SET_BUFFER(SOUND_BUFFER_SHIFT));
}
bool OSystem_Dreamcast::setSoundCallback(SoundProc proc, void *param)
@ -82,7 +82,7 @@ void OSystem_Dreamcast::checkSound()
memcpy4s(RING_BUF+fillpos, temp_sound_buffer, SAMPLES_TO_BYTES(r));
fillpos = 0;
n -= r;
memcpy4s(RING_BUF, temp_sound_buffer+(r<<1), SAMPLES_TO_BYTES(n));
memcpy4s(RING_BUF, temp_sound_buffer+r, SAMPLES_TO_BYTES(n));
} else {
memcpy4s(RING_BUF+fillpos, temp_sound_buffer, SAMPLES_TO_BYTES(n));
}

View File

@ -24,6 +24,7 @@
#include <ronin/soundcommon.h>
#define NUM_BUFFERS 4
#define SOUND_BUFFER_SHIFT 3
class OSystem_Dreamcast : public OSystem {
@ -168,7 +169,7 @@ class OSystem_Dreamcast : public OSystem {
void *ovl_tx[NUM_BUFFERS];
unsigned short palette[256];
short temp_sound_buffer[RING_BUFFER_SAMPLES];
int temp_sound_buffer[RING_BUFFER_SAMPLES>>SOUND_BUFFER_SHIFT];
void checkSound();