2024-06-10 12:18:42 +00:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <filesystem>
|
|
|
|
#include <thread>
|
|
|
|
|
2024-07-31 10:25:55 +00:00
|
|
|
#include "common/singleton.h"
|
2024-06-10 12:18:42 +00:00
|
|
|
#include "core/linker.h"
|
|
|
|
#include "input/controller.h"
|
|
|
|
#include "sdl_window.h"
|
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
|
2024-06-26 11:43:01 +00:00
|
|
|
using HLEInitDef = void (*)(Core::Loader::SymbolsResolver* sym);
|
|
|
|
|
|
|
|
struct SysModules {
|
|
|
|
std::string_view module_name;
|
|
|
|
HLEInitDef callback;
|
|
|
|
};
|
|
|
|
|
2024-06-10 12:18:42 +00:00
|
|
|
class Emulator {
|
|
|
|
public:
|
|
|
|
Emulator();
|
|
|
|
~Emulator();
|
|
|
|
|
|
|
|
void Run(const std::filesystem::path& file);
|
2024-10-09 10:30:51 +00:00
|
|
|
void UpdatePlayTime(const std::string& serial);
|
2024-06-10 12:18:42 +00:00
|
|
|
|
|
|
|
private:
|
2024-10-31 14:08:34 +00:00
|
|
|
void LoadSystemModules(const std::filesystem::path& file, std::string game_serial);
|
2024-07-01 10:35:35 +00:00
|
|
|
|
|
|
|
Core::MemoryManager* memory;
|
2024-07-15 21:22:47 +00:00
|
|
|
Input::GameController* controller;
|
|
|
|
Core::Linker* linker;
|
|
|
|
std::unique_ptr<Frontend::WindowSDL> window;
|
2024-10-09 10:30:51 +00:00
|
|
|
std::chrono::steady_clock::time_point start_time;
|
2024-06-10 12:18:42 +00:00
|
|
|
};
|
2024-09-11 09:56:27 +00:00
|
|
|
|
2024-06-13 21:58:57 +00:00
|
|
|
} // namespace Core
|