format shim conversion on some files

xam_info.cc, xam_msg.cc, xam_notify.cc, xboxkrnl_memory.cc,
xboxkrnl_misc.cc
This commit is contained in:
Megamouse
2017-03-27 22:43:03 +02:00
parent 46504adcc0
commit c38accbb76
5 changed files with 198 additions and 357 deletions

View File

@@ -18,46 +18,32 @@ namespace xe {
namespace kernel {
namespace xam {
SHIM_CALL XamNotifyCreateListener_shim(PPCContext* ppc_context,
KernelState* kernel_state) {
uint64_t mask = SHIM_GET_ARG_64(0);
uint32_t one = SHIM_GET_ARG_32(1);
XELOGD("XamNotifyCreateListener(%.8llX, %d)", mask, one);
dword_result_t XamNotifyCreateListener(qword_t mask, dword_t one) {
// r4=1 may indicate user process?
auto listener = object_ref<NotifyListener>(new NotifyListener(kernel_state));
auto listener =
object_ref<NotifyListener>(new NotifyListener(kernel_state()));
listener->Initialize(mask);
// Handle ref is incremented, so return that.
uint32_t handle = listener->handle();
SHIM_SET_RETURN_32(handle);
return handle;
}
DECLARE_XAM_EXPORT(XamNotifyCreateListener, ExportTag::kImplemented);
// http://ffplay360.googlecode.com/svn/Test/Common/AtgSignIn.cpp
SHIM_CALL XNotifyGetNext_shim(PPCContext* ppc_context,
KernelState* kernel_state) {
uint32_t handle = SHIM_GET_ARG_32(0);
uint32_t match_id = SHIM_GET_ARG_32(1);
uint32_t id_ptr = SHIM_GET_ARG_32(2);
uint32_t param_ptr = SHIM_GET_ARG_32(3);
XELOGD("XNotifyGetNext(%.8X, %.8X, %.8X, %.8X)", handle, match_id, id_ptr,
param_ptr);
dword_result_t XNotifyGetNext(dword_t handle, dword_t match_id,
lpdword_t id_ptr, lpdword_t param_ptr) {
if (!handle) {
SHIM_SET_RETURN_32(0);
return;
return 0;
}
// Grab listener.
auto listener =
kernel_state->object_table()->LookupObject<NotifyListener>(handle);
kernel_state()->object_table()->LookupObject<NotifyListener>(handle);
if (!listener) {
SHIM_SET_RETURN_32(0);
return;
return 0;
}
bool dequeued = false;
@@ -73,43 +59,31 @@ SHIM_CALL XNotifyGetNext_shim(PPCContext* ppc_context,
}
if (dequeued) {
SHIM_SET_MEM_32(id_ptr, id);
SHIM_SET_MEM_32(param_ptr, param);
*id_ptr = id;
*param_ptr = param;
} else {
SHIM_SET_MEM_32(id_ptr, 0);
SHIM_SET_MEM_32(param_ptr, 0);
*id_ptr = 0;
*param_ptr = 0;
}
SHIM_SET_RETURN_32(dequeued ? 1 : 0);
return dequeued ? 1 : 0;
}
DECLARE_XAM_EXPORT(XNotifyGetNext, ExportTag::kImplemented);
SHIM_CALL XNotifyDelayUI_shim(PPCContext* ppc_context,
KernelState* kernel_state) {
uint32_t delay_ms = SHIM_GET_ARG_32(0);
XELOGD("XNotifyDelayUI(%d)", delay_ms);
dword_result_t XNotifyDelayUI(dword_t delay_ms) {
// Ignored.
SHIM_SET_RETURN_32(0);
return 0;
}
DECLARE_XAM_EXPORT(XNotifyDelayUI, ExportTag::kStub);
SHIM_CALL XNotifyPositionUI_shim(PPCContext* ppc_context,
KernelState* kernel_state) {
uint32_t position = SHIM_GET_ARG_32(0);
XELOGD("XNotifyPositionUI(%.8X)", position);
void XNotifyPositionUI(dword_t position) {
// Ignored.
}
DECLARE_XAM_EXPORT(XNotifyPositionUI, ExportTag::kStub);
void RegisterNotifyExports(xe::cpu::ExportResolver* export_resolver,
KernelState* kernel_state) {
SHIM_SET_MAPPING("xam.xex", XamNotifyCreateListener, state);
SHIM_SET_MAPPING("xam.xex", XNotifyGetNext, state);
SHIM_SET_MAPPING("xam.xex", XNotifyDelayUI, state);
SHIM_SET_MAPPING("xam.xex", XNotifyPositionUI, state);
}
KernelState* kernel_state) {}
} // namespace xam
} // namespace kernel
} // namespace xe
} // namespace xe