Skip to content

Open Nero track-at-once images, and offer .nrg - #39

Open
sunlollyking wants to merge 2 commits into
libretro:masterfrom
sunlollyking:nero-track-at-once
Open

sunlollyking wants to merge 2 commits into
libretro:masterfrom
sunlollyking:nero-track-at-once

Conversation

@sunlollyking

Copy link
Copy Markdown

Nero images (.nrg) don't load, for two reasons:

  • chdcd_parse_nero() only reads the DAOX chunk of a disc-at-once image, and rejects anything from Nero before 5.5. A track-at-once image has no DAOX: its tracks are in a TINF (before 5.5), ETNF or ETN2 chunk. So it either failed outright or opened with no tracks, and the player showed an open drive.
  • The libretro side didn't take .nrg anywhere. It's not in valid_extensions, disk_control::is_disc() refused it, and retro_init.cpp only passed chd, iso and cue to -cdrom.

The first commit accepts the older NERO footer and, when there's no DAOX, builds the tracks from TINF, ETNF or ETN2, using the same track modes as DAOX. The second adds nrg to those three places.

My two CD-i Nero images are both a single Mode 2/2336 track, so they also need #38 to read their sectors.

Tested with a small ctypes frontend that boots to the player, presses button 1 on PLAY CD-I and grabs a frame 60 s later, built with #38:

  • Shaolin's Road (Nero 5.5+, one ETN2 track): before, the drive shows open; after, its menu.
  • Escape From CyberCity (pre-5.5 NERO footer, one TINF track): before, refused; after, its menu.
  • Myst from a cue sheet, to check nothing else moved: same as before.

parse_nero() only read the DAOX chunk of a disc-at-once image and
rejected images from Nero before 5.5. Track-at-once images have no DAOX;
their tracks are in a TINF (before 5.5), ETNF or ETN2 chunk, so they
opened with no tracks at all. Accept the older "NERO" footer, and when
there's no DAOX build the tracks from those chunks, using the same track
modes as DAOX.
MAME's CD code opens .nrg images, but the core didn't list the
extension, disc control wouldn't take one, and it wasn't passed to the
CD-ROM drive, so frontends never got a Nero image as far as MAME.
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.

1 participant