Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util/cdrom, machine/t10mmc: Add preliminary support for multisession CD-ROMs, indexes, and track flags #12201

Merged
merged 7 commits into from
May 12, 2024

Conversation

987123879113
Copy link
Contributor

All of the commits can be reviewed independently. Opening as a draft to get feedback because it's a lot of changes.

I won't be adding CHD support for these features. This is just to get the features somewhat functional within MAME and then in the future someone can figure out how to add CHD support. All of the features can be tested by loading a .cue/.bin through -cdrom.

  • Did some refactoring of util/cdrom for readability since there was a lot of samey code doing the same initializations and checks in parse_metadata in particular
  • Removed idx0offs and idx1offs in favor of an array of index values and added the code to read indexes from .cues
  • Parsed out the FLAGS from .cue and made them readable through get_adr_control
  • Added preliminary multisession support. Multisession support in cues seems to be a bit fragmented so I pulled samples from various dumper tools and made notes of the differences
  • Filled out the code to return index, sessions, and full TOC for the T10MMC_CMD_READ_TOC_PMA_ATIP command
  • Implemented T10MMC_CMD_MECHANISM_STATUS since it was used by cdrdao, which I was using for testing within MAME to easily check if things were reading properly
  • Some other small cleanups to t10mmc

Multisession CDs can be tested using the pumpitup BIOS machine and manually specifying one of the multisession .cue games. I've tested "Pump it Up: The 2nd Dance Floor" and "Pump it Up The O.B.G: The 3rd Dance Floor" and they both are booting and playable with these changes. The later games after that are also multisession CD but need additional hardware emulation to boot.

It's possible to run cdrdao within MAME using shutms11 via a Knoppix live CD (enter knoppix 2 to boot without the X11 GUI) to do more thorough testing. Index detection probably won't work without CDDA scanning implemented, which I didn't include in this PR.

The generated full TOC and legacy TOC were checked against data dumped via Redumper and/or DiscImageCreator when possible. It isn't perfect (first lead-in area being hardcoded to 95:00:00 for example) but it mostly generates a matching full TOC and legacy TOC.

@happppp
Copy link
Member

happppp commented Apr 1, 2024

@987123879113 OT if you already saw the notification then nevermind, I left a note here about an array out of bounds issue in one of your devices: #11558 (comment)

@rb6502
Copy link
Contributor

rb6502 commented May 12, 2024

This looks really good. It's pretty much how I'd always envisioned multisession working in my head, plus some other useful fixes (keeping all of the track flags, allowing 99 indices, etc).

@rb6502 rb6502 merged commit df62ba1 into mamedev:master May 12, 2024
5 checks passed
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.

None yet

3 participants