From a40d587bf15f8edd9f75fdb865da78ef795d37cd Mon Sep 17 00:00:00 2001 From: NyperYuhgard <93950153+NyperYuhgard@users.noreply.github.com> Date: Fri, 10 Jul 2026 16:50:37 -0500 Subject: [PATCH] Things --- build_recompiler.sh | 3 +++ build_runtime.sh | 3 +++ recomp_bios.sh | 3 +++ recompiler/src/config_loader.cpp | 13 ++++++++++++- recompiler/src/config_loader.h | 4 ++++ runtime/launcher/launcher.cpp | 8 +++++--- runtime/src/main.cpp | 1 + 7 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 build_recompiler.sh create mode 100644 build_runtime.sh create mode 100644 recomp_bios.sh diff --git a/build_recompiler.sh b/build_recompiler.sh new file mode 100644 index 00000000..e94ebcbd --- /dev/null +++ b/build_recompiler.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +cmake -S recompiler -B recompiler/build -G Ninja -DCMAKE_BUILD_TYPE=Release && cmake --build recompiler/build diff --git a/build_runtime.sh b/build_runtime.sh new file mode 100644 index 00000000..dfe41a17 --- /dev/null +++ b/build_runtime.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=Release && cmake --build runtime/build --target psx-runtime diff --git a/recomp_bios.sh b/recomp_bios.sh new file mode 100644 index 00000000..2bbba75b --- /dev/null +++ b/recomp_bios.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +recompiler/build/psxrecomp-bios bios/SCPH1001.BIN generated --emit-full recompiler/seeds/phase2_ghidra_seeds.json diff --git a/recompiler/src/config_loader.cpp b/recompiler/src/config_loader.cpp index c27a2b74..0904abb0 100644 --- a/recompiler/src/config_loader.cpp +++ b/recompiler/src/config_loader.cpp @@ -1032,6 +1032,16 @@ UserSettings load_user_settings(const fs::path& path) { if (!v.empty()) { s.language = v; s.has_language = true; } }); } + if (doc.contains("launcher")) { + const toml::value& lc = toml::find(doc, "launcher"); + if (lc.contains("ui_scale")) try_get([&]{ + const auto v = toml::find(lc, "ui_scale"); + if (!v.empty()) { + float val = std::stof(v); + if (val >= 0.5f && val <= 2.0f) { s.ui_scale = val; s.has_ui_scale = true; } + } + }); + } if (doc.contains("controller")) { const toml::value& ct = toml::find(doc, "controller"); if (ct.contains("p1_device")) try_get([&]{ @@ -1127,8 +1137,9 @@ bool save_user_settings(const fs::path& path, const UserSettings& s) { f << "\n[audio]\n"; if (s.has_spu_hq) f << "spu_hq = " << (s.spu_hq ? "true" : "false") << "\n"; - if (s.has_skip_launcher) + if (s.has_skip_launcher || s.has_ui_scale) f << "\n[launcher]\nskip_launcher = " << (s.skip_launcher ? "true" : "false") << "\n"; + if (s.has_ui_scale) f << "ui_scale = " << s.ui_scale << "\n"; if (s.has_bios_path) f << "\n[bios]\npath = \"" << fwd(s.bios_path) << "\"\n"; if (s.has_disc_path) diff --git a/recompiler/src/config_loader.h b/recompiler/src/config_loader.h index 080bcbff..1a133a56 100644 --- a/recompiler/src/config_loader.h +++ b/recompiler/src/config_loader.h @@ -620,6 +620,10 @@ struct UserSettings { // .language / g_lang). "off"/"jp"/"" = untranslated native game. Persisted to // settings.toml [localization].language. bool has_language = false; std::string language = "en"; + + // UI scale: launcher UI scale cycling (0.5 0.75 1.0 1.25 1.5 1.75 2.0). + // Persisted to settings.toml [launcher].ui_scale. + bool has_ui_scale = false; float ui_scale = 1.0f; }; // GameOptions — the game's OWN native OPTION-screen settings, declared in a diff --git a/runtime/launcher/launcher.cpp b/runtime/launcher/launcher.cpp index 440e2f34..960a167f 100644 --- a/runtime/launcher/launcher.cpp +++ b/runtime/launcher/launcher.cpp @@ -321,8 +321,10 @@ struct LauncherModel { std::string disc_file, disc_region, disc_serial, verdict_title, verdict_detail, verdict_state="none"; bool v_header=false, v_crc=false, v_verified=false; - // display labels (computed from the values above) + // launcher UI scale (persistent, 0.5..2.0) float uiscale = 1.0f; + + // display labels (computed from the values above) std::string renderer_label, crt_label, texfilter_label, aspect_label, winsize_label, uiscale_label; // keybind rebinding @@ -746,7 +748,7 @@ Result run(SDL_Window* window, void* gl_context, m.lock_device = game.lock_device; m.ws_offered = game.ws_offered; m.deadzone_pct = io.has_deadzone ? (io.deadzone * 100 / 32767) : 37; - m.uiscale = 1.0f; // TODO: persist uiscale in UserSettings + m.uiscale = io.has_ui_scale ? io.ui_scale : 1.0f; m.p1_dev_index = io.has_p1_device ? find_or_add_device_index(dev_opts, io.p1_device) : (dev_opts.size()>2?2:1); m.p2_dev_index = io.has_p2_device ? find_or_add_device_index(dev_opts, io.p2_device) : 0; refresh_player(m, 0, dev_opts); @@ -1191,7 +1193,7 @@ Result run(SDL_Window* window, void* gl_context, io.language = game.languages[m.lang_index].code; io.has_language = true; } - // io.uiscale = m.uiscale; io.has_uiscale = true; + io.ui_scale = m.uiscale; io.has_ui_scale = true; } return result; diff --git a/runtime/src/main.cpp b/runtime/src/main.cpp index 74b708af..b6fd9cf1 100644 --- a/runtime/src/main.cpp +++ b/runtime/src/main.cpp @@ -2696,6 +2696,7 @@ int main(int argc, char** argv) { seed.deadzone = resolved_deadzone >= 0 ? resolved_deadzone : 12000; seed.has_deadzone = true; seed.window_width = g_video_win_w; seed.has_window_width = true; + // ui_scale: default to 1.0 (no config source yet, launcher reads from settings.toml) SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);