diff --git a/docs/CORE_LIBRARY.md b/docs/CORE_LIBRARY.md index 13c654f..50c491d 100644 --- a/docs/CORE_LIBRARY.md +++ b/docs/CORE_LIBRARY.md @@ -1,9 +1,11 @@ # Core titles in the library -The N64 internal-resolution menu offers 1x, 2x and 3x for every title, in both -platform and title settings. A previously saved or explicit higher numeric -scale is resolved to 3x when the hub launches N64. This shared player policy -does not change other systems' scales or the core's developer diagnostics. +The internal-resolution menu uses the values declared by the selected core, +in both platform and title settings. Current n64lle cores offer 1x, 2x, 3x +and 4x. The launcher preserves the selected scale, including an explicit +`--opt video.internal_resolution=4x`; it does not silently lower resolution +for performance. Stored values no longer declared by the core are omitted +with a warning; explicit invalid values remain the core's validation error. A **core title** plays inside the hub's own window through an rcore core (Retro-Runtime `docs/CORE_LINK.md`), instead of being spawned as its own program. This page covers diff --git a/src/hub/hub_core_settings.cpp b/src/hub/hub_core_settings.cpp index 856a746..1c2eaf5 100644 --- a/src/hub/hub_core_settings.cpp +++ b/src/hub/hub_core_settings.cpp @@ -12,22 +12,6 @@ namespace retcomm::hub { -std::string player_core_option_value(const std::string& platform, const std::string& key, - const std::string& value) { - if (platform != "n64" || key != "video.internal_resolution") return value; - const auto scale = [](const std::string& text) -> unsigned { - if (text.size() < 2 || text.back() != 'x') return 0; - unsigned result = 0; - for (std::size_t i = 0; i + 1 < text.size(); ++i) { - if (text[i] < '0' || text[i] > '9') return 0; - result = result * 10 + static_cast(text[i] - '0'); - if (result > 64) return 0; - } - return result; - }; - return scale(value) > 3 ? "3x" : value; -} - namespace { namespace corelink = ::retro::corelink; diff --git a/src/hub/hub_core_settings.hpp b/src/hub/hub_core_settings.hpp index e13026f..9df94e3 100644 --- a/src/hub/hub_core_settings.hpp +++ b/src/hub/hub_core_settings.hpp @@ -50,12 +50,6 @@ struct CoreOptionDecl { std::string description; }; -// Shared player-facing limits apply to both the menu and launch options. -// N64 currently offers at most 3x; the core's diagnostic scales remain available -// to developer tools. Other platforms/options and non-scale values pass through. -std::string player_core_option_value(const std::string& platform, const std::string& key, - const std::string& value); - struct CoreInputDecl { std::uint32_t button = 0; // one RCORE_PAD_* bit, or 0 std::uint32_t axis = 0; // RCORE_AXIS_* + 1, or 0 diff --git a/src/hub/hub_main.cpp b/src/hub/hub_main.cpp index b75cb41..e3dc586 100644 --- a/src/hub/hub_main.cpp +++ b/src/hub/hub_main.cpp @@ -11120,8 +11120,6 @@ void apply_player_settings(retcomm::hub::PlayArgs& args, const fs::path& data_di drop(title, "this title's"); } args.options = retcomm::hub::layer_core_options(plat, title, args.options); - for (auto& [key, value] : args.options) - value = retcomm::hub::player_core_option_value(platform, key, value); } // A runner from before seats 2-4 took a Transfer Pak (no transfer_pak_seats @@ -11619,8 +11617,7 @@ void draw_core_option_row(CoreSettingsPage& p, const retcomm::hub::CoreOptionDec std::string inherited = o.has_default ? o.default_value : std::string(); if (p.title_scope) if (const auto it = p.plat_opts.find(o.key); it != p.plat_opts.end()) inherited = it->second; - const std::string requested = set ? own->second : inherited; - const std::string cur = retcomm::hub::player_core_option_value(p.platform, o.key, requested); + const std::string cur = set ? own->second : inherited; const std::string label = o.label.empty() ? o.key : o.label; const char* inherit_word = p.title_scope ? "All titles" : "Default"; @@ -11638,8 +11635,6 @@ void draw_core_option_row(CoreSettingsPage& p, const retcomm::hub::CoreOptionDec layer.erase(o.key); for (const std::string& v : o.values) { if (p.title_scope && v == kTitleDeclaredValue) continue; - if (retcomm::hub::player_core_option_value(p.platform, o.key, v) != v) - continue; const bool chosen = (set || p.title_scope) && v == cur; if (ImGui::Selectable(v.c_str(), chosen)) layer[o.key] = v; if (chosen) ImGui::SetItemDefaultFocus(); diff --git a/tests/hub_core_settings_test.cpp b/tests/hub_core_settings_test.cpp index 14302e1..3bcc347 100644 --- a/tests/hub_core_settings_test.cpp +++ b/tests/hub_core_settings_test.cpp @@ -217,6 +217,15 @@ void test_options(const fs::path& dir) { std::string err; check(save_core_options(dir, "n64", "pokemonstadiumtest_game", v, &err), "options save"); check(load_core_options(dir, "n64", "pokemonstadiumtest_game") == v, "options round-trip"); + const std::map four_x{{"video.internal_resolution", "4x"}}; + check(save_core_options(dir, "n64", "resolution-test", four_x, &err), "4x options save"); + const auto stored = load_core_options(dir, "n64", "resolution-test"); + check(stored == four_x && layer_core_options({}, stored, {}).at("video.internal_resolution") == "4x", + "stored N64 4x remains 4x at launch"); + check(layer_core_options({{"video.internal_resolution", "2x"}}, + {{"video.internal_resolution", "3x"}}, four_x) + .at("video.internal_resolution") == "4x", + "explicit N64 4x wins over platform and title scales"); check(!save_core_options(dir, "n64", "t", {{"k", "a\nb"}}, &err), "a value with a newline refused"); } @@ -613,17 +622,6 @@ int main(int argc, char** argv) { test_display(dir); test_n64lle_mods(dir); test_n64lle_options(dir); - check(player_core_option_value("n64", "video.internal_resolution", "4x") == "3x", - "N64 stored or explicit 4x launches at 3x"); - check(player_core_option_value("n64", "video.internal_resolution", "6x") == "3x", - "N64 higher diagnostic scales are not player choices"); - for (const std::string& value : {"1x", "2x", "3x", "title", "bad", "99999999999999999x"}) - check(player_core_option_value("n64", "video.internal_resolution", value) == value, - "N64 lower scales and non-scale values pass through"); - check(player_core_option_value("psx", "video.internal_resolution", "4x") == "4x", - "other platforms retain their own scales"); - check(player_core_option_value("n64", "video.supersampling", "4x") == "4x", - "unrelated options retain their own choices"); test_transfer_pak(dir); test_tpak_library(dir); {