summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/core/CMakeLists.txt12
-rw-r--r--src/core/hle/service/ir/ir.cpp48
-rw-r--r--src/core/hle/service/ir/ir.h30
-rw-r--r--src/core/hle/service/ir/ir_rst.cpp24
-rw-r--r--src/core/hle/service/ir/ir_rst.h (renamed from src/core/hle/service/ir_rst.h)13
-rw-r--r--src/core/hle/service/ir/ir_u.cpp (renamed from src/core/hle/service/ir_u.cpp)17
-rw-r--r--src/core/hle/service/ir/ir_u.h (renamed from src/core/hle/service/ir_u.h)13
-rw-r--r--src/core/hle/service/ir/ir_user.cpp34
-rw-r--r--src/core/hle/service/ir/ir_user.h22
-rw-r--r--src/core/hle/service/ir_rst.cpp27
-rw-r--r--src/core/hle/service/service.cpp7
11 files changed, 188 insertions, 59 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index bdf4b6212..0528175ba 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -61,8 +61,10 @@ set(SRCS
61 hle/service/hid/hid_spvr.cpp 61 hle/service/hid/hid_spvr.cpp
62 hle/service/gsp_lcd.cpp 62 hle/service/gsp_lcd.cpp
63 hle/service/http_c.cpp 63 hle/service/http_c.cpp
64 hle/service/ir_rst.cpp 64 hle/service/ir/ir.cpp
65 hle/service/ir_u.cpp 65 hle/service/ir/ir_rst.cpp
66 hle/service/ir/ir_u.cpp
67 hle/service/ir/ir_user.cpp
66 hle/service/ldr_ro.cpp 68 hle/service/ldr_ro.cpp
67 hle/service/mic_u.cpp 69 hle/service/mic_u.cpp
68 hle/service/ndm_u.cpp 70 hle/service/ndm_u.cpp
@@ -170,8 +172,10 @@ set(HEADERS
170 hle/service/hid/hid_user.h 172 hle/service/hid/hid_user.h
171 hle/service/gsp_lcd.h 173 hle/service/gsp_lcd.h
172 hle/service/http_c.h 174 hle/service/http_c.h
173 hle/service/ir_rst.h 175 hle/service/ir/ir.h
174 hle/service/ir_u.h 176 hle/service/ir/ir_rst.h
177 hle/service/ir/ir_u.h
178 hle/service/ir/ir_user.h
175 hle/service/ldr_ro.h 179 hle/service/ldr_ro.h
176 hle/service/mic_u.h 180 hle/service/mic_u.h
177 hle/service/ndm_u.h 181 hle/service/ndm_u.h
diff --git a/src/core/hle/service/ir/ir.cpp b/src/core/hle/service/ir/ir.cpp
new file mode 100644
index 000000000..58dfd8e1a
--- /dev/null
+++ b/src/core/hle/service/ir/ir.cpp
@@ -0,0 +1,48 @@
1// Copyright 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/service/service.h"
6#include "core/hle/service/ir/ir.h"
7#include "core/hle/service/ir/ir_rst.h"
8#include "core/hle/service/ir/ir_u.h"
9#include "core/hle/service/ir/ir_user.h"
10
11#include "core/hle/hle.h"
12#include "core/hle/kernel/event.h"
13#include "core/hle/kernel/shared_memory.h"
14
15namespace Service {
16namespace IR {
17
18static Kernel::SharedPtr<Kernel::Event> handle_event = nullptr;
19static Kernel::SharedPtr<Kernel::SharedMemory> shared_memory = nullptr;
20
21void GetHandles(Service::Interface* self) {
22 u32* cmd_buff = Kernel::GetCommandBuffer();
23
24 cmd_buff[1] = RESULT_SUCCESS.raw;
25 cmd_buff[2] = 0x4000000;
26 cmd_buff[3] = Kernel::g_handle_table.Create(Service::IR::shared_memory).MoveFrom();
27 cmd_buff[4] = Kernel::g_handle_table.Create(Service::IR::handle_event).MoveFrom();
28}
29
30void Init() {
31 using namespace Kernel;
32
33 AddService(new IR_RST_Interface);
34 AddService(new IR_U_Interface);
35 AddService(new IR_User_Interface);
36
37 shared_memory = SharedMemory::Create("IR:SharedMemory");
38
39 // Create event handle(s)
40 handle_event = Event::Create(RESETTYPE_ONESHOT, "IR:HandleEvent");
41}
42
43void Shutdown() {
44}
45
46} // namespace IR
47
48} // namespace Service
diff --git a/src/core/hle/service/ir/ir.h b/src/core/hle/service/ir/ir.h
new file mode 100644
index 000000000..c16d963e7
--- /dev/null
+++ b/src/core/hle/service/ir/ir.h
@@ -0,0 +1,30 @@
1// Copyright 2015 Citra Emulator Project
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/kernel/kernel.h"
8#include "core/hle/service/service.h"
9
10namespace Service {
11namespace IR {
12
13/**
14 * IR::GetHandles service function
15 * Outputs:
16 * 1 : Result of function, 0 on success, otherwise error code
17 * 2 : Translate header, used by the ARM11-kernel
18 * 3 : Shared memory handle
19 * 4 : Event handle
20 */
21void GetHandles(Interface* self);
22
23/// Initialize IR service
24void Init();
25
26/// Shutdown IR service
27void Shutdown();
28
29} // namespace IR
30} // namespace Service
diff --git a/src/core/hle/service/ir/ir_rst.cpp b/src/core/hle/service/ir/ir_rst.cpp
new file mode 100644
index 000000000..96ae63420
--- /dev/null
+++ b/src/core/hle/service/ir/ir_rst.cpp
@@ -0,0 +1,24 @@
1// Copyright 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/hle.h"
6#include "core/hle/service/ir/ir.h"
7#include "core/hle/service/ir/ir_rst.h"
8
9namespace Service {
10namespace IR {
11
12const Interface::FunctionInfo FunctionTable[] = {
13 {0x00010000, GetHandles, "GetHandles"},
14 {0x00020080, nullptr, "Initialize"},
15 {0x00030000, nullptr, "Shutdown"},
16 {0x00090000, nullptr, "WriteToTwoFields"},
17};
18
19IR_RST_Interface::IR_RST_Interface() {
20 Register(FunctionTable);
21}
22
23} // namespace IR
24} // namespace Service
diff --git a/src/core/hle/service/ir_rst.h b/src/core/hle/service/ir/ir_rst.h
index deef701c5..a492e15c9 100644
--- a/src/core/hle/service/ir_rst.h
+++ b/src/core/hle/service/ir/ir_rst.h
@@ -6,18 +6,17 @@
6 6
7#include "core/hle/service/service.h" 7#include "core/hle/service/service.h"
8 8
9//////////////////////////////////////////////////////////////////////////////////////////////////// 9namespace Service {
10// Namespace IR_RST 10namespace IR {
11 11
12namespace IR_RST { 12class IR_RST_Interface : public Service::Interface {
13
14class Interface : public Service::Interface {
15public: 13public:
16 Interface(); 14 IR_RST_Interface();
17 15
18 std::string GetPortName() const override { 16 std::string GetPortName() const override {
19 return "ir:rst"; 17 return "ir:rst";
20 } 18 }
21}; 19};
22 20
23} // namespace 21} // namespace IR
22} // namespace Service
diff --git a/src/core/hle/service/ir_u.cpp b/src/core/hle/service/ir/ir_u.cpp
index 608ed3c06..1b1e3078b 100644
--- a/src/core/hle/service/ir_u.cpp
+++ b/src/core/hle/service/ir/ir_u.cpp
@@ -3,12 +3,11 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "core/hle/hle.h" 5#include "core/hle/hle.h"
6#include "core/hle/service/ir_u.h" 6#include "core/hle/service/ir/ir.h"
7#include "core/hle/service/ir/ir_u.h"
7 8
8//////////////////////////////////////////////////////////////////////////////////////////////////// 9namespace Service {
9// Namespace IR_U 10namespace IR {
10
11namespace IR_U {
12 11
13const Interface::FunctionInfo FunctionTable[] = { 12const Interface::FunctionInfo FunctionTable[] = {
14 {0x00010000, nullptr, "Initialize"}, 13 {0x00010000, nullptr, "Initialize"},
@@ -31,11 +30,9 @@ const Interface::FunctionInfo FunctionTable[] = {
31 {0x00120040, nullptr, "SetSleepModeState"}, 30 {0x00120040, nullptr, "SetSleepModeState"},
32}; 31};
33 32
34//////////////////////////////////////////////////////////////////////////////////////////////////// 33IR_U_Interface::IR_U_Interface() {
35// Interface class
36
37Interface::Interface() {
38 Register(FunctionTable); 34 Register(FunctionTable);
39} 35}
40 36
41} // namespace 37} // namespace IR
38} // namespace Service
diff --git a/src/core/hle/service/ir_u.h b/src/core/hle/service/ir/ir_u.h
index ec47a1524..056d2ce1a 100644
--- a/src/core/hle/service/ir_u.h
+++ b/src/core/hle/service/ir/ir_u.h
@@ -6,18 +6,17 @@
6 6
7#include "core/hle/service/service.h" 7#include "core/hle/service/service.h"
8 8
9//////////////////////////////////////////////////////////////////////////////////////////////////// 9namespace Service {
10// Namespace IR_U 10namespace IR {
11 11
12namespace IR_U { 12class IR_U_Interface : public Service::Interface {
13
14class Interface : public Service::Interface {
15public: 13public:
16 Interface(); 14 IR_U_Interface();
17 15
18 std::string GetPortName() const override { 16 std::string GetPortName() const override {
19 return "ir:u"; 17 return "ir:u";
20 } 18 }
21}; 19};
22 20
23} // namespace 21} // namespace IR
22} // namespace Service
diff --git a/src/core/hle/service/ir/ir_user.cpp b/src/core/hle/service/ir/ir_user.cpp
new file mode 100644
index 000000000..8e3ff140f
--- /dev/null
+++ b/src/core/hle/service/ir/ir_user.cpp
@@ -0,0 +1,34 @@
1// Copyright 2015 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/hle.h"
6#include "core/hle/service/ir/ir.h"
7#include "core/hle/service/ir/ir_user.h"
8
9namespace Service {
10namespace IR {
11
12const Interface::FunctionInfo FunctionTable[] = {
13 {0x00010182, nullptr, "InitializeIrNop"},
14 {0x00020000, nullptr, "FinalizeIrNop"},
15 {0x00030000, nullptr, "ClearReceiveBuffer"},
16 {0x00040000, nullptr, "ClearSendBuffer"},
17 {0x00060040, nullptr, "RequireConnection"},
18 {0x00090000, nullptr, "Disconnect"},
19 {0x000A0000, nullptr, "GetReceiveEvent"},
20 {0x000B0000, nullptr, "GetSendEvent"},
21 {0x000C0000, nullptr, "GetConnectionStatusEvent"},
22 {0x000D0042, nullptr, "SendIrNop"},
23 {0x000E0042, nullptr, "SendIrNopLarge"},
24 {0x00180182, nullptr, "InitializeIrNopShared"},
25 {0x00190040, nullptr, "ReleaseReceivedData"},
26 {0x001A0040, nullptr, "SetOwnMachineId"},
27};
28
29IR_User_Interface::IR_User_Interface() {
30 Register(FunctionTable);
31}
32
33} // namespace IR
34} // namespace Service
diff --git a/src/core/hle/service/ir/ir_user.h b/src/core/hle/service/ir/ir_user.h
new file mode 100644
index 000000000..71c932ffa
--- /dev/null
+++ b/src/core/hle/service/ir/ir_user.h
@@ -0,0 +1,22 @@
1// Copyright 2015 Citra Emulator Project
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 {
10namespace IR {
11
12class IR_User_Interface : public Service::Interface {
13public:
14 IR_User_Interface();
15
16 std::string GetPortName() const override {
17 return "ir:USER";
18 }
19};
20
21} // namespace IR
22} // namespace Service
diff --git a/src/core/hle/service/ir_rst.cpp b/src/core/hle/service/ir_rst.cpp
deleted file mode 100644
index 4c26c2f03..000000000
--- a/src/core/hle/service/ir_rst.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
1// Copyright 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "core/hle/hle.h"
6#include "core/hle/service/ir_rst.h"
7
8////////////////////////////////////////////////////////////////////////////////////////////////////
9// Namespace IR_RST
10
11namespace IR_RST {
12
13const Interface::FunctionInfo FunctionTable[] = {
14 {0x00010000, nullptr, "GetHandles"},
15 {0x00020080, nullptr, "Initialize"},
16 {0x00030000, nullptr, "Shutdown"},
17 {0x00090000, nullptr, "WriteToTwoFields"},
18};
19
20////////////////////////////////////////////////////////////////////////////////////////////////////
21// Interface class
22
23Interface::Interface() {
24 Register(FunctionTable);
25}
26
27} // namespace
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index eeb404659..134ff1740 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -24,8 +24,6 @@
24#include "core/hle/service/gsp_gpu.h" 24#include "core/hle/service/gsp_gpu.h"
25#include "core/hle/service/gsp_lcd.h" 25#include "core/hle/service/gsp_lcd.h"
26#include "core/hle/service/http_c.h" 26#include "core/hle/service/http_c.h"
27#include "core/hle/service/ir_rst.h"
28#include "core/hle/service/ir_u.h"
29#include "core/hle/service/ldr_ro.h" 27#include "core/hle/service/ldr_ro.h"
30#include "core/hle/service/mic_u.h" 28#include "core/hle/service/mic_u.h"
31#include "core/hle/service/ndm_u.h" 29#include "core/hle/service/ndm_u.h"
@@ -45,6 +43,7 @@
45#include "core/hle/service/fs/archive.h" 43#include "core/hle/service/fs/archive.h"
46#include "core/hle/service/cfg/cfg.h" 44#include "core/hle/service/cfg/cfg.h"
47#include "core/hle/service/hid/hid.h" 45#include "core/hle/service/hid/hid.h"
46#include "core/hle/service/ir/ir.h"
48#include "core/hle/service/ptm/ptm.h" 47#include "core/hle/service/ptm/ptm.h"
49 48
50namespace Service { 49namespace Service {
@@ -73,6 +72,7 @@ void Init() {
73 Service::APT::Init(); 72 Service::APT::Init();
74 Service::PTM::Init(); 73 Service::PTM::Init();
75 Service::HID::Init(); 74 Service::HID::Init();
75 Service::IR::Init();
76 76
77 AddService(new AC_U::Interface); 77 AddService(new AC_U::Interface);
78 AddService(new ACT_U::Interface); 78 AddService(new ACT_U::Interface);
@@ -91,8 +91,6 @@ void Init() {
91 AddService(new GSP_GPU::Interface); 91 AddService(new GSP_GPU::Interface);
92 AddService(new GSP_LCD::Interface); 92 AddService(new GSP_LCD::Interface);
93 AddService(new HTTP_C::Interface); 93 AddService(new HTTP_C::Interface);
94 AddService(new IR_RST::Interface);
95 AddService(new IR_U::Interface);
96 AddService(new LDR_RO::Interface); 94 AddService(new LDR_RO::Interface);
97 AddService(new MIC_U::Interface); 95 AddService(new MIC_U::Interface);
98 AddService(new NDM_U::Interface); 96 AddService(new NDM_U::Interface);
@@ -112,6 +110,7 @@ void Init() {
112 110
113/// Shutdown ServiceManager 111/// Shutdown ServiceManager
114void Shutdown() { 112void Shutdown() {
113 Service::IR::Shutdown();
115 Service::HID::Shutdown(); 114 Service::HID::Shutdown();
116 Service::PTM::Shutdown(); 115 Service::PTM::Shutdown();
117 Service::APT::Shutdown(); 116 Service::APT::Shutdown();