summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/common/logging/backend.cpp2
-rw-r--r--src/common/logging/log.h2
-rw-r--r--src/common/threadsafe_queue.h32
-rw-r--r--src/core/CMakeLists.txt24
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic.cpp18
-rw-r--r--src/core/hle/kernel/address_arbiter.cpp6
-rw-r--r--src/core/hle/kernel/address_arbiter.h4
-rw-r--r--src/core/hle/kernel/client_port.cpp3
-rw-r--r--src/core/hle/kernel/client_session.cpp2
-rw-r--r--src/core/hle/kernel/event.cpp2
-rw-r--r--src/core/hle/kernel/hle_ipc.cpp1
-rw-r--r--src/core/hle/kernel/hle_ipc.h1
-rw-r--r--src/core/hle/kernel/memory.cpp4
-rw-r--r--src/core/hle/kernel/memory.h5
-rw-r--r--src/core/hle/kernel/mutex.cpp4
-rw-r--r--src/core/hle/kernel/mutex.h6
-rw-r--r--src/core/hle/kernel/scheduler.cpp4
-rw-r--r--src/core/hle/kernel/scheduler.h3
-rw-r--r--src/core/hle/kernel/server_port.h1
-rw-r--r--src/core/hle/kernel/server_session.cpp2
-rw-r--r--src/core/hle/kernel/server_session.h4
-rw-r--r--src/core/hle/kernel/shared_memory.cpp2
-rw-r--r--src/core/hle/kernel/shared_memory.h3
-rw-r--r--src/core/hle/kernel/svc.cpp3
-rw-r--r--src/core/hle/kernel/thread.cpp6
-rw-r--r--src/core/hle/kernel/thread.h5
-rw-r--r--src/core/hle/kernel/wait_object.cpp2
-rw-r--r--src/core/hle/service/am/am.cpp6
-rw-r--r--src/core/hle/service/am/idle.cpp24
-rw-r--r--src/core/hle/service/am/idle.h16
-rw-r--r--src/core/hle/service/am/omm.cpp42
-rw-r--r--src/core/hle/service/am/omm.h16
-rw-r--r--src/core/hle/service/am/spsm.cpp30
-rw-r--r--src/core/hle/service/am/spsm.h16
-rw-r--r--src/core/hle/service/audio/audctl.cpp45
-rw-r--r--src/core/hle/service/audio/audctl.h16
-rw-r--r--src/core/hle/service/audio/auddbg.cpp20
-rw-r--r--src/core/hle/service/audio/auddbg.h16
-rw-r--r--src/core/hle/service/audio/audin_a.cpp24
-rw-r--r--src/core/hle/service/audio/audin_a.h16
-rw-r--r--src/core/hle/service/audio/audio.cpp16
-rw-r--r--src/core/hle/service/audio/audout_a.cpp26
-rw-r--r--src/core/hle/service/audio/audout_a.h16
-rw-r--r--src/core/hle/service/audio/audout_u.cpp2
-rw-r--r--src/core/hle/service/audio/audrec_a.cpp22
-rw-r--r--src/core/hle/service/audio/audrec_a.h16
-rw-r--r--src/core/hle/service/audio/audren_a.cpp28
-rw-r--r--src/core/hle/service/audio/audren_a.h16
-rw-r--r--src/core/hle/service/fgm/fgm.cpp75
-rw-r--r--src/core/hle/service/fgm/fgm.h15
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp14
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp9
-rw-r--r--src/core/hle/service/pcie/pcie.cpp64
-rw-r--r--src/core/hle/service/pcie/pcie.h15
-rw-r--r--src/core/hle/service/service.cpp4
-rw-r--r--src/video_core/macro_interpreter.cpp4
-rw-r--r--src/video_core/macro_interpreter.h4
57 files changed, 734 insertions, 50 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 55de535c0..d86c40d26 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -171,6 +171,7 @@ void FileBackend::Write(const Entry& entry) {
171 SUB(Service, BCAT) \ 171 SUB(Service, BCAT) \
172 SUB(Service, BTM) \ 172 SUB(Service, BTM) \
173 SUB(Service, Fatal) \ 173 SUB(Service, Fatal) \
174 SUB(Service, FGM) \
174 SUB(Service, Friend) \ 175 SUB(Service, Friend) \
175 SUB(Service, FS) \ 176 SUB(Service, FS) \
176 SUB(Service, HID) \ 177 SUB(Service, HID) \
@@ -185,6 +186,7 @@ void FileBackend::Write(const Entry& entry) {
185 SUB(Service, NIFM) \ 186 SUB(Service, NIFM) \
186 SUB(Service, NS) \ 187 SUB(Service, NS) \
187 SUB(Service, NVDRV) \ 188 SUB(Service, NVDRV) \
189 SUB(Service, PCIE) \
188 SUB(Service, PCTL) \ 190 SUB(Service, PCTL) \
189 SUB(Service, PREPO) \ 191 SUB(Service, PREPO) \
190 SUB(Service, SET) \ 192 SUB(Service, SET) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index e8d98de99..140cd8e47 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -58,6 +58,7 @@ enum class Class : ClassType {
58 Service_BCAT, ///< The BCAT service 58 Service_BCAT, ///< The BCAT service
59 Service_BTM, ///< The BTM service 59 Service_BTM, ///< The BTM service
60 Service_Fatal, ///< The Fatal service 60 Service_Fatal, ///< The Fatal service
61 Service_FGM, ///< The FGM service
61 Service_Friend, ///< The friend service 62 Service_Friend, ///< The friend service
62 Service_FS, ///< The FS (Filesystem) service 63 Service_FS, ///< The FS (Filesystem) service
63 Service_HID, ///< The HID (Human interface device) service 64 Service_HID, ///< The HID (Human interface device) service
@@ -72,6 +73,7 @@ enum class Class : ClassType {
72 Service_NIFM, ///< The NIFM (Network interface) service 73 Service_NIFM, ///< The NIFM (Network interface) service
73 Service_NS, ///< The NS services 74 Service_NS, ///< The NS services
74 Service_NVDRV, ///< The NVDRV (Nvidia driver) service 75 Service_NVDRV, ///< The NVDRV (Nvidia driver) service
76 Service_PCIE, ///< The PCIe service
75 Service_PCTL, ///< The PCTL (Parental control) service 77 Service_PCTL, ///< The PCTL (Parental control) service
76 Service_PREPO, ///< The PREPO (Play report) service 78 Service_PREPO, ///< The PREPO (Play report) service
77 Service_SET, ///< The SET (Settings) service 79 Service_SET, ///< The SET (Settings) service
diff --git a/src/common/threadsafe_queue.h b/src/common/threadsafe_queue.h
index a0c731e8c..edf13bc49 100644
--- a/src/common/threadsafe_queue.h
+++ b/src/common/threadsafe_queue.h
@@ -33,9 +33,11 @@ public:
33 bool Empty() const { 33 bool Empty() const {
34 return !read_ptr->next.load(); 34 return !read_ptr->next.load();
35 } 35 }
36
36 T& Front() const { 37 T& Front() const {
37 return read_ptr->current; 38 return read_ptr->current;
38 } 39 }
40
39 template <typename Arg> 41 template <typename Arg>
40 void Push(Arg&& t) { 42 void Push(Arg&& t) {
41 // create the element, add it to the queue 43 // create the element, add it to the queue
@@ -108,15 +110,41 @@ private:
108// single reader, multiple writer queue 110// single reader, multiple writer queue
109 111
110template <typename T, bool NeedSize = true> 112template <typename T, bool NeedSize = true>
111class MPSCQueue : public SPSCQueue<T, NeedSize> { 113class MPSCQueue {
112public: 114public:
115 u32 Size() const {
116 return spsc_queue.Size();
117 }
118
119 bool Empty() const {
120 return spsc_queue.Empty();
121 }
122
123 T& Front() const {
124 return spsc_queue.Front();
125 }
126
113 template <typename Arg> 127 template <typename Arg>
114 void Push(Arg&& t) { 128 void Push(Arg&& t) {
115 std::lock_guard<std::mutex> lock(write_lock); 129 std::lock_guard<std::mutex> lock(write_lock);
116 SPSCQueue<T, NeedSize>::Push(t); 130 spsc_queue.Push(t);
131 }
132
133 void Pop() {
134 return spsc_queue.Pop();
135 }
136
137 bool Pop(T& t) {
138 return spsc_queue.Pop(t);
139 }
140
141 // not thread-safe
142 void Clear() {
143 spsc_queue.Clear();
117 } 144 }
118 145
119private: 146private:
147 SPSCQueue<T, NeedSize> spsc_queue;
120 std::mutex write_lock; 148 std::mutex write_lock;
121}; 149};
122} // namespace Common 150} // namespace Common
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 3a4ddc14c..ccb0695e4 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -112,23 +112,39 @@ add_library(core STATIC
112 hle/service/am/applet_ae.h 112 hle/service/am/applet_ae.h
113 hle/service/am/applet_oe.cpp 113 hle/service/am/applet_oe.cpp
114 hle/service/am/applet_oe.h 114 hle/service/am/applet_oe.h
115 hle/service/am/idle.cpp
116 hle/service/am/idle.h
117 hle/service/am/omm.cpp
118 hle/service/am/omm.h
119 hle/service/am/spsm.cpp
120 hle/service/am/spsm.h
115 hle/service/aoc/aoc_u.cpp 121 hle/service/aoc/aoc_u.cpp
116 hle/service/aoc/aoc_u.h 122 hle/service/aoc/aoc_u.h
117 hle/service/apm/apm.cpp 123 hle/service/apm/apm.cpp
118 hle/service/apm/apm.h 124 hle/service/apm/apm.h
119 hle/service/apm/interface.cpp 125 hle/service/apm/interface.cpp
120 hle/service/apm/interface.h 126 hle/service/apm/interface.h
127 hle/service/audio/audctl.cpp
128 hle/service/audio/audctl.h
129 hle/service/audio/auddbg.cpp
130 hle/service/audio/auddbg.h
131 hle/service/audio/audin_a.cpp
132 hle/service/audio/audin_a.h
121 hle/service/audio/audin_u.cpp 133 hle/service/audio/audin_u.cpp
122 hle/service/audio/audin_u.h 134 hle/service/audio/audin_u.h
123 hle/service/audio/audio.cpp 135 hle/service/audio/audio.cpp
124 hle/service/audio/audio.h 136 hle/service/audio/audio.h
137 hle/service/audio/audout_a.cpp
138 hle/service/audio/audout_a.h
125 hle/service/audio/audout_u.cpp 139 hle/service/audio/audout_u.cpp
126 hle/service/audio/audout_u.h 140 hle/service/audio/audout_u.h
141 hle/service/audio/audrec_a.cpp
142 hle/service/audio/audrec_a.h
127 hle/service/audio/audrec_u.cpp 143 hle/service/audio/audrec_u.cpp
128 hle/service/audio/audrec_u.h 144 hle/service/audio/audrec_u.h
145 hle/service/audio/audren_a.cpp
146 hle/service/audio/audren_a.h
129 hle/service/audio/audren_u.cpp 147 hle/service/audio/audren_u.cpp
130 hle/service/audio/audren_u.cpp
131 hle/service/audio/audren_u.h
132 hle/service/audio/audren_u.h 148 hle/service/audio/audren_u.h
133 hle/service/audio/codecctl.cpp 149 hle/service/audio/codecctl.cpp
134 hle/service/audio/codecctl.h 150 hle/service/audio/codecctl.h
@@ -158,6 +174,8 @@ add_library(core STATIC
158 hle/service/filesystem/filesystem.h 174 hle/service/filesystem/filesystem.h
159 hle/service/filesystem/fsp_srv.cpp 175 hle/service/filesystem/fsp_srv.cpp
160 hle/service/filesystem/fsp_srv.h 176 hle/service/filesystem/fsp_srv.h
177 hle/service/fgm/fgm.cpp
178 hle/service/fgm/fgm.h
161 hle/service/friend/friend.cpp 179 hle/service/friend/friend.cpp
162 hle/service/friend/friend.h 180 hle/service/friend/friend.h
163 hle/service/friend/interface.cpp 181 hle/service/friend/interface.cpp
@@ -223,6 +241,8 @@ add_library(core STATIC
223 hle/service/nvflinger/buffer_queue.h 241 hle/service/nvflinger/buffer_queue.h
224 hle/service/nvflinger/nvflinger.cpp 242 hle/service/nvflinger/nvflinger.cpp
225 hle/service/nvflinger/nvflinger.h 243 hle/service/nvflinger/nvflinger.h
244 hle/service/pcie/pcie.cpp
245 hle/service/pcie/pcie.h
226 hle/service/pctl/module.cpp 246 hle/service/pctl/module.cpp
227 hle/service/pctl/module.h 247 hle/service/pctl/module.h
228 hle/service/pctl/pctl.cpp 248 hle/service/pctl/pctl.cpp
diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp
index 57b8634b9..ceb3f7683 100644
--- a/src/core/arm/dynarmic/arm_dynarmic.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic.cpp
@@ -10,7 +10,7 @@
10#include "core/arm/dynarmic/arm_dynarmic.h" 10#include "core/arm/dynarmic/arm_dynarmic.h"
11#include "core/core.h" 11#include "core/core.h"
12#include "core/core_timing.h" 12#include "core/core_timing.h"
13#include "core/hle/kernel/memory.h" 13#include "core/hle/kernel/process.h"
14#include "core/hle/kernel/svc.h" 14#include "core/hle/kernel/svc.h"
15#include "core/memory.h" 15#include "core/memory.h"
16 16
@@ -139,14 +139,12 @@ void ARM_Dynarmic::Step() {
139} 139}
140 140
141ARM_Dynarmic::ARM_Dynarmic(std::shared_ptr<ExclusiveMonitor> exclusive_monitor, size_t core_index) 141ARM_Dynarmic::ARM_Dynarmic(std::shared_ptr<ExclusiveMonitor> exclusive_monitor, size_t core_index)
142 : cb(std::make_unique<ARM_Dynarmic_Callbacks>(*this)), 142 : cb(std::make_unique<ARM_Dynarmic_Callbacks>(*this)), core_index{core_index},
143 jit(MakeJit()), exclusive_monitor{std::dynamic_pointer_cast<DynarmicExclusiveMonitor>( 143 exclusive_monitor{std::dynamic_pointer_cast<DynarmicExclusiveMonitor>(exclusive_monitor)} {
144 exclusive_monitor)}, 144 ThreadContext ctx;
145 core_index{core_index} {
146 ARM_Interface::ThreadContext ctx;
147 inner_unicorn.SaveContext(ctx); 145 inner_unicorn.SaveContext(ctx);
148 LoadContext(ctx);
149 PageTableChanged(); 146 PageTableChanged();
147 LoadContext(ctx);
150} 148}
151 149
152ARM_Dynarmic::~ARM_Dynarmic() = default; 150ARM_Dynarmic::~ARM_Dynarmic() = default;
@@ -205,7 +203,7 @@ u64 ARM_Dynarmic::GetTlsAddress() const {
205 return cb->tpidrro_el0; 203 return cb->tpidrro_el0;
206} 204}
207 205
208void ARM_Dynarmic::SetTlsAddress(u64 address) { 206void ARM_Dynarmic::SetTlsAddress(VAddr address) {
209 cb->tpidrro_el0 = address; 207 cb->tpidrro_el0 = address;
210} 208}
211 209
@@ -217,7 +215,7 @@ void ARM_Dynarmic::SetTPIDR_EL0(u64 value) {
217 cb->tpidr_el0 = value; 215 cb->tpidr_el0 = value;
218} 216}
219 217
220void ARM_Dynarmic::SaveContext(ARM_Interface::ThreadContext& ctx) { 218void ARM_Dynarmic::SaveContext(ThreadContext& ctx) {
221 ctx.cpu_registers = jit->GetRegisters(); 219 ctx.cpu_registers = jit->GetRegisters();
222 ctx.sp = jit->GetSP(); 220 ctx.sp = jit->GetSP();
223 ctx.pc = jit->GetPC(); 221 ctx.pc = jit->GetPC();
@@ -226,7 +224,7 @@ void ARM_Dynarmic::SaveContext(ARM_Interface::ThreadContext& ctx) {
226 ctx.fpscr = jit->GetFpcr(); 224 ctx.fpscr = jit->GetFpcr();
227} 225}
228 226
229void ARM_Dynarmic::LoadContext(const ARM_Interface::ThreadContext& ctx) { 227void ARM_Dynarmic::LoadContext(const ThreadContext& ctx) {
230 jit->SetRegisters(ctx.cpu_registers); 228 jit->SetRegisters(ctx.cpu_registers);
231 jit->SetSP(ctx.sp); 229 jit->SetSP(ctx.sp);
232 jit->SetPC(ctx.pc); 230 jit->SetPC(ctx.pc);
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp
index 233fdab25..6a10efab1 100644
--- a/src/core/hle/kernel/address_arbiter.cpp
+++ b/src/core/hle/kernel/address_arbiter.cpp
@@ -2,15 +2,17 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm>
6#include <vector>
7
5#include "common/assert.h" 8#include "common/assert.h"
6#include "common/common_funcs.h"
7#include "common/common_types.h" 9#include "common/common_types.h"
8#include "core/core.h" 10#include "core/core.h"
9#include "core/hle/kernel/errors.h" 11#include "core/hle/kernel/errors.h"
10#include "core/hle/kernel/kernel.h" 12#include "core/hle/kernel/kernel.h"
11#include "core/hle/kernel/process.h" 13#include "core/hle/kernel/process.h"
12#include "core/hle/kernel/thread.h" 14#include "core/hle/kernel/thread.h"
13#include "core/hle/lock.h" 15#include "core/hle/result.h"
14#include "core/memory.h" 16#include "core/memory.h"
15 17
16namespace Kernel { 18namespace Kernel {
diff --git a/src/core/hle/kernel/address_arbiter.h b/src/core/hle/kernel/address_arbiter.h
index f20f3dbc0..e3657b8e9 100644
--- a/src/core/hle/kernel/address_arbiter.h
+++ b/src/core/hle/kernel/address_arbiter.h
@@ -4,7 +4,9 @@
4 4
5#pragma once 5#pragma once
6 6
7#include "core/hle/result.h" 7#include "common/common_types.h"
8
9union ResultCode;
8 10
9namespace Kernel { 11namespace Kernel {
10 12
diff --git a/src/core/hle/kernel/client_port.cpp b/src/core/hle/kernel/client_port.cpp
index fb2b6f7a3..2d6051e8b 100644
--- a/src/core/hle/kernel/client_port.cpp
+++ b/src/core/hle/kernel/client_port.cpp
@@ -2,7 +2,8 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "common/assert.h" 5#include <tuple>
6
6#include "core/hle/kernel/client_port.h" 7#include "core/hle/kernel/client_port.h"
7#include "core/hle/kernel/client_session.h" 8#include "core/hle/kernel/client_session.h"
8#include "core/hle/kernel/errors.h" 9#include "core/hle/kernel/errors.h"
diff --git a/src/core/hle/kernel/client_session.cpp b/src/core/hle/kernel/client_session.cpp
index 72773d8b1..fdffc648d 100644
--- a/src/core/hle/kernel/client_session.cpp
+++ b/src/core/hle/kernel/client_session.cpp
@@ -2,8 +2,6 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "common/assert.h"
6
7#include "core/hle/kernel/client_session.h" 5#include "core/hle/kernel/client_session.h"
8#include "core/hle/kernel/errors.h" 6#include "core/hle/kernel/errors.h"
9#include "core/hle/kernel/hle_ipc.h" 7#include "core/hle/kernel/hle_ipc.h"
diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp
index 9cae2369f..37e0766c3 100644
--- a/src/core/hle/kernel/event.cpp
+++ b/src/core/hle/kernel/event.cpp
@@ -3,8 +3,6 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm> 5#include <algorithm>
6#include <map>
7#include <vector>
8#include "common/assert.h" 6#include "common/assert.h"
9#include "core/hle/kernel/event.h" 7#include "core/hle/kernel/event.h"
10#include "core/hle/kernel/kernel.h" 8#include "core/hle/kernel/kernel.h"
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp
index f24392520..771d6d476 100644
--- a/src/core/hle/kernel/hle_ipc.cpp
+++ b/src/core/hle/kernel/hle_ipc.cpp
@@ -2,6 +2,7 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm>
5#include <utility> 6#include <utility>
6 7
7#include <boost/range/algorithm_ext/erase.hpp> 8#include <boost/range/algorithm_ext/erase.hpp>
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h
index 84727f748..ee4abebf2 100644
--- a/src/core/hle/kernel/hle_ipc.h
+++ b/src/core/hle/kernel/hle_ipc.h
@@ -5,7 +5,6 @@
5#pragma once 5#pragma once
6 6
7#include <array> 7#include <array>
8#include <iterator>
9#include <memory> 8#include <memory>
10#include <string> 9#include <string>
11#include <type_traits> 10#include <type_traits>
diff --git a/src/core/hle/kernel/memory.cpp b/src/core/hle/kernel/memory.cpp
index 94eac677c..a7f3c3c5a 100644
--- a/src/core/hle/kernel/memory.cpp
+++ b/src/core/hle/kernel/memory.cpp
@@ -4,7 +4,6 @@
4 4
5#include <algorithm> 5#include <algorithm>
6#include <cinttypes> 6#include <cinttypes>
7#include <map>
8#include <memory> 7#include <memory>
9#include <utility> 8#include <utility>
10#include <vector> 9#include <vector>
@@ -12,10 +11,9 @@
12#include "common/common_types.h" 11#include "common/common_types.h"
13#include "common/logging/log.h" 12#include "common/logging/log.h"
14#include "core/hle/kernel/memory.h" 13#include "core/hle/kernel/memory.h"
14#include "core/hle/kernel/process.h"
15#include "core/hle/kernel/vm_manager.h" 15#include "core/hle/kernel/vm_manager.h"
16#include "core/hle/result.h"
17#include "core/memory.h" 16#include "core/memory.h"
18#include "core/memory_setup.h"
19 17
20//////////////////////////////////////////////////////////////////////////////////////////////////// 18////////////////////////////////////////////////////////////////////////////////////////////////////
21 19
diff --git a/src/core/hle/kernel/memory.h b/src/core/hle/kernel/memory.h
index 61e30c679..1d05b8871 100644
--- a/src/core/hle/kernel/memory.h
+++ b/src/core/hle/kernel/memory.h
@@ -5,12 +5,15 @@
5#pragma once 5#pragma once
6 6
7#include <memory> 7#include <memory>
8#include <vector>
9
8#include "common/common_types.h" 10#include "common/common_types.h"
9#include "core/hle/kernel/process.h"
10 11
11namespace Kernel { 12namespace Kernel {
12 13
13class VMManager; 14class VMManager;
15enum class MemoryRegion : u16;
16struct AddressMapping;
14 17
15struct MemoryRegionInfo { 18struct MemoryRegionInfo {
16 u64 base; // Not an address, but offset from start of FCRAM 19 u64 base; // Not an address, but offset from start of FCRAM
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp
index f12c3a5e5..12b974c4b 100644
--- a/src/core/hle/kernel/mutex.cpp
+++ b/src/core/hle/kernel/mutex.cpp
@@ -3,8 +3,11 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <map> 5#include <map>
6#include <utility>
6#include <vector> 7#include <vector>
8
7#include <boost/range/algorithm_ext/erase.hpp> 9#include <boost/range/algorithm_ext/erase.hpp>
10
8#include "common/assert.h" 11#include "common/assert.h"
9#include "core/core.h" 12#include "core/core.h"
10#include "core/hle/kernel/errors.h" 13#include "core/hle/kernel/errors.h"
@@ -12,6 +15,7 @@
12#include "core/hle/kernel/kernel.h" 15#include "core/hle/kernel/kernel.h"
13#include "core/hle/kernel/mutex.h" 16#include "core/hle/kernel/mutex.h"
14#include "core/hle/kernel/thread.h" 17#include "core/hle/kernel/thread.h"
18#include "core/hle/result.h"
15 19
16namespace Kernel { 20namespace Kernel {
17 21
diff --git a/src/core/hle/kernel/mutex.h b/src/core/hle/kernel/mutex.h
index 3117e7c70..febfde698 100644
--- a/src/core/hle/kernel/mutex.h
+++ b/src/core/hle/kernel/mutex.h
@@ -4,12 +4,10 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <string>
8#include "common/common_types.h" 7#include "common/common_types.h"
9#include "common/swap.h"
10#include "core/hle/kernel/kernel.h" 8#include "core/hle/kernel/kernel.h"
11#include "core/hle/kernel/wait_object.h" 9
12#include "core/hle/result.h" 10union ResultCode;
13 11
14namespace Kernel { 12namespace Kernel {
15 13
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp
index e307eec98..94065c736 100644
--- a/src/core/hle/kernel/scheduler.cpp
+++ b/src/core/hle/kernel/scheduler.cpp
@@ -2,8 +2,12 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm>
5#include <utility> 6#include <utility>
6 7
8#include "common/assert.h"
9#include "common/logging/log.h"
10#include "core/arm/arm_interface.h"
7#include "core/core.h" 11#include "core/core.h"
8#include "core/core_timing.h" 12#include "core/core_timing.h"
9#include "core/hle/kernel/process.h" 13#include "core/hle/kernel/process.h"
diff --git a/src/core/hle/kernel/scheduler.h b/src/core/hle/kernel/scheduler.h
index a3b5fb8ca..cdc14808b 100644
--- a/src/core/hle/kernel/scheduler.h
+++ b/src/core/hle/kernel/scheduler.h
@@ -8,9 +8,10 @@
8#include <vector> 8#include <vector>
9#include "common/common_types.h" 9#include "common/common_types.h"
10#include "common/thread_queue_list.h" 10#include "common/thread_queue_list.h"
11#include "core/arm/arm_interface.h"
12#include "core/hle/kernel/thread.h" 11#include "core/hle/kernel/thread.h"
13 12
13class ARM_Interface;
14
14namespace Kernel { 15namespace Kernel {
15 16
16class Scheduler final { 17class Scheduler final {
diff --git a/src/core/hle/kernel/server_port.h b/src/core/hle/kernel/server_port.h
index 9ef4ecc35..e6546687e 100644
--- a/src/core/hle/kernel/server_port.h
+++ b/src/core/hle/kernel/server_port.h
@@ -7,6 +7,7 @@
7#include <memory> 7#include <memory>
8#include <string> 8#include <string>
9#include <tuple> 9#include <tuple>
10#include <vector>
10#include "common/common_types.h" 11#include "common/common_types.h"
11#include "core/hle/kernel/kernel.h" 12#include "core/hle/kernel/kernel.h"
12#include "core/hle/kernel/wait_object.h" 13#include "core/hle/kernel/wait_object.h"
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp
index 29b163528..60370e9ec 100644
--- a/src/core/hle/kernel/server_session.cpp
+++ b/src/core/hle/kernel/server_session.cpp
@@ -5,6 +5,8 @@
5#include <tuple> 5#include <tuple>
6#include <utility> 6#include <utility>
7 7
8#include "common/assert.h"
9#include "common/logging/log.h"
8#include "core/core.h" 10#include "core/core.h"
9#include "core/hle/ipc_helpers.h" 11#include "core/hle/ipc_helpers.h"
10#include "core/hle/kernel/client_port.h" 12#include "core/hle/kernel/client_port.h"
diff --git a/src/core/hle/kernel/server_session.h b/src/core/hle/kernel/server_session.h
index 2da807042..c7656cc49 100644
--- a/src/core/hle/kernel/server_session.h
+++ b/src/core/hle/kernel/server_session.h
@@ -6,12 +6,12 @@
6 6
7#include <memory> 7#include <memory>
8#include <string> 8#include <string>
9#include "common/assert.h" 9#include <vector>
10
10#include "common/common_types.h" 11#include "common/common_types.h"
11#include "core/hle/kernel/kernel.h" 12#include "core/hle/kernel/kernel.h"
12#include "core/hle/kernel/wait_object.h" 13#include "core/hle/kernel/wait_object.h"
13#include "core/hle/result.h" 14#include "core/hle/result.h"
14#include "core/memory.h"
15 15
16namespace Kernel { 16namespace Kernel {
17 17
diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp
index 4bf11c7e2..a5b11bd87 100644
--- a/src/core/hle/kernel/shared_memory.cpp
+++ b/src/core/hle/kernel/shared_memory.cpp
@@ -3,6 +3,8 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <utility> 5#include <utility>
6
7#include "common/assert.h"
6#include "common/logging/log.h" 8#include "common/logging/log.h"
7#include "core/core.h" 9#include "core/core.h"
8#include "core/hle/kernel/errors.h" 10#include "core/hle/kernel/errors.h"
diff --git a/src/core/hle/kernel/shared_memory.h b/src/core/hle/kernel/shared_memory.h
index 86f818e90..17b9cedc4 100644
--- a/src/core/hle/kernel/shared_memory.h
+++ b/src/core/hle/kernel/shared_memory.h
@@ -4,7 +4,10 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <memory>
7#include <string> 8#include <string>
9#include <vector>
10
8#include "common/common_types.h" 11#include "common/common_types.h"
9#include "core/hle/kernel/kernel.h" 12#include "core/hle/kernel/kernel.h"
10#include "core/hle/kernel/process.h" 13#include "core/hle/kernel/process.h"
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 0488cf286..d1cbbc1f2 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -5,7 +5,10 @@
5#include <algorithm> 5#include <algorithm>
6#include <cinttypes> 6#include <cinttypes>
7#include <iterator> 7#include <iterator>
8#include <mutex>
9#include <vector>
8 10
11#include "common/assert.h"
9#include "common/logging/log.h" 12#include "common/logging/log.h"
10#include "common/microprofile.h" 13#include "common/microprofile.h"
11#include "common/string_util.h" 14#include "common/string_util.h"
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 94735c86e..93ea58a1e 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -4,8 +4,11 @@
4 4
5#include <algorithm> 5#include <algorithm>
6#include <cinttypes> 6#include <cinttypes>
7#include <list>
8#include <vector> 7#include <vector>
8
9#include <boost/optional.hpp>
10#include <boost/range/algorithm_ext/erase.hpp>
11
9#include "common/assert.h" 12#include "common/assert.h"
10#include "common/common_types.h" 13#include "common/common_types.h"
11#include "common/logging/log.h" 14#include "common/logging/log.h"
@@ -19,7 +22,6 @@
19#include "core/hle/kernel/handle_table.h" 22#include "core/hle/kernel/handle_table.h"
20#include "core/hle/kernel/kernel.h" 23#include "core/hle/kernel/kernel.h"
21#include "core/hle/kernel/memory.h" 24#include "core/hle/kernel/memory.h"
22#include "core/hle/kernel/mutex.h"
23#include "core/hle/kernel/process.h" 25#include "core/hle/kernel/process.h"
24#include "core/hle/kernel/thread.h" 26#include "core/hle/kernel/thread.h"
25#include "core/hle/result.h" 27#include "core/hle/result.h"
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h
index 6218960d2..a456745a1 100644
--- a/src/core/hle/kernel/thread.h
+++ b/src/core/hle/kernel/thread.h
@@ -4,12 +4,11 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <functional>
7#include <memory> 8#include <memory>
8#include <string> 9#include <string>
9#include <unordered_map>
10#include <vector> 10#include <vector>
11#include <boost/container/flat_map.hpp> 11
12#include <boost/container/flat_set.hpp>
13#include "common/common_types.h" 12#include "common/common_types.h"
14#include "core/arm/arm_interface.h" 13#include "core/arm/arm_interface.h"
15#include "core/hle/kernel/kernel.h" 14#include "core/hle/kernel/kernel.h"
diff --git a/src/core/hle/kernel/wait_object.cpp b/src/core/hle/kernel/wait_object.cpp
index 23af346d0..97394bca2 100644
--- a/src/core/hle/kernel/wait_object.cpp
+++ b/src/core/hle/kernel/wait_object.cpp
@@ -5,11 +5,9 @@
5#include <algorithm> 5#include <algorithm>
6#include "common/assert.h" 6#include "common/assert.h"
7#include "common/logging/log.h" 7#include "common/logging/log.h"
8#include "core/hle/kernel/errors.h"
9#include "core/hle/kernel/kernel.h" 8#include "core/hle/kernel/kernel.h"
10#include "core/hle/kernel/memory.h" 9#include "core/hle/kernel/memory.h"
11#include "core/hle/kernel/process.h" 10#include "core/hle/kernel/process.h"
12#include "core/hle/kernel/resource_limit.h"
13#include "core/hle/kernel/thread.h" 11#include "core/hle/kernel/thread.h"
14#include "core/hle/kernel/timer.h" 12#include "core/hle/kernel/timer.h"
15 13
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 97ef07bf9..94d2a973d 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -11,6 +11,9 @@
11#include "core/hle/service/am/am.h" 11#include "core/hle/service/am/am.h"
12#include "core/hle/service/am/applet_ae.h" 12#include "core/hle/service/am/applet_ae.h"
13#include "core/hle/service/am/applet_oe.h" 13#include "core/hle/service/am/applet_oe.h"
14#include "core/hle/service/am/idle.h"
15#include "core/hle/service/am/omm.h"
16#include "core/hle/service/am/spsm.h"
14#include "core/hle/service/apm/apm.h" 17#include "core/hle/service/apm/apm.h"
15#include "core/hle/service/filesystem/filesystem.h" 18#include "core/hle/service/filesystem/filesystem.h"
16#include "core/hle/service/nvflinger/nvflinger.h" 19#include "core/hle/service/nvflinger/nvflinger.h"
@@ -689,6 +692,9 @@ void InstallInterfaces(SM::ServiceManager& service_manager,
689 std::shared_ptr<NVFlinger::NVFlinger> nvflinger) { 692 std::shared_ptr<NVFlinger::NVFlinger> nvflinger) {
690 std::make_shared<AppletAE>(nvflinger)->InstallAsService(service_manager); 693 std::make_shared<AppletAE>(nvflinger)->InstallAsService(service_manager);
691 std::make_shared<AppletOE>(nvflinger)->InstallAsService(service_manager); 694 std::make_shared<AppletOE>(nvflinger)->InstallAsService(service_manager);
695 std::make_shared<IdleSys>()->InstallAsService(service_manager);
696 std::make_shared<OMM>()->InstallAsService(service_manager);
697 std::make_shared<SPSM>()->InstallAsService(service_manager);
692} 698}
693 699
694IHomeMenuFunctions::IHomeMenuFunctions() : ServiceFramework("IHomeMenuFunctions") { 700IHomeMenuFunctions::IHomeMenuFunctions() : ServiceFramework("IHomeMenuFunctions") {
diff --git a/src/core/hle/service/am/idle.cpp b/src/core/hle/service/am/idle.cpp
new file mode 100644
index 000000000..af46e9494
--- /dev/null
+++ b/src/core/hle/service/am/idle.cpp
@@ -0,0 +1,24 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/am/idle.h"
6
7namespace Service::AM {
8
9IdleSys::IdleSys() : ServiceFramework{"idle:sys"} {
10 // clang-format off
11 static const FunctionInfo functions[] = {
12 {0, nullptr, "GetAutoPowerDownEvent"},
13 {1, nullptr, "Unknown1"},
14 {2, nullptr, "Unknown2"},
15 {3, nullptr, "Unknown3"},
16 {4, nullptr, "Unknown4"},
17 {5, nullptr, "Unknown5"},
18 };
19 // clang-format on
20
21 RegisterHandlers(functions);
22}
23
24} // namespace Service::AM
diff --git a/src/core/hle/service/am/idle.h b/src/core/hle/service/am/idle.h
new file mode 100644
index 000000000..1eb68d2c9
--- /dev/null
+++ b/src/core/hle/service/am/idle.h
@@ -0,0 +1,16 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9namespace Service::AM {
10
11class IdleSys final : public ServiceFramework<IdleSys> {
12public:
13 explicit IdleSys();
14};
15
16} // namespace Service::AM
diff --git a/src/core/hle/service/am/omm.cpp b/src/core/hle/service/am/omm.cpp
new file mode 100644
index 000000000..447fe8669
--- /dev/null
+++ b/src/core/hle/service/am/omm.cpp
@@ -0,0 +1,42 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/am/omm.h"
6
7namespace Service::AM {
8
9OMM::OMM() : ServiceFramework{"omm"} {
10 // clang-format off
11 static const FunctionInfo functions[] = {
12 {0, nullptr, "GetOperationMode"},
13 {1, nullptr, "GetOperationModeChangeEvent"},
14 {2, nullptr, "EnableAudioVisual"},
15 {3, nullptr, "DisableAudioVisual"},
16 {4, nullptr, "EnterSleepAndWait"},
17 {5, nullptr, "GetCradleStatus"},
18 {6, nullptr, "FadeInDisplay"},
19 {7, nullptr, "FadeOutDisplay"},
20 {8, nullptr, "Unknown1"},
21 {9, nullptr, "Unknown2"},
22 {10, nullptr, "Unknown3"},
23 {11, nullptr, "Unknown4"},
24 {12, nullptr, "Unknown5"},
25 {13, nullptr, "Unknown6"},
26 {14, nullptr, "Unknown7"},
27 {15, nullptr, "Unknown8"},
28 {16, nullptr, "Unknown9"},
29 {17, nullptr, "Unknown10"},
30 {18, nullptr, "Unknown11"},
31 {19, nullptr, "Unknown12"},
32 {20, nullptr, "Unknown13"},
33 {21, nullptr, "Unknown14"},
34 {22, nullptr, "Unknown15"},
35 {23, nullptr, "Unknown16"},
36 };
37 // clang-format on
38
39 RegisterHandlers(functions);
40}
41
42} // namespace Service::AM
diff --git a/src/core/hle/service/am/omm.h b/src/core/hle/service/am/omm.h
new file mode 100644
index 000000000..49e5d331c
--- /dev/null
+++ b/src/core/hle/service/am/omm.h
@@ -0,0 +1,16 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9namespace Service::AM {
10
11class OMM final : public ServiceFramework<OMM> {
12public:
13 explicit OMM();
14};
15
16} // namespace Service::AM
diff --git a/src/core/hle/service/am/spsm.cpp b/src/core/hle/service/am/spsm.cpp
new file mode 100644
index 000000000..a05d433d0
--- /dev/null
+++ b/src/core/hle/service/am/spsm.cpp
@@ -0,0 +1,30 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/am/spsm.h"
6
7namespace Service::AM {
8
9SPSM::SPSM() : ServiceFramework{"spsm"} {
10 // clang-format off
11 static const FunctionInfo functions[] = {
12 {0, nullptr, "GetState"},
13 {1, nullptr, "SleepSystemAndWaitAwake"},
14 {2, nullptr, "Unknown1"},
15 {3, nullptr, "Unknown2"},
16 {4, nullptr, "GetNotificationMessageEventHandle"},
17 {5, nullptr, "Unknown3"},
18 {6, nullptr, "Unknown4"},
19 {7, nullptr, "Unknown5"},
20 {8, nullptr, "AnalyzePerformanceLogForLastSleepWakeSequence"},
21 {9, nullptr, "ChangeHomeButtonLongPressingTime"},
22 {10, nullptr, "Unknown6"},
23 {11, nullptr, "Unknown7"},
24 };
25 // clang-format on
26
27 RegisterHandlers(functions);
28}
29
30} // namespace Service::AM
diff --git a/src/core/hle/service/am/spsm.h b/src/core/hle/service/am/spsm.h
new file mode 100644
index 000000000..57dde62e1
--- /dev/null
+++ b/src/core/hle/service/am/spsm.h
@@ -0,0 +1,16 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9namespace Service::AM {
10
11class SPSM final : public ServiceFramework<SPSM> {
12public:
13 explicit SPSM();
14};
15
16} // namespace Service::AM
diff --git a/src/core/hle/service/audio/audctl.cpp b/src/core/hle/service/audio/audctl.cpp
new file mode 100644
index 000000000..37c3fdcac
--- /dev/null
+++ b/src/core/hle/service/audio/audctl.cpp
@@ -0,0 +1,45 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/audio/audctl.h"
6
7namespace Service::Audio {
8
9AudCtl::AudCtl() : ServiceFramework{"audctl"} {
10 // clang-format off
11 static const FunctionInfo functions[] = {
12 {0, nullptr, "GetTargetVolume"},
13 {1, nullptr, "SetTargetVolume"},
14 {2, nullptr, "GetTargetVolumeMin"},
15 {3, nullptr, "GetTargetVolumeMax"},
16 {4, nullptr, "IsTargetMute"},
17 {5, nullptr, "SetTargetMute"},
18 {6, nullptr, "IsTargetConnected"},
19 {7, nullptr, "SetDefaultTarget"},
20 {8, nullptr, "GetDefaultTarget"},
21 {9, nullptr, "GetAudioOutputMode"},
22 {10, nullptr, "SetAudioOutputMode"},
23 {11, nullptr, "SetForceMutePolicy"},
24 {12, nullptr, "GetForceMutePolicy"},
25 {13, nullptr, "GetOutputModeSetting"},
26 {14, nullptr, "SetOutputModeSetting"},
27 {15, nullptr, "SetOutputTarget"},
28 {16, nullptr, "SetInputTargetForceEnabled"},
29 {17, nullptr, "SetHeadphoneOutputLevelMode"},
30 {18, nullptr, "GetHeadphoneOutputLevelMode"},
31 {19, nullptr, "AcquireAudioVolumeUpdateEventForPlayReport"},
32 {20, nullptr, "AcquireAudioOutputDeviceUpdateEventForPlayReport"},
33 {21, nullptr, "GetAudioOutputTargetForPlayReport"},
34 {22, nullptr, "NotifyHeadphoneVolumeWarningDisplayedEvent"},
35 {23, nullptr, "SetSystemOutputMasterVolume"},
36 {24, nullptr, "GetSystemOutputMasterVolume"},
37 {25, nullptr, "GetAudioVolumeDataForPlayReport"},
38 {26, nullptr, "UpdateHeadphoneSettings"},
39 };
40 // clang-format on
41
42 RegisterHandlers(functions);
43}
44
45} // namespace Service::Audio
diff --git a/src/core/hle/service/audio/audctl.h b/src/core/hle/service/audio/audctl.h
new file mode 100644
index 000000000..ed837bdf2
--- /dev/null
+++ b/src/core/hle/service/audio/audctl.h
@@ -0,0 +1,16 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9namespace Service::Audio {
10
11class AudCtl final : public ServiceFramework<AudCtl> {
12public:
13 explicit AudCtl();
14};
15
16} // namespace Service::Audio
diff --git a/src/core/hle/service/audio/auddbg.cpp b/src/core/hle/service/audio/auddbg.cpp
new file mode 100644
index 000000000..b08c21a20
--- /dev/null
+++ b/src/core/hle/service/audio/auddbg.cpp
@@ -0,0 +1,20 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/audio/auddbg.h"
6
7namespace Service::Audio {
8
9AudDbg::AudDbg(const char* name) : ServiceFramework{name} {
10 // clang-format off
11 static const FunctionInfo functions[] = {
12 {0, nullptr, "RequestSuspendForDebug"},
13 {1, nullptr, "RequestResumeForDebug"},
14 };
15 // clang-format on
16
17 RegisterHandlers(functions);
18}
19
20} // namespace Service::Audio
diff --git a/src/core/hle/service/audio/auddbg.h b/src/core/hle/service/audio/auddbg.h
new file mode 100644
index 000000000..a2f540b75
--- /dev/null
+++ b/src/core/hle/service/audio/auddbg.h
@@ -0,0 +1,16 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9namespace Service::Audio {
10
11class AudDbg final : public ServiceFramework<AudDbg> {
12public:
13 explicit AudDbg(const char* name);
14};
15
16} // namespace Service::Audio
diff --git a/src/core/hle/service/audio/audin_a.cpp b/src/core/hle/service/audio/audin_a.cpp
new file mode 100644
index 000000000..e62a27945
--- /dev/null
+++ b/src/core/hle/service/audio/audin_a.cpp
@@ -0,0 +1,24 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/audio/audin_a.h"
8
9namespace Service::Audio {
10
11AudInA::AudInA() : ServiceFramework{"audin:a"} {
12 // clang-format off
13 static const FunctionInfo functions[] = {
14 {0, nullptr, "RequestSuspendAudioIns"},
15 {1, nullptr, "RequestResumeAudioIns"},
16 {2, nullptr, "GetAudioInsProcessMasterVolume"},
17 {3, nullptr, "SetAudioInsProcessMasterVolume"},
18 };
19 // clang-format on
20
21 RegisterHandlers(functions);
22}
23
24} // namespace Service::Audio
diff --git a/src/core/hle/service/audio/audin_a.h b/src/core/hle/service/audio/audin_a.h
new file mode 100644
index 000000000..e4c75510f
--- /dev/null
+++ b/src/core/hle/service/audio/audin_a.h
@@ -0,0 +1,16 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9namespace Service::Audio {
10
11class AudInA final : public ServiceFramework<AudInA> {
12public:
13 explicit AudInA();
14};
15
16} // namespace Service::Audio
diff --git a/src/core/hle/service/audio/audio.cpp b/src/core/hle/service/audio/audio.cpp
index d231e91e1..6b5e15633 100644
--- a/src/core/hle/service/audio/audio.cpp
+++ b/src/core/hle/service/audio/audio.cpp
@@ -2,10 +2,16 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/service/audio/audctl.h"
6#include "core/hle/service/audio/auddbg.h"
7#include "core/hle/service/audio/audin_a.h"
5#include "core/hle/service/audio/audin_u.h" 8#include "core/hle/service/audio/audin_u.h"
6#include "core/hle/service/audio/audio.h" 9#include "core/hle/service/audio/audio.h"
10#include "core/hle/service/audio/audout_a.h"
7#include "core/hle/service/audio/audout_u.h" 11#include "core/hle/service/audio/audout_u.h"
12#include "core/hle/service/audio/audrec_a.h"
8#include "core/hle/service/audio/audrec_u.h" 13#include "core/hle/service/audio/audrec_u.h"
14#include "core/hle/service/audio/audren_a.h"
9#include "core/hle/service/audio/audren_u.h" 15#include "core/hle/service/audio/audren_u.h"
10#include "core/hle/service/audio/codecctl.h" 16#include "core/hle/service/audio/codecctl.h"
11#include "core/hle/service/audio/hwopus.h" 17#include "core/hle/service/audio/hwopus.h"
@@ -13,12 +19,22 @@
13namespace Service::Audio { 19namespace Service::Audio {
14 20
15void InstallInterfaces(SM::ServiceManager& service_manager) { 21void InstallInterfaces(SM::ServiceManager& service_manager) {
22 std::make_shared<AudCtl>()->InstallAsService(service_manager);
23 std::make_shared<AudOutA>()->InstallAsService(service_manager);
16 std::make_shared<AudOutU>()->InstallAsService(service_manager); 24 std::make_shared<AudOutU>()->InstallAsService(service_manager);
25 std::make_shared<AudInA>()->InstallAsService(service_manager);
17 std::make_shared<AudInU>()->InstallAsService(service_manager); 26 std::make_shared<AudInU>()->InstallAsService(service_manager);
27 std::make_shared<AudRecA>()->InstallAsService(service_manager);
18 std::make_shared<AudRecU>()->InstallAsService(service_manager); 28 std::make_shared<AudRecU>()->InstallAsService(service_manager);
29 std::make_shared<AudRenA>()->InstallAsService(service_manager);
19 std::make_shared<AudRenU>()->InstallAsService(service_manager); 30 std::make_shared<AudRenU>()->InstallAsService(service_manager);
20 std::make_shared<CodecCtl>()->InstallAsService(service_manager); 31 std::make_shared<CodecCtl>()->InstallAsService(service_manager);
21 std::make_shared<HwOpus>()->InstallAsService(service_manager); 32 std::make_shared<HwOpus>()->InstallAsService(service_manager);
33
34 std::make_shared<AudDbg>("audin:d")->InstallAsService(service_manager);
35 std::make_shared<AudDbg>("audout:d")->InstallAsService(service_manager);
36 std::make_shared<AudDbg>("audrec:d")->InstallAsService(service_manager);
37 std::make_shared<AudDbg>("audren:d")->InstallAsService(service_manager);
22} 38}
23 39
24} // namespace Service::Audio 40} // namespace Service::Audio
diff --git a/src/core/hle/service/audio/audout_a.cpp b/src/core/hle/service/audio/audout_a.cpp
new file mode 100644
index 000000000..57b934dd6
--- /dev/null
+++ b/src/core/hle/service/audio/audout_a.cpp
@@ -0,0 +1,26 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/audio/audout_a.h"
8
9namespace Service::Audio {
10
11AudOutA::AudOutA() : ServiceFramework{"audout:a"} {
12 // clang-format off
13 static const FunctionInfo functions[] = {
14 {0, nullptr, "RequestSuspendAudioOuts"},
15 {1, nullptr, "RequestResumeAudioOuts"},
16 {2, nullptr, "GetAudioOutsProcessMasterVolume"},
17 {3, nullptr, "SetAudioOutsProcessMasterVolume"},
18 {4, nullptr, "GetAudioOutsProcessRecordVolume"},
19 {5, nullptr, "SetAudioOutsProcessRecordVolume"},
20 };
21 // clang-format on
22
23 RegisterHandlers(functions);
24}
25
26} // namespace Service::Audio
diff --git a/src/core/hle/service/audio/audout_a.h b/src/core/hle/service/audio/audout_a.h
new file mode 100644
index 000000000..91a069152
--- /dev/null
+++ b/src/core/hle/service/audio/audout_a.h
@@ -0,0 +1,16 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9namespace Service::Audio {
10
11class AudOutA final : public ServiceFramework<AudOutA> {
12public:
13 explicit AudOutA();
14};
15
16} // namespace Service::Audio
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp
index ab37c2a69..b317027b6 100644
--- a/src/core/hle/service/audio/audout_u.cpp
+++ b/src/core/hle/service/audio/audout_u.cpp
@@ -194,7 +194,7 @@ void AudOutU::OpenAudioOutImpl(Kernel::HLERequestContext& ctx) {
194 // TODO(bunnei): Support more than one IAudioOut interface. When we add this, ListAudioOutsImpl 194 // TODO(bunnei): Support more than one IAudioOut interface. When we add this, ListAudioOutsImpl
195 // will likely need to be updated as well. 195 // will likely need to be updated as well.
196 ASSERT_MSG(!audio_out_interface, "Unimplemented"); 196 ASSERT_MSG(!audio_out_interface, "Unimplemented");
197 audio_out_interface = std::make_shared<IAudioOut>(std::move(params), *audio_core); 197 audio_out_interface = std::make_shared<IAudioOut>(params, *audio_core);
198 198
199 IPC::ResponseBuilder rb{ctx, 6, 0, 1}; 199 IPC::ResponseBuilder rb{ctx, 6, 0, 1};
200 rb.Push(RESULT_SUCCESS); 200 rb.Push(RESULT_SUCCESS);
diff --git a/src/core/hle/service/audio/audrec_a.cpp b/src/core/hle/service/audio/audrec_a.cpp
new file mode 100644
index 000000000..9c32f9b98
--- /dev/null
+++ b/src/core/hle/service/audio/audrec_a.cpp
@@ -0,0 +1,22 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/audio/audrec_a.h"
8
9namespace Service::Audio {
10
11AudRecA::AudRecA() : ServiceFramework{"audrec:a"} {
12 // clang-format off
13 static const FunctionInfo functions[] = {
14 {0, nullptr, "RequestSuspendFinalOutputRecorders"},
15 {1, nullptr, "RequestResumeFinalOutputRecorders"},
16 };
17 // clang-format on
18
19 RegisterHandlers(functions);
20}
21
22} // namespace Service::Audio
diff --git a/src/core/hle/service/audio/audrec_a.h b/src/core/hle/service/audio/audrec_a.h
new file mode 100644
index 000000000..9685047f2
--- /dev/null
+++ b/src/core/hle/service/audio/audrec_a.h
@@ -0,0 +1,16 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9namespace Service::Audio {
10
11class AudRecA final : public ServiceFramework<AudRecA> {
12public:
13 explicit AudRecA();
14};
15
16} // namespace Service::Audio
diff --git a/src/core/hle/service/audio/audren_a.cpp b/src/core/hle/service/audio/audren_a.cpp
new file mode 100644
index 000000000..bc9930d79
--- /dev/null
+++ b/src/core/hle/service/audio/audren_a.cpp
@@ -0,0 +1,28 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/audio/audren_a.h"
8
9namespace Service::Audio {
10
11AudRenA::AudRenA() : ServiceFramework{"audren:a"} {
12 // clang-format off
13 static const FunctionInfo functions[] = {
14 {0, nullptr, "RequestSuspendAudioRenderers"},
15 {1, nullptr, "RequestResumeAudioRenderers"},
16 {2, nullptr, "GetAudioRenderersProcessMasterVolume"},
17 {3, nullptr, "SetAudioRenderersProcessMasterVolume"},
18 {4, nullptr, "RegisterAppletResourceUserId"},
19 {5, nullptr, "UnregisterAppletResourceUserId"},
20 {6, nullptr, "GetAudioRenderersProcessRecordVolume"},
21 {7, nullptr, "SetAudioRenderersProcessRecordVolume"},
22 };
23 // clang-format on
24
25 RegisterHandlers(functions);
26}
27
28} // namespace Service::Audio
diff --git a/src/core/hle/service/audio/audren_a.h b/src/core/hle/service/audio/audren_a.h
new file mode 100644
index 000000000..5ecf2e184
--- /dev/null
+++ b/src/core/hle/service/audio/audren_a.h
@@ -0,0 +1,16 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "core/hle/service/service.h"
8
9namespace Service::Audio {
10
11class AudRenA final : public ServiceFramework<AudRenA> {
12public:
13 explicit AudRenA();
14};
15
16} // namespace Service::Audio
diff --git a/src/core/hle/service/fgm/fgm.cpp b/src/core/hle/service/fgm/fgm.cpp
new file mode 100644
index 000000000..566fbf924
--- /dev/null
+++ b/src/core/hle/service/fgm/fgm.cpp
@@ -0,0 +1,75 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <memory>
6
7#include "core/hle/ipc_helpers.h"
8#include "core/hle/kernel/hle_ipc.h"
9#include "core/hle/service/fgm/fgm.h"
10#include "core/hle/service/service.h"
11#include "core/hle/service/sm/sm.h"
12
13namespace Service::FGM {
14
15class IRequest final : public ServiceFramework<IRequest> {
16public:
17 explicit IRequest() : ServiceFramework{"IRequest"} {
18 // clang-format off
19 static const FunctionInfo functions[] = {
20 {0, nullptr, "Initialize"},
21 {1, nullptr, "Set"},
22 {2, nullptr, "Get"},
23 {3, nullptr, "Cancel"},
24 };
25 // clang-format on
26
27 RegisterHandlers(functions);
28 }
29};
30
31class FGM final : public ServiceFramework<FGM> {
32public:
33 explicit FGM(const char* name) : ServiceFramework{name} {
34 // clang-format off
35 static const FunctionInfo functions[] = {
36 {0, &FGM::Initialize, "Initialize"},
37 };
38 // clang-format on
39
40 RegisterHandlers(functions);
41 }
42
43private:
44 void Initialize(Kernel::HLERequestContext& ctx) {
45 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
46 rb.Push(RESULT_SUCCESS);
47 rb.PushIpcInterface<IRequest>();
48
49 LOG_DEBUG(Service_FGM, "called");
50 }
51};
52
53class FGM_DBG final : public ServiceFramework<FGM_DBG> {
54public:
55 explicit FGM_DBG() : ServiceFramework{"fgm:dbg"} {
56 // clang-format off
57 static const FunctionInfo functions[] = {
58 {0, nullptr, "Initialize"},
59 {1, nullptr, "Read"},
60 {2, nullptr, "Cancel"},
61 };
62 // clang-format on
63
64 RegisterHandlers(functions);
65 }
66};
67
68void InstallInterfaces(SM::ServiceManager& sm) {
69 std::make_shared<FGM>("fgm")->InstallAsService(sm);
70 std::make_shared<FGM>("fgm:0")->InstallAsService(sm);
71 std::make_shared<FGM>("fgm:9")->InstallAsService(sm);
72 std::make_shared<FGM_DBG>()->InstallAsService(sm);
73}
74
75} // namespace Service::FGM
diff --git a/src/core/hle/service/fgm/fgm.h b/src/core/hle/service/fgm/fgm.h
new file mode 100644
index 000000000..e59691264
--- /dev/null
+++ b/src/core/hle/service/fgm/fgm.h
@@ -0,0 +1,15 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::FGM {
12
13void InstallInterfaces(SM::ServiceManager& sm);
14
15} // namespace Service::FGM
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp
index 44e062f50..010072a5b 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_ctrl_gpu.cpp
@@ -97,7 +97,9 @@ u32 nvhost_ctrl_gpu::GetTPCMasks(const std::vector<u8>& input, std::vector<u8>&
97u32 nvhost_ctrl_gpu::GetActiveSlotMask(const std::vector<u8>& input, std::vector<u8>& output) { 97u32 nvhost_ctrl_gpu::GetActiveSlotMask(const std::vector<u8>& input, std::vector<u8>& output) {
98 LOG_DEBUG(Service_NVDRV, "called"); 98 LOG_DEBUG(Service_NVDRV, "called");
99 IoctlActiveSlotMask params{}; 99 IoctlActiveSlotMask params{};
100 std::memcpy(&params, input.data(), input.size()); 100 if (input.size() > 0) {
101 std::memcpy(&params, input.data(), input.size());
102 }
101 params.slot = 0x07; 103 params.slot = 0x07;
102 params.mask = 0x01; 104 params.mask = 0x01;
103 std::memcpy(output.data(), &params, output.size()); 105 std::memcpy(output.data(), &params, output.size());
@@ -107,7 +109,9 @@ u32 nvhost_ctrl_gpu::GetActiveSlotMask(const std::vector<u8>& input, std::vector
107u32 nvhost_ctrl_gpu::ZCullGetCtxSize(const std::vector<u8>& input, std::vector<u8>& output) { 109u32 nvhost_ctrl_gpu::ZCullGetCtxSize(const std::vector<u8>& input, std::vector<u8>& output) {
108 LOG_DEBUG(Service_NVDRV, "called"); 110 LOG_DEBUG(Service_NVDRV, "called");
109 IoctlZcullGetCtxSize params{}; 111 IoctlZcullGetCtxSize params{};
110 std::memcpy(&params, input.data(), input.size()); 112 if (input.size() > 0) {
113 std::memcpy(&params, input.data(), input.size());
114 }
111 params.size = 0x1; 115 params.size = 0x1;
112 std::memcpy(output.data(), &params, output.size()); 116 std::memcpy(output.data(), &params, output.size());
113 return 0; 117 return 0;
@@ -116,7 +120,11 @@ u32 nvhost_ctrl_gpu::ZCullGetCtxSize(const std::vector<u8>& input, std::vector<u
116u32 nvhost_ctrl_gpu::ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>& output) { 120u32 nvhost_ctrl_gpu::ZCullGetInfo(const std::vector<u8>& input, std::vector<u8>& output) {
117 LOG_DEBUG(Service_NVDRV, "called"); 121 LOG_DEBUG(Service_NVDRV, "called");
118 IoctlNvgpuGpuZcullGetInfoArgs params{}; 122 IoctlNvgpuGpuZcullGetInfoArgs params{};
119 std::memcpy(&params, input.data(), input.size()); 123
124 if (input.size() > 0) {
125 std::memcpy(&params, input.data(), input.size());
126 }
127
120 params.width_align_pixels = 0x20; 128 params.width_align_pixels = 0x20;
121 params.height_align_pixels = 0x20; 129 params.height_align_pixels = 0x20;
122 params.pixel_squares_by_aliquots = 0x400; 130 params.pixel_squares_by_aliquots = 0x400;
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
index 126782573..5a1123ad2 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp
@@ -132,9 +132,12 @@ u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& outp
132 LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}", 132 LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}",
133 params.address, params.num_entries, params.flags); 133 params.address, params.num_entries, params.flags);
134 134
135 auto entries = std::vector<IoctlGpfifoEntry>(); 135 ASSERT_MSG(input.size() ==
136 entries.resize(params.num_entries); 136 sizeof(IoctlSubmitGpfifo) + params.num_entries * sizeof(IoctlGpfifoEntry),
137 std::memcpy(&entries[0], &input.data()[sizeof(IoctlSubmitGpfifo)], 137 "Incorrect input size");
138
139 std::vector<IoctlGpfifoEntry> entries(params.num_entries);
140 std::memcpy(entries.data(), &input[sizeof(IoctlSubmitGpfifo)],
138 params.num_entries * sizeof(IoctlGpfifoEntry)); 141 params.num_entries * sizeof(IoctlGpfifoEntry));
139 for (auto entry : entries) { 142 for (auto entry : entries) {
140 Tegra::GPUVAddr va_addr = entry.Address(); 143 Tegra::GPUVAddr va_addr = entry.Address();
diff --git a/src/core/hle/service/pcie/pcie.cpp b/src/core/hle/service/pcie/pcie.cpp
new file mode 100644
index 000000000..39cf05eba
--- /dev/null
+++ b/src/core/hle/service/pcie/pcie.cpp
@@ -0,0 +1,64 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <memory>
6
7#include "core/hle/service/pcie/pcie.h"
8#include "core/hle/service/service.h"
9#include "core/hle/service/sm/sm.h"
10
11namespace Service::PCIe {
12
13class ISession final : public ServiceFramework<ISession> {
14public:
15 explicit ISession() : ServiceFramework{"ISession"} {
16 // clang-format off
17 static const FunctionInfo functions[] = {
18 {0, nullptr, "QueryFunctions"},
19 {1, nullptr, "AcquireFunction"},
20 {2, nullptr, "ReleaseFunction"},
21 {3, nullptr, "GetFunctionState"},
22 {4, nullptr, "GetBarProfile"},
23 {5, nullptr, "ReadConfig"},
24 {6, nullptr, "WriteConfig"},
25 {7, nullptr, "ReadBarRegion"},
26 {8, nullptr, "WriteBarRegion"},
27 {9, nullptr, "FindCapability"},
28 {10, nullptr, "FindExtendedCapability"},
29 {11, nullptr, "MapDma"},
30 {12, nullptr, "UnmapDma"},
31 {13, nullptr, "UnmapDmaBusAddress"},
32 {14, nullptr, "GetDmaBusAddress"},
33 {15, nullptr, "GetDmaBusAddressRange"},
34 {16, nullptr, "SetDmaEnable"},
35 {17, nullptr, "AcquireIrq"},
36 {18, nullptr, "ReleaseIrq"},
37 {19, nullptr, "SetIrqEnable"},
38 {20, nullptr, "SetAspmEnable"},
39 };
40 // clang-format on
41
42 RegisterHandlers(functions);
43 }
44};
45
46class PCIe final : public ServiceFramework<PCIe> {
47public:
48 explicit PCIe() : ServiceFramework{"pcie"} {
49 // clang-format off
50 static const FunctionInfo functions[] = {
51 {0, nullptr, "RegisterClassDriver"},
52 {1, nullptr, "QueryFunctionsUnregistered"},
53 };
54 // clang-format on
55
56 RegisterHandlers(functions);
57 }
58};
59
60void InstallInterfaces(SM::ServiceManager& sm) {
61 std::make_shared<PCIe>()->InstallAsService(sm);
62}
63
64} // namespace Service::PCIe
diff --git a/src/core/hle/service/pcie/pcie.h b/src/core/hle/service/pcie/pcie.h
new file mode 100644
index 000000000..59c22ca45
--- /dev/null
+++ b/src/core/hle/service/pcie/pcie.h
@@ -0,0 +1,15 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::PCIe {
12
13void InstallInterfaces(SM::ServiceManager& sm);
14
15} // namespace Service::PCIe
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 3cad64837..fccc4c461 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -27,6 +27,7 @@
27#include "core/hle/service/es/es.h" 27#include "core/hle/service/es/es.h"
28#include "core/hle/service/eupld/eupld.h" 28#include "core/hle/service/eupld/eupld.h"
29#include "core/hle/service/fatal/fatal.h" 29#include "core/hle/service/fatal/fatal.h"
30#include "core/hle/service/fgm/fgm.h"
30#include "core/hle/service/filesystem/filesystem.h" 31#include "core/hle/service/filesystem/filesystem.h"
31#include "core/hle/service/friend/friend.h" 32#include "core/hle/service/friend/friend.h"
32#include "core/hle/service/grc/grc.h" 33#include "core/hle/service/grc/grc.h"
@@ -44,6 +45,7 @@
44#include "core/hle/service/nim/nim.h" 45#include "core/hle/service/nim/nim.h"
45#include "core/hle/service/ns/ns.h" 46#include "core/hle/service/ns/ns.h"
46#include "core/hle/service/nvdrv/nvdrv.h" 47#include "core/hle/service/nvdrv/nvdrv.h"
48#include "core/hle/service/pcie/pcie.h"
47#include "core/hle/service/pctl/pctl.h" 49#include "core/hle/service/pctl/pctl.h"
48#include "core/hle/service/pm/pm.h" 50#include "core/hle/service/pm/pm.h"
49#include "core/hle/service/prepo/prepo.h" 51#include "core/hle/service/prepo/prepo.h"
@@ -208,6 +210,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
208 ES::InstallInterfaces(*sm); 210 ES::InstallInterfaces(*sm);
209 EUPLD::InstallInterfaces(*sm); 211 EUPLD::InstallInterfaces(*sm);
210 Fatal::InstallInterfaces(*sm); 212 Fatal::InstallInterfaces(*sm);
213 FGM::InstallInterfaces(*sm);
211 FileSystem::InstallInterfaces(*sm); 214 FileSystem::InstallInterfaces(*sm);
212 Friend::InstallInterfaces(*sm); 215 Friend::InstallInterfaces(*sm);
213 GRC::InstallInterfaces(*sm); 216 GRC::InstallInterfaces(*sm);
@@ -225,6 +228,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
225 NIM::InstallInterfaces(*sm); 228 NIM::InstallInterfaces(*sm);
226 NS::InstallInterfaces(*sm); 229 NS::InstallInterfaces(*sm);
227 Nvidia::InstallInterfaces(*sm); 230 Nvidia::InstallInterfaces(*sm);
231 PCIe::InstallInterfaces(*sm);
228 PCTL::InstallInterfaces(*sm); 232 PCTL::InstallInterfaces(*sm);
229 PlayReport::InstallInterfaces(*sm); 233 PlayReport::InstallInterfaces(*sm);
230 PM::InstallInterfaces(*sm); 234 PM::InstallInterfaces(*sm);
diff --git a/src/video_core/macro_interpreter.cpp b/src/video_core/macro_interpreter.cpp
index 44ece01c1..377bd66ab 100644
--- a/src/video_core/macro_interpreter.cpp
+++ b/src/video_core/macro_interpreter.cpp
@@ -102,11 +102,11 @@ bool MacroInterpreter::Step(const std::vector<u32>& code, bool is_delay_slot) {
102 if (taken) { 102 if (taken) {
103 // Ignore the delay slot if the branch has the annul bit. 103 // Ignore the delay slot if the branch has the annul bit.
104 if (opcode.branch_annul) { 104 if (opcode.branch_annul) {
105 pc = base_address + (opcode.immediate << 2); 105 pc = base_address + opcode.GetBranchTarget();
106 return true; 106 return true;
107 } 107 }
108 108
109 delayed_pc = base_address + (opcode.immediate << 2); 109 delayed_pc = base_address + opcode.GetBranchTarget();
110 // Execute one more instruction due to the delay slot. 110 // Execute one more instruction due to the delay slot.
111 return Step(code, true); 111 return Step(code, true);
112 } 112 }
diff --git a/src/video_core/macro_interpreter.h b/src/video_core/macro_interpreter.h
index a71e359d8..7d836b816 100644
--- a/src/video_core/macro_interpreter.h
+++ b/src/video_core/macro_interpreter.h
@@ -91,6 +91,10 @@ private:
91 u32 GetBitfieldMask() const { 91 u32 GetBitfieldMask() const {
92 return (1 << bf_size) - 1; 92 return (1 << bf_size) - 1;
93 } 93 }
94
95 s32 GetBranchTarget() const {
96 return static_cast<s32>(immediate * sizeof(u32));
97 }
94 }; 98 };
95 99
96 union MethodAddress { 100 union MethodAddress {