summaryrefslogtreecommitdiff
path: root/src/core/hle/service/ptm
diff options
context:
space:
mode:
authorGravatar JamePeng2016-04-20 18:12:05 +0800
committerGravatar JamePeng2016-04-20 18:12:05 +0800
commit7129611e65096ba2cbe8266f6cb068a9b18981d8 (patch)
treee411b0e7d50ece8adee68ddcd1bc1b6936b0b91e /src/core/hle/service/ptm
parentMerge pull request #1644 from polaris-/gdb-fixes (diff)
downloadyuzu-7129611e65096ba2cbe8266f6cb068a9b18981d8.tar.gz
yuzu-7129611e65096ba2cbe8266f6cb068a9b18981d8.tar.xz
yuzu-7129611e65096ba2cbe8266f6cb068a9b18981d8.zip
Implement CheckNew3DS and CheckNew3DSApp
Append an item[is_new3ds] to config file[System] group Implement APT::SetNSStateField,it will update the unknown NS_state_field
Diffstat (limited to 'src/core/hle/service/ptm')
-rw-r--r--src/core/hle/service/ptm/ptm.cpp16
-rw-r--r--src/core/hle/service/ptm/ptm.h8
-rw-r--r--src/core/hle/service/ptm/ptm_sysm.cpp4
3 files changed, 25 insertions, 3 deletions
diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp
index 94f494690..3a0331ee1 100644
--- a/src/core/hle/service/ptm/ptm.cpp
+++ b/src/core/hle/service/ptm/ptm.cpp
@@ -3,7 +3,7 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include "common/logging/log.h" 5#include "common/logging/log.h"
6 6#include "core/settings.h"
7#include "core/file_sys/file_backend.h" 7#include "core/file_sys/file_backend.h"
8#include "core/hle/service/fs/archive.h" 8#include "core/hle/service/fs/archive.h"
9#include "core/hle/service/ptm/ptm.h" 9#include "core/hle/service/ptm/ptm.h"
@@ -89,6 +89,20 @@ void IsLegacyPowerOff(Service::Interface* self) {
89 LOG_WARNING(Service_PTM, "(STUBBED) called"); 89 LOG_WARNING(Service_PTM, "(STUBBED) called");
90} 90}
91 91
92void CheckNew3DS(Service::Interface* self) {
93 u32* cmd_buff = Kernel::GetCommandBuffer();
94 const bool is_new_3ds = Settings::values.is_new3ds;
95
96 if (is_new_3ds) {
97 LOG_CRITICAL(Service_PTM, "The option 'is_new3ds' is enabled as part of the 'System' settings. Citra does not fully support New3DS emulation yet!");
98 }
99
100 cmd_buff[1] = RESULT_SUCCESS.raw;
101 cmd_buff[2] = is_new_3ds ? 1 : 0;
102
103 LOG_WARNING(Service_PTM, "(STUBBED) called isNew3DS = 0x%08x", static_cast<u32>(is_new_3ds));
104}
105
92void Init() { 106void Init() {
93 AddService(new PTM_Play_Interface); 107 AddService(new PTM_Play_Interface);
94 AddService(new PTM_Sysm_Interface); 108 AddService(new PTM_Sysm_Interface);
diff --git a/src/core/hle/service/ptm/ptm.h b/src/core/hle/service/ptm/ptm.h
index 4cf7383d1..7ef8877c7 100644
--- a/src/core/hle/service/ptm/ptm.h
+++ b/src/core/hle/service/ptm/ptm.h
@@ -88,6 +88,14 @@ void GetTotalStepCount(Interface* self);
88 */ 88 */
89void IsLegacyPowerOff(Interface* self); 89void IsLegacyPowerOff(Interface* self);
90 90
91/**
92 * PTM::CheckNew3DS service function
93 * Outputs:
94 * 1: Result code, 0 on success, otherwise error code
95 * 2: u8 output: 0 = Old3DS, 1 = New3DS.
96 */
97void CheckNew3DS(Interface* self);
98
91/// Initialize the PTM service 99/// Initialize the PTM service
92void Init(); 100void Init();
93 101
diff --git a/src/core/hle/service/ptm/ptm_sysm.cpp b/src/core/hle/service/ptm/ptm_sysm.cpp
index fe76dd108..cc4ef1101 100644
--- a/src/core/hle/service/ptm/ptm_sysm.cpp
+++ b/src/core/hle/service/ptm/ptm_sysm.cpp
@@ -18,7 +18,7 @@ const Interface::FunctionInfo FunctionTable[] = {
18 {0x040700C0, nullptr, "ShutdownAsync"}, 18 {0x040700C0, nullptr, "ShutdownAsync"},
19 {0x04080000, nullptr, "Awake"}, 19 {0x04080000, nullptr, "Awake"},
20 {0x04090080, nullptr, "RebootAsync"}, 20 {0x04090080, nullptr, "RebootAsync"},
21 {0x040A0000, nullptr, "CheckNew3DS"}, 21 {0x040A0000, CheckNew3DS, "CheckNew3DS"},
22 {0x08010640, nullptr, "SetInfoLEDPattern"}, 22 {0x08010640, nullptr, "SetInfoLEDPattern"},
23 {0x08020040, nullptr, "SetInfoLEDPatternHeader"}, 23 {0x08020040, nullptr, "SetInfoLEDPatternHeader"},
24 {0x08030000, nullptr, "GetInfoLEDStatus"}, 24 {0x08030000, nullptr, "GetInfoLEDStatus"},
@@ -35,7 +35,7 @@ const Interface::FunctionInfo FunctionTable[] = {
35 {0x080E0140, nullptr, "NotifyPlayEvent"}, 35 {0x080E0140, nullptr, "NotifyPlayEvent"},
36 {0x080F0000, IsLegacyPowerOff, "IsLegacyPowerOff"}, 36 {0x080F0000, IsLegacyPowerOff, "IsLegacyPowerOff"},
37 {0x08100000, nullptr, "ClearLegacyPowerOff"}, 37 {0x08100000, nullptr, "ClearLegacyPowerOff"},
38 {0x08110000, nullptr, "GetShellStatus"}, 38 {0x08110000, GetShellState, "GetShellState"},
39 {0x08120000, nullptr, "IsShutdownByBatteryEmpty"}, 39 {0x08120000, nullptr, "IsShutdownByBatteryEmpty"},
40 {0x08130000, nullptr, "FormatSavedata"}, 40 {0x08130000, nullptr, "FormatSavedata"},
41 {0x08140000, nullptr, "GetLegacyJumpProhibitedFlag"}, 41 {0x08140000, nullptr, "GetLegacyJumpProhibitedFlag"},