Conversation
pvmm
marked this pull request as draft
September 2, 2026 19:24
Extends the openmsx_emu_media tool so an IPS patch can be applied to a ROM or disk image at insert time, mapping to openMSX's `-ips` option. - server_tools.ts: add optional `ips` param to romInsert/diskInsert; when set, build `carta/diska insert "<media>" -ips "<patch>"`. The patch is applied in-memory only; the host media file is untouched. - utils.ts: add pure helpers `buildIpsPatch()` (original/patched bytes -> IPS buffer, with RLE records) and `bytesToHexList()` (Buffer -> space-separated hex bytes). - tests: add `tests/utils/ips.test.ts` (buildIpsPatch round-trips and edge cases) and extend `tests/tools/emu-media.test.ts` with TCL construction cases for the `-ips` option. - fixtures: add bootable e2e media pairs under `tests/fixtures/` (sample.dsk + sample.patch.ips, sample16k.rom + sample16k.patch.ips) that print patch-visible strings on screen; ship them in the npm package via package.json `files`. - docs: AGENTS.md gains the manual e2e IPS-patching recipe with the verified reset semantics (patch applies at insert; no extra reset unless the machine already booted the media; DSK reload caveat: in-RAM programs stay stale after patching — reload from disk or reset) plus a screen-capture EACCES workaround. Skill references (media-management, emulator-control, screen-capture) updated to document the new `ips` parameter. Verified on National_CF-3300: patched DSK shows "PATCHED: DSK boot-sector msg!!!!!!!" and patched ROM shows "PATCHED 16KB ROM cart." on the emulated screen.
pvmm
marked this pull request as ready for review
September 2, 2026 19:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends the openmsx_emu_media tool so an IPS patch can be applied to a ROM or disk image at insert time, mapping to openMSX's
-ipsoption.ipsparam to romInsert/diskInsert; when set, buildcarta/diska insert "<media>" -ips "<patch>". The patch is applied in-memory only; the host media file is untouched.buildIpsPatch()(original/patched bytes -> IPS buffer, with RLE records) andbytesToHexList()(Buffer -> space-separated hex bytes).tests/utils/ips.test.ts(buildIpsPatch round-trips and edge cases) and extendtests/tools/emu-media.test.tswith TCL construction cases for the-ipsoption.tests/fixtures/(sample.dsk + sample.patch.ips, sample16k.rom + sample16k.patch.ips) that print patch-visible strings on screen; ship them in the npm package via package.jsonfiles.ipsparameter.Verified on National_CF-3300: patched DSK shows
"PATCHED: DSK boot-sector msg!!!!!!!" and patched ROM shows "PATCHED 16KB ROM cart." on the emulated screen.