Skip to content

[8/8] Add patch watches, RAM auditing and debugger tools - #120

Merged
nuggslet merged 3 commits into
nuggslet:masterfrom
TideGear:pr/08-diagnostics
Sep 17, 2026
Merged

nuggslet merged 3 commits into
nuggslet:masterfrom
TideGear:pr/08-diagnostics

Conversation

@TideGear

@TideGear TideGear commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Add optional collection-patch watches, explicit RAM auditing and debugger bridge tooling for investigating the patch paths introduced earlier in the series. Keep these diagnostic additions in their own review. This completes the full repository contribution, including the historical documentation introduced in PR 6.

Review order

PR 8 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: #119

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.
  • All 52 Python self-tests and the native patch-option tests passed.
  • The collection package previously passed clean-build, manifest, checksum and real-data English/grenade selection checks.

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: 5616c4258e

ℹ️ 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/m2fix/ketchup.cpp
}

template <Squirk Q>
void Ketchup<Q>::Audit()

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 Schedule the RAM audit before repairing patches

When a foreign writer corrupts a mirrored executable region, this diagnostic can never report it: repository-wide call-site search finds only explicit template instantiations of Audit(), while the per-frame _SQReturn_update_gadgets path calls Update() directly, which silently repairs the bytes. Because Audit() is also private, it cannot be invoked as an external explicit diagnostic; schedule it at the intended cadence before repair so RAM-corruption investigations produce the promised warnings.

Useful? React with 👍 / 👎.

Comment thread src/modules/sqhook.cpp Outdated
Comment on lines +633 to +637
// Watches first: a watch is a report, and must see the patch whether or
// not a filter below then drops it.
for (auto &watch : PatchWatches)
{
if (offset < watch.start || offset >= watch.end) continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Run patch watches before the master CD-ROM filter

When DisableCDROM = true, either early return immediately above this loop exits before any watch is evaluated, despite the new comment saying watches must see patches that a filter drops. This makes the diagnostic omit every collection write in precisely the configuration used to suppress those writes; move the watch processing ahead of both master-filter checks.

Useful? React with 👍 / 👎.

@nuggslet
nuggslet changed the base branch from master to pr/07-testing-aids September 14, 2026 03:43

@nuggslet nuggslet left a comment

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.

See comment.

Comment thread src/games/mgs1.h Outdated
// span = the retail `option` stage, sectors 27136..27210, through
// (lba + fo / 2048) * 2352 + 24 + fo % 2048, with STAGE.DIR at LBA
// 136654 on disc 1 and 105178 on disc 2.
SQHook<Squirk::Standard>::SetPatchWatch(0x16F634B8ull, 0x16F8E5C8ull,

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.

Doesn't this need to be guarded, to check that the running title is Integral? None of this needs to be applied for the other regions etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Would you like me to fix this?

@nuggslet
nuggslet self-requested a review September 16, 2026 17:41

@nuggslet nuggslet left a comment

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.

Great - looks good!

SetPatchWatch matched on the disc-image offset alone, so a CD-ROM patch
from any title landing inside one of the Integral windows was reported
under an Integral label. Nothing about these offsets is title-specific.

Key each watch to a title, version and disk - the way
SetPatchRangeBlacklist already keys its ranges - and test that key when
the patch is submitted, since registration in Load() runs before the
title is known. Version as well as title and disk because Integral's
game discs and its VR disc share title 99 and disk 0.
@nuggslet
nuggslet changed the base branch from pr/07-testing-aids to master September 17, 2026 02:21
@nuggslet
nuggslet merged commit d05daea into nuggslet:master Sep 17, 2026
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