update Cheat files

This commit is contained in:
Nayla Hanegan 2023-04-20 20:32:13 -04:00
commit cbfd634a4b
No known key found for this signature in database
GPG key ID: BAFE9001DA16CFA2
217 changed files with 2263 additions and 1880 deletions

View file

@ -250,13 +250,13 @@ void AutoUpdateChecker::TriggerUpdate(const AutoUpdateChecker::NewVersionInforma
}
else
{
const std::string error = GetLastErrorString();
const std::string error = Common::GetLastErrorString();
CriticalAlertFmtT("Could not start updater process: {0}", error);
}
#else
if (popen(command_line.c_str(), "r") == nullptr)
{
const std::string error = LastStrerrorString();
const std::string error = Common::LastStrerrorString();
CriticalAlertFmtT("Could not start updater process: {0}", error);
}
#endif

View file

@ -22,7 +22,7 @@ class CommandLineConfigLayerLoader final : public Config::ConfigLayerLoader
{
public:
CommandLineConfigLayerLoader(const std::list<std::string>& args, const std::string& video_backend,
const std::string& audio_backend, bool batch)
const std::string& audio_backend, bool batch, bool debugger)
: ConfigLayerLoader(Config::LayerType::CommandLine)
{
if (!video_backend.empty())
@ -39,6 +39,9 @@ public:
if (batch)
m_values.emplace_back(Config::MAIN_RENDER_TO_MAIN.GetLocation(), ValueToString(false));
if (debugger)
m_values.emplace_back(Config::MAIN_ENABLE_DEBUGGING.GetLocation(), ValueToString(true));
// Arguments are in the format of <System>.<Section>.<Key>=Value
for (const auto& arg : args)
{
@ -134,7 +137,7 @@ static void AddConfigLayer(const optparse::Values& options)
Config::AddLayer(std::make_unique<CommandLineConfigLayerLoader>(
std::move(config_args), static_cast<const char*>(options.get("video_backend")),
static_cast<const char*>(options.get("audio_emulation")),
static_cast<bool>(options.get("batch"))));
static_cast<bool>(options.get("batch")), static_cast<bool>(options.get("debugger"))));
}
optparse::Values& ParseArguments(optparse::OptionParser* parser, int argc, char** argv)

View file

@ -47,7 +47,8 @@ HostDisassemblerLLVM::HostDisassemblerLLVM(const std::string& host_disasm, int i
LLVMInitializeAllTargetMCs();
LLVMInitializeAllDisassemblers();
m_llvm_context = LLVMCreateDisasmCPU(host_disasm.c_str(), cpu.c_str(), nullptr, 0, 0, nullptr);
m_llvm_context =
LLVMCreateDisasmCPU(host_disasm.c_str(), cpu.c_str(), nullptr, 0, nullptr, nullptr);
// Couldn't create llvm context
if (!m_llvm_context)

View file

@ -17,11 +17,11 @@ namespace
std::vector<ResourcePack> packs;
std::string packs_path;
IniFile GetPackConfig()
Common::IniFile GetPackConfig()
{
packs_path = File::GetUserPath(D_RESOURCEPACK_IDX) + "/Packs.ini";
IniFile file;
Common::IniFile file;
file.Load(packs_path);
return file;
@ -34,7 +34,7 @@ bool Init()
const std::vector<std::string> pack_list =
Common::DoFileSearch({File::GetUserPath(D_RESOURCEPACK_IDX)}, {".zip"});
IniFile file = GetPackConfig();
Common::IniFile file = GetPackConfig();
auto* order = file.GetOrCreateSection("Order");
@ -123,7 +123,7 @@ ResourcePack* Add(const std::string& path, int offset)
if (!pack.IsValid())
return nullptr;
IniFile file = GetPackConfig();
Common::IniFile file = GetPackConfig();
auto* order = file.GetOrCreateSection("Order");
@ -150,7 +150,7 @@ bool Remove(ResourcePack& pack)
if (pack_iterator == packs.end())
return false;
IniFile file = GetPackConfig();
Common::IniFile file = GetPackConfig();
auto* order = file.GetOrCreateSection("Order");
@ -170,7 +170,7 @@ bool Remove(ResourcePack& pack)
void SetInstalled(const ResourcePack& pack, bool installed)
{
IniFile file = GetPackConfig();
Common::IniFile file = GetPackConfig();
auto* install = file.GetOrCreateSection("Installed");
@ -184,7 +184,7 @@ void SetInstalled(const ResourcePack& pack, bool installed)
bool IsInstalled(const ResourcePack& pack)
{
IniFile file = GetPackConfig();
Common::IniFile file = GetPackConfig();
auto* install = file.GetOrCreateSection("Installed");

View file

@ -36,7 +36,7 @@ ResourcePack::ResourcePack(const std::string& path) : m_path(path)
return;
}
if (unzLocateFile(file, "manifest.json", 0) == UNZ_END_OF_LIST_OF_FILE)
if (unzLocateFile(file, "manifest.json", nullptr) == UNZ_END_OF_LIST_OF_FILE)
{
m_valid = false;
m_error = "Resource pack is missing a manifest.";
@ -63,7 +63,7 @@ ResourcePack::ResourcePack(const std::string& path) : m_path(path)
return;
}
if (unzLocateFile(file, "logo.png", 0) != UNZ_END_OF_LIST_OF_FILE)
if (unzLocateFile(file, "logo.png", nullptr) != UNZ_END_OF_LIST_OF_FILE)
{
unz_file_info64 logo_info{};
unzGetCurrentFileInfo64(file, &logo_info, nullptr, 0, nullptr, 0, nullptr, 0);

View file

@ -547,7 +547,7 @@ std::string FormatSize(u64 bytes, int decimals)
// div 10 to get largest named unit less than size
// 10 == log2(1024) (number of B in a KiB, KiB in a MiB, etc)
// Max value is 63 / 10 = 6
const int unit = IntLog2(std::max<u64>(bytes, 1)) / 10;
const int unit = MathUtil::IntLog2(std::max<u64>(bytes, 1)) / 10;
// Don't need exact values, only 5 most significant digits
const double unit_size = std::pow(2, unit * 10);