mirror of
https://github.com/ran-j/PS2Recomp.git
synced 2026-10-04 03:15:35 -04:00
feat: added a entrypoint for the runtime for now
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#include "ps2_runtime.h"
|
||||
#include "register_functions.h"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
std::cout << "Usage: " << argv[0] << " <elf_file>" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string elfPath = argv[1];
|
||||
|
||||
PS2Runtime runtime;
|
||||
if (!runtime.initialize())
|
||||
{
|
||||
std::cerr << "Failed to initialize PS2 runtime" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
registerAllFunctions(runtime);
|
||||
|
||||
if (!runtime.loadELF(elfPath))
|
||||
{
|
||||
std::cerr << "Failed to load ELF file: " << elfPath << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
runtime.run();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user