diff --git a/src/audio/mixer.c b/src/audio/mixer.c index 0a0b83be..b677c267 100644 --- a/src/audio/mixer.c +++ b/src/audio/mixer.c @@ -16,8 +16,8 @@ #define ROUND_DOWN_16(v) ((v) & ~0xf) //#define DMEM_BUF_SIZE (0x1000 - 0x0330 - 0x10 - 0x40) -#define DMEM_BUF_SIZE (0x1000 - 0x450 - 0x40) -// #define DMEM_BUF_SIZE 0xC90 +//#define DMEM_BUF_SIZE (0x1000 - 0x450 - 0x40) +#define DMEM_BUF_SIZE 0xC90 #define BUF_U8(a) (rspa.buf.as_u8 + ((a)-0x450)) #define BUF_S16(a) (rspa.buf.as_s16 + ((a)-0x450) / sizeof(int16_t)) diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index de722428..89292876 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -68,7 +68,7 @@ GameEngine::GameEngine() { } this->context = - Ship::Context::CreateInstance("Starship", "ship", "starship.cfg.json", OTRFiles, {}, 3, { 32000, 1024, 2480 }); + Ship::Context::CreateInstance("Starship", "ship", "starship.cfg.json", OTRFiles, {}, 3, { 32000, 512, 1240 }); auto loader = context->GetResourceManager()->GetResourceLoader(); loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, @@ -149,8 +149,8 @@ void GameEngine::StartFrame() const { this->context->GetWindow()->StartFrame(); } -#define SAMPLES_HIGH 752 -#define SAMPLES_LOW 720 +#define SAMPLES_HIGH 560 +#define SAMPLES_LOW 528 #define NUM_AUDIO_CHANNELS 2 #define SAMPLES_PER_FRAME (SAMPLES_HIGH * NUM_AUDIO_CHANNELS * 3) @@ -179,10 +179,9 @@ void GameEngine::HandleAudioThread() { //#define AUDIO_FRAMES_PER_UPDATE (gVIsPerFrame > 0 ? gVIsPerFrame : 1) #define AUDIO_FRAMES_PER_UPDATE 2 - std::unique_lock Lock(audio.mutex); int samples_left = AudioPlayerBuffered(); - u32 num_audio_samples = samples_left < AudioPlayerGetDesiredBuffered() ? 560 : 528; + u32 num_audio_samples = samples_left < AudioPlayerGetDesiredBuffered() ? SAMPLES_HIGH : SAMPLES_LOW; frames++;