PowerPC recompiler rework (#641)
Some checks failed
Build check / build (push) Failing after 0s
Generate translation template / generate-pot (push) Failing after 0s

This commit is contained in:
Exzap 2025-04-26 17:59:32 +02:00 committed by GitHub
parent 06233e3462
commit b089ae5b32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
54 changed files with 15433 additions and 12397 deletions

View file

@ -165,6 +165,11 @@ bool ActiveSettings::DumpTexturesEnabled()
return s_dump_textures;
}
bool ActiveSettings::DumpRecompilerFunctionsEnabled()
{
return s_dump_recompiler_functions;
}
bool ActiveSettings::DumpLibcurlRequestsEnabled()
{
return s_dump_libcurl_requests;
@ -180,6 +185,11 @@ void ActiveSettings::EnableDumpTextures(bool state)
s_dump_textures = state;
}
void ActiveSettings::EnableDumpRecompilerFunctions(bool state)
{
s_dump_recompiler_functions = state;
}
void ActiveSettings::EnableDumpLibcurlRequests(bool state)
{
s_dump_libcurl_requests = state;

View file

@ -109,9 +109,11 @@ public:
// dump options
[[nodiscard]] static bool DumpShadersEnabled();
[[nodiscard]] static bool DumpTexturesEnabled();
[[nodiscard]] static bool DumpRecompilerFunctionsEnabled();
[[nodiscard]] static bool DumpLibcurlRequestsEnabled();
static void EnableDumpShaders(bool state);
static void EnableDumpTextures(bool state);
static void EnableDumpRecompilerFunctions(bool state);
static void EnableDumpLibcurlRequests(bool state);
// hacks
@ -125,6 +127,7 @@ private:
// dump options
inline static bool s_dump_shaders = false;
inline static bool s_dump_textures = false;
inline static bool s_dump_recompiler_functions = false;
inline static bool s_dump_libcurl_requests = false;
// timer speed

View file

@ -13,6 +13,7 @@
#include "util/crypto/aes128.h"
#include "Cafe/Filesystem/FST/FST.h"
#include "util/helpers/StringHelpers.h"
void requireConsole();
@ -74,7 +75,9 @@ bool LaunchSettings::HandleCommandline(const std::vector<std::wstring>& args)
po::options_description hidden{ "Hidden options" };
hidden.add_options()
("nsight", po::value<bool>()->implicit_value(true), "NSight debugging options")
("legacy", po::value<bool>()->implicit_value(true), "Intel legacy graphic mode");
("legacy", po::value<bool>()->implicit_value(true), "Intel legacy graphic mode")
("ppcrec-lower-addr", po::value<std::string>(), "For debugging: Lower address allowed for PPC recompilation")
("ppcrec-upper-addr", po::value<std::string>(), "For debugging: Upper address allowed for PPC recompilation");
po::options_description extractor{ "Extractor tool" };
extractor.add_options()
@ -186,6 +189,20 @@ bool LaunchSettings::HandleCommandline(const std::vector<std::wstring>& args)
if (vm.count("output"))
log_path = vm["output"].as<std::wstring>();
// recompiler range limit for debugging
if (vm.count("ppcrec-lower-addr"))
{
uint32 addr = (uint32)StringHelpers::ToInt64(vm["ppcrec-lower-addr"].as<std::string>());
ppcRec_limitLowerAddr = addr;
}
if (vm.count("ppcrec-upper-addr"))
{
uint32 addr = (uint32)StringHelpers::ToInt64(vm["ppcrec-upper-addr"].as<std::string>());
ppcRec_limitUpperAddr = addr;
}
if(ppcRec_limitLowerAddr != 0 && ppcRec_limitUpperAddr != 0)
cemuLog_log(LogType::Force, "PPCRec range limited to 0x{:08x}-0x{:08x}", ppcRec_limitLowerAddr, ppcRec_limitUpperAddr);
if(!extract_path.empty())
{
ExtractorTool(extract_path, output_path, log_path);

View file

@ -29,6 +29,9 @@ public:
static std::optional<uint32> GetPersistentId() { return s_persistent_id; }
static uint32 GetPPCRecLowerAddr() { return ppcRec_limitLowerAddr; };
static uint32 GetPPCRecUpperAddr() { return ppcRec_limitUpperAddr; };
private:
inline static std::optional<fs::path> s_load_game_file{};
inline static std::optional<uint64> s_load_title_id{};
@ -44,6 +47,10 @@ private:
inline static std::optional<uint32> s_persistent_id{};
// for recompiler debugging
inline static uint32 ppcRec_limitLowerAddr{};
inline static uint32 ppcRec_limitUpperAddr{};
static bool ExtractorTool(std::wstring_view wud_path, std::string_view output_path, std::wstring_view log_path);
};