Skip to content

mgs: load the second disc - #16

Merged
finger563 merged 1 commit into
mainfrom
feat/mgs-disc2
Nov 9, 2026
Merged

finger563 merged 1 commit into
mainfrom
feat/mgs-disc2

Conversation

@finger563

Copy link
Copy Markdown
Contributor

What

MGS can now change to disc 2. Copy disc 2's extracted files into mgs/DISC2/ on the SD card (next to disc 1's STAGE.DIR). When the game shows its "insert disc 2" screen, press START. The port swaps the files it reads in place of opening the console's lid, then the game runs its own disc check.

How (mgs_reversing esp32p4)

  • The four screens that check discs (change, abst's load, open/title, demosel) wait for the lid to open and close. On the port, MGS_TRAY_STEP puts the wanted disc in at that step and skips the spin-up steps. The sector-16 read is faked, and FS_CdMakePositionTable reports which disc is in.
  • virtual_cd.c: Mgs_CdInsertDisc pauses the read-ahead task, reopens the files from the other disc's folder and clears the sectors it had already read from the old disc. If DISC2 is missing, it logs that and the game reports the wrong disc and asks again.
  • A save state taken on disc 2 puts disc 2 back in when it's loaded.
  • MGS_DiskName now includes disc 2's executable name, SLUS_007.76.

Testing

  • Tested on the Tab5 with a build that boots straight into the change stage.
  • The log showed [vcd] disc 1 out, disc 2 in, then the game's THIS IS DISC 2!! / OK! OK!, then load s13a.
  • In s13a you can move around and the radar shows the enemies. The door can't be opened because that test skipped disc 1, so Snake has no items or keycards.
  • After the test, the boot was set back to the title screen and rebuilt.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY

Bumps mgs_reversing to the virtual disc tray: disc 2's files go in
mgs/DISC2 on the card, and the game's disc change screen swaps to them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SFCMzomCZ5wRHJN4sxwkvY
Copilot AI balanced review requested due to automatic review settings November 9, 2026 00:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The unpopulated mgs_reversing submodule prevents verification of the missing-disc fallback, return to disc 1, and disc-2 save-state restoration.

No open issues 🎉

What changed in this PR

Updates the MGS port’s README to document second-disc setup and disc-switching behavior.

Changes:

  • Explains where to place disc 2’s extracted files and how to switch discs using START.
  • Describes missing-disc behavior and restoration of disc 2 when loading a save state.
File Description
components/​mgs/​README.md Documents disc 2 installation, switching, and save-state support.

Review effort: Balanced

@finger563
finger563 merged commit d8744e4 into main Nov 9, 2026
2 checks passed
@finger563
finger563 deleted the feat/mgs-disc2 branch November 9, 2026 00:53
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

ESP-IDF Size Report for 'Tab5 Emu'

Metric Base PR Delta
FLASH 0 bytes (0.00%) 0 bytes (0.00%) 0 bytes (0.00%)
DRAM 267,410 bytes (60.60%) 267,410 bytes (60.60%) 0 bytes (0.00%)
IRAM 0 bytes 0 bytes 0 bytes
RAM (DRAM+IRAM) 267,410 bytes 267,410 bytes 0 bytes (0.00%)

FLASH uses app .bin size or json2 flash sum. RAM sums DRAM+IRAM via idf_size. Percentages shown when totals are available.
DRAM/IRAM usage does not include memory used by the heap allocator at runtime.
This report was generated by esp-idf-size-delta.

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.

2 participants