diff options
| author | GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> | 2022-08-03 02:30:39 +0200 |
|---|---|---|
| committer | louist103 <35883445+louist103@users.noreply.github.com> | 2022-08-06 21:52:42 -0400 |
| commit | cb2410d9c5920a882f01b6ea4a4736e37438d2ad (patch) | |
| tree | eb72d0a4d673c6d588e4075a2e8826aff953ffc4 /soh/src/code | |
| parent | b2ac01bc98f3e52f21e02ffe3e97132897178d6a (diff) | |
Handle audio thread properly
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/graph.c | 16 | ||||
| -rw-r--r-- | soh/src/code/main.c | 4 |
2 files changed, 3 insertions, 17 deletions
diff --git a/soh/src/code/graph.c b/soh/src/code/graph.c index cf0a53c76..f4dcf56e8 100644 --- a/soh/src/code/graph.c +++ b/soh/src/code/graph.c @@ -481,22 +481,6 @@ static void RunFrame() uint64_t ticksA, ticksB; ticksA = GetPerfCounter(); -#ifdef __SWITCH__ - #define SAMPLES_HIGH 752 - #define SAMPLES_LOW 720 - - #define AUDIO_FRAMES_PER_UPDATE (R_UPDATE_RATE > 0 ? R_UPDATE_RATE : 1 ) - #define NUM_AUDIO_CHANNELS 2 - int samples_left = AudioPlayer_Buffered(); - u32 num_audio_samples = samples_left < AudioPlayer_GetDesiredBuffered() ? SAMPLES_HIGH : SAMPLES_LOW; - - s16 audio_buffer[SAMPLES_HIGH * NUM_AUDIO_CHANNELS * 3]; - for (int i = 0; i < AUDIO_FRAMES_PER_UPDATE; i++) { - AudioMgr_CreateNextAudioBuffer(audio_buffer + i * (num_audio_samples * NUM_AUDIO_CHANNELS), num_audio_samples); - } - - AudioPlayer_Play((u8*)audio_buffer, num_audio_samples * (sizeof(int16_t) * NUM_AUDIO_CHANNELS * AUDIO_FRAMES_PER_UPDATE)); -#endif Graph_StartFrame(); // TODO: Workaround for rumble being too long. Implement os thread functions. diff --git a/soh/src/code/main.c b/soh/src/code/main.c index fd02b016a..ccfdc2019 100644 --- a/soh/src/code/main.c +++ b/soh/src/code/main.c @@ -36,12 +36,14 @@ void Main_LogSystemHeap(void) { osSyncPrintf(VT_RST); } -void main(int argc, char** argv) +int main(int argc, char** argv) { GameConsole_Init(); InitOTR(); BootCommands_Init(); Main(0); + DeinitOTR(); + return 0; } void Main(void* arg) { |
