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

Game List: Add shortcut to open cache dir #15687

Merged
merged 2 commits into from
Jun 10, 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
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/PPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5292,7 +5292,7 @@ static void ppu_initialize2(jit_compiler& jit, const ppu_module& module_part, co
if (g_cfg.core.llvm_logs)
{
out << *_module; // print IR
fs::file(cache_path + obj_name + ".log", fs::rewrite).write(out.str());
fs::write_file(cache_path + obj_name + ".log", fs::rewrite, out.str());
result.clear();
}

Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ spu_function_t spu_recompiler::compile(spu_program&& _func)
log += "\n\n\n";

// Append log file
fs::file(m_spurt->get_cache_path() + "spu-ir.log", fs::write + fs::append).write(log);
fs::write_file(m_spurt->get_cache_path() + "spu-ir.log", fs::write + fs::append, log);
}

return fn;
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/SPUCommonRecompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ spu_runtime::spu_runtime()
return;
}

if (g_cfg.core.spu_debug)
if (g_cfg.core.spu_debug && g_cfg.core.spu_decoder != spu_decoder_type::dynamic && g_cfg.core.spu_decoder != spu_decoder_type::_static)
{
if (!fs::create_dir(m_cache_path + "llvm/"))
{
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/SPULLVMRecompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2635,7 +2635,7 @@ class spu_llvm_recompiler : public spu_recompiler_base, public cpu_translator

if (g_cfg.core.spu_debug)
{
fs::file(m_spurt->get_cache_path() + "spu-ir.log", fs::write + fs::append).write(log);
fs::write_file(m_spurt->get_cache_path() + "spu-ir.log", fs::write + fs::append, log);
}

if (auto& cache = g_fxo->get<spu_cache>())
Expand Down
8 changes: 7 additions & 1 deletion rpcs3/Emu/Io/mouse_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,13 @@ bool mouse_config::load()

void mouse_config::save() const
{
fs::file(cfg_name, fs::rewrite).write(to_string());
fs::pending_file file(cfg_name);

if (file.file)
{
file.file.write(to_string());
file.commit();
}
}

cfg::string& mouse_config::get_button(int code)
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/RSX/GL/glutils/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ namespace gl
break;
}

fs::file(fs::get_cache_dir() + base_name + std::to_string(m_id) + ".glsl", fs::rewrite).write(str, length);
fs::write_file(fs::get_cache_dir() + base_name + std::to_string(m_id) + ".glsl", fs::rewrite, str, length);
}

glShaderSource(m_id, 1, &str, &length);
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/RSX/VK/VKFragmentProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ void VKFragmentProgram::Decompile(const RSXFragmentProgram& prog)
void VKFragmentProgram::Compile()
{
if (g_cfg.video.log_programs)
fs::file(fs::get_cache_dir() + "shaderlog/FragmentProgram" + std::to_string(id) + ".spirv", fs::rewrite).write(shader.get_source());
fs::write_file(fs::get_cache_dir() + "shaderlog/FragmentProgram" + std::to_string(id) + ".spirv", fs::rewrite, shader.get_source());
handle = shader.compile();
}

Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/RSX/VK/VKVertexProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ void VKVertexProgram::Decompile(const RSXVertexProgram& prog)
void VKVertexProgram::Compile()
{
if (g_cfg.video.log_programs)
fs::file(fs::get_cache_dir() + "shaderlog/VertexProgram" + std::to_string(id) + ".spirv", fs::rewrite).write(shader.get_source());
fs::write_file(fs::get_cache_dir() + "shaderlog/VertexProgram" + std::to_string(id) + ".spirv", fs::rewrite, shader.get_source());
handle = shader.compile();
}

Expand Down
8 changes: 7 additions & 1 deletion rpcs3/Input/evdev_joystick_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,13 @@ struct positive_axis : cfg::node

void save()
{
fs::file(cfg_name, fs::rewrite).write(to_string());
fs::pending_file file(cfg_name);

if (file.file)
{
file.file.write(to_string());
file.commit();
}
}

bool exist()
Expand Down
16 changes: 16 additions & 0 deletions rpcs3/rpcs3qt/game_list_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,22 @@ void game_list_frame::ShowContextMenu(const QPoint &pos)
gui::utils::open_dir(config_path);
});
}

// This is a debug feature, let's hide it by reusing debug tab protection
if (m_gui_settings->GetValue(gui::m_showDebugTab).toBool())
{
QAction* open_cache_folder = menu.addAction(tr("&Open Cache Folder"));
open_cache_folder->setEnabled(fs::is_dir(cache_base_dir));

if (open_cache_folder->isEnabled())
{
connect(open_cache_folder, &QAction::triggered, this, [cache_base_dir]()
{
gui::utils::open_dir(cache_base_dir);
});
}
}

if (fs::is_dir(data_base_dir))
{
QAction* open_data_dir = menu.addAction(tr("&Open Data Folder"));
Expand Down