mirror of
https://github.com/ARMSX2/ARMSX2.git
synced 2026-08-24 16:50:16 -07:00
iOS: shorten the longest comment blocks in the hack code
Tightens the new comments this branch added and the longest blocks it sits next to, so every file it touches lands at or under the comment density it started with. Two of the trimmed blocks described what the code no longer does, which is the kind of comment that goes stale without anyone noticing.
This commit is contained in:
+1
-1
@@ -729,7 +729,7 @@ void VMManager::LoadCoreSettings(SettingsInterface& si)
|
||||
EmuConfig.LoadSave(slw);
|
||||
|
||||
// A game file's UserHackOverrides replaces the base mask outright, and the
|
||||
// player's global claims still stand for this game.
|
||||
// player's global claims still stand here.
|
||||
if (SettingsInterface* base = Host::Internal::GetBaseSettingsLayer(); base && base != &si)
|
||||
EmuConfig.GS.UserHackOverrides |= static_cast<u32>(base->GetIntValue("EmuCore/GS", "UserHackOverrides", 0));
|
||||
|
||||
|
||||
@@ -1749,9 +1749,8 @@ static NSMutableDictionary<NSString*, id>* ARMSX2BuildGlobalGameSettingsResult()
|
||||
// Overlays per-game INI overrides for the given serial/crc onto a globals-seeded result.
|
||||
// Sourcing serial/crc from the caller avoids re-scanning the disc image (which is unsafe
|
||||
// while the VM is actively reading the same disc).
|
||||
// Every pin-backed hack key, paired with its claim bit. A per-game file's claim
|
||||
// mask is derivable from which of these keys it holds, so the mask is never
|
||||
// stored ahead of the keys.
|
||||
// Every pin-backed hack key with its claim bit, so a file's mask is derivable
|
||||
// from which of these keys it holds rather than stored ahead of them.
|
||||
static constexpr struct { const char* key; GSUserHackOverride hack; } s_pinned_hack_keys[] = {
|
||||
{"UserHacks_align_sprite_X", GSUserHackOverride::AlignSprite},
|
||||
{"UserHacks_merge_pp_sprite", GSUserHackOverride::MergeSprite},
|
||||
@@ -1779,7 +1778,6 @@ static u32 ARMSX2DerivePerGameHackClaims(INISettingsInterface& si)
|
||||
return claims;
|
||||
}
|
||||
|
||||
// Writes the derived mask, or removes it when nothing claims anything.
|
||||
static void ARMSX2StoreDerivedPerGameHackClaims(INISettingsInterface& si)
|
||||
{
|
||||
const u32 claims = ARMSX2DerivePerGameHackClaims(si);
|
||||
@@ -2165,9 +2163,8 @@ static void ARMSX2WriteGameSettingsForIdentity(const std::string& serial,
|
||||
else
|
||||
si.DeleteValue("EmuCore/GS", "UserHacks_TCOffsetY");
|
||||
|
||||
// Overriding a hack for one game only counts if the GameDB stops writing that
|
||||
// hack for that game, so the claim mask goes in this file too. Derived from the
|
||||
// keys just written; the core folds the global claims back in at load.
|
||||
// Derived from the keys just written, so the GameDB stops writing them for
|
||||
// this game. The core folds the global claims back in at load.
|
||||
ARMSX2StoreDerivedPerGameHackClaims(si);
|
||||
|
||||
if (skipDrawStartOverride)
|
||||
|
||||
@@ -1841,13 +1841,9 @@ final class SettingsStore {
|
||||
normalizeDEV9Settings()
|
||||
VPadSkinLibraryStore.shared.adoptLegacySelection(virtualPadSkin)
|
||||
_aspectRatioConfig.write(aspectRatio)
|
||||
// Do NOT re-apply the OSD preset here. The saved per-item OSD flags are the
|
||||
// source of truth and are pushed into the live GSConfig natively by
|
||||
// ARMSX2ApplyIOSOsdPresetFromConfig() at scene startup. Calling
|
||||
// applyOsdPreset(preset) at load rewrote every flag from the preset and
|
||||
// discarded the user settings.
|
||||
// Seed the Custom OSD snapshot once from the loaded flags so cycling to Custom
|
||||
// before any manual edit shows the current set rather than an empty overlay.
|
||||
// The saved per-item flags are the source of truth, so applying the preset here
|
||||
// would rewrite every one of them. Seed the Custom snapshot once instead, or
|
||||
// cycling to Custom shows an empty overlay.
|
||||
if !ARMSX2Bridge.getINIBool("ARMSX2iOS/UI", key: "OsdCustomSeeded", defaultValue: false) {
|
||||
snapshotCustomOsd()
|
||||
ARMSX2Bridge.setINIBool("ARMSX2iOS/UI", key: "OsdCustomSeeded", value: true)
|
||||
@@ -2016,13 +2012,9 @@ final class SettingsStore {
|
||||
|
||||
func setRuntimeFastForwardEnabled(_ enabled: Bool) {
|
||||
fastForwardRuntimeEnabled = enabled
|
||||
// Fast forward is purely a limiter-mode switch (Nominal <-> Turbo). The
|
||||
// previous implementation also flipped frameLimiterEnabled, whose didSet
|
||||
// writes NominalScalar=10 to the INI — that made the OSD report T: 1000%
|
||||
// (the Nominal scalar) while the real turbo target was the FF scalar, and
|
||||
// churned the INI on every toggle. Turbo mode alone is sufficient: the
|
||||
// core computes the target from TurboScalar while in Turbo, and switching
|
||||
// back to Nominal restores the user's normal target (T: 100%).
|
||||
// Purely a limiter mode switch. Touching frameLimiterEnabled as well writes
|
||||
// NominalScalar=10, which makes the OSD report the nominal scalar rather than
|
||||
// the turbo target and churns the INI on every toggle.
|
||||
if enabled {
|
||||
NSLog("@@FF_UI@@ enabled=1 turbo=%.3f", fastForwardScalar)
|
||||
ARMSX2Bridge.setLimiterMode(1)
|
||||
|
||||
@@ -1337,12 +1337,9 @@ struct PerGameSettingsPanel: View {
|
||||
} else {
|
||||
Self.clearPerGameValue("ARMSX2iOS/FramePacing", "Preset", useCurrent: useCurrent, iso: iso)
|
||||
}
|
||||
// Cascade the preset's individual keys when a named preset is picked
|
||||
// per-game (raw values 0...3). FramePacingPreset(rawValue:) returns nil
|
||||
// for Use Global (-1); framePacingPresetTable[preset] returns nil for
|
||||
// .custom (raw 4 — not in the table). Placed after the individual-key
|
||||
// writes above so the named preset's curated profile wins over stale
|
||||
// per-game Picker state.
|
||||
// Cascade a named preset's own keys. Use Global and .custom both miss the
|
||||
// table and fall through. After the individual writes on purpose, so the
|
||||
// preset's profile wins over stale per-game picker state.
|
||||
if enabled, let preset = FramePacingPreset(rawValue: perGameFramePacingPreset),
|
||||
let values = SettingsStore.framePacingPresetTable[preset] {
|
||||
Self.setPerGameIntValue("EmuCore/GS", "VsyncQueueSize", values.vsyncQueueSize, useCurrent: useCurrent, iso: iso)
|
||||
|
||||
@@ -217,8 +217,7 @@ struct GraphicsSettingsView: View {
|
||||
|
||||
Section(settings.localized("Display")) {
|
||||
Picker(settings.localized("Deinterlace"), selection: $settings.interlaceMode) {
|
||||
// Tags are GSInterlaceMode values. This list used to be shifted by one, so
|
||||
// every label from Weave down named the mode below it.
|
||||
// Tags are GSInterlaceMode values; a shift by one renames every mode.
|
||||
Text(settings.localized("Automatic (Default)")).tag(0)
|
||||
Text(settings.localized("Off (No Deinterlacing)")).tag(1)
|
||||
Text(settings.localized("Weave (TFF)")).tag(2)
|
||||
|
||||
@@ -247,8 +247,7 @@ struct GraphicsTab: View {
|
||||
.disabled(!enabled)
|
||||
}
|
||||
|
||||
// Its own section, the way the global screen has it. The header is what lets the four rows
|
||||
// be called Brightness and Contrast rather than repeating Shade Boost four times.
|
||||
// Its own section, as on the global screen, so the four rows can be named plainly.
|
||||
Section(settings.localized("Shade Boost")) {
|
||||
Picker(settings.localized("Shade Boost"), selection: $perGameShadeBoost) {
|
||||
Text(settings.localized("Use Global")).tag(-1)
|
||||
|
||||
Reference in New Issue
Block a user