2024-02-23 21:32:32 +00:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
2023-11-10 17:52:41 +00:00
|
|
|
#include <fmt/core.h>
|
2024-09-13 04:44:20 +00:00
|
|
|
#include "common/memory_patcher.h"
|
2024-07-31 10:25:55 +00:00
|
|
|
#include "emulator.h"
|
2023-11-10 17:52:41 +00:00
|
|
|
|
2023-10-13 06:40:59 +00:00
|
|
|
int main(int argc, char* argv[]) {
|
2023-08-03 10:06:23 +00:00
|
|
|
if (argc == 1) {
|
2023-10-26 20:29:05 +00:00
|
|
|
fmt::print("Usage: {} <elf or eboot.bin path>\n", argv[0]);
|
2023-07-07 10:54:44 +00:00
|
|
|
return -1;
|
2023-08-03 10:06:23 +00:00
|
|
|
}
|
2024-09-19 09:17:05 +00:00
|
|
|
// check if eboot file exists
|
|
|
|
if (!std::filesystem::exists(argv[1])) {
|
|
|
|
fmt::print("Eboot.bin file not found\n");
|
|
|
|
return -1;
|
|
|
|
}
|
2023-08-11 22:02:42 +00:00
|
|
|
|
2024-09-13 04:44:20 +00:00
|
|
|
for (int i = 0; i < argc; i++) {
|
|
|
|
std::string curArg = argv[i];
|
|
|
|
if (curArg == "-p") {
|
|
|
|
std::string patchFile = argv[i + 1];
|
|
|
|
MemoryPatcher::patchFile = patchFile;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-10 12:18:42 +00:00
|
|
|
Core::Emulator emulator;
|
|
|
|
emulator.Run(argv[1]);
|
2024-09-13 04:44:20 +00:00
|
|
|
|
2023-04-27 16:13:19 +00:00
|
|
|
return 0;
|
|
|
|
}
|