Skip to content

[4/8] Correct USA brightness help with scoped disc patches - #116

Merged
nuggslet merged 1 commit into
nuggslet:masterfrom
TideGear:pr/04-usa-brightness
Sep 16, 2026
Merged

nuggslet merged 1 commit into
nuggslet:masterfrom
TideGear:pr/04-usa-brightness

Conversation

@TideGear

@TideGear TideGear commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Correct the USA Option/SCREEN brightness instructions using built-in patches for the two supported disc layouts. Scope collection-patch filtering to the correct title, disc and byte range, with explicit BrightnessText configuration. Include standalone range tests. Runtime appearance still needs gameplay verification; source/payload checks do not prove runtime routing.

Review order

PR 4 of 8 in the complete TideGear contribution. These are an ordered stack against upstream master; GitHub shows earlier unmerged changes cumulatively. Merge in order 1 through 8 and update the remaining branches after each merge.

Previous PR: #115

Review only this step

Validation

  • This branch passed Release x64 and x86 builds with the development installer disabled.
  • Standalone native RAM repair tests passed for both architectures.
  • Standalone scoped patch-range tests passed for both architectures.

Ready for maintainer review. The documented gameplay testing remains outstanding; no gameplay pass is claimed.

Complete series

  1. [1/8] Build Zydis with the selected toolset and invalidate stale caches #113
  2. [2/8] Validate PPF3 files and preserve executable RAM patches #114
  3. [3/8] Preserve MGS1 configuration and Integral language choices #115
  4. [4/8] Correct USA brightness help with scoped disc patches #116
  5. [5/8] Correct thin textured polygon sampling in MGS1 #117
  6. [6/8] Add Integral English and grenade patches with the complete toolchain #118
  7. [7/8] Add optional MGS1 and VR testing aids #119
  8. [8/8] Add patch watches, RAM auditing and debugger tools #120

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9948069e4d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/games/mgs1.cpp
// read itself follows this hook on the same thread, so the two agree.
if (M2Config::bPatchesPreserveConfiguration && MGS1_ConfigPTR != 0
&& width == 16 && offset == MGS1_ConfigPTR) {
MGS1_ConfigSeen = SQEmuTask<Squirk::Standard>::GetRamValue(16, MGS1_ConfigPTR) & 0xFFFF;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid recursively invoking the hooked RAM reader

When PreserveConfiguration is enabled (the new default) and the collection reads GM_Configuration, this callback invokes getRamValue(16, MGS1_ConfigPTR) again before the outer native call has completed. SQEmuTask::GetRamValue goes through the same CallNative/SQNative_getRamValue hook, which re-enters this branch indefinitely and can stack-overflow as soon as the per-frame configuration read occurs. Read through an unhooked path or add a reentrancy guard instead.

Useful? React with 👍 / 👎.

Comment thread src/m2fix/ketchup.cpp
Comment on lines +338 to +339
ApplyBlock(v, title, version, disk, patch.offset,
patch.data.data(), patch.data.size());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Bypass the range blacklist for the built-in fix

In the default BrightnessText=fixed mode, both built-in offsets are inside the ranges registered by SetPatchRangeBlacklist. Calling ApplyBlock here routes the built-in data through the hooked entryCdRomPatch, where SQNative_entryCdRomPatch matches that same range and returns 1, suppressing the native write. Consequently the collection replacement is removed but the blank-row patch is also discarded, so fixed behaves like original instead of producing the advertised four-line texture.

Useful? React with 👍 / 👎.

@nuggslet
nuggslet changed the base branch from master to pr/03-configuration-language September 14, 2026 03:45
Comment thread src/m2fix/m2config.h

// What to do about the collection's replacement for MGS1's Option -> SCREEN
// help texture. See [Patches] BrightnessText in the ini.
enum class M2BrightnessText

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I question the location of this

@nuggslet
nuggslet changed the base branch from pr/03-configuration-language to master September 14, 2026 07:28
@TideGear
TideGear force-pushed the pr/04-usa-brightness branch from 9948069 to 12b8499 Compare September 15, 2026 03:30
@nuggslet
nuggslet merged commit dbe9bb5 into nuggslet:master Sep 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants