mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-11-03 23:28:48 +00:00 
			
		
		
		
	Services: Continue separation of services into their own folders
This commit is contained in:
		
							parent
							
								
									b1cb0a3f2c
								
							
						
					
					
						commit
						7933dbe6a0
					
				
					 75 changed files with 1190 additions and 637 deletions
				
			
		
							
								
								
									
										55
									
								
								src/core/hle/service/am/am.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								src/core/hle/service/am/am.cpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,55 @@
 | 
			
		|||
// Copyright 2015 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include "common/logging/log.h"
 | 
			
		||||
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
#include "core/hle/service/am/am_app.h"
 | 
			
		||||
#include "core/hle/service/am/am_net.h"
 | 
			
		||||
#include "core/hle/service/am/am_sys.h"
 | 
			
		||||
 | 
			
		||||
#include "core/hle/hle.h"
 | 
			
		||||
#include "core/hle/kernel/event.h"
 | 
			
		||||
#include "core/hle/kernel/shared_memory.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace AM {
 | 
			
		||||
 | 
			
		||||
void TitleIDListGetTotal(Service::Interface* self) {
 | 
			
		||||
    u32* cmd_buff = Kernel::GetCommandBuffer();
 | 
			
		||||
    u32 media_type = cmd_buff[1] & 0xFF;
 | 
			
		||||
 | 
			
		||||
    cmd_buff[1] = RESULT_SUCCESS.raw;
 | 
			
		||||
    cmd_buff[2] = 0;
 | 
			
		||||
 | 
			
		||||
    LOG_WARNING(Service_AM, "(STUBBED) media_type %u", media_type);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void GetTitleIDList(Service::Interface* self) {
 | 
			
		||||
    u32* cmd_buff = Kernel::GetCommandBuffer();
 | 
			
		||||
    u32 num_titles = cmd_buff[1];
 | 
			
		||||
    u32 media_type = cmd_buff[2] & 0xFF;
 | 
			
		||||
    u32 addr       = cmd_buff[4];
 | 
			
		||||
 | 
			
		||||
    cmd_buff[1] = RESULT_SUCCESS.raw;
 | 
			
		||||
    cmd_buff[2] = 0;
 | 
			
		||||
 | 
			
		||||
    LOG_WARNING(Service_AM, "(STUBBED) Requested %u titles from media type %u", num_titles, media_type);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Init() {
 | 
			
		||||
    using namespace Kernel;
 | 
			
		||||
 | 
			
		||||
    AddService(new AM_APP_Interface);
 | 
			
		||||
    AddService(new AM_NET_Interface);
 | 
			
		||||
    AddService(new AM_SYS_Interface);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Shutdown() {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
} // namespace AM
 | 
			
		||||
 | 
			
		||||
} // namespace Service
 | 
			
		||||
							
								
								
									
										47
									
								
								src/core/hle/service/am/am.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								src/core/hle/service/am/am.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,47 @@
 | 
			
		|||
// Copyright 2015 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "core/hle/kernel/kernel.h"
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace AM {
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * AM::TitleIDListGetTotal service function
 | 
			
		||||
 * Gets the number of installed titles in the requested media type
 | 
			
		||||
 *  Inputs:
 | 
			
		||||
 *      0 : Command header (0x00010040)
 | 
			
		||||
 *      1 : Media type to load the titles from
 | 
			
		||||
 *  Outputs:
 | 
			
		||||
 *      1 : Result, 0 on success, otherwise error code
 | 
			
		||||
 *      2 : The number of titles in the requested media type
 | 
			
		||||
 */
 | 
			
		||||
void TitleIDListGetTotal(Service::Interface* self);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * AM::GetTitleIDList service function
 | 
			
		||||
 * Loads information about the desired number of titles from the desired media type into an array
 | 
			
		||||
 *  Inputs:
 | 
			
		||||
 *      0 : Command header (0x00020082)
 | 
			
		||||
 *      1 : The maximum number of titles to load
 | 
			
		||||
 *      2 : Media type to load the titles from
 | 
			
		||||
 *      3 : Descriptor of the output buffer pointer
 | 
			
		||||
 *      4 : Address of the output buffer
 | 
			
		||||
 *  Outputs:
 | 
			
		||||
 *      1 : Result, 0 on success, otherwise error code
 | 
			
		||||
 *      2 : The number of titles loaded from the requested media type
 | 
			
		||||
 */
 | 
			
		||||
void GetTitleIDList(Service::Interface* self);
 | 
			
		||||
 | 
			
		||||
/// Initialize AM service
 | 
			
		||||
void Init();
 | 
			
		||||
 | 
			
		||||
/// Shutdown AM service
 | 
			
		||||
void Shutdown();
 | 
			
		||||
 | 
			
		||||
} // namespace AM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
							
								
								
									
										20
									
								
								src/core/hle/service/am/am_app.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								src/core/hle/service/am/am_app.cpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,20 @@
 | 
			
		|||
// Copyright 2014 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include "core/hle/hle.h"
 | 
			
		||||
#include "core/hle/service/am/am.h"
 | 
			
		||||
#include "core/hle/service/am/am_app.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace AM {
 | 
			
		||||
 | 
			
		||||
// Empty arrays are illegal -- commented out until an entry is added.
 | 
			
		||||
//const Interface::FunctionInfo FunctionTable[] = { };
 | 
			
		||||
 | 
			
		||||
AM_APP_Interface::AM_APP_Interface() {
 | 
			
		||||
    //Register(FunctionTable);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
} // namespace AM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
							
								
								
									
										22
									
								
								src/core/hle/service/am/am_app.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								src/core/hle/service/am/am_app.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,22 @@
 | 
			
		|||
// Copyright 2014 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included..
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace AM {
 | 
			
		||||
 | 
			
		||||
class AM_APP_Interface : public Service::Interface {
 | 
			
		||||
public:
 | 
			
		||||
    AM_APP_Interface();
 | 
			
		||||
 | 
			
		||||
    std::string GetPortName() const override {
 | 
			
		||||
        return "am:app";
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace AM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
							
								
								
									
										40
									
								
								src/core/hle/service/am/am_net.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								src/core/hle/service/am/am_net.cpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,40 @@
 | 
			
		|||
// Copyright 2014 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include "core/hle/hle.h"
 | 
			
		||||
#include "core/hle/service/am/am.h"
 | 
			
		||||
#include "core/hle/service/am/am_net.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace AM {
 | 
			
		||||
 | 
			
		||||
const Interface::FunctionInfo FunctionTable[] = {
 | 
			
		||||
    {0x08010000, nullptr,               "OpenTicket"},
 | 
			
		||||
    {0x08020002, nullptr,               "TicketAbortInstall"},
 | 
			
		||||
    {0x08030002, nullptr,               "TicketFinalizeInstall"},
 | 
			
		||||
    {0x08040100, nullptr,               "InstallTitleBegin"},
 | 
			
		||||
    {0x08050000, nullptr,               "InstallTitleAbort"},
 | 
			
		||||
    {0x080600C0, nullptr,               "InstallTitleResume"},
 | 
			
		||||
    {0x08070000, nullptr,               "InstallTitleAbortTMD"},
 | 
			
		||||
    {0x08080000, nullptr,               "InstallTitleFinish"},
 | 
			
		||||
    {0x080A0000, nullptr,               "OpenTMD"},
 | 
			
		||||
    {0x080B0002, nullptr,               "TMDAbortInstall"},
 | 
			
		||||
    {0x080C0042, nullptr,               "TMDFinalizeInstall"},
 | 
			
		||||
    {0x080E0040, nullptr,               "OpenContentCreate"},
 | 
			
		||||
    {0x080F0002, nullptr,               "ContentAbortInstall"},
 | 
			
		||||
    {0x08100040, nullptr,               "OpenContentResume"},
 | 
			
		||||
    {0x08120002, nullptr,               "ContentFinalizeInstall"},
 | 
			
		||||
    {0x08130000, nullptr,               "GetTotalContents"},
 | 
			
		||||
    {0x08140042, nullptr,               "GetContentIndexes"},
 | 
			
		||||
    {0x08150044, nullptr,               "GetContentsInfo"},
 | 
			
		||||
    {0x08190108, nullptr,               "Unknown"},
 | 
			
		||||
    {0x081B00C2, nullptr,               "InstallTitlesFinish"},
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
AM_NET_Interface::AM_NET_Interface() {
 | 
			
		||||
    Register(FunctionTable);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
} // namespace AM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
							
								
								
									
										22
									
								
								src/core/hle/service/am/am_net.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								src/core/hle/service/am/am_net.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,22 @@
 | 
			
		|||
// Copyright 2014 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included..
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace AM {
 | 
			
		||||
 | 
			
		||||
class AM_NET_Interface : public Service::Interface {
 | 
			
		||||
public:
 | 
			
		||||
    AM_NET_Interface();
 | 
			
		||||
 | 
			
		||||
    std::string GetPortName() const override {
 | 
			
		||||
        return "am:net";
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace AM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
							
								
								
									
										22
									
								
								src/core/hle/service/am/am_sys.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								src/core/hle/service/am/am_sys.cpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,22 @@
 | 
			
		|||
// Copyright 2015 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include "core/hle/hle.h"
 | 
			
		||||
#include "core/hle/service/am/am.h"
 | 
			
		||||
#include "core/hle/service/am/am_sys.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace AM {
 | 
			
		||||
 | 
			
		||||
const Interface::FunctionInfo FunctionTable[] = {
 | 
			
		||||
    {0x00010040, TitleIDListGetTotal,         "TitleIDListGetTotal"},
 | 
			
		||||
    {0x00020082, GetTitleIDList,              "GetTitleIDList"},
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
AM_SYS_Interface::AM_SYS_Interface() {
 | 
			
		||||
    Register(FunctionTable);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
} // namespace AM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
							
								
								
									
										22
									
								
								src/core/hle/service/am/am_sys.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								src/core/hle/service/am/am_sys.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,22 @@
 | 
			
		|||
// Copyright 2015 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included..
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace AM {
 | 
			
		||||
 | 
			
		||||
class AM_SYS_Interface : public Service::Interface {
 | 
			
		||||
public:
 | 
			
		||||
    AM_SYS_Interface();
 | 
			
		||||
 | 
			
		||||
    std::string GetPortName() const override {
 | 
			
		||||
        return "am:sys";
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace AM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
							
								
								
									
										22
									
								
								src/core/hle/service/am/am_u.cpp
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								src/core/hle/service/am/am_u.cpp
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,22 @@
 | 
			
		|||
// Copyright 2015 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included.
 | 
			
		||||
 | 
			
		||||
#include "core/hle/hle.h"
 | 
			
		||||
#include "core/hle/service/am/am.h"
 | 
			
		||||
#include "core/hle/service/am/am_u.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace AM {
 | 
			
		||||
 | 
			
		||||
const Interface::FunctionInfo FunctionTable[] = {
 | 
			
		||||
    {0x00010040, TitleIDListGetTotal,         "TitleIDListGetTotal"},
 | 
			
		||||
    {0x00020082, GetTitleIDList,              "GetTitleIDList"},
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
AM_U_Interface::AM_U_Interface() {
 | 
			
		||||
    Register(FunctionTable);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
} // namespace AM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
							
								
								
									
										22
									
								
								src/core/hle/service/am/am_u.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								src/core/hle/service/am/am_u.h
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,22 @@
 | 
			
		|||
// Copyright 2015 Citra Emulator Project
 | 
			
		||||
// Licensed under GPLv2 or any later version
 | 
			
		||||
// Refer to the license.txt file included..
 | 
			
		||||
 | 
			
		||||
#pragma once
 | 
			
		||||
 | 
			
		||||
#include "core/hle/service/service.h"
 | 
			
		||||
 | 
			
		||||
namespace Service {
 | 
			
		||||
namespace AM {
 | 
			
		||||
 | 
			
		||||
class AM_U_Interface : public Service::Interface {
 | 
			
		||||
public:
 | 
			
		||||
    AM_U_Interface();
 | 
			
		||||
 | 
			
		||||
    std::string GetPortName() const override {
 | 
			
		||||
        return "am:u";
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace AM
 | 
			
		||||
} // namespace Service
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue