Mass renaming. I love clang-format.
This commit is contained in:
@@ -18,7 +18,8 @@
|
||||
namespace xe {
|
||||
namespace kernel {
|
||||
|
||||
SHIM_CALL XamUserGetXUID_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
SHIM_CALL XamUserGetXUID_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t unk = SHIM_GET_ARG_32(1);
|
||||
uint32_t xuid_ptr = SHIM_GET_ARG_32(2);
|
||||
@@ -26,7 +27,7 @@ SHIM_CALL XamUserGetXUID_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
XELOGD("XamUserGetXUID(%d, %.8X, %.8X)", user_index, unk, xuid_ptr);
|
||||
|
||||
if (user_index == 0) {
|
||||
const auto& user_profile = state->user_profile();
|
||||
const auto& user_profile = kernel_state->user_profile();
|
||||
if (xuid_ptr) {
|
||||
SHIM_SET_MEM_64(xuid_ptr, user_profile->xuid());
|
||||
}
|
||||
@@ -36,8 +37,8 @@ SHIM_CALL XamUserGetXUID_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
}
|
||||
}
|
||||
|
||||
SHIM_CALL XamUserGetSigninState_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamUserGetSigninState_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
|
||||
XELOGD("XamUserGetSigninState(%d)", user_index);
|
||||
@@ -46,7 +47,7 @@ SHIM_CALL XamUserGetSigninState_shim(PPCContext* ppc_state,
|
||||
// This should keep games from asking us to sign in and also keep them
|
||||
// from initializing the network.
|
||||
if (user_index == 0 || (user_index & 0xFF) == 0xFF) {
|
||||
const auto& user_profile = state->user_profile();
|
||||
const auto& user_profile = kernel_state->user_profile();
|
||||
auto signin_state = user_profile->signin_state();
|
||||
SHIM_SET_RETURN_32(signin_state);
|
||||
} else {
|
||||
@@ -54,7 +55,8 @@ SHIM_CALL XamUserGetSigninState_shim(PPCContext* ppc_state,
|
||||
}
|
||||
}
|
||||
|
||||
SHIM_CALL XamUserGetSigninInfo_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
SHIM_CALL XamUserGetSigninInfo_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t flags = SHIM_GET_ARG_32(1);
|
||||
uint32_t info_ptr = SHIM_GET_ARG_32(2);
|
||||
@@ -62,7 +64,7 @@ SHIM_CALL XamUserGetSigninInfo_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
XELOGD("XamUserGetSigninInfo(%d, %.8X, %.8X)", user_index, flags, info_ptr);
|
||||
|
||||
if (user_index == 0) {
|
||||
const auto& user_profile = state->user_profile();
|
||||
const auto& user_profile = kernel_state->user_profile();
|
||||
SHIM_SET_MEM_64(info_ptr + 0, user_profile->xuid());
|
||||
SHIM_SET_MEM_32(info_ptr + 8, 0); // maybe zero?
|
||||
SHIM_SET_MEM_32(info_ptr + 12, user_profile->signin_state());
|
||||
@@ -76,7 +78,8 @@ SHIM_CALL XamUserGetSigninInfo_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
}
|
||||
}
|
||||
|
||||
SHIM_CALL XamUserGetName_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
SHIM_CALL XamUserGetName_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t buffer_ptr = SHIM_GET_ARG_32(1);
|
||||
uint32_t buffer_len = SHIM_GET_ARG_32(2);
|
||||
@@ -84,7 +87,7 @@ SHIM_CALL XamUserGetName_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
XELOGD("XamUserGetName(%d, %.8X, %d)", user_index, buffer_ptr, buffer_len);
|
||||
|
||||
if (user_index == 0) {
|
||||
const auto& user_profile = state->user_profile();
|
||||
const auto& user_profile = kernel_state->user_profile();
|
||||
char* buffer = (char*)SHIM_MEM_ADDR(buffer_ptr);
|
||||
strcpy(buffer, user_profile->name().data());
|
||||
SHIM_SET_RETURN_32(0);
|
||||
@@ -94,8 +97,8 @@ SHIM_CALL XamUserGetName_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
}
|
||||
|
||||
// http://freestyledash.googlecode.com/svn/trunk/Freestyle/Tools/Generic/xboxtools.cpp
|
||||
SHIM_CALL XamUserReadProfileSettings_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamUserReadProfileSettings_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t title_id = SHIM_GET_ARG_32(0);
|
||||
uint32_t user_index = SHIM_GET_ARG_32(1);
|
||||
uint32_t unk_0 = SHIM_GET_ARG_32(2);
|
||||
@@ -105,7 +108,7 @@ SHIM_CALL XamUserReadProfileSettings_shim(PPCContext* ppc_state,
|
||||
uint32_t buffer_size_ptr = SHIM_GET_ARG_32(6);
|
||||
uint32_t buffer_ptr = SHIM_GET_ARG_32(7);
|
||||
// arg8 is in stack!
|
||||
uint32_t sp = (uint32_t)ppc_state->r[1];
|
||||
uint32_t sp = (uint32_t)ppc_context->r[1];
|
||||
uint32_t overlapped_ptr = SHIM_MEM_32(sp + 0x54);
|
||||
|
||||
uint32_t buffer_size = SHIM_MEM_32(buffer_size_ptr);
|
||||
@@ -126,14 +129,15 @@ SHIM_CALL XamUserReadProfileSettings_shim(PPCContext* ppc_state,
|
||||
if (user_index) {
|
||||
// Only support user 0.
|
||||
if (overlapped_ptr) {
|
||||
state->CompleteOverlappedImmediate(overlapped_ptr, X_ERROR_NOT_FOUND);
|
||||
kernel_state->CompleteOverlappedImmediate(overlapped_ptr,
|
||||
X_ERROR_NOT_FOUND);
|
||||
SHIM_SET_RETURN_32(X_ERROR_IO_PENDING);
|
||||
} else {
|
||||
SHIM_SET_RETURN_32(X_ERROR_NOT_FOUND);
|
||||
}
|
||||
return;
|
||||
}
|
||||
const auto& user_profile = state->user_profile();
|
||||
const auto& user_profile = kernel_state->user_profile();
|
||||
|
||||
// First call asks for size (fill buffer_size_ptr).
|
||||
// Second call asks for buffer contents with that size.
|
||||
@@ -170,8 +174,8 @@ SHIM_CALL XamUserReadProfileSettings_shim(PPCContext* ppc_state,
|
||||
if (any_missing) {
|
||||
// TODO(benvanik): don't fail? most games don't even check!
|
||||
if (overlapped_ptr) {
|
||||
state->CompleteOverlappedImmediate(overlapped_ptr,
|
||||
X_ERROR_INVALID_PARAMETER);
|
||||
kernel_state->CompleteOverlappedImmediate(overlapped_ptr,
|
||||
X_ERROR_INVALID_PARAMETER);
|
||||
SHIM_SET_RETURN_32(X_ERROR_IO_PENDING);
|
||||
} else {
|
||||
SHIM_SET_RETURN_32(X_ERROR_INVALID_PARAMETER);
|
||||
@@ -181,8 +185,8 @@ SHIM_CALL XamUserReadProfileSettings_shim(PPCContext* ppc_state,
|
||||
SHIM_SET_MEM_32(buffer_size_ptr, size_needed);
|
||||
if (!buffer_ptr || buffer_size < size_needed) {
|
||||
if (overlapped_ptr) {
|
||||
state->CompleteOverlappedImmediate(overlapped_ptr,
|
||||
X_ERROR_INSUFFICIENT_BUFFER);
|
||||
kernel_state->CompleteOverlappedImmediate(overlapped_ptr,
|
||||
X_ERROR_INSUFFICIENT_BUFFER);
|
||||
SHIM_SET_RETURN_32(X_ERROR_IO_PENDING);
|
||||
} else {
|
||||
SHIM_SET_RETURN_32(X_ERROR_INSUFFICIENT_BUFFER);
|
||||
@@ -215,15 +219,15 @@ SHIM_CALL XamUserReadProfileSettings_shim(PPCContext* ppc_state,
|
||||
}
|
||||
|
||||
if (overlapped_ptr) {
|
||||
state->CompleteOverlappedImmediate(overlapped_ptr, X_ERROR_SUCCESS);
|
||||
kernel_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 XamUserWriteProfileSettings_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamUserWriteProfileSettings_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t unknown = SHIM_GET_ARG_32(1);
|
||||
uint32_t setting_count = SHIM_GET_ARG_32(2);
|
||||
@@ -237,8 +241,8 @@ SHIM_CALL XamUserWriteProfileSettings_shim(PPCContext* ppc_state,
|
||||
|
||||
if (!setting_count || !settings_ptr) {
|
||||
if (overlapped_ptr) {
|
||||
state->CompleteOverlappedImmediate(overlapped_ptr,
|
||||
X_ERROR_INVALID_PARAMETER);
|
||||
kernel_state->CompleteOverlappedImmediate(overlapped_ptr,
|
||||
X_ERROR_INVALID_PARAMETER);
|
||||
SHIM_SET_RETURN_32(X_ERROR_IO_PENDING);
|
||||
} else {
|
||||
SHIM_SET_RETURN_32(X_ERROR_INVALID_PARAMETER);
|
||||
@@ -256,20 +260,20 @@ SHIM_CALL XamUserWriteProfileSettings_shim(PPCContext* ppc_state,
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& user_profile = state->user_profile();
|
||||
const auto& user_profile = kernel_state->user_profile();
|
||||
|
||||
// TODO: Update and save settings.
|
||||
|
||||
if (overlapped_ptr) {
|
||||
state->CompleteOverlappedImmediate(overlapped_ptr, X_ERROR_SUCCESS);
|
||||
kernel_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 XamUserCheckPrivilege_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamUserCheckPrivilege_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t mask = SHIM_GET_ARG_32(1);
|
||||
uint32_t out_value_ptr = SHIM_GET_ARG_32(2);
|
||||
@@ -283,8 +287,8 @@ SHIM_CALL XamUserCheckPrivilege_shim(PPCContext* ppc_state,
|
||||
SHIM_SET_RETURN_32(X_ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
SHIM_CALL XamUserAreUsersFriends_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamUserAreUsersFriends_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t unk1 = SHIM_GET_ARG_32(1);
|
||||
uint32_t unk2 = SHIM_GET_ARG_32(2);
|
||||
@@ -308,7 +312,7 @@ SHIM_CALL XamUserAreUsersFriends_shim(PPCContext* ppc_state,
|
||||
|
||||
X_RESULT result = X_ERROR_SUCCESS;
|
||||
|
||||
const auto& user_profile = state->user_profile();
|
||||
const auto& user_profile = kernel_state->user_profile();
|
||||
if (user_profile->signin_state() == 0) {
|
||||
result = X_ERROR_NOT_LOGGED_ON;
|
||||
}
|
||||
@@ -317,14 +321,15 @@ SHIM_CALL XamUserAreUsersFriends_shim(PPCContext* ppc_state,
|
||||
SHIM_SET_MEM_32(out_value_ptr, 0);
|
||||
|
||||
if (overlapped_ptr) {
|
||||
state->CompleteOverlappedImmediate(overlapped_ptr, result);
|
||||
kernel_state->CompleteOverlappedImmediate(overlapped_ptr, result);
|
||||
SHIM_SET_RETURN_32(X_ERROR_IO_PENDING);
|
||||
} else {
|
||||
SHIM_SET_RETURN_32(result);
|
||||
}
|
||||
}
|
||||
|
||||
SHIM_CALL XamShowSigninUI_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
SHIM_CALL XamShowSigninUI_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t unk_0 = SHIM_GET_ARG_32(0);
|
||||
uint32_t unk_mask = SHIM_GET_ARG_32(1);
|
||||
|
||||
@@ -332,13 +337,13 @@ SHIM_CALL XamShowSigninUI_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
|
||||
// Mask values vary. Probably matching user types? Local/remote?
|
||||
// Games seem to sit and loop until we trigger this notification.
|
||||
state->BroadcastNotification(0x00000009, 0);
|
||||
kernel_state->BroadcastNotification(0x00000009, 0);
|
||||
|
||||
SHIM_SET_RETURN_32(X_ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
SHIM_CALL XamUserCreateAchievementEnumerator_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamUserCreateAchievementEnumerator_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t title_id = SHIM_GET_ARG_32(0);
|
||||
uint32_t user_index = SHIM_GET_ARG_32(1);
|
||||
uint32_t xuid = SHIM_GET_ARG_32(2);
|
||||
@@ -359,7 +364,7 @@ SHIM_CALL XamUserCreateAchievementEnumerator_shim(PPCContext* ppc_state,
|
||||
SHIM_SET_MEM_32(buffer_size_ptr, 64 * count);
|
||||
}
|
||||
|
||||
auto e = new XStaticEnumerator(state, count, 64);
|
||||
auto e = new XStaticEnumerator(kernel_state, count, 64);
|
||||
e->Initialize();
|
||||
|
||||
SHIM_SET_MEM_32(handle_ptr, e->handle());
|
||||
@@ -367,7 +372,8 @@ SHIM_CALL XamUserCreateAchievementEnumerator_shim(PPCContext* ppc_state,
|
||||
SHIM_SET_RETURN_32(X_ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
SHIM_CALL XamParseGamerTileKey_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
SHIM_CALL XamParseGamerTileKey_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_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);
|
||||
@@ -383,7 +389,8 @@ SHIM_CALL XamParseGamerTileKey_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
SHIM_SET_RETURN_32(X_ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
SHIM_CALL XamReadTileToTexture_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
SHIM_CALL XamReadTileToTexture_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_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
|
||||
@@ -397,14 +404,15 @@ SHIM_CALL XamReadTileToTexture_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
unk2, unk3, buffer_ptr, stride, height, overlapped_ptr);
|
||||
|
||||
if (overlapped_ptr) {
|
||||
state->CompleteOverlappedImmediate(overlapped_ptr, X_ERROR_SUCCESS);
|
||||
kernel_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) {
|
||||
SHIM_CALL XamWriteGamerTile_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t arg0 = SHIM_GET_ARG_32(0);
|
||||
uint32_t arg1 = SHIM_GET_ARG_32(1);
|
||||
uint32_t arg2 = SHIM_GET_ARG_32(2);
|
||||
@@ -416,15 +424,15 @@ SHIM_CALL XamWriteGamerTile_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
arg2, arg3, arg4, overlapped_ptr);
|
||||
|
||||
if (overlapped_ptr) {
|
||||
state->CompleteOverlappedImmediate(overlapped_ptr, X_ERROR_SUCCESS);
|
||||
kernel_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 XamSessionCreateHandle_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamSessionCreateHandle_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t handle_ptr = SHIM_GET_ARG_32(0);
|
||||
|
||||
XELOGD("XamSessionCreateHandle(%.8X)", handle_ptr);
|
||||
@@ -434,8 +442,8 @@ SHIM_CALL XamSessionCreateHandle_shim(PPCContext* ppc_state,
|
||||
SHIM_SET_RETURN_32(X_ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
SHIM_CALL XamSessionRefObjByHandle_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamSessionRefObjByHandle_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t handle = SHIM_GET_ARG_32(0);
|
||||
uint32_t obj_ptr = SHIM_GET_ARG_32(1);
|
||||
|
||||
@@ -452,7 +460,7 @@ SHIM_CALL XamSessionRefObjByHandle_shim(PPCContext* ppc_state,
|
||||
} // namespace xe
|
||||
|
||||
void xe::kernel::xam::RegisterUserExports(
|
||||
xe::cpu::ExportResolver* export_resolver, KernelState* state) {
|
||||
xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {
|
||||
SHIM_SET_MAPPING("xam.xex", XamUserGetXUID, state);
|
||||
SHIM_SET_MAPPING("xam.xex", XamUserGetSigninState, state);
|
||||
SHIM_SET_MAPPING("xam.xex", XamUserGetSigninInfo, state);
|
||||
|
||||
Reference in New Issue
Block a user