Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some warnings #15742

Merged
merged 4 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rpcs3/Emu/Cell/lv2/sys_prx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "sys_memory.h"
#include <span>

extern void dump_executable(std::span<const u8> data, ppu_module* _main, std::string_view title_id);
extern void dump_executable(std::span<const u8> data, const ppu_module* _module, std::string_view title_id);

extern std::shared_ptr<lv2_prx> ppu_load_prx(const ppu_prx_object&, bool virtual_load, const std::string&, s64, utils::serial* = nullptr);
extern void ppu_unload_prx(const lv2_prx& prx);
Expand Down Expand Up @@ -195,8 +195,8 @@ static error_code prx_load_module(const std::string& vpath, u64 flags, vm::ptr<s
}

std::string vpath0;
const std::string path = vfs::get(vpath, nullptr, &vpath0);
const std::string name = vpath0.substr(vpath0.find_last_of('/') + 1);
std::string path = vfs::get(vpath, nullptr, &vpath0);
std::string name = vpath0.substr(vpath0.find_last_of('/') + 1);

bool ignore = false;

Expand Down
9 changes: 6 additions & 3 deletions rpcs3/Emu/System.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,14 +301,17 @@ static void fixup_settings(const psf::registry* _psf)
}
}

extern void dump_executable(std::span<const u8> data, ppu_module* _module, std::string_view title_id)
extern void dump_executable(std::span<const u8> data, const ppu_module* _module, std::string_view title_id)
{
const std::string_view filename = _module->path.substr(_module->path.find_last_of('/') + 1);
std::string_view filename = _module->path;
filename = filename.substr(filename.find_last_of('/') + 1);

const std::string lower = fmt::to_lower(filename);

// Format filename and directory name
// Make each directory for each file so tools like IDA can work on it cleanly
const std::string dir_path = fs::get_cache_dir() + "ppu_progs/" + std::string{!title_id.empty() ? title_id : "untitled"} + fmt::format("-%s-%s", fmt::base57(_module->sha1), filename) + '/';
const std::string file_path = dir_path + (fmt::to_lower(filename).ends_with(".prx") || fmt::to_lower(filename).ends_with(".sprx") ? "prog.prx" : "exec.elf");
const std::string file_path = dir_path + (lower.ends_with(".prx") || lower.ends_with(".sprx") ? "prog.prx" : "exec.elf");

if (fs::create_dir(dir_path) || fs::g_tls_error == fs::error::exist)
{
Expand Down