Commit e874f7b6 authored by Vladimir Serbinenko's avatar Vladimir Serbinenko
Browse files

Add lower FPS for 3DS

This required increasing audio buffer and ensuring that it's completely flushed
when frame comes
parent 49cdbf05
......@@ -1268,7 +1268,7 @@ void D_EndDirectRect(int x, int y, int width, int height)
* SOUND (TODO)
*/
#define BUFFER_SIZE (2048)
#define BUFFER_SIZE (10240)
static int16_t audio_buffer[BUFFER_SIZE];
static unsigned audio_buffer_ptr;
......@@ -1289,10 +1289,20 @@ static void audio_process(void)
CDAudio_Update();
}
static void
audio_batch_cb_blocking(int16_t * sa, size_t sz) {
while (sz) {
size_t r = audio_batch_cb(sa, sz);
sz -= r;
sa += r;
}
}
static void audio_callback(void)
{
unsigned read_first, read_second;
float samples_per_frame = (2 * SAMPLERATE) / framerate;
const int nchans = 2;
int samples_per_frame = (nchans * SAMPLERATE) / framerate;
unsigned read_end = audio_buffer_ptr + samples_per_frame;
if (read_end > BUFFER_SIZE)
......@@ -1301,10 +1311,10 @@ static void audio_callback(void)
read_first = read_end - audio_buffer_ptr;
read_second = samples_per_frame - read_first;
audio_batch_cb(audio_buffer + audio_buffer_ptr, read_first / (shm->samplebits / 8));
audio_batch_cb_blocking(audio_buffer + audio_buffer_ptr, read_first / nchans);
audio_buffer_ptr += read_first;
if (read_second >= 1) {
audio_batch_cb(audio_buffer, read_second / (shm->samplebits / 8));
audio_batch_cb_blocking(audio_buffer, read_second / nchans);
audio_buffer_ptr = read_second;
}
}
......
......@@ -73,6 +73,12 @@ struct retro_core_option_definition option_defs_us[] = {
"Modify framerate. Requires a restart.",
{
{ "auto", "Auto"},
{ "10", "10fps"},
{ "15", "15fps"},
{ "20", "20fps"},
{ "25", "25fps"},
{ "30", "30fps"},
{ "40", "40fps"},
{ "50", "50fps"},
{ "60", "60fps"},
{ "72", "72fps"},
......@@ -93,7 +99,11 @@ struct retro_core_option_definition option_defs_us[] = {
{ "360", "360fps"},
{ NULL, NULL },
},
#ifdef _3DS
"25"
#else
"auto"
#endif
},
{
"tyrquake_colored_lighting",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment