From eba44261c79dfe20c9aac47b8ad4c46a07ca734e Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Fri, 28 Apr 2017 19:03:24 +0300 Subject: [PATCH] Preserve original function names --- rpcs3/Emu/Cell/PPUModule.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUModule.h b/rpcs3/Emu/Cell/PPUModule.h index 99327ec1ef..3df05d87da 100644 --- a/rpcs3/Emu/Cell/PPUModule.h +++ b/rpcs3/Emu/Cell/PPUModule.h @@ -4,7 +4,17 @@ #include "PPUCallback.h" #include "ErrorCodes.h" -#include +// Helper function +constexpr const char* ppu_select_name(const char* name, u32 id) +{ + return name; +} + +// Helper function +constexpr const char* ppu_select_name(const char* name, const char* orig_name) +{ + return orig_name; +} // Generate FNID or VNID for given name extern u32 ppu_generate_id(const char* name); @@ -226,11 +236,11 @@ inline RT ppu_execute_function_or_callback(const char* name, ppu_thread& ppu, Ar #define CALL_FUNC(ppu, func, ...) ppu_execute_function_or_callback(#func, ppu, __VA_ARGS__) -#define REG_FNID(module, nid, func) ppu_module_manager::register_static_function(#module, #func, BIND_FUNC(func), ppu_generate_id(nid)) +#define REG_FNID(module, nid, func) ppu_module_manager::register_static_function(#module, ppu_select_name(#func, nid), BIND_FUNC(func), ppu_generate_id(nid)) #define REG_FUNC(module, func) REG_FNID(module, #func, func) -#define REG_VNID(module, nid, var) ppu_module_manager::register_static_variable(#module, #var, ppu_generate_id(nid)) +#define REG_VNID(module, nid, var) ppu_module_manager::register_static_variable(#module, ppu_select_name(#var, nid), ppu_generate_id(nid)) #define REG_VAR(module, var) REG_VNID(module, #var, var)