From c273c0e42b1511c1e7efd467fca2031055176b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandro=20S=C3=A1nchez=20Bach?= Date: Tue, 19 Aug 2014 12:14:26 +0200 Subject: [PATCH] Minor sys_prx update --- rpcs3/Emu/SysCalls/lv2/sys_prx.cpp | 25 +++++++++++++++++++------ rpcs3/Emu/SysCalls/lv2/sys_prx.h | 10 +++++----- rpcs3/Gui/KernelExplorer.cpp | 2 +- rpcs3/Gui/KernelExplorer.h | 1 - rpcs3/Loader/ELF64.cpp | 3 +-- 5 files changed, 26 insertions(+), 15 deletions(-) diff --git a/rpcs3/Emu/SysCalls/lv2/sys_prx.cpp b/rpcs3/Emu/SysCalls/lv2/sys_prx.cpp index 2d46a178fb..5e8370b730 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_prx.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_prx.cpp @@ -4,6 +4,7 @@ #include "Emu/System.h" #include "Emu/SysCalls/SysCalls.h" #include "Emu/FS/vfsFile.h" +#include "Crypto/unself.h" #include "sys_prx.h" SysCallBase sys_prx("sys_prx"); @@ -13,18 +14,30 @@ s32 sys_prx_load_module(u32 path_addr, u64 flags, mem_ptr_tsize = f.GetSize(); + prx->address = Memory.Alloc(prx->size, 4); + prx->path = path; + + // Load the PRX into memory + f.Read(Memory.VirtualToRealAddr(prx->address), prx->size); + u32 id = sys_prx.GetNewId(prx, TYPE_PRX); return id; } diff --git a/rpcs3/Emu/SysCalls/lv2/sys_prx.h b/rpcs3/Emu/SysCalls/lv2/sys_prx.h index 523ccc82cc..5c09a7c475 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_prx.h +++ b/rpcs3/Emu/SysCalls/lv2/sys_prx.h @@ -51,15 +51,15 @@ struct sys_prx_unload_module_option_t }; // Auxiliary data types -struct sys_prx_t { +struct sys_prx_t +{ u32 size; u32 address; + std::string path; bool isStarted; - sys_prx_t(u32 prx_size, u32 prx_address) - : size(prx_size) - , address(prx_address) - , isStarted(false) + sys_prx_t() + : isStarted(false) { } }; diff --git a/rpcs3/Gui/KernelExplorer.cpp b/rpcs3/Gui/KernelExplorer.cpp index 711e3f4df5..a3b159e3f7 100644 --- a/rpcs3/Gui/KernelExplorer.cpp +++ b/rpcs3/Gui/KernelExplorer.cpp @@ -43,7 +43,7 @@ void KernelExplorer::Update() char name[4096]; m_tree->DeleteAllItems(); - auto& root = m_tree->AddRoot("Process, ID = 0x00000001, Total Memory Usage = 0x0C8A9000 (200.7 MB)"); + auto& root = m_tree->AddRoot("Process, ID = 0x00000001, Total Memory Usage = 0x???????? (???.? MB)"); // TODO: PPU Threads // TODO: SPU/RawSPU Threads diff --git a/rpcs3/Gui/KernelExplorer.h b/rpcs3/Gui/KernelExplorer.h index 06b65eeeed..85316badf4 100644 --- a/rpcs3/Gui/KernelExplorer.h +++ b/rpcs3/Gui/KernelExplorer.h @@ -1,6 +1,5 @@ #pragma once -#include #include class KernelExplorer : public wxFrame diff --git a/rpcs3/Loader/ELF64.cpp b/rpcs3/Loader/ELF64.cpp index e949ae56d3..f32697a716 100644 --- a/rpcs3/Loader/ELF64.cpp +++ b/rpcs3/Loader/ELF64.cpp @@ -5,10 +5,9 @@ #include "Emu/Cell/PPUThread.h" #include "Emu/SysCalls/SC_FUNC.h" #include "Emu/SysCalls/Modules.h" -#include "ELF64.h" #include "Emu/Cell/PPUInstrTable.h" -#include "Emu/System.h" #include "Emu/SysCalls/ModuleManager.h" +#include "ELF64.h" using namespace PPU_instr;