From 540a693eae210d090b87426ead8cfac5893a9ef8 Mon Sep 17 00:00:00 2001 From: bunnei Date: Fri, 16 May 2014 23:23:56 -0400 Subject: updated APT_U::GetLockHandle to return a valid handle --- src/core/hle/service/apt.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/core/hle/service/apt.cpp') diff --git a/src/core/hle/service/apt.cpp b/src/core/hle/service/apt.cpp index 709ac5493..ddb975607 100644 --- a/src/core/hle/service/apt.cpp +++ b/src/core/hle/service/apt.cpp @@ -19,7 +19,11 @@ void Initialize(Service::Interface* self) { void GetLockHandle(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); - cmd_buff[5] = 0x00000000; // TODO: This should be an actual mutex handle + u32 flags = cmd_buff[1]; + + // TODO: This should be an actual mutex handle. Games will check that this is not non-zero + // (NULL), and fail if such. A faked non-zero value will at least enable further booting. + cmd_buff[5] = 0xDEADBEEF; } const Interface::FunctionInfo FunctionTable[] = { -- cgit v1.2.3 From 0886dc70ed3eb3c30fcbe0039d53a5c780a6c4b9 Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 19 May 2014 22:21:17 -0400 Subject: apt: changed stubbed handle to be something other than 0xDEADBEEF (used as a magic value in other places) so that I can track how it propagates through the app code --- src/core/hle/service/apt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/hle/service/apt.cpp') diff --git a/src/core/hle/service/apt.cpp b/src/core/hle/service/apt.cpp index ddb975607..1f6a70eab 100644 --- a/src/core/hle/service/apt.cpp +++ b/src/core/hle/service/apt.cpp @@ -23,7 +23,7 @@ void GetLockHandle(Service::Interface* self) { // TODO: This should be an actual mutex handle. Games will check that this is not non-zero // (NULL), and fail if such. A faked non-zero value will at least enable further booting. - cmd_buff[5] = 0xDEADBEEF; + cmd_buff[5] = 0x12345678; } const Interface::FunctionInfo FunctionTable[] = { -- cgit v1.2.3 From 978e1d4653cd12a68d6bfa05af57edb1645da0f5 Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 20 May 2014 23:03:45 -0400 Subject: mutex: initial commit of HLE module --- src/core/hle/service/apt.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/core/hle/service/apt.cpp') diff --git a/src/core/hle/service/apt.cpp b/src/core/hle/service/apt.cpp index 1f6a70eab..ecec4da00 100644 --- a/src/core/hle/service/apt.cpp +++ b/src/core/hle/service/apt.cpp @@ -3,9 +3,10 @@ // Refer to the license.txt file included. -#include "common/log.h" +#include "common/common.h" #include "core/hle/hle.h" +#include "core/hle/kernel/mutex.h" #include "core/hle/service/apt.h" //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -19,11 +20,8 @@ void Initialize(Service::Interface* self) { void GetLockHandle(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); - u32 flags = cmd_buff[1]; - - // TODO: This should be an actual mutex handle. Games will check that this is not non-zero - // (NULL), and fail if such. A faked non-zero value will at least enable further booting. - cmd_buff[5] = 0x12345678; + u32 flags = cmd_buff[1]; // TODO(bunnei): Figure out the purpose of the flag field + cmd_buff[1] = Kernel::CreateMutex(cmd_buff[5], false); } const Interface::FunctionInfo FunctionTable[] = { -- cgit v1.2.3 From eb537c560a33db9955413a96afd3b98203a729fe Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 20 May 2014 23:23:58 -0400 Subject: mutex: refactored the interface to code to return a Mutex* handle --- src/core/hle/service/apt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/hle/service/apt.cpp') diff --git a/src/core/hle/service/apt.cpp b/src/core/hle/service/apt.cpp index ecec4da00..b01f35ac5 100644 --- a/src/core/hle/service/apt.cpp +++ b/src/core/hle/service/apt.cpp @@ -21,7 +21,8 @@ void Initialize(Service::Interface* self) { void GetLockHandle(Service::Interface* self) { u32* cmd_buff = Service::GetCommandBuffer(); u32 flags = cmd_buff[1]; // TODO(bunnei): Figure out the purpose of the flag field - cmd_buff[1] = Kernel::CreateMutex(cmd_buff[5], false); + cmd_buff[1] = 0; // No error + cmd_buff[5] = Kernel::CreateMutex(false); } const Interface::FunctionInfo FunctionTable[] = { -- cgit v1.2.3 From 9fddba68435f6e276bfb40c793f1ca0f8b984ec9 Mon Sep 17 00:00:00 2001 From: bunnei Date: Thu, 22 May 2014 18:48:14 -0400 Subject: APT_U: added a debug log on calling GetLockHandle --- src/core/hle/service/apt.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/core/hle/service/apt.cpp') diff --git a/src/core/hle/service/apt.cpp b/src/core/hle/service/apt.cpp index b01f35ac5..32759a087 100644 --- a/src/core/hle/service/apt.cpp +++ b/src/core/hle/service/apt.cpp @@ -23,6 +23,7 @@ void GetLockHandle(Service::Interface* self) { u32 flags = cmd_buff[1]; // TODO(bunnei): Figure out the purpose of the flag field cmd_buff[1] = 0; // No error cmd_buff[5] = Kernel::CreateMutex(false); + DEBUG_LOG(KERNEL, "APT_U::GetLockHandle called : created handle 0x%08X", cmd_buff[5]); } const Interface::FunctionInfo FunctionTable[] = { -- cgit v1.2.3