From 70c6750561b0c130b430e2ec3d076708b3767674 Mon Sep 17 00:00:00 2001 From: Arisotura Date: Thu, 2 Nov 2023 21:04:09 +0100 Subject: better, less hacky, more OOP-friendly scheduler design --- src/SPU.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/SPU.cpp') diff --git a/src/SPU.cpp b/src/SPU.cpp index 76fdd2d..cdfc244 100644 --- a/src/SPU.cpp +++ b/src/SPU.cpp @@ -93,6 +93,8 @@ CaptureUnit* Capture[2]; bool Init() { + NDS::RegisterEventFunc(NDS::Event_SPU, 0, Mix); + for (int i = 0; i < 16; i++) Channels[i] = new Channel(i); @@ -147,6 +149,8 @@ void DeInit() Platform::Mutex_Free(AudioLock); AudioLock = nullptr; + + NDS::UnregisterEventFunc(NDS::Event_SPU, 0); } void Reset() @@ -163,7 +167,7 @@ void Reset() Capture[0]->Reset(); Capture[1]->Reset(); - NDS::ScheduleEvent(NDS::Event_SPU, false, 1024, Mix, 0); + NDS::ScheduleEvent(NDS::Event_SPU, false, 1024, 0, 0); } void Stop() @@ -864,7 +868,7 @@ void Mix(u32 dummy) OutputBackbufferWritePosition += 2; } - NDS::ScheduleEvent(NDS::Event_SPU, true, 1024, Mix, 0); + NDS::ScheduleEvent(NDS::Event_SPU, true, 1024, 0, 0); } void TransferOutput() -- cgit v1.2.3