From 8209e6c1e3ac1b2f1b25daacb3cb444618506637 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 9 May 2017 18:17:55 +0300 Subject: [PATCH] ppu_initialize_syscalls draft --- rpcs3/Emu/Cell/PPUModule.cpp | 3 +++ rpcs3/Emu/Cell/lv2/lv2.cpp | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/PPUModule.cpp b/rpcs3/Emu/Cell/PPUModule.cpp index 7ea600d30e..d3ba2f2639 100644 --- a/rpcs3/Emu/Cell/PPUModule.cpp +++ b/rpcs3/Emu/Cell/PPUModule.cpp @@ -142,6 +142,7 @@ cfg::set_entry g_cfg_load_libs(cfg::root.core, "Load libraries"); extern cfg::map_entry g_cfg_ppu_decoder; +extern void ppu_initialize_syscalls(); extern std::string ppu_get_function_name(const std::string& module, u32 fnid); extern std::string ppu_get_variable_name(const std::string& module, u32 vnid); extern void ppu_register_range(u32 addr, u32 size); @@ -234,6 +235,8 @@ struct ppu_linkage_info // Initialize static modules. static void ppu_initialize_modules(const std::shared_ptr& link) { + ppu_initialize_syscalls(); + const std::initializer_list registered { &ppu_module_manager::cellAdec, diff --git a/rpcs3/Emu/Cell/lv2/lv2.cpp b/rpcs3/Emu/Cell/lv2/lv2.cpp index dcced8143d..907da6be88 100644 --- a/rpcs3/Emu/Cell/lv2/lv2.cpp +++ b/rpcs3/Emu/Cell/lv2/lv2.cpp @@ -62,12 +62,14 @@ extern std::string ppu_get_syscall_name(u64 code); static constexpr ppu_function_t null_func = nullptr; +std::array g_ppu_syscall_table{}; + // UNS = Unused // ROOT = Root // DBG = Debug // PM = Product Mode // AuthID = Authentication ID -std::array g_ppu_syscall_table +const std::array s_ppu_syscall_table { null_func, BIND_FUNC(sys_process_getpid), //1 (0x001) @@ -986,6 +988,11 @@ void fmt_class_string::format(std::string& out, u64 arg) }); } +extern void ppu_initialize_syscalls() +{ + g_ppu_syscall_table = s_ppu_syscall_table; +} + extern void ppu_execute_syscall(ppu_thread& ppu, u64 code) { if (code < g_ppu_syscall_table.size())