summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar mailwl2016-12-29 23:38:47 +0300
committerGravatar mailwl2016-12-30 09:40:54 +0300
commitf2985f70808ed8777eb6b51b27bb5686869e01c7 (patch)
treeda59c3c3e853945cd47a91c2c7605ab941f7451f
parentMerge pull request #2240 from wwylele/auto-region (diff)
downloadyuzu-f2985f70808ed8777eb6b51b27bb5686869e01c7.tar.gz
yuzu-f2985f70808ed8777eb6b51b27bb5686869e01c7.tar.xz
yuzu-f2985f70808ed8777eb6b51b27bb5686869e01c7.zip
Service/NFC: stub GetTagInRangeEvent
Fix Fatal Error in Mini-Mario & Friends - amiibo Challenge
-rw-r--r--src/common/logging/backend.cpp1
-rw-r--r--src/common/logging/log.h1
-rw-r--r--src/core/hle/service/nfc/nfc.cpp20
-rw-r--r--src/core/hle/service/nfc/nfc.h17
-rw-r--r--src/core/hle/service/nfc/nfc_m.cpp2
-rw-r--r--src/core/hle/service/nfc/nfc_u.cpp2
-rw-r--r--src/core/hle/service/service.cpp1
7 files changed, 44 insertions, 0 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index 3ea102229..2ef3e6b05 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -45,6 +45,7 @@ namespace Log {
45 SUB(Service, LDR) \ 45 SUB(Service, LDR) \
46 SUB(Service, MIC) \ 46 SUB(Service, MIC) \
47 SUB(Service, NDM) \ 47 SUB(Service, NDM) \
48 SUB(Service, NFC) \
48 SUB(Service, NIM) \ 49 SUB(Service, NIM) \
49 SUB(Service, NWM) \ 50 SUB(Service, NWM) \
50 SUB(Service, CAM) \ 51 SUB(Service, CAM) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index 9d8c18d8e..4330ef879 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -62,6 +62,7 @@ enum class Class : ClassType {
62 Service_LDR, ///< The LDR (3ds dll loader) service 62 Service_LDR, ///< The LDR (3ds dll loader) service
63 Service_MIC, ///< The MIC (Microphone) service 63 Service_MIC, ///< The MIC (Microphone) service
64 Service_NDM, ///< The NDM (Network daemon manager) service 64 Service_NDM, ///< The NDM (Network daemon manager) service
65 Service_NFC, ///< The NFC service
65 Service_NIM, ///< The NIM (Network interface manager) service 66 Service_NIM, ///< The NIM (Network interface manager) service
66 Service_NWM, ///< The NWM (Network wlan manager) service 67 Service_NWM, ///< The NWM (Network wlan manager) service
67 Service_CAM, ///< The CAM (Camera) service 68 Service_CAM, ///< The CAM (Camera) service
diff --git a/src/core/hle/service/nfc/nfc.cpp b/src/core/hle/service/nfc/nfc.cpp
index d9738c6a1..e248285f9 100644
--- a/src/core/hle/service/nfc/nfc.cpp
+++ b/src/core/hle/service/nfc/nfc.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 "core/hle/kernel/event.h"
5#include "core/hle/service/nfc/nfc.h" 6#include "core/hle/service/nfc/nfc.h"
6#include "core/hle/service/nfc/nfc_m.h" 7#include "core/hle/service/nfc/nfc_m.h"
7#include "core/hle/service/nfc/nfc_u.h" 8#include "core/hle/service/nfc/nfc_u.h"
@@ -9,9 +10,28 @@
9namespace Service { 10namespace Service {
10namespace NFC { 11namespace NFC {
11 12
13static Kernel::SharedPtr<Kernel::Event> tag_in_range_event;
14
15void GetTagInRangeEvent(Interface* self) {
16 u32* cmd_buff = Kernel::GetCommandBuffer();
17
18 cmd_buff[0] = IPC::MakeHeader(0xB, 1, 2);
19 cmd_buff[1] = RESULT_SUCCESS.raw;
20 cmd_buff[2] = IPC::CopyHandleDesc();
21 cmd_buff[3] = Kernel::g_handle_table.Create(tag_in_range_event).MoveFrom();
22 LOG_WARNING(Service_NFC, "(STUBBED) called");
23}
24
12void Init() { 25void Init() {
13 AddService(new NFC_M()); 26 AddService(new NFC_M());
14 AddService(new NFC_U()); 27 AddService(new NFC_U());
28
29 tag_in_range_event =
30 Kernel::Event::Create(Kernel::ResetType::OneShot, "NFC::tag_in_range_event");
31}
32
33void Shutdown() {
34 tag_in_range_event = nullptr;
15} 35}
16 36
17} // namespace NFC 37} // namespace NFC
diff --git a/src/core/hle/service/nfc/nfc.h b/src/core/hle/service/nfc/nfc.h
index cd65a5fdc..b02354201 100644
--- a/src/core/hle/service/nfc/nfc.h
+++ b/src/core/hle/service/nfc/nfc.h
@@ -5,10 +5,27 @@
5#pragma once 5#pragma once
6 6
7namespace Service { 7namespace Service {
8
9class Interface;
10
8namespace NFC { 11namespace NFC {
9 12
13/**
14 * NFC::GetTagInRangeEvent service function
15 * Inputs:
16 * 0 : Header code [0x000B0000]
17 * Outputs:
18 * 1 : Result of function, 0 on success, otherwise error code
19 * 2 : Copy handle descriptor
20 * 3 : Event Handle
21 */
22void GetTagInRangeEvent(Interface* self);
23
10/// Initialize all NFC services. 24/// Initialize all NFC services.
11void Init(); 25void Init();
12 26
27/// Shutdown all NFC services.
28void Shutdown();
29
13} // namespace NFC 30} // namespace NFC
14} // namespace Service 31} // namespace Service
diff --git a/src/core/hle/service/nfc/nfc_m.cpp b/src/core/hle/service/nfc/nfc_m.cpp
index 717335c11..f43b4029a 100644
--- a/src/core/hle/service/nfc/nfc_m.cpp
+++ b/src/core/hle/service/nfc/nfc_m.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 "core/hle/service/nfc/nfc.h"
5#include "core/hle/service/nfc/nfc_m.h" 6#include "core/hle/service/nfc/nfc_m.h"
6 7
7namespace Service { 8namespace Service {
@@ -19,6 +20,7 @@ const Interface::FunctionInfo FunctionTable[] = {
19 {0x00070000, nullptr, "LoadAmiiboData"}, 20 {0x00070000, nullptr, "LoadAmiiboData"},
20 {0x00080000, nullptr, "ResetTagScanState"}, 21 {0x00080000, nullptr, "ResetTagScanState"},
21 {0x00090002, nullptr, "UpdateStoredAmiiboData"}, 22 {0x00090002, nullptr, "UpdateStoredAmiiboData"},
23 {0x000B0000, GetTagInRangeEvent, "GetTagInRangeEvent"},
22 {0x000D0000, nullptr, "GetTagState"}, 24 {0x000D0000, nullptr, "GetTagState"},
23 {0x000F0000, nullptr, "CommunicationGetStatus"}, 25 {0x000F0000, nullptr, "CommunicationGetStatus"},
24 {0x00100000, nullptr, "GetTagInfo2"}, 26 {0x00100000, nullptr, "GetTagInfo2"},
diff --git a/src/core/hle/service/nfc/nfc_u.cpp b/src/core/hle/service/nfc/nfc_u.cpp
index deffb0b4f..4b5200ae8 100644
--- a/src/core/hle/service/nfc/nfc_u.cpp
+++ b/src/core/hle/service/nfc/nfc_u.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 "core/hle/service/nfc/nfc.h"
5#include "core/hle/service/nfc/nfc_u.h" 6#include "core/hle/service/nfc/nfc_u.h"
6 7
7namespace Service { 8namespace Service {
@@ -18,6 +19,7 @@ const Interface::FunctionInfo FunctionTable[] = {
18 {0x00070000, nullptr, "LoadAmiiboData"}, 19 {0x00070000, nullptr, "LoadAmiiboData"},
19 {0x00080000, nullptr, "ResetTagScanState"}, 20 {0x00080000, nullptr, "ResetTagScanState"},
20 {0x00090002, nullptr, "UpdateStoredAmiiboData"}, 21 {0x00090002, nullptr, "UpdateStoredAmiiboData"},
22 {0x000B0000, GetTagInRangeEvent, "GetTagInRangeEvent"},
21 {0x000D0000, nullptr, "GetTagState"}, 23 {0x000D0000, nullptr, "GetTagState"},
22 {0x000F0000, nullptr, "CommunicationGetStatus"}, 24 {0x000F0000, nullptr, "CommunicationGetStatus"},
23 {0x00100000, nullptr, "GetTagInfo2"}, 25 {0x00100000, nullptr, "GetTagInfo2"},
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 7e52a05d9..f3190e0fa 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -178,6 +178,7 @@ void Init() {
178/// Shutdown ServiceManager 178/// Shutdown ServiceManager
179void Shutdown() { 179void Shutdown() {
180 PTM::Shutdown(); 180 PTM::Shutdown();
181 NFC::Shutdown();
181 NIM::Shutdown(); 182 NIM::Shutdown();
182 NEWS::Shutdown(); 183 NEWS::Shutdown();
183 NDM::Shutdown(); 184 NDM::Shutdown();