fix: point VMCDIR.TXT at disc 1's folder, not its VCD file - #69
Merged
Conversation
A multi-disc game would have lost the player's save at the disc change. VMCDIR.TXT names the support DIRECTORY whose memory card a disc shares. ps2hdd wrote the VCD's filename into it instead: SLUS_005.94.Metal Gear Solid_CD1.VCD was written SLUS_005.94.Metal Gear Solid_CD1 is correct The difference is four characters and it fails silently. POPStarter finds no folder of that name, falls back to giving the disc a virtual memory card of its own, and a save made on disc 1 is simply not there on disc 2 -- which is exactly the failure the comment on writePS1Support describes and says must not happen. Two more limits from the same documentation, both silent when exceeded. A VCD filename has to fit the buffer DISCS.TXT paths are read into, which caps it at about 73 characters rather than the 89 the wiki quotes. The smaller number now applies to every title: a name is only an identifier, and a shorter one costs nothing next to a multi-disc game that cannot change discs. DISCS.TXT describes at most four discs. A title with more installs and boots as before, and now says that its disc-swap menu will not work rather than leaving it to be discovered mid-game. The tests and the smoke check asserted the old contents, so all three encoded the bug. They now assert the documented format, and that VMCDIR.TXT carries no .VCD extension at all. Claude-Session: https://claude.ai/code/session_018eBAB3V9GRxNwgpQcpGje4
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.
A multi-disc game would have lost the player's save at the disc change.
VMCDIR.TXTnames the support directory whose memory card a disc shares. ps2hdd wrote the VCD's filename into it:Four characters, and it fails silently. POPStarter finds no folder of that name, falls back to giving the disc a virtual memory card of its own, and a save made on disc 1 is simply not there on disc 2.
That is precisely the failure the comment on
writePS1Supportdescribes and says must not happen:Found while answering a question about how disc swapping works, by reading POPStarter's documented file formats instead of assuming ours matched them.
Two more limits from the same source, both silent
Filename length. A VCD name has to fit the buffer
DISCS.TXTpaths are read into, which caps it at roughly 73 characters — not the 89 POPStarter's wiki quotes.maxVCDNameLendrops to 73 for every title: a name is only an identifier, and a shorter one costs nothing next to a multi-disc game that cannot change discs.Disc count.
DISCS.TXTdescribes at most four discs. A title with more installs and boots exactly as before, and now says its disc-swap menu will not work rather than leaving that to be discovered mid-game.The tests encoded the bug
All three of them — the unit test, the app-level test, and
scripts/demo-smoke.sh— asserted_CD1.VCDinVMCDIR.TXT. They now assert the documented format, and explicitly that the file carries no.VCDextension, along with POPStarter's 103-byte and no-path-separator limits.Mutation-checked: restoring the old one-line contents compiles and fails both the unit test and the app test.
New coverage:
TestVCDNameFitsTheDiscsFileBuffer— names stay inside the buffer at every disc number, and the_CDnsuffix survives truncation, since a title cut back to a shared prefix would install four files under one name.TestDiscsFileListsFilenames— every line names a.VCD(unlikeVMCDIR.TXT), lines are in disc order, and each fits the buffer.Full suite,
go vet,gofmtand the smoke test pass.Source: POPStarter Docs — Multi-disc & VMC
https://claude.ai/code/session_018eBAB3V9GRxNwgpQcpGje4