33 lines
698 B
C++
Raw Normal View History

2024-09-21 16:59:55 +03:00
#include "pch.h"
#include "swa_recompiler.h"
2024-09-21 21:47:34 +03:00
#include "test_recompiler.h"
// argv 1: xex file path
// argv 2: switches toml file path
// argv 3: output directory path
int main(int argc, char* argv[])
2024-09-07 18:00:09 +06:00
{
2024-09-21 21:47:34 +03:00
if (strstr(argv[1], ".xex") != nullptr)
{
SWARecompiler recompiler;
2024-09-18 11:37:50 +03:00
2024-09-21 21:47:34 +03:00
std::println("Loading executable...");
recompiler.LoadExecutable(argv[1]);
2024-09-18 11:37:50 +03:00
2024-09-21 21:47:34 +03:00
std::println("Loading switch tables...");
recompiler.LoadSwitchTables(argv[2]);
2024-09-18 11:37:50 +03:00
2024-09-21 21:47:34 +03:00
std::println("Analysing functions...");
recompiler.Analyse();
recompiler.Recompile(argv[3]);
}
else
{
TestRecompiler::RecompileTests(argv[1], argv[2]);
}
2024-09-09 23:23:04 +06:00
2024-09-07 18:21:08 +06:00
return 0;
}