From 2ee034b16e929706c687ba9cd6f706d520348db5 Mon Sep 17 00:00:00 2001 From: KiritoDv Date: Tue, 29 Oct 2024 08:12:39 -0600 Subject: [PATCH] Increased samples per frame and readded malloc system --- src/port/Engine.cpp | 5 +++-- src/port/Engine.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index 25480a2f..53b10a5f 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -42,7 +42,7 @@ void AudioThread_CreateNextAudioBuffer(int16_t *samples, uint32_t num_samples); GameEngine* GameEngine::Instance; static GamePool MemoryPool = { - .chunk = 2048, + .chunk = 1024 * 20, .cursor = 0, .length = 0, .memory = nullptr @@ -437,7 +437,8 @@ extern "C" int32_t OTRConvertHUDXToScreenX(int32_t v) { extern "C" void* GameEngine_Malloc(size_t size) { // This is really wrong - return malloc(size); + // return malloc(size); + // TODO: Kenix please take a look at this, i think it works but you are better at this const auto chunk = MemoryPool.chunk; diff --git a/src/port/Engine.h b/src/port/Engine.h index e222330d..0af0ea59 100644 --- a/src/port/Engine.h +++ b/src/port/Engine.h @@ -19,7 +19,7 @@ struct GamePool { #define SAMPLES_LOW 528 #define AUDIO_FRAMES_PER_UPDATE 2 #define NUM_AUDIO_CHANNELS 2 -#define SAMPLES_PER_FRAME (SAMPLES_HIGH * NUM_AUDIO_CHANNELS * 2) +#define SAMPLES_PER_FRAME (SAMPLES_HIGH * NUM_AUDIO_CHANNELS * 3) class GameEngine { public: