diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/citra/config.cpp | 5 | ||||
| -rw-r--r-- | src/citra_qt/config.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/service/apt/apt.cpp | 51 | ||||
| -rw-r--r-- | src/core/hle/service/apt/apt.h | 44 | ||||
| -rw-r--r-- | src/core/hle/service/apt/apt_a.cpp | 6 | ||||
| -rw-r--r-- | src/core/hle/service/apt/apt_s.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/service/apt/apt_u.cpp | 8 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm.cpp | 16 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm.h | 8 | ||||
| -rw-r--r-- | src/core/hle/service/ptm/ptm_sysm.cpp | 4 | ||||
| -rw-r--r-- | src/core/settings.h | 3 |
11 files changed, 145 insertions, 14 deletions
diff --git a/src/citra/config.cpp b/src/citra/config.cpp index c5cb4fb38..4d170dec8 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp | |||
| @@ -77,8 +77,9 @@ void Config::ReadValues() { | |||
| 77 | // Data Storage | 77 | // Data Storage |
| 78 | Settings::values.use_virtual_sd = sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true); | 78 | Settings::values.use_virtual_sd = sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true); |
| 79 | 79 | ||
| 80 | // System Region | 80 | // System |
| 81 | Settings::values.region_value = sdl2_config->GetInteger("System Region", "region_value", 1); | 81 | Settings::values.is_new3ds = sdl2_config->GetBoolean("System", "is_new3ds", false); |
| 82 | Settings::values.region_value = sdl2_config->GetInteger("System", "region_value", 1); | ||
| 82 | 83 | ||
| 83 | // Miscellaneous | 84 | // Miscellaneous |
| 84 | Settings::values.log_filter = sdl2_config->Get("Miscellaneous", "log_filter", "*:Info"); | 85 | Settings::values.log_filter = sdl2_config->Get("Miscellaneous", "log_filter", "*:Info"); |
diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index b5bb75537..f6e498128 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp | |||
| @@ -60,7 +60,8 @@ void Config::ReadValues() { | |||
| 60 | Settings::values.use_virtual_sd = qt_config->value("use_virtual_sd", true).toBool(); | 60 | Settings::values.use_virtual_sd = qt_config->value("use_virtual_sd", true).toBool(); |
| 61 | qt_config->endGroup(); | 61 | qt_config->endGroup(); |
| 62 | 62 | ||
| 63 | qt_config->beginGroup("System Region"); | 63 | qt_config->beginGroup("System"); |
| 64 | Settings::values.is_new3ds = qt_config->value("is_new3ds", false).toBool(); | ||
| 64 | Settings::values.region_value = qt_config->value("region_value", 1).toInt(); | 65 | Settings::values.region_value = qt_config->value("region_value", 1).toInt(); |
| 65 | qt_config->endGroup(); | 66 | qt_config->endGroup(); |
| 66 | 67 | ||
| @@ -150,7 +151,8 @@ void Config::SaveValues() { | |||
| 150 | qt_config->setValue("use_virtual_sd", Settings::values.use_virtual_sd); | 151 | qt_config->setValue("use_virtual_sd", Settings::values.use_virtual_sd); |
| 151 | qt_config->endGroup(); | 152 | qt_config->endGroup(); |
| 152 | 153 | ||
| 153 | qt_config->beginGroup("System Region"); | 154 | qt_config->beginGroup("System"); |
| 155 | qt_config->setValue("is_new3ds", Settings::values.is_new3ds); | ||
| 154 | qt_config->setValue("region_value", Settings::values.region_value); | 156 | qt_config->setValue("region_value", Settings::values.region_value); |
| 155 | qt_config->endGroup(); | 157 | qt_config->endGroup(); |
| 156 | 158 | ||
diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 73fce6079..bbf170b71 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include "core/hle/service/apt/apt_u.h" | 14 | #include "core/hle/service/apt/apt_u.h" |
| 15 | #include "core/hle/service/apt/bcfnt/bcfnt.h" | 15 | #include "core/hle/service/apt/bcfnt/bcfnt.h" |
| 16 | #include "core/hle/service/fs/archive.h" | 16 | #include "core/hle/service/fs/archive.h" |
| 17 | #include "core/hle/service/ptm/ptm.h" | ||
| 17 | 18 | ||
| 18 | #include "core/hle/kernel/event.h" | 19 | #include "core/hle/kernel/event.h" |
| 19 | #include "core/hle/kernel/mutex.h" | 20 | #include "core/hle/kernel/mutex.h" |
| @@ -33,6 +34,9 @@ static Kernel::SharedPtr<Kernel::Event> parameter_event; ///< APT parameter even | |||
| 33 | 34 | ||
| 34 | static u32 cpu_percent; ///< CPU time available to the running application | 35 | static u32 cpu_percent; ///< CPU time available to the running application |
| 35 | 36 | ||
| 37 | // APT::CheckNew3DSApp will check this unknown_ns_state_field to determine processing mode | ||
| 38 | static u8 unknown_ns_state_field; | ||
| 39 | |||
| 36 | /// Parameter data to be returned in the next call to Glance/ReceiveParameter | 40 | /// Parameter data to be returned in the next call to Glance/ReceiveParameter |
| 37 | static MessageParameter next_parameter; | 41 | static MessageParameter next_parameter; |
| 38 | 42 | ||
| @@ -258,6 +262,10 @@ void PrepareToStartApplication(Service::Interface* self) { | |||
| 258 | u32 title_info4 = cmd_buff[4]; | 262 | u32 title_info4 = cmd_buff[4]; |
| 259 | u32 flags = cmd_buff[5]; | 263 | u32 flags = cmd_buff[5]; |
| 260 | 264 | ||
| 265 | if (flags & 0x00000100) { | ||
| 266 | unknown_ns_state_field = 1; | ||
| 267 | } | ||
| 268 | |||
| 261 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error | 269 | cmd_buff[1] = RESULT_SUCCESS.raw; // No error |
| 262 | 270 | ||
| 263 | LOG_WARNING(Service_APT, "(STUBBED) called title_info1=0x%08X, title_info2=0x%08X, title_info3=0x%08X," | 271 | LOG_WARNING(Service_APT, "(STUBBED) called title_info1=0x%08X, title_info2=0x%08X, title_info3=0x%08X," |
| @@ -373,6 +381,25 @@ void StartLibraryApplet(Service::Interface* self) { | |||
| 373 | cmd_buff[1] = applet->Start(parameter).raw; | 381 | cmd_buff[1] = applet->Start(parameter).raw; |
| 374 | } | 382 | } |
| 375 | 383 | ||
| 384 | void SetNSStateField(Service::Interface* self) { | ||
| 385 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 386 | |||
| 387 | unknown_ns_state_field = cmd_buff[1]; | ||
| 388 | |||
| 389 | cmd_buff[0] = IPC::MakeHeader(0x55, 1, 0); | ||
| 390 | cmd_buff[1] = RESULT_SUCCESS.raw; | ||
| 391 | LOG_WARNING(Service_APT, "(STUBBED) unknown_ns_state_field=%u", unknown_ns_state_field); | ||
| 392 | } | ||
| 393 | |||
| 394 | void GetNSStateField(Service::Interface* self) { | ||
| 395 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 396 | |||
| 397 | cmd_buff[0] = IPC::MakeHeader(0x56, 2, 0); | ||
| 398 | cmd_buff[1] = RESULT_SUCCESS.raw; | ||
| 399 | cmd_buff[8] = unknown_ns_state_field; | ||
| 400 | LOG_WARNING(Service_APT, "(STUBBED) unknown_ns_state_field=%u", unknown_ns_state_field); | ||
| 401 | } | ||
| 402 | |||
| 376 | void GetAppletInfo(Service::Interface* self) { | 403 | void GetAppletInfo(Service::Interface* self) { |
| 377 | u32* cmd_buff = Kernel::GetCommandBuffer(); | 404 | u32* cmd_buff = Kernel::GetCommandBuffer(); |
| 378 | auto app_id = static_cast<AppletId>(cmd_buff[1]); | 405 | auto app_id = static_cast<AppletId>(cmd_buff[1]); |
| @@ -408,6 +435,29 @@ void GetStartupArgument(Service::Interface* self) { | |||
| 408 | cmd_buff[2] = (parameter_size > 0) ? 1 : 0; | 435 | cmd_buff[2] = (parameter_size > 0) ? 1 : 0; |
| 409 | } | 436 | } |
| 410 | 437 | ||
| 438 | void CheckNew3DSApp(Service::Interface* self) { | ||
| 439 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 440 | |||
| 441 | if (unknown_ns_state_field) { | ||
| 442 | cmd_buff[1] = RESULT_SUCCESS.raw; | ||
| 443 | cmd_buff[2] = 0; | ||
| 444 | } else { | ||
| 445 | PTM::CheckNew3DS(self); | ||
| 446 | } | ||
| 447 | |||
| 448 | cmd_buff[0] = IPC::MakeHeader(0x101, 2, 0); | ||
| 449 | LOG_WARNING(Service_APT, "(STUBBED) called"); | ||
| 450 | } | ||
| 451 | |||
| 452 | void CheckNew3DS(Service::Interface* self) { | ||
| 453 | u32* cmd_buff = Kernel::GetCommandBuffer(); | ||
| 454 | |||
| 455 | PTM::CheckNew3DS(self); | ||
| 456 | |||
| 457 | cmd_buff[0] = IPC::MakeHeader(0x102, 2, 0); | ||
| 458 | LOG_WARNING(Service_APT, "(STUBBED) called"); | ||
| 459 | } | ||
| 460 | |||
| 411 | void Init() { | 461 | void Init() { |
| 412 | AddService(new APT_A_Interface); | 462 | AddService(new APT_A_Interface); |
| 413 | AddService(new APT_S_Interface); | 463 | AddService(new APT_S_Interface); |
| @@ -441,6 +491,7 @@ void Init() { | |||
| 441 | lock = Kernel::Mutex::Create(false, "APT_U:Lock"); | 491 | lock = Kernel::Mutex::Create(false, "APT_U:Lock"); |
| 442 | 492 | ||
| 443 | cpu_percent = 0; | 493 | cpu_percent = 0; |
| 494 | unknown_ns_state_field = 0; | ||
| 444 | 495 | ||
| 445 | // TODO(bunnei): Check if these are created in Initialize or on APT process startup. | 496 | // TODO(bunnei): Check if these are created in Initialize or on APT process startup. |
| 446 | notification_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "APT_U:Notification"); | 497 | notification_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "APT_U:Notification"); |
diff --git a/src/core/hle/service/apt/apt.h b/src/core/hle/service/apt/apt.h index 1a1034fcc..ed7c47cca 100644 --- a/src/core/hle/service/apt/apt.h +++ b/src/core/hle/service/apt/apt.h | |||
| @@ -376,6 +376,50 @@ void StartLibraryApplet(Service::Interface* self); | |||
| 376 | */ | 376 | */ |
| 377 | void GetStartupArgument(Service::Interface* self); | 377 | void GetStartupArgument(Service::Interface* self); |
| 378 | 378 | ||
| 379 | /** | ||
| 380 | * APT::SetNSStateField service function | ||
| 381 | * Inputs: | ||
| 382 | * 1 : u8 NS state field | ||
| 383 | * Outputs: | ||
| 384 | * 1 : Result of function, 0 on success, otherwise error code | ||
| 385 | * Note: | ||
| 386 | * This writes the input u8 to a NS state field. | ||
| 387 | */ | ||
| 388 | void SetNSStateField(Service::Interface* self); | ||
| 389 | |||
| 390 | /** | ||
| 391 | * APT::GetNSStateField service function | ||
| 392 | * Outputs: | ||
| 393 | * 1 : Result of function, 0 on success, otherwise error code | ||
| 394 | * 8 : u8 NS state field | ||
| 395 | * Note: | ||
| 396 | * This returns a u8 NS state field(which can be set by cmd 0x00550040), at cmdreply+8. | ||
| 397 | */ | ||
| 398 | void GetNSStateField(Service::Interface* self); | ||
| 399 | |||
| 400 | /** | ||
| 401 | * APT::CheckNew3DSApp service function | ||
| 402 | * Outputs: | ||
| 403 | * 1: Result code, 0 on success, otherwise error code | ||
| 404 | * 2: u8 output: 0 = Old3DS, 1 = New3DS. | ||
| 405 | * Note: | ||
| 406 | * This uses PTMSYSM:CheckNew3DS. | ||
| 407 | * When a certain NS state field is non-zero, the output value is zero, | ||
| 408 | * Otherwise the output is from PTMSYSM:CheckNew3DS. | ||
| 409 | * Normally this NS state field is zero, however this state field is set to 1 | ||
| 410 | * when APT:PrepareToStartApplication is used with flags bit8 is set. | ||
| 411 | */ | ||
| 412 | void CheckNew3DSApp(Service::Interface* self); | ||
| 413 | |||
| 414 | /** | ||
| 415 | * Wrapper for PTMSYSM:CheckNew3DS | ||
| 416 | * APT::CheckNew3DS service function | ||
| 417 | * Outputs: | ||
| 418 | * 1: Result code, 0 on success, otherwise error code | ||
| 419 | * 2: u8 output: 0 = Old3DS, 1 = New3DS. | ||
| 420 | */ | ||
| 421 | void CheckNew3DS(Service::Interface* self); | ||
| 422 | |||
| 379 | /// Initialize the APT service | 423 | /// Initialize the APT service |
| 380 | void Init(); | 424 | void Init(); |
| 381 | 425 | ||
diff --git a/src/core/hle/service/apt/apt_a.cpp b/src/core/hle/service/apt/apt_a.cpp index 9ff47701a..223c0a8bd 100644 --- a/src/core/hle/service/apt/apt_a.cpp +++ b/src/core/hle/service/apt/apt_a.cpp | |||
| @@ -21,6 +21,7 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 21 | {0x000D0080, ReceiveParameter, "ReceiveParameter"}, | 21 | {0x000D0080, ReceiveParameter, "ReceiveParameter"}, |
| 22 | {0x000E0080, GlanceParameter, "GlanceParameter"}, | 22 | {0x000E0080, GlanceParameter, "GlanceParameter"}, |
| 23 | {0x000F0100, CancelParameter, "CancelParameter"}, | 23 | {0x000F0100, CancelParameter, "CancelParameter"}, |
| 24 | {0x00150140, PrepareToStartApplication, "PrepareToStartApplication"}, | ||
| 24 | {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, | 25 | {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, |
| 25 | {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"}, | 26 | {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"}, |
| 26 | {0x001E0084, StartLibraryApplet, "StartLibraryApplet"}, | 27 | {0x001E0084, StartLibraryApplet, "StartLibraryApplet"}, |
| @@ -32,7 +33,10 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 32 | {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, | 33 | {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, |
| 33 | {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, | 34 | {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, |
| 34 | {0x00510080, GetStartupArgument, "GetStartupArgument"}, | 35 | {0x00510080, GetStartupArgument, "GetStartupArgument"}, |
| 35 | {0x00550040, nullptr, "WriteInputToNsState?"}, | 36 | {0x00550040, SetNSStateField, "SetNSStateField?"}, |
| 37 | {0x00560000, GetNSStateField, "GetNSStateField?"}, | ||
| 38 | {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, | ||
| 39 | {0x01020000, CheckNew3DS, "CheckNew3DS"} | ||
| 36 | }; | 40 | }; |
| 37 | 41 | ||
| 38 | APT_A_Interface::APT_A_Interface() { | 42 | APT_A_Interface::APT_A_Interface() { |
diff --git a/src/core/hle/service/apt/apt_s.cpp b/src/core/hle/service/apt/apt_s.cpp index ca54e593c..f5c52fa3d 100644 --- a/src/core/hle/service/apt/apt_s.cpp +++ b/src/core/hle/service/apt/apt_s.cpp | |||
| @@ -29,7 +29,7 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 29 | {0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"}, | 29 | {0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"}, |
| 30 | {0x00130000, nullptr, "GetPreparationState"}, | 30 | {0x00130000, nullptr, "GetPreparationState"}, |
| 31 | {0x00140040, nullptr, "SetPreparationState"}, | 31 | {0x00140040, nullptr, "SetPreparationState"}, |
| 32 | {0x00150140, nullptr, "PrepareToStartApplication"}, | 32 | {0x00150140, PrepareToStartApplication, "PrepareToStartApplication"}, |
| 33 | {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, | 33 | {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, |
| 34 | {0x00170040, nullptr, "FinishPreloadingLibraryApplet"}, | 34 | {0x00170040, nullptr, "FinishPreloadingLibraryApplet"}, |
| 35 | {0x00180040, PrepareToStartLibraryApplet,"PrepareToStartLibraryApplet"}, | 35 | {0x00180040, PrepareToStartLibraryApplet,"PrepareToStartLibraryApplet"}, |
| @@ -92,9 +92,11 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 92 | {0x00510080, GetStartupArgument, "GetStartupArgument"}, | 92 | {0x00510080, GetStartupArgument, "GetStartupArgument"}, |
| 93 | {0x00520104, nullptr, "Wrap1"}, | 93 | {0x00520104, nullptr, "Wrap1"}, |
| 94 | {0x00530104, nullptr, "Unwrap1"}, | 94 | {0x00530104, nullptr, "Unwrap1"}, |
| 95 | {0x00550040, SetNSStateField, "SetNSStateField?" }, | ||
| 96 | {0x00560000, GetNSStateField, "GetNSStateField?" }, | ||
| 95 | {0x00580002, nullptr, "GetProgramID"}, | 97 | {0x00580002, nullptr, "GetProgramID"}, |
| 96 | {0x01010000, nullptr, "CheckNew3DSApp"}, | 98 | {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, |
| 97 | {0x01020000, nullptr, "CheckNew3DS"} | 99 | {0x01020000, CheckNew3DS, "CheckNew3DS"} |
| 98 | }; | 100 | }; |
| 99 | 101 | ||
| 100 | APT_S_Interface::APT_S_Interface() { | 102 | APT_S_Interface::APT_S_Interface() { |
diff --git a/src/core/hle/service/apt/apt_u.cpp b/src/core/hle/service/apt/apt_u.cpp index 0e85c6d08..0e60bd34f 100644 --- a/src/core/hle/service/apt/apt_u.cpp +++ b/src/core/hle/service/apt/apt_u.cpp | |||
| @@ -29,7 +29,7 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 29 | {0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"}, | 29 | {0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"}, |
| 30 | {0x00130000, nullptr, "GetPreparationState"}, | 30 | {0x00130000, nullptr, "GetPreparationState"}, |
| 31 | {0x00140040, nullptr, "SetPreparationState"}, | 31 | {0x00140040, nullptr, "SetPreparationState"}, |
| 32 | {0x00150140, nullptr, "PrepareToStartApplication"}, | 32 | {0x00150140, PrepareToStartApplication, "PrepareToStartApplication"}, |
| 33 | {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, | 33 | {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, |
| 34 | {0x00170040, nullptr, "FinishPreloadingLibraryApplet"}, | 34 | {0x00170040, nullptr, "FinishPreloadingLibraryApplet"}, |
| 35 | {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"}, | 35 | {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"}, |
| @@ -92,9 +92,11 @@ const Interface::FunctionInfo FunctionTable[] = { | |||
| 92 | {0x00510080, GetStartupArgument, "GetStartupArgument"}, | 92 | {0x00510080, GetStartupArgument, "GetStartupArgument"}, |
| 93 | {0x00520104, nullptr, "Wrap1"}, | 93 | {0x00520104, nullptr, "Wrap1"}, |
| 94 | {0x00530104, nullptr, "Unwrap1"}, | 94 | {0x00530104, nullptr, "Unwrap1"}, |
| 95 | {0x00550040, SetNSStateField, "SetNSStateField?"}, | ||
| 96 | {0x00560000, GetNSStateField, "GetNSStateField?"}, | ||
| 95 | {0x00580002, nullptr, "GetProgramID"}, | 97 | {0x00580002, nullptr, "GetProgramID"}, |
| 96 | {0x01010000, nullptr, "CheckNew3DSApp"}, | 98 | {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, |
| 97 | {0x01020000, nullptr, "CheckNew3DS"} | 99 | {0x01020000, CheckNew3DS, "CheckNew3DS"} |
| 98 | }; | 100 | }; |
| 99 | 101 | ||
| 100 | APT_U_Interface::APT_U_Interface() { | 102 | APT_U_Interface::APT_U_Interface() { |
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 | ||
| 92 | void 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 | |||
| 92 | void Init() { | 106 | void 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 | */ |
| 89 | void IsLegacyPowerOff(Interface* self); | 89 | void 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 | */ | ||
| 97 | void CheckNew3DS(Interface* self); | ||
| 98 | |||
| 91 | /// Initialize the PTM service | 99 | /// Initialize the PTM service |
| 92 | void Init(); | 100 | void 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"}, |
diff --git a/src/core/settings.h b/src/core/settings.h index ce2a31164..a61f25cbe 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -41,6 +41,9 @@ static const std::array<Values, NUM_INPUTS> All = {{ | |||
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | struct Values { | 43 | struct Values { |
| 44 | // CheckNew3DS | ||
| 45 | bool is_new3ds; | ||
| 46 | |||
| 44 | // Controls | 47 | // Controls |
| 45 | std::array<int, NativeInput::NUM_INPUTS> input_mappings; | 48 | std::array<int, NativeInput::NUM_INPUTS> input_mappings; |
| 46 | 49 | ||