From 13edfa95a5949105570a4364ca269e6ce24c8976 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sun, 26 Oct 2014 02:42:03 -0700 Subject: [PATCH] Fake gamer tile reading. --- src/xenia/kernel/user_profile.cc | 2 +- src/xenia/kernel/xam_user.cc | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/xenia/kernel/user_profile.cc b/src/xenia/kernel/user_profile.cc index 8815c5f13..2541a7273 100644 --- a/src/xenia/kernel/user_profile.cc +++ b/src/xenia/kernel/user_profile.cc @@ -64,7 +64,7 @@ UserProfile::UserProfile() { // If we set this, games will try to get it. // XPROFILE_GAMERCARD_PICTURE_KEY - // AddSetting(WStringSetting(0x4064000F, L"")); + AddSetting(std::make_unique(0x4064000F, L"gamercard_picture_key")); std::vector zeros; zeros.resize(1000); diff --git a/src/xenia/kernel/xam_user.cc b/src/xenia/kernel/xam_user.cc index 333e185b3..a045ac37a 100644 --- a/src/xenia/kernel/xam_user.cc +++ b/src/xenia/kernel/xam_user.cc @@ -303,6 +303,43 @@ SHIM_CALL XamUserCreateAchievementEnumerator_shim(PPCContext* ppc_state, SHIM_SET_RETURN_32(X_ERROR_SUCCESS); } +SHIM_CALL XamParseGamerTileKey_shim(PPCContext* ppc_state, KernelState* state) { + uint32_t key_ptr = SHIM_GET_ARG_32(0); + uint32_t out0_ptr = SHIM_GET_ARG_32(1); + uint32_t out1_ptr = SHIM_GET_ARG_32(2); + uint32_t out2_ptr = SHIM_GET_ARG_32(3); + + XELOGD("XamParseGamerTileKey(%.8X, %.8X, %.8X, %.8X, %.8X, %.8X)", key_ptr, + out0_ptr, out1_ptr, out2_ptr); + + SHIM_SET_MEM_32(out0_ptr, 0xC0DE0001); + SHIM_SET_MEM_32(out1_ptr, 0xC0DE0002); + SHIM_SET_MEM_32(out2_ptr, 0xC0DE0003); + + SHIM_SET_RETURN_32(X_ERROR_SUCCESS); +} + +SHIM_CALL XamReadTileToTexture_shim(PPCContext* ppc_state, KernelState* state) { + uint32_t unk0 = SHIM_GET_ARG_32(0); // const? + uint32_t unk1 = SHIM_GET_ARG_32(1); // out0 from XamParseGamerTileKey + uint32_t unk2 = SHIM_GET_ARG_32(2); // some variant of out1/out2 + uint32_t unk3 = SHIM_GET_ARG_32(3); // const? + uint32_t buffer_ptr = SHIM_GET_ARG_32(4); + uint32_t stride = SHIM_GET_ARG_32(5); + uint32_t height = SHIM_GET_ARG_32(6); + uint32_t overlapped_ptr = SHIM_GET_ARG_32(7); + + XELOGD("XamReadTileToTexture(%.8X, %.8X, %.8X, %.8X, %.8X, %.8X)", unk0, unk1, + unk2, unk3, buffer_ptr, stride, height, overlapped_ptr); + + if (overlapped_ptr) { + state->CompleteOverlappedImmediate(overlapped_ptr, X_ERROR_SUCCESS); + SHIM_SET_RETURN_32(X_ERROR_IO_PENDING); + } else { + SHIM_SET_RETURN_32(X_ERROR_SUCCESS); + } +} + SHIM_CALL XamWriteGamerTile_shim(PPCContext* ppc_state, KernelState* state) { uint32_t arg0 = SHIM_GET_ARG_32(0); uint32_t arg1 = SHIM_GET_ARG_32(1); @@ -336,5 +373,7 @@ void xe::kernel::xam::RegisterUserExports(ExportResolver* export_resolver, SHIM_SET_MAPPING("xam.xex", XamUserCheckPrivilege, state); SHIM_SET_MAPPING("xam.xex", XamShowSigninUI, state); SHIM_SET_MAPPING("xam.xex", XamUserCreateAchievementEnumerator, state); + SHIM_SET_MAPPING("xam.xex", XamParseGamerTileKey, state); + SHIM_SET_MAPPING("xam.xex", XamReadTileToTexture, state); SHIM_SET_MAPPING("xam.xex", XamWriteGamerTile, state); }