summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2015-03-01 04:51:28 +0100
committerSubv <subv2112@gmail.com>2015-03-02 14:12:04 +0100
commit9a72fb79fc886932ea8b54822475970c22d28578 (patch)
tree906e203dd4d0db84133fbbf5fb2ae2d66559f82d /src
parentMerge pull request #599 from Subv/morton (diff)
downloadyuzu-9a72fb79fc886932ea8b54822475970c22d28578.tar
yuzu-9a72fb79fc886932ea8b54822475970c22d28578.tar.gz
yuzu-9a72fb79fc886932ea8b54822475970c22d28578.tar.bz2
yuzu-9a72fb79fc886932ea8b54822475970c22d28578.tar.lz
yuzu-9a72fb79fc886932ea8b54822475970c22d28578.tar.xz
yuzu-9a72fb79fc886932ea8b54822475970c22d28578.tar.zst
yuzu-9a72fb79fc886932ea8b54822475970c22d28578.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/am_sys.cpp53
1 files changed, 45 insertions, 8 deletions
diff --git a/src/core/hle/service/am_sys.cpp b/src/core/hle/service/am_sys.cpp
index 7ab89569f..b244190a2 100644
--- a/src/core/hle/service/am_sys.cpp
+++ b/src/core/hle/service/am_sys.cpp
@@ -5,19 +5,56 @@
#include "core/hle/hle.h"
#include "core/hle/service/am_sys.h"
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// Namespace AM_SYS
-
namespace AM_SYS {
-// Empty arrays are illegal -- commented out until an entry is added.
-//const Interface::FunctionInfo FunctionTable[] = { };
+/**
+ * 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
+ */
+static 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_CFG, "(STUBBED) media_type %u", media_type);
+}
+
+/**
+ * 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
+ */
+static 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_CFG, "(STUBBED) Requested %u titles from media type %u", num_titles, media_type);
+}
-////////////////////////////////////////////////////////////////////////////////////////////////////
-// Interface class
+const Interface::FunctionInfo FunctionTable[] = {
+ {0x00010040, TitleIDListGetTotal, "TitleIDListGetTotal"},
+ {0x00020082, GetTitleIDList, "GetTitleIDList"},
+};
Interface::Interface() {
- //Register(FunctionTable);
+ Register(FunctionTable);
}
} // namespace