2024-10-01 00:09:18 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
struct RecompilerSwitchTable
|
|
|
|
{
|
|
|
|
uint32_t r;
|
|
|
|
std::vector<uint32_t> labels;
|
|
|
|
};
|
|
|
|
|
2024-10-06 18:54:47 +03:00
|
|
|
struct RecompilerMidAsmHook
|
|
|
|
{
|
|
|
|
std::string name;
|
|
|
|
std::vector<std::string> registers;
|
|
|
|
};
|
|
|
|
|
2024-10-01 00:09:18 +03:00
|
|
|
struct RecompilerConfig
|
|
|
|
{
|
|
|
|
std::string directoryPath;
|
|
|
|
std::string filePath;
|
|
|
|
std::string outDirectoryPath;
|
|
|
|
std::string switchTableFilePath;
|
|
|
|
std::unordered_map<uint32_t, RecompilerSwitchTable> switchTables;
|
|
|
|
bool skipLr = false;
|
|
|
|
bool ctrAsLocalVariable = false;
|
|
|
|
bool xerAsLocalVariable = false;
|
|
|
|
bool reservedRegisterAsLocalVariable = false;
|
|
|
|
bool skipMsr = false;
|
|
|
|
bool crRegistersAsLocalVariables = false;
|
|
|
|
bool nonArgumentRegistersAsLocalVariables = false;
|
|
|
|
bool nonVolatileRegistersAsLocalVariables = false;
|
|
|
|
uint32_t restGpr14Address = 0;
|
|
|
|
uint32_t saveGpr14Address = 0;
|
|
|
|
uint32_t restFpr14Address = 0;
|
|
|
|
uint32_t saveFpr14Address = 0;
|
|
|
|
uint32_t restVmx14Address = 0;
|
|
|
|
uint32_t saveVmx14Address = 0;
|
|
|
|
uint32_t restVmx64Address = 0;
|
|
|
|
uint32_t saveVmx64Address = 0;
|
|
|
|
uint32_t longJmpAddress = 0;
|
|
|
|
uint32_t setJmpAddress = 0;
|
|
|
|
std::unordered_map<uint32_t, uint32_t> functions;
|
|
|
|
std::unordered_map<uint32_t, uint32_t> invalidInstructions;
|
2024-10-06 18:54:47 +03:00
|
|
|
std::unordered_map<uint32_t, RecompilerMidAsmHook> midAsmHooks;
|
2024-10-01 00:09:18 +03:00
|
|
|
|
|
|
|
void Load(const std::string_view& configFilePath);
|
|
|
|
};
|