Skip to content

libretro: Add an option to let a game write to its own disks - #428

Merged
audetto merged 2 commits into
audetto:masterfrom
sunlollyking:game-disk-write-protect
Oct 10, 2026
Merged

audetto merged 2 commits into
audetto:masterfrom
sunlollyking:game-disk-write-protect

Conversation

@sunlollyking

Copy link
Copy Markdown

The libretro core always inserts a game's disks write-protected, so a game that saves to its own disk can't. Eamon is the one I hit: registering a character on the master disk ends in WRITE PROTECTED / BREAK IN 350. #SAVEDISK: doesn't help there, since the game writes to the disk it booted from, and some games won't start on a protected disk at all.

This adds a "Write-protect Game Disks" option under Disk Control. It's enabled by default, so nothing changes unless it's turned off; disabled, a disk follows its image file's own permission, as the desktop builds do. Save disks are untouched.

Tested with Eamon 001's master disk: enabled it stops at WRITE PROTECTED as now, disabled it carries on to the next question.

Game disks are always inserted write-protected, so a game that saves to
its own disk fails: Eamon's master disk can't register a character
("WRITE PROTECTED / BREAK IN 350"). With "Write-protect Game Disks"
disabled, a disk follows its image file's own permission. It stays
enabled by default.
@Jamiras

Jamiras commented Oct 6, 2026

Copy link
Copy Markdown

For the libretro implementation, any changes to the disk should be stored in the SRAM folder. If the original disk is modified, it's checksum will change and the game will no longer be detected for RetroAchievements.

Here's the MSX implementation.

Writing to the original image changes its checksum, so RetroAchievements
no longer recognises the game. With "Write-protect Game Disks" disabled,
a game disk is now copied to the save folder the first time it is
inserted, and that copy is the one written and used afterwards. The
original image is never written. Without a save folder the disk stays
write-protected.
@sunlollyking
sunlollyking force-pushed the game-disk-write-protect branch from 27259f9 to d67ea4a Compare October 6, 2026 13:39
@audetto
audetto merged commit a1e20c0 into audetto:master Oct 10, 2026
2 checks passed
@sunlollyking
sunlollyking deleted the game-disk-write-protect branch October 21, 2026 19:12
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.

3 participants