switch to INI for settings (easier), make settings a singleton thingy, slightly simplify core pause/stop/reset. Drop support for remappable inputs for now

This commit is contained in:
irisz64
2025-06-27 00:50:47 +02:00
parent 38129d8d88
commit 7ca337ca48
18 changed files with 2279 additions and 137 deletions

View File

@@ -3,6 +3,7 @@
#include <backend/Core.hpp>
#include <ImGuiImpl/StatusBar.hpp>
#include <ImGuiImpl/GUI.hpp>
#include <resources/gamecontrollerdb.h>
bool HandleInput(void *userdata, SDL_Event *event);
bool QueryDevices(void *userdata, SDL_Event *event);
@@ -10,6 +11,7 @@ bool QueryDevices(void *userdata, SDL_Event *event);
KaizenGui::KaizenGui() noexcept : window("Kaizen", 800, 600), core(std::make_shared<n64::Core>()), vulkanWidget(core, window.getHandle()), emuThread(core, fpsCounter, vulkanWidget, settingsWindow) {
gui::Initialize(core->parallel.wsi, window.getHandle());
SDL_AddGamepadMapping(gamecontrollerdb_str);
SDL_AddEventWatch(HandleInput, this);
SDL_AddEventWatch(QueryDevices, this);
@@ -59,6 +61,7 @@ KaizenGui::KaizenGui() noexcept : window("Kaizen", 800, 600), core(std::make_sha
if(result == NFD_CANCEL) return;
if(result == NFD_ERROR)
Util::panic("Error: {}", NFD::GetError());
LoadROM(path.get());
}},
{"Exit", [&]() {
@@ -233,7 +236,6 @@ void KaizenGui::LoadROM(const std::string &path) noexcept {
void KaizenGui::run() {
while(!quit) {
emuThread.run();
SDL_Event e;
while (SDL_PollEvent(&e)) {
ImGui_ImplSDL3_ProcessEvent(&e);
@@ -245,6 +247,7 @@ void KaizenGui::run() {
}
}
emuThread.run();
RenderUI();
}
}