mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-11-03 23:28:48 +00:00 
			
		
		
		
	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
This commit is contained in:
		
							parent
							
								
									a4c5d8fd50
								
							
						
					
					
						commit
						7129611e65
					
				
					 11 changed files with 145 additions and 14 deletions
				
			
		| 
						 | 
				
			
			@ -3,7 +3,7 @@
 | 
			
		|||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include "common/logging/log.h"
 | 
			
		||||
 | 
			
		||||
#include "core/settings.h"
 | 
			
		||||
#include "core/file_sys/file_backend.h"
 | 
			
		||||
#include "core/hle/service/fs/archive.h"
 | 
			
		||||
#include "core/hle/service/ptm/ptm.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -89,6 +89,20 @@ void IsLegacyPowerOff(Service::Interface* self) {
 | 
			
		|||
    LOG_WARNING(Service_PTM, "(STUBBED) called");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CheckNew3DS(Service::Interface* self) {
 | 
			
		||||
    u32* cmd_buff = Kernel::GetCommandBuffer();
 | 
			
		||||
    const bool is_new_3ds = Settings::values.is_new3ds;
 | 
			
		||||
 | 
			
		||||
    if (is_new_3ds) {
 | 
			
		||||
        LOG_CRITICAL(Service_PTM, "The option 'is_new3ds' is enabled as part of the 'System' settings. Citra does not fully support New3DS emulation yet!");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    cmd_buff[1] = RESULT_SUCCESS.raw;
 | 
			
		||||
    cmd_buff[2] = is_new_3ds ? 1 : 0;
 | 
			
		||||
 | 
			
		||||
    LOG_WARNING(Service_PTM, "(STUBBED) called isNew3DS = 0x%08x", static_cast<u32>(is_new_3ds));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Init() {
 | 
			
		||||
    AddService(new PTM_Play_Interface);
 | 
			
		||||
    AddService(new PTM_Sysm_Interface);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -88,6 +88,14 @@ void GetTotalStepCount(Interface* self);
 | 
			
		|||
 */
 | 
			
		||||
void IsLegacyPowerOff(Interface* self);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * PTM::CheckNew3DS service function
 | 
			
		||||
 *  Outputs:
 | 
			
		||||
 *      1: Result code, 0 on success, otherwise error code
 | 
			
		||||
 *      2: u8 output: 0 = Old3DS, 1 = New3DS.
 | 
			
		||||
 */
 | 
			
		||||
void CheckNew3DS(Interface* self);
 | 
			
		||||
 | 
			
		||||
/// Initialize the PTM service
 | 
			
		||||
void Init();
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,7 +18,7 @@ const Interface::FunctionInfo FunctionTable[] = {
 | 
			
		|||
    {0x040700C0, nullptr,             "ShutdownAsync"},
 | 
			
		||||
    {0x04080000, nullptr,             "Awake"},
 | 
			
		||||
    {0x04090080, nullptr,             "RebootAsync"},
 | 
			
		||||
    {0x040A0000, nullptr,             "CheckNew3DS"},
 | 
			
		||||
    {0x040A0000, CheckNew3DS,         "CheckNew3DS"},
 | 
			
		||||
    {0x08010640, nullptr,             "SetInfoLEDPattern"},
 | 
			
		||||
    {0x08020040, nullptr,             "SetInfoLEDPatternHeader"},
 | 
			
		||||
    {0x08030000, nullptr,             "GetInfoLEDStatus"},
 | 
			
		||||
| 
						 | 
				
			
			@ -35,7 +35,7 @@ const Interface::FunctionInfo FunctionTable[] = {
 | 
			
		|||
    {0x080E0140, nullptr,             "NotifyPlayEvent"},
 | 
			
		||||
    {0x080F0000, IsLegacyPowerOff,    "IsLegacyPowerOff"},
 | 
			
		||||
    {0x08100000, nullptr,             "ClearLegacyPowerOff"},
 | 
			
		||||
    {0x08110000, nullptr,             "GetShellStatus"},
 | 
			
		||||
    {0x08110000, GetShellState,       "GetShellState"},
 | 
			
		||||
    {0x08120000, nullptr,             "IsShutdownByBatteryEmpty"},
 | 
			
		||||
    {0x08130000, nullptr,             "FormatSavedata"},
 | 
			
		||||
    {0x08140000, nullptr,             "GetLegacyJumpProhibitedFlag"},
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue