Skip to content

Add support for IPS patching via GPO cluster interweaving#205

Open
tasken wants to merge 2 commits into
Gericom:feature/cache-hicodefrom
tasken:feature/ips-patching
Open

Add support for IPS patching via GPO cluster interweaving#205
tasken wants to merge 2 commits into
Gericom:feature/cache-hicodefrom
tasken:feature/ips-patching

Conversation

@tasken

@tasken tasken commented Jun 15, 2026

Copy link
Copy Markdown

Loads and applies IPS patches at boot by generating a .gpo sidecar file that stores pre-patched clusters. The FatFS cluster link-map is replaced with a merged table that transparently redirects patched cluster reads to the GPO file, with zero runtime overhead in the SD cache hot path.

This build adds:

  • ROM extension support: IPS hunks past the original EOF now work (extension clusters appended to the GPO, gFile.obj.objsize updated)
  • IPS truncate field handling
  • SNESTool EOF ambiguity fix (offset 0x454F46 only treated as EOF when <= 3 bytes remain)
  • Power-loss guard: GPO is written with a GPOT placeholder and promoted to GPO1 only on successful completion
  • RLE count=0 guard, unchecked I/O fixes, file handle leak fixes

Tested:

Still experimental. Closes #16.

Add support for loading and interweaving IPS patches via GPO files on boot.

    - Transparently routes reads to patched clusters on the SD card without runtime emulation overhead.
    - Integrates data cache flushing and memory alignment to ensure a reliable boot process (fixing black screen crashes).
    - Optimizes initialization to skip all SD card write operations and exit immediately when no IPS patch is present.
@tasken tasken changed the base branch from develop to feature/cache-hicode June 15, 2026 06:07
Adds extension cluster support (hunks past original ROM EOF), IPS truncate
field handling, and patchedRomSize tracking through verifyGpo, createGpo,
mergeClusterMaps, gpo_init, and gpo_patchLinearChunk. Also fixes SNESTool EOF
ambiguity, RLE count==0 hang, unchecked I/O, file handle leaks, and adds a
GPOT power-loss guard.
@tasken tasken marked this pull request as ready for review June 15, 2026 23:15
@tasken tasken changed the title Add support for IPS patching Add support for IPS patching via GPO cluster interweaving Jun 15, 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.

1 participant