Compare commits
2 Commits
fda755f7d8
...
004dcee429
| Author | SHA1 | Date | |
|---|---|---|---|
| 004dcee429 | |||
| ad6007b254 |
+31
-28
@@ -1,52 +1,55 @@
|
|||||||
#include <Core.hpp>
|
#include <Core.hpp>
|
||||||
#include <EmuThread.hpp>
|
#include <EmuThread.hpp>
|
||||||
#include <KaizenGui.hpp>
|
#include <KaizenGui.hpp>
|
||||||
|
#include <chrono>
|
||||||
|
#include <thread>
|
||||||
|
|
||||||
|
using namespace std::chrono_literals;
|
||||||
|
|
||||||
EmuThread::EmuThread(double &fps, SettingsWindow &settings) noexcept : settings(settings), fps(fps) {}
|
EmuThread::EmuThread(double &fps, SettingsWindow &settings) noexcept : settings(settings), fps(fps) {}
|
||||||
|
|
||||||
void EmuThread::run() const noexcept {
|
void EmuThread::run() noexcept {
|
||||||
n64::Core& core = n64::Core::GetInstance();
|
n64::Core& core = n64::Core::GetInstance();
|
||||||
if(!core.romLoaded) return;
|
rdramCopy = core.GetMem().GetRDRAM();
|
||||||
|
|
||||||
auto lastSample = std::chrono::high_resolution_clock::now();
|
while(!shouldExit) {
|
||||||
auto avgFps = 16.667;
|
if(!core.romLoaded) {
|
||||||
auto sampledFps = 0;
|
std::this_thread::sleep_for(1ms);
|
||||||
static bool oneSecondPassed = false;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
fps = 1000.0 / avgFps;
|
if(core.pause) {
|
||||||
|
std::this_thread::sleep_for(1ms);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const auto startFrameTime = std::chrono::high_resolution_clock::now();
|
|
||||||
if (!core.pause) {
|
|
||||||
core.Run(settings.getVolumeL(), settings.getVolumeR());
|
core.Run(settings.getVolumeL(), settings.getVolumeR());
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lk(presentMutex);
|
||||||
|
memcpy(rdramCopy.data(), core.GetMem().GetRDRAMPtr(), RDRAM_SIZE);
|
||||||
|
}
|
||||||
|
readyForPresentation.notify_all();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto endFrameTime = std::chrono::high_resolution_clock::now();
|
void EmuThread::create() noexcept {
|
||||||
using namespace std::chrono_literals;
|
shouldExit.store(false, std::memory_order_release);
|
||||||
const auto frameTimeMs = std::chrono::duration<double>(endFrameTime - startFrameTime) / 1ms;
|
std::thread worker(&EmuThread::run, this);
|
||||||
avgFps += frameTimeMs;
|
worker.detach();
|
||||||
|
|
||||||
sampledFps++;
|
|
||||||
|
|
||||||
if (const auto elapsedSinceLastSample = std::chrono::duration<double>(endFrameTime - lastSample) / 1s;
|
|
||||||
elapsedSinceLastSample >= 1.0) {
|
|
||||||
if (!oneSecondPassed) {
|
|
||||||
oneSecondPassed = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
avgFps /= sampledFps;
|
|
||||||
fps = 1000.0 / avgFps;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmuThread::TogglePause() const noexcept {
|
void EmuThread::TogglePause() const noexcept {
|
||||||
n64::Core::GetInstance().TogglePause();
|
n64::Core::GetInstance().TogglePause();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmuThread::Reset() const noexcept {
|
void EmuThread::Reset() noexcept {
|
||||||
n64::Core::GetInstance().Reset();
|
n64::Core& core = n64::Core::GetInstance();
|
||||||
|
core.Reset();
|
||||||
|
rdramCopy = core.GetMem().GetRDRAM();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmuThread::Stop() const noexcept {
|
void EmuThread::Stop() noexcept {
|
||||||
|
shouldExit.store(true, std::memory_order_release);
|
||||||
n64::Core& core = n64::Core::GetInstance();
|
n64::Core& core = n64::Core::GetInstance();
|
||||||
core.Stop();
|
core.Stop();
|
||||||
core.rom = {};
|
core.rom = {};
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#include <RenderWidget.hpp>
|
#include <RenderWidget.hpp>
|
||||||
#include <SettingsWindow.hpp>
|
#include <SettingsWindow.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <atomic>
|
||||||
|
|
||||||
namespace n64 {
|
namespace n64 {
|
||||||
struct Core;
|
struct Core;
|
||||||
@@ -12,12 +13,17 @@ class EmuThread final {
|
|||||||
public:
|
public:
|
||||||
explicit EmuThread(double &, SettingsWindow &) noexcept;
|
explicit EmuThread(double &, SettingsWindow &) noexcept;
|
||||||
~EmuThread() = default;
|
~EmuThread() = default;
|
||||||
void run() const noexcept;
|
void create() noexcept;
|
||||||
|
void run() noexcept;
|
||||||
void TogglePause() const noexcept;
|
void TogglePause() const noexcept;
|
||||||
void Reset() const noexcept;
|
void Reset() noexcept;
|
||||||
void Stop() const noexcept;
|
void Stop() noexcept;
|
||||||
|
|
||||||
bool interruptionRequested = false, parallelRDPInitialized = false;
|
bool interruptionRequested = false, parallelRDPInitialized = false;
|
||||||
SettingsWindow &settings;
|
SettingsWindow &settings;
|
||||||
double& fps;
|
double& fps;
|
||||||
|
std::atomic_bool shouldExit = false;
|
||||||
|
std::mutex presentMutex;
|
||||||
|
std::condition_variable readyForPresentation;
|
||||||
|
std::vector<u8> rdramCopy;
|
||||||
};
|
};
|
||||||
|
|||||||
+64
-32
@@ -4,8 +4,13 @@
|
|||||||
#include <ImGuiImpl/ProgressIndicators.hpp>
|
#include <ImGuiImpl/ProgressIndicators.hpp>
|
||||||
#include <ImGuiImpl/StatusBar.hpp>
|
#include <ImGuiImpl/StatusBar.hpp>
|
||||||
#include <resources/gamecontrollerdb.h>
|
#include <resources/gamecontrollerdb.h>
|
||||||
|
#include <chrono>
|
||||||
|
|
||||||
KaizenGui::KaizenGui() noexcept : window("Kaizen " KAIZEN_VERSION_STR, 1280, 720), settingsWindow(window), vulkanWidget(window.getHandle()), emuThread(fpsCounter, settingsWindow) {
|
using namespace std::chrono_literals;
|
||||||
|
|
||||||
|
KaizenGui::KaizenGui() noexcept :
|
||||||
|
window("Kaizen " KAIZEN_VERSION_STR, 1280, 720), settingsWindow(window), emuThread(fpsCounter, settingsWindow),
|
||||||
|
vulkanWidget(window.getHandle(), emuThread.rdramCopy.data()) {
|
||||||
gui::Initialize(n64::Core::GetInstance().parallel.wsi, window.getHandle());
|
gui::Initialize(n64::Core::GetInstance().parallel.wsi, window.getHandle());
|
||||||
SDL_InitSubSystem(SDL_INIT_GAMEPAD);
|
SDL_InitSubSystem(SDL_INIT_GAMEPAD);
|
||||||
|
|
||||||
@@ -33,7 +38,8 @@ void KaizenGui::QueryDevices(const SDL_Event &event) {
|
|||||||
if (gamepad)
|
if (gamepad)
|
||||||
SDL_CloseGamepad(gamepad);
|
SDL_CloseGamepad(gamepad);
|
||||||
break;
|
break;
|
||||||
default: break;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,7 +51,8 @@ void KaizenGui::HandleInput(const SDL_Event &event) {
|
|||||||
if (!gamepad)
|
if (!gamepad)
|
||||||
break;
|
break;
|
||||||
{
|
{
|
||||||
pif.UpdateButton(0, n64::Controller::Key::Z, SDL_GetGamepadAxis(gamepad, SDL_GAMEPAD_AXIS_LEFT_TRIGGER) == SDL_JOYSTICK_AXIS_MAX);
|
pif.UpdateButton(0, n64::Controller::Key::Z,
|
||||||
|
SDL_GetGamepadAxis(gamepad, SDL_GAMEPAD_AXIS_LEFT_TRIGGER) == SDL_JOYSTICK_AXIS_MAX);
|
||||||
pif.UpdateButton(0, n64::Controller::Key::CUp, SDL_GetGamepadAxis(gamepad, SDL_GAMEPAD_AXIS_RIGHTY) <= -127);
|
pif.UpdateButton(0, n64::Controller::Key::CUp, SDL_GetGamepadAxis(gamepad, SDL_GAMEPAD_AXIS_RIGHTY) <= -127);
|
||||||
pif.UpdateButton(0, n64::Controller::Key::CDown, SDL_GetGamepadAxis(gamepad, SDL_GAMEPAD_AXIS_RIGHTY) >= 127);
|
pif.UpdateButton(0, n64::Controller::Key::CDown, SDL_GetGamepadAxis(gamepad, SDL_GAMEPAD_AXIS_RIGHTY) >= 127);
|
||||||
pif.UpdateButton(0, n64::Controller::Key::CLeft, SDL_GetGamepadAxis(gamepad, SDL_GAMEPAD_AXIS_RIGHTX) <= -127);
|
pif.UpdateButton(0, n64::Controller::Key::CLeft, SDL_GetGamepadAxis(gamepad, SDL_GAMEPAD_AXIS_RIGHTX) <= -127);
|
||||||
@@ -134,16 +141,21 @@ void KaizenGui::HandleInput(const SDL_Event &event) {
|
|||||||
|
|
||||||
float x = 0, y = 0;
|
float x = 0, y = 0;
|
||||||
|
|
||||||
if (keys[SDL_SCANCODE_UP]) y = 86;
|
if (keys[SDL_SCANCODE_UP])
|
||||||
if (keys[SDL_SCANCODE_DOWN]) y = -86;
|
y = 86;
|
||||||
if (keys[SDL_SCANCODE_LEFT]) x = -86;
|
if (keys[SDL_SCANCODE_DOWN])
|
||||||
if (keys[SDL_SCANCODE_RIGHT]) x = 86;
|
y = -86;
|
||||||
|
if (keys[SDL_SCANCODE_LEFT])
|
||||||
|
x = -86;
|
||||||
|
if (keys[SDL_SCANCODE_RIGHT])
|
||||||
|
x = 86;
|
||||||
|
|
||||||
pif.UpdateAxis(0, n64::Controller::Axis::X, x);
|
pif.UpdateAxis(0, n64::Controller::Axis::X, x);
|
||||||
pif.UpdateAxis(0, n64::Controller::Axis::Y, y);
|
pif.UpdateAxis(0, n64::Controller::Axis::Y, y);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: break;
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,9 +168,9 @@ std::pair<std::optional<s64>, std::optional<Util::Error::MemoryAccess>> RenderEr
|
|||||||
auto memoryAccess = Util::Error::GetMemoryAccess();
|
auto memoryAccess = Util::Error::GetMemoryAccess();
|
||||||
if (memoryAccess.has_value()) {
|
if (memoryAccess.has_value()) {
|
||||||
const auto [is_write, size, address, written_val] = memoryAccess.value();
|
const auto [is_write, size, address, written_val] = memoryAccess.value();
|
||||||
ImGui::Text("%s", std::format("{} {}-bit value @ {:08X}{}", is_write ? "Writing" : "Reading",
|
ImGui::Text("%s",
|
||||||
static_cast<u8>(size), address,
|
std::format("{} {}-bit value @ {:08X}{}", is_write ? "Writing" : "Reading", static_cast<u8>(size),
|
||||||
is_write ? std::format(" (value = 0x{:X})", written_val) : "")
|
address, is_write ? std::format(" (value = 0x{:X})", written_val) : "")
|
||||||
.c_str());
|
.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,7 +272,8 @@ void KaizenGui::RenderUI() {
|
|||||||
if (ImGui::BeginPopupModal(Util::Error::GetSeverity().as_c_str(), nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
|
if (ImGui::BeginPopupModal(Util::Error::GetSeverity().as_c_str(), nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
|
||||||
emuThread.TogglePause();
|
emuThread.TogglePause();
|
||||||
switch (Util::Error::GetSeverity().as_enum) {
|
switch (Util::Error::GetSeverity().as_enum) {
|
||||||
case Util::Error::Severity::WARN: {
|
case Util::Error::Severity::WARN:
|
||||||
|
{
|
||||||
ImGui::PushStyleColor(ImGuiCol_TitleBg, 0x8054eae5);
|
ImGui::PushStyleColor(ImGuiCol_TitleBg, 0x8054eae5);
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, 0xff7be4e1);
|
ImGui::PushStyleColor(ImGuiCol_Text, 0xff7be4e1);
|
||||||
ImGui::Text("Warning of type: %s", Util::Error::GetType().as_c_str());
|
ImGui::Text("Warning of type: %s", Util::Error::GetType().as_c_str());
|
||||||
@@ -270,8 +283,10 @@ void KaizenGui::RenderUI() {
|
|||||||
RenderErrorMessageDetails();
|
RenderErrorMessageDetails();
|
||||||
|
|
||||||
if (n64::Core::GetInstance().romLoaded && !n64::Core::GetInstance().pause) {
|
if (n64::Core::GetInstance().romLoaded && !n64::Core::GetInstance().pause) {
|
||||||
const bool ignore = ImGui::Button("Try continuing"); ImGui::SameLine();
|
const bool ignore = ImGui::Button("Try continuing");
|
||||||
const bool stop = ImGui::Button("Stop emulation"); ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
const bool stop = ImGui::Button("Stop emulation");
|
||||||
|
ImGui::SameLine();
|
||||||
const bool chooseAnother = ImGui::Button("Choose another ROM");
|
const bool chooseAnother = ImGui::Button("Choose another ROM");
|
||||||
if (ignore || stop || chooseAnother) {
|
if (ignore || stop || chooseAnother) {
|
||||||
Util::Error::SetHandled();
|
Util::Error::SetHandled();
|
||||||
@@ -294,8 +309,10 @@ void KaizenGui::RenderUI() {
|
|||||||
|
|
||||||
if (ImGui::Button("OK"))
|
if (ImGui::Button("OK"))
|
||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
} break;
|
}
|
||||||
case Util::Error::Severity::UNRECOVERABLE: {
|
break;
|
||||||
|
case Util::Error::Severity::UNRECOVERABLE:
|
||||||
|
{
|
||||||
emuThread.Stop();
|
emuThread.Stop();
|
||||||
ImGui::PushStyleColor(ImGuiCol_TitleBg, 0x800000ff);
|
ImGui::PushStyleColor(ImGuiCol_TitleBg, 0x800000ff);
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, 0xff3b3bbf);
|
ImGui::PushStyleColor(ImGuiCol_Text, 0xff3b3bbf);
|
||||||
@@ -307,8 +324,10 @@ void KaizenGui::RenderUI() {
|
|||||||
RenderErrorMessageDetails();
|
RenderErrorMessageDetails();
|
||||||
if (ImGui::Button("OK"))
|
if (ImGui::Button("OK"))
|
||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
} break;
|
}
|
||||||
case Util::Error::Severity::NON_FATAL: {
|
break;
|
||||||
|
case Util::Error::Severity::NON_FATAL:
|
||||||
|
{
|
||||||
ImGui::PushStyleColor(ImGuiCol_TitleBg, 0x800000ff);
|
ImGui::PushStyleColor(ImGuiCol_TitleBg, 0x800000ff);
|
||||||
ImGui::PushStyleColor(ImGuiCol_Text, 0xff3b3bbf);
|
ImGui::PushStyleColor(ImGuiCol_Text, 0xff3b3bbf);
|
||||||
ImGui::Text("An error has occurred!");
|
ImGui::Text("An error has occurred!");
|
||||||
@@ -318,10 +337,13 @@ void KaizenGui::RenderUI() {
|
|||||||
ImGui::Text(R"(Error message: "%s")", Util::Error::GetError().c_str());
|
ImGui::Text(R"(Error message: "%s")", Util::Error::GetError().c_str());
|
||||||
auto [lastPC, memoryAccess] = RenderErrorMessageDetails();
|
auto [lastPC, memoryAccess] = RenderErrorMessageDetails();
|
||||||
|
|
||||||
const bool ignore = ImGui::Button("Try continuing"); ImGui::SameLine();
|
const bool ignore = ImGui::Button("Try continuing");
|
||||||
const bool stop = ImGui::Button("Stop emulation"); ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
const bool stop = ImGui::Button("Stop emulation");
|
||||||
|
ImGui::SameLine();
|
||||||
const bool chooseAnother = ImGui::Button("Choose another ROM");
|
const bool chooseAnother = ImGui::Button("Choose another ROM");
|
||||||
const bool openInDebugger = lastPC.has_value() ? ImGui::Button("Add breakpoint at this PC and open the debugger") : false;
|
const bool openInDebugger =
|
||||||
|
lastPC.has_value() ? ImGui::Button("Add breakpoint at this PC and open the debugger") : false;
|
||||||
if (ignore || stop || chooseAnother || openInDebugger) {
|
if (ignore || stop || chooseAnother || openInDebugger) {
|
||||||
Util::Error::SetHandled();
|
Util::Error::SetHandled();
|
||||||
ImGui::CloseCurrentPopup();
|
ImGui::CloseCurrentPopup();
|
||||||
@@ -346,8 +368,10 @@ void KaizenGui::RenderUI() {
|
|||||||
debugger.Open();
|
debugger.Open();
|
||||||
emuThread.Reset();
|
emuThread.Reset();
|
||||||
}
|
}
|
||||||
} break;
|
}
|
||||||
default: break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
@@ -359,7 +383,8 @@ void KaizenGui::RenderUI() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (shouldDisplaySpinner) {
|
if (shouldDisplaySpinner) {
|
||||||
ImGui::SetNextWindowPos({static_cast<float>(width) * 0.5f, static_cast<float>(height) * 0.5f}, 0, ImVec2(0.5f, 0.5f));
|
ImGui::SetNextWindowPos({static_cast<float>(width) * 0.5f, static_cast<float>(height) * 0.5f}, 0,
|
||||||
|
ImVec2(0.5f, 0.5f));
|
||||||
ImGui::PushStyleColor(ImGuiCol_WindowBg, IM_COL32_BLACK_TRANS);
|
ImGui::PushStyleColor(ImGuiCol_WindowBg, IM_COL32_BLACK_TRANS);
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
|
||||||
|
|
||||||
@@ -386,8 +411,11 @@ void KaizenGui::RenderUI() {
|
|||||||
|
|
||||||
if (fileDialogOpen) {
|
if (fileDialogOpen) {
|
||||||
fileDialogOpen = false;
|
fileDialogOpen = false;
|
||||||
constexpr SDL_DialogFileFilter filters[] = {{"All files", "*"}, {"Nintendo 64 executable", "n64;z64;v64"}, {"Nintendo 64 executable archive", "rar;tar;zip;7z"}};
|
constexpr SDL_DialogFileFilter filters[] = {{"All files", "*"},
|
||||||
SDL_ShowOpenFileDialog([](void *userdata, const char * const *filelist, int) {
|
{"Nintendo 64 executable", "n64;z64;v64"},
|
||||||
|
{"Nintendo 64 executable archive", "rar;tar;zip;7z"}};
|
||||||
|
SDL_ShowOpenFileDialog(
|
||||||
|
[](void *userdata, const char *const *filelist, int) {
|
||||||
auto kaizen = static_cast<KaizenGui *>(userdata);
|
auto kaizen = static_cast<KaizenGui *>(userdata);
|
||||||
|
|
||||||
if (!filelist) {
|
if (!filelist) {
|
||||||
@@ -405,14 +433,19 @@ void KaizenGui::RenderUI() {
|
|||||||
|
|
||||||
std::thread fileWorker(&KaizenGui::FileWorker, kaizen);
|
std::thread fileWorker(&KaizenGui::FileWorker, kaizen);
|
||||||
fileWorker.detach();
|
fileWorker.detach();
|
||||||
}, this, window.getHandle(), filters, 3, nullptr, false);
|
},
|
||||||
|
this, window.getHandle(), filters, 3, nullptr, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minimized)
|
if (minimized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (core.romLoaded) {
|
if (core.romLoaded) {
|
||||||
|
std::unique_lock<std::mutex> lk(emuThread.presentMutex);
|
||||||
|
if (emuThread.readyForPresentation.wait_for(lk, 16.6667ms) == std::cv_status::no_timeout)
|
||||||
core.parallel.UpdateScreen<true>();
|
core.parallel.UpdateScreen<true>();
|
||||||
|
else
|
||||||
|
core.parallel.UpdateScreen<false>();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -422,6 +455,7 @@ void KaizenGui::RenderUI() {
|
|||||||
void KaizenGui::LoadROM(const std::string &path) noexcept {
|
void KaizenGui::LoadROM(const std::string &path) noexcept {
|
||||||
n64::Core &core = n64::Core::GetInstance();
|
n64::Core &core = n64::Core::GetInstance();
|
||||||
core.LoadROM(path);
|
core.LoadROM(path);
|
||||||
|
emuThread.create();
|
||||||
const auto gameNameDB = n64::Core::GetMem().rom.gameNameDB;
|
const auto gameNameDB = n64::Core::GetMem().rom.gameNameDB;
|
||||||
SDL_SetWindowTitle(window.getHandle(), ("Kaizen " KAIZEN_VERSION_STR " - " + gameNameDB).c_str());
|
SDL_SetWindowTitle(window.getHandle(), ("Kaizen " KAIZEN_VERSION_STR " - " + gameNameDB).c_str());
|
||||||
}
|
}
|
||||||
@@ -443,18 +477,16 @@ void KaizenGui::run() {
|
|||||||
minimized = false;
|
minimized = false;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
QueryDevices(e);
|
QueryDevices(e);
|
||||||
HandleInput(e);
|
HandleInput(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_GetWindowSize(window.getHandle(), &width, &height);
|
SDL_GetWindowSize(window.getHandle(), &width, &height);
|
||||||
|
|
||||||
emuThread.run();
|
|
||||||
RenderUI();
|
RenderUI();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KaizenGui::LoadTAS(const std::string &path) noexcept {
|
void KaizenGui::LoadTAS(const std::string &path) noexcept { n64::Core::GetInstance().LoadTAS(fs::path(path)); }
|
||||||
n64::Core::GetInstance().LoadTAS(fs::path(path));
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ public:
|
|||||||
bool minimized = false;
|
bool minimized = false;
|
||||||
|
|
||||||
SettingsWindow settingsWindow;
|
SettingsWindow settingsWindow;
|
||||||
RenderWidget vulkanWidget;
|
|
||||||
EmuThread emuThread;
|
EmuThread emuThread;
|
||||||
|
RenderWidget vulkanWidget;
|
||||||
Debugger debugger;
|
Debugger debugger;
|
||||||
|
|
||||||
SDL_Gamepad* gamepad = nullptr;
|
SDL_Gamepad* gamepad = nullptr;
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
#include <SDL3/SDL.h>
|
#include <SDL3/SDL.h>
|
||||||
#include <imgui_impl_sdl3.h>
|
#include <imgui_impl_sdl3.h>
|
||||||
|
|
||||||
RenderWidget::RenderWidget(SDL_Window* window) {
|
RenderWidget::RenderWidget(SDL_Window* window, u8* rdram) {
|
||||||
wsiPlatform = std::make_shared<SDLWSIPlatform>(window);
|
wsiPlatform = std::make_shared<SDLWSIPlatform>(window);
|
||||||
windowInfo = std::make_shared<SDLParallelRdpWindowInfo>(window);
|
windowInfo = std::make_shared<SDLParallelRdpWindowInfo>(window);
|
||||||
n64::Core& core = n64::Core::GetInstance();
|
n64::Core& core = n64::Core::GetInstance();
|
||||||
core.parallel.Init(wsiPlatform, windowInfo, core.GetMem().GetRDRAMPtr());
|
core.parallel.Init(wsiPlatform, windowInfo, rdram);
|
||||||
}
|
}
|
||||||
@@ -72,7 +72,7 @@ private:
|
|||||||
|
|
||||||
class RenderWidget final {
|
class RenderWidget final {
|
||||||
public:
|
public:
|
||||||
explicit RenderWidget(SDL_Window*);
|
explicit RenderWidget(SDL_Window*, u8* rdram);
|
||||||
|
|
||||||
std::shared_ptr<ParallelRDP::WindowInfo> windowInfo;
|
std::shared_ptr<ParallelRDP::WindowInfo> windowInfo;
|
||||||
std::shared_ptr<SDLWSIPlatform> wsiPlatform;
|
std::shared_ptr<SDLWSIPlatform> wsiPlatform;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <fstream>
|
|
||||||
#include <common.hpp>
|
#include <common.hpp>
|
||||||
#include <mini/ini.h>
|
#include <mini/ini.h>
|
||||||
#include <log.hpp>
|
#include <log.hpp>
|
||||||
@@ -40,7 +39,9 @@ struct Options {
|
|||||||
if (!file.write(structure))
|
if (!file.write(structure))
|
||||||
panic("Could not modify options on disk!");
|
panic("Could not modify options on disk!");
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mINI::INIFile file;
|
mINI::INIFile file;
|
||||||
mINI::INIStructure structure;
|
mINI::INIStructure structure;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user