summaryrefslogtreecommitdiff
path: root/src/audio_core/hle/dsp.cpp
diff options
context:
space:
mode:
authorGravatar MerryMage2016-02-21 13:13:52 +0000
committerGravatar MerryMage2016-02-21 13:13:52 +0000
commit8b00954ec79fad71691ad2d4c82d5c1c60e21b0c (patch)
tree443d275fd39c58928e68ef22ce3fe0fa56c73642 /src/audio_core/hle/dsp.cpp
parentMerge pull request #1406 from MerryMage/bitfield2 (diff)
downloadyuzu-8b00954ec79fad71691ad2d4c82d5c1c60e21b0c.tar.gz
yuzu-8b00954ec79fad71691ad2d4c82d5c1c60e21b0c.tar.xz
yuzu-8b00954ec79fad71691ad2d4c82d5c1c60e21b0c.zip
AudioCore: Skeleton Implementation
This commit: * Adds a new subproject, audio_core. * Defines structures that exist in DSP shared memory. * Hooks up various other parts of the emulator into audio core. This sets the foundation for a later HLE DSP implementation.
Diffstat (limited to 'src/audio_core/hle/dsp.cpp')
-rw-r--r--src/audio_core/hle/dsp.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/audio_core/hle/dsp.cpp b/src/audio_core/hle/dsp.cpp
new file mode 100644
index 000000000..c89356edc
--- /dev/null
+++ b/src/audio_core/hle/dsp.cpp
@@ -0,0 +1,42 @@
1// Copyright 2016 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "audio_core/hle/dsp.h"
6#include "audio_core/hle/pipe.h"
7
8namespace DSP {
9namespace HLE {
10
11SharedMemory g_region0;
12SharedMemory g_region1;
13
14void Init() {
15 DSP::HLE::ResetPipes();
16}
17
18void Shutdown() {
19}
20
21bool Tick() {
22 return true;
23}
24
25SharedMemory& CurrentRegion() {
26 // The region with the higher frame counter is chosen unless there is wraparound.
27
28 if (g_region0.frame_counter == 0xFFFFu && g_region1.frame_counter != 0xFFFEu) {
29 // Wraparound has occured.
30 return g_region1;
31 }
32
33 if (g_region1.frame_counter == 0xFFFFu && g_region0.frame_counter != 0xFFFEu) {
34 // Wraparound has occured.
35 return g_region0;
36 }
37
38 return (g_region0.frame_counter > g_region1.frame_counter) ? g_region0 : g_region1;
39}
40
41} // namespace HLE
42} // namespace DSP