[Feature] Web player: play a ROM with a translation or hack patch

Open
#5,463 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
22/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python, typescript
Domain
api, backend, frontend

Research direction

Start in frontend/src/views/Player/emulatorJSConfig.ts, where EJS_gamePatchUrl is declared but never set, then trace the existing Patcher endpoint POST /api/roms/{id}/patch on the backend. The proposal needs a patch URL ending in the ROM stem plus .ips/.bps/.ups, and server-side patching for other formats and disc platforms. Done means a selected patch plays on a cartridge platform without being stored, and saves record the active patch.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem? Please describe.

The Patcher (POST /api/roms/{id}/patch) closed #2098 and #3210, but playing a translation kept as translations/*.ips still means patching, uploading the result as a new game, waiting for the scan and opening that entry. The result is a second, unrelated game (#4582) with its own saves.

Describe the solution you'd like

Apply the patch picked in the player's Patch selector, the one # proposes under the chosen file instead of offering patch files as files to boot. The choice is remembered per game, like the disc.

  1. IPS, BPS and UPS on cartridge platforms go to EmulatorJS through EJS_gamePatchUrl, which frontend/src/views/Player/emulatorJSConfig.ts declares but never sets. EmulatorJS downloads the patch after the ROM and writes it under the URL's last segment, and RetroArch applies a <ROM stem>.ips|.bps|.ups found next to the ROM, so the URL has to end in that name, for example /api/roms/<id>/content/<ROM stem>.ips?file_ids=<patch id>. Nothing is stored.
  2. Other formats (xdelta, PPF and the rest the Patcher accepts) and disc platforms, whose cores load the game from a path and skip soft patching, are patched on the server with the Patcher's code and served for the session, without being stored. A ready-made set in translations/ keeps its own entry in the File selector.

Saves should record which patch was active, so patched and unpatched play do not share one history. With #5175 channels, the patch name as the channel label would be enough.

Describe alternatives you've considered

  • The Patcher plus "Upload to RomM". It works, but it duplicates the base ROM and disconnects the variants.
  • Pre-patched files in the category folder. That is the only option for disc systems, and wasteful for cartridges, where the patch is a few KB.

Additional context

This is the "play" half of #2098. #2965 (closed, mine) suggested picking a patch and then its base ROM; a Patch selector under the chosen file turns that around, so the base game stays the default. #5405 asks for the Patcher's output to be filed into collections as a separate game, and #5367 adds release types to a whole game, while this is about the files inside one. Related: #2707, #4582, #5162.

Dominant language
Python
Stars
13.3k
Forks
747
Avg merge
20h 58m
Merged PRs (30d)
207

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rommapp/romm

All issues in rommapp/romm

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.