aboutsummaryrefslogtreecommitdiff
path: root/src/SPU.cpp
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2023-11-02 21:04:09 +0100
committerArisotura <thetotalworm@gmail.com>2023-11-02 21:04:09 +0100
commit70c6750561b0c130b430e2ec3d076708b3767674 (patch)
treef2cc1b0aad735f9be60e5f837ceca120980ca682 /src/SPU.cpp
parent5ccd3916ff719ea4ed49030077794fadda048cb9 (diff)
better, less hacky, more OOP-friendly scheduler design
Diffstat (limited to 'src/SPU.cpp')
-rw-r--r--src/SPU.cpp8
1 files changed, 6 insertions, 2 deletions
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()