Fix compiler errors i introduced under clang-cl

remove xe_kernel_export_shim_fn field of Export function_data, trampoline is now the only way exports get invoked
Remove kernelstate argument from string functions in order to conform to the trampoline signature (the argument was unused anyway)
Constant-evaluated initialization of ppc_opcode_disasm_table, removal of unused std::vector fields
Constant-evaluated initialization of export tables
name field on export is just a const char* now, only immutable static strings are ever passed to it
Remove unused callcount field of export.
PM4 compare op function extracted
Globally apply /Oy, /GS-, /Gw on msvc windows
Remove imgui testwindow code call, it took up like 300 kb
This commit is contained in:
chss95cs@gmail.com
2022-09-29 07:04:17 -07:00
parent 203267b106
commit 7e58a3b320
20 changed files with 140 additions and 204 deletions

View File

@@ -824,7 +824,7 @@ class WideCountFormatData : public FormatData {
int32_t count_;
};
SHIM_CALL DbgPrint_entry(PPCContext* ppc_context, KernelState* kernel_state) {
SHIM_CALL DbgPrint_entry(PPCContext* ppc_context) {
uint32_t format_ptr = SHIM_GET_ARG_32(0);
if (!format_ptr) {
SHIM_SET_RETURN_32(X_STATUS_INVALID_PARAMETER);
@@ -854,7 +854,7 @@ SHIM_CALL DbgPrint_entry(PPCContext* ppc_context, KernelState* kernel_state) {
}
// https://msdn.microsoft.com/en-us/library/2ts7cx93.aspx
SHIM_CALL _snprintf_entry(PPCContext* ppc_context, KernelState* kernel_state) {
SHIM_CALL _snprintf_entry(PPCContext* ppc_context) {
uint32_t buffer_ptr = SHIM_GET_ARG_32(0);
int32_t buffer_count = SHIM_GET_ARG_32(1);
uint32_t format_ptr = SHIM_GET_ARG_32(2);
@@ -894,7 +894,7 @@ SHIM_CALL _snprintf_entry(PPCContext* ppc_context, KernelState* kernel_state) {
}
// https://msdn.microsoft.com/en-us/library/ybk95axf.aspx
SHIM_CALL sprintf_entry(PPCContext* ppc_context, KernelState* kernel_state) {
SHIM_CALL sprintf_entry(PPCContext* ppc_context) {
uint32_t buffer_ptr = SHIM_GET_ARG_32(0);
uint32_t format_ptr = SHIM_GET_ARG_32(1);
@@ -925,7 +925,7 @@ SHIM_CALL sprintf_entry(PPCContext* ppc_context, KernelState* kernel_state) {
}
// https://msdn.microsoft.com/en-us/library/2ts7cx93.aspx
SHIM_CALL _snwprintf_entry(PPCContext* ppc_context, KernelState* kernel_state) {
SHIM_CALL _snwprintf_entry(PPCContext* ppc_context) {
uint32_t buffer_ptr = SHIM_GET_ARG_32(0);
int32_t buffer_count = SHIM_GET_ARG_32(1);
uint32_t format_ptr = SHIM_GET_ARG_32(2);
@@ -966,7 +966,7 @@ SHIM_CALL _snwprintf_entry(PPCContext* ppc_context, KernelState* kernel_state) {
}
// https://msdn.microsoft.com/en-us/library/ybk95axf.aspx
SHIM_CALL swprintf_entry(PPCContext* ppc_context, KernelState* kernel_state) {
SHIM_CALL swprintf_entry(PPCContext* ppc_context) {
uint32_t buffer_ptr = SHIM_GET_ARG_32(0);
uint32_t format_ptr = SHIM_GET_ARG_32(1);
@@ -998,7 +998,7 @@ SHIM_CALL swprintf_entry(PPCContext* ppc_context, KernelState* kernel_state) {
}
// https://msdn.microsoft.com/en-us/library/1kt27hek.aspx
SHIM_CALL _vsnprintf_entry(PPCContext* ppc_context, KernelState* kernel_state) {
SHIM_CALL _vsnprintf_entry(PPCContext* ppc_context) {
uint32_t buffer_ptr = SHIM_GET_ARG_32(0);
int32_t buffer_count = SHIM_GET_ARG_32(1);
uint32_t format_ptr = SHIM_GET_ARG_32(2);
@@ -1087,7 +1087,7 @@ SHIM_CALL _vsnwprintf_entry(PPCContext* ppc_context,
}
// https://msdn.microsoft.com/en-us/library/28d5ce15.aspx
SHIM_CALL vsprintf_entry(PPCContext* ppc_context, KernelState* kernel_state) {
SHIM_CALL vsprintf_entry(PPCContext* ppc_context) {
uint32_t buffer_ptr = SHIM_GET_ARG_32(0);
uint32_t format_ptr = SHIM_GET_ARG_32(1);
uint32_t arg_ptr = SHIM_GET_ARG_32(2);
@@ -1147,7 +1147,7 @@ SHIM_CALL _vscwprintf_entry(PPCContext* ppc_context,
}
// https://msdn.microsoft.com/en-us/library/28d5ce15.aspx
SHIM_CALL vswprintf_entry(PPCContext* ppc_context, KernelState* kernel_state) {
SHIM_CALL vswprintf_entry(PPCContext* ppc_context) {
uint32_t buffer_ptr = SHIM_GET_ARG_32(0);
uint32_t format_ptr = SHIM_GET_ARG_32(1);
uint32_t arg_ptr = SHIM_GET_ARG_32(2);
@@ -1179,7 +1179,7 @@ SHIM_CALL vswprintf_entry(PPCContext* ppc_context, KernelState* kernel_state) {
}
SHIM_SET_RETURN_32(count);
}
#if 1
void RegisterStringExports(xe::cpu::ExportResolver* export_resolver,
KernelState* state) {
SHIM_SET_MAPPING("xboxkrnl.exe", DbgPrint, state);
@@ -1193,7 +1193,7 @@ void RegisterStringExports(xe::cpu::ExportResolver* export_resolver,
SHIM_SET_MAPPING("xboxkrnl.exe", vswprintf, state);
SHIM_SET_MAPPING("xboxkrnl.exe", _vsnwprintf, state);
}
#endif
} // namespace xboxkrnl
} // namespace kernel
} // namespace xe