Mass renaming. I love clang-format.
This commit is contained in:
@@ -28,8 +28,8 @@ static const DeviceInfo dummy_device_info_ = {
|
||||
0xF00D0000, 1, 1024 * 1024 * 1024, 1024 * 1024 * 1024, L"Dummy HDD",
|
||||
};
|
||||
|
||||
SHIM_CALL XamContentGetLicenseMask_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamContentGetLicenseMask_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t mask_ptr = SHIM_GET_ARG_32(0);
|
||||
uint32_t overlapped_ptr = SHIM_GET_ARG_32(1);
|
||||
|
||||
@@ -41,15 +41,15 @@ SHIM_CALL XamContentGetLicenseMask_shim(PPCContext* ppc_state,
|
||||
SHIM_SET_MEM_32(mask_ptr, 0xFFFFFFFF);
|
||||
|
||||
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 XamShowDeviceSelectorUI_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamShowDeviceSelectorUI_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t content_type = SHIM_GET_ARG_32(1);
|
||||
uint32_t content_flags = SHIM_GET_ARG_32(2);
|
||||
@@ -75,15 +75,15 @@ SHIM_CALL XamShowDeviceSelectorUI_shim(PPCContext* ppc_state,
|
||||
|
||||
X_RESULT result = X_ERROR_SUCCESS;
|
||||
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 XamContentGetDeviceName_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamContentGetDeviceName_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t device_id = SHIM_GET_ARG_32(0);
|
||||
uint32_t name_ptr = SHIM_GET_ARG_32(1);
|
||||
uint32_t name_capacity = SHIM_GET_ARG_32(2);
|
||||
@@ -107,8 +107,8 @@ SHIM_CALL XamContentGetDeviceName_shim(PPCContext* ppc_state,
|
||||
SHIM_SET_RETURN_32(X_ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
SHIM_CALL XamContentGetDeviceState_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamContentGetDeviceState_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t device_id = SHIM_GET_ARG_32(0);
|
||||
uint32_t overlapped_ptr = SHIM_GET_ARG_32(1);
|
||||
|
||||
@@ -116,9 +116,9 @@ SHIM_CALL XamContentGetDeviceState_shim(PPCContext* ppc_state,
|
||||
|
||||
if ((device_id & 0xFFFF0000) != dummy_device_info_.device_id) {
|
||||
if (overlapped_ptr) {
|
||||
state->CompleteOverlappedImmediateEx(overlapped_ptr,
|
||||
X_ERROR_FUNCTION_FAILED,
|
||||
X_ERROR_DEVICE_NOT_CONNECTED, 0);
|
||||
kernel_state->CompleteOverlappedImmediateEx(
|
||||
overlapped_ptr, X_ERROR_FUNCTION_FAILED, X_ERROR_DEVICE_NOT_CONNECTED,
|
||||
0);
|
||||
SHIM_SET_RETURN_32(X_ERROR_IO_PENDING);
|
||||
} else {
|
||||
SHIM_SET_RETURN_32(X_ERROR_DEVICE_NOT_CONNECTED);
|
||||
@@ -127,15 +127,15 @@ SHIM_CALL XamContentGetDeviceState_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 XamContentGetDeviceData_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamContentGetDeviceData_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t device_id = SHIM_GET_ARG_32(0);
|
||||
uint32_t device_data_ptr = SHIM_GET_ARG_32(1);
|
||||
|
||||
@@ -158,7 +158,8 @@ SHIM_CALL XamContentGetDeviceData_shim(PPCContext* ppc_state,
|
||||
SHIM_SET_RETURN_32(X_ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
SHIM_CALL XamContentResolve_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
SHIM_CALL XamContentResolve_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t content_data_ptr = SHIM_GET_ARG_32(1);
|
||||
uint32_t buffer_ptr = SHIM_GET_ARG_32(2);
|
||||
@@ -182,8 +183,8 @@ SHIM_CALL XamContentResolve_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
}
|
||||
|
||||
// http://gameservice.googlecode.com/svn-history/r14/trunk/ContentManager.cpp
|
||||
SHIM_CALL XamContentCreateEnumerator_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamContentCreateEnumerator_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t device_id = SHIM_GET_ARG_32(1);
|
||||
uint32_t content_type = SHIM_GET_ARG_32(2);
|
||||
@@ -210,12 +211,13 @@ SHIM_CALL XamContentCreateEnumerator_shim(PPCContext* ppc_state,
|
||||
SHIM_SET_MEM_32(buffer_size_ptr, item_count * XCONTENT_DATA::kSize);
|
||||
}
|
||||
|
||||
auto e = new XStaticEnumerator(state, item_count, XCONTENT_DATA::kSize);
|
||||
auto e =
|
||||
new XStaticEnumerator(kernel_state, item_count, XCONTENT_DATA::kSize);
|
||||
e->Initialize();
|
||||
|
||||
// Get all content data.
|
||||
auto content_datas =
|
||||
state->content_manager()->ListContent(device_id, content_type);
|
||||
kernel_state->content_manager()->ListContent(device_id, content_type);
|
||||
for (auto& content_data : content_datas) {
|
||||
auto ptr = e->AppendItem();
|
||||
if (!ptr) {
|
||||
@@ -230,7 +232,7 @@ SHIM_CALL XamContentCreateEnumerator_shim(PPCContext* ppc_state,
|
||||
SHIM_SET_RETURN_32(X_ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
void XamContentCreateCore(PPCContext* ppc_state, KernelState* state,
|
||||
void XamContentCreateCore(PPCContext* ppc_context, KernelState* kernel_state,
|
||||
uint32_t user_index, std::string root_name,
|
||||
XCONTENT_DATA content_data, uint32_t flags,
|
||||
uint32_t disposition_ptr, uint32_t license_mask_ptr,
|
||||
@@ -240,7 +242,7 @@ void XamContentCreateCore(PPCContext* ppc_state, KernelState* state,
|
||||
|
||||
X_RESULT result = X_ERROR_INVALID_PARAMETER;
|
||||
|
||||
auto content_manager = state->content_manager();
|
||||
auto content_manager = kernel_state->content_manager();
|
||||
bool create = false;
|
||||
bool open = false;
|
||||
switch (flags & 0xF) {
|
||||
@@ -308,15 +310,16 @@ void XamContentCreateCore(PPCContext* ppc_state, KernelState* state,
|
||||
}
|
||||
|
||||
if (overlapped_ptr) {
|
||||
state->CompleteOverlappedImmediateEx(overlapped_ptr, disposition, result,
|
||||
0);
|
||||
kernel_state->CompleteOverlappedImmediateEx(overlapped_ptr, disposition,
|
||||
result, 0);
|
||||
SHIM_SET_RETURN_32(X_ERROR_IO_PENDING);
|
||||
} else {
|
||||
SHIM_SET_RETURN_32(result);
|
||||
}
|
||||
}
|
||||
|
||||
SHIM_CALL XamContentCreate_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
SHIM_CALL XamContentCreate_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t root_name_ptr = SHIM_GET_ARG_32(1);
|
||||
uint32_t content_data_ptr = SHIM_GET_ARG_32(2);
|
||||
@@ -332,12 +335,13 @@ SHIM_CALL XamContentCreate_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
user_index, root_name_ptr, root_name.c_str(), content_data_ptr, flags,
|
||||
disposition_ptr, license_mask_ptr, overlapped_ptr);
|
||||
|
||||
XamContentCreateCore(ppc_state, state, user_index, root_name, content_data,
|
||||
flags, disposition_ptr, license_mask_ptr, 0, 0,
|
||||
overlapped_ptr);
|
||||
XamContentCreateCore(ppc_context, kernel_state, user_index, root_name,
|
||||
content_data, flags, disposition_ptr, license_mask_ptr,
|
||||
0, 0, overlapped_ptr);
|
||||
}
|
||||
|
||||
SHIM_CALL XamContentCreateEx_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
SHIM_CALL XamContentCreateEx_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t root_name_ptr = SHIM_GET_ARG_32(1);
|
||||
uint32_t content_data_ptr = SHIM_GET_ARG_32(2);
|
||||
@@ -346,7 +350,7 @@ SHIM_CALL XamContentCreateEx_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
uint32_t license_mask_ptr = SHIM_GET_ARG_32(5);
|
||||
uint32_t cache_size = SHIM_GET_ARG_32(6);
|
||||
uint64_t content_size = SHIM_GET_ARG_64(7);
|
||||
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);
|
||||
|
||||
auto root_name = xe::load_and_swap<std::string>(SHIM_MEM_ADDR(root_name_ptr));
|
||||
@@ -359,12 +363,13 @@ SHIM_CALL XamContentCreateEx_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
disposition_ptr, license_mask_ptr, cache_size, content_size,
|
||||
overlapped_ptr);
|
||||
|
||||
XamContentCreateCore(ppc_state, state, user_index, root_name, content_data,
|
||||
flags, disposition_ptr, license_mask_ptr, cache_size,
|
||||
content_size, overlapped_ptr);
|
||||
XamContentCreateCore(ppc_context, kernel_state, user_index, root_name,
|
||||
content_data, flags, disposition_ptr, license_mask_ptr,
|
||||
cache_size, content_size, overlapped_ptr);
|
||||
}
|
||||
|
||||
SHIM_CALL XamContentFlush_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
SHIM_CALL XamContentFlush_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t root_name_ptr = SHIM_GET_ARG_32(0);
|
||||
uint32_t overlapped_ptr = SHIM_GET_ARG_32(1);
|
||||
|
||||
@@ -375,14 +380,15 @@ SHIM_CALL XamContentFlush_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
|
||||
X_RESULT result = X_ERROR_SUCCESS;
|
||||
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 XamContentClose_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
SHIM_CALL XamContentClose_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t root_name_ptr = SHIM_GET_ARG_32(0);
|
||||
uint32_t overlapped_ptr = SHIM_GET_ARG_32(1);
|
||||
|
||||
@@ -392,17 +398,18 @@ SHIM_CALL XamContentClose_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
overlapped_ptr);
|
||||
|
||||
// Closes a previously opened root from XamContentCreate*.
|
||||
auto result = state->content_manager()->CloseContent(root_name);
|
||||
auto result = kernel_state->content_manager()->CloseContent(root_name);
|
||||
|
||||
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 XamContentGetCreator_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
SHIM_CALL XamContentGetCreator_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t content_data_ptr = SHIM_GET_ARG_32(1);
|
||||
uint32_t is_creator_ptr = SHIM_GET_ARG_32(2);
|
||||
@@ -420,7 +427,7 @@ SHIM_CALL XamContentGetCreator_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
// User always creates saves.
|
||||
SHIM_SET_MEM_32(is_creator_ptr, 1);
|
||||
if (creator_xuid_ptr) {
|
||||
SHIM_SET_MEM_64(creator_xuid_ptr, state->user_profile()->xuid());
|
||||
SHIM_SET_MEM_64(creator_xuid_ptr, kernel_state->user_profile()->xuid());
|
||||
}
|
||||
} else {
|
||||
SHIM_SET_MEM_32(is_creator_ptr, 0);
|
||||
@@ -430,15 +437,15 @@ SHIM_CALL XamContentGetCreator_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
}
|
||||
|
||||
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 XamContentGetThumbnail_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamContentGetThumbnail_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t content_data_ptr = SHIM_GET_ARG_32(1);
|
||||
uint32_t buffer_ptr = SHIM_GET_ARG_32(2);
|
||||
@@ -455,8 +462,8 @@ SHIM_CALL XamContentGetThumbnail_shim(PPCContext* ppc_state,
|
||||
|
||||
// Get thumbnail (if it exists).
|
||||
std::vector<uint8_t> buffer;
|
||||
auto result =
|
||||
state->content_manager()->GetContentThumbnail(content_data, &buffer);
|
||||
auto result = kernel_state->content_manager()->GetContentThumbnail(
|
||||
content_data, &buffer);
|
||||
|
||||
SHIM_SET_MEM_32(buffer_size_ptr, uint32_t(buffer.size()));
|
||||
|
||||
@@ -475,15 +482,15 @@ SHIM_CALL XamContentGetThumbnail_shim(PPCContext* ppc_state,
|
||||
}
|
||||
|
||||
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 XamContentSetThumbnail_shim(PPCContext* ppc_state,
|
||||
KernelState* state) {
|
||||
SHIM_CALL XamContentSetThumbnail_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t content_data_ptr = SHIM_GET_ARG_32(1);
|
||||
uint32_t buffer_ptr = SHIM_GET_ARG_32(2);
|
||||
@@ -498,18 +505,19 @@ SHIM_CALL XamContentSetThumbnail_shim(PPCContext* ppc_state,
|
||||
// Buffer is PNG data.
|
||||
auto buffer = std::vector<uint8_t>(SHIM_MEM_ADDR(buffer_ptr),
|
||||
SHIM_MEM_ADDR(buffer_ptr) + buffer_size);
|
||||
auto result = state->content_manager()->SetContentThumbnail(
|
||||
auto result = kernel_state->content_manager()->SetContentThumbnail(
|
||||
content_data, std::move(buffer));
|
||||
|
||||
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 XamContentDelete_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
SHIM_CALL XamContentDelete_shim(PPCContext* ppc_context,
|
||||
KernelState* kernel_state) {
|
||||
uint32_t user_index = SHIM_GET_ARG_32(0);
|
||||
uint32_t content_data_ptr = SHIM_GET_ARG_32(1);
|
||||
uint32_t overlapped_ptr = SHIM_GET_ARG_32(2);
|
||||
@@ -519,10 +527,10 @@ SHIM_CALL XamContentDelete_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
XELOGD("XamContentDelete(%d, %.8X, %.8X)", user_index, content_data_ptr,
|
||||
overlapped_ptr);
|
||||
|
||||
auto result = state->content_manager()->DeleteContent(content_data);
|
||||
auto result = kernel_state->content_manager()->DeleteContent(content_data);
|
||||
|
||||
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);
|
||||
@@ -533,7 +541,7 @@ SHIM_CALL XamContentDelete_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
} // namespace xe
|
||||
|
||||
void xe::kernel::xam::RegisterContentExports(
|
||||
xe::cpu::ExportResolver* export_resolver, KernelState* state) {
|
||||
xe::cpu::ExportResolver* export_resolver, KernelState* kernel_state) {
|
||||
SHIM_SET_MAPPING("xam.xex", XamContentGetLicenseMask, state);
|
||||
SHIM_SET_MAPPING("xam.xex", XamShowDeviceSelectorUI, state);
|
||||
SHIM_SET_MAPPING("xam.xex", XamContentGetDeviceName, state);
|
||||
|
||||
Reference in New Issue
Block a user