Skip to content

Added m3u support#259

Open
rtomasa wants to merge 2 commits into
libretro:masterfrom
rtomasa:master
Open

Added m3u support#259
rtomasa wants to merge 2 commits into
libretro:masterfrom
rtomasa:master

Conversation

@rtomasa
Copy link
Copy Markdown
Contributor

@rtomasa rtomasa commented Jun 2, 2026

Changelog

  • Added M3U playlist support for multi-disc 3DO games.
  • Added .m3u as a supported content extension.
  • Added M3U parsing with support for relative paths, comments, blank lines, quoted entries, and UTF-8 BOM handling.
  • Added support for multi-disc playlists using .iso, .bin, .cue, and .chd images.
  • Added libretro disk control support for ejecting, inserting, switching, replacing, adding, and removing discs.
  • Added extended disk control support when provided by the frontend.
  • Added disc path and disc label reporting for better frontend integration.
  • Added initial disc index handling when supported by the frontend.
  • Added error handling and logging for empty playlists, unsupported entries, and invalid disc images.
  • Updated CD-ROM initialization so disc status flags are only set when valid CD data is actually present.
  • Added CD data checks in opera_cdrom.c so opening the virtual tray works correctly when no valid disc image is loaded.
  • Updated disc swap handling to save NVRAM before ejecting or replacing a disc.
  • Improved disc insertion/ejection behavior so the core properly reflects tray state and CD availability during runtime.

Please note that I was not able to play any multi-disc game up to the point where a disc swap is requested, so I cannot fully confirm that this works 100% in-game yet.

@trapexit
Copy link
Copy Markdown
Collaborator

trapexit commented Jun 3, 2026

Please note that I was not able to play any multi-disc game up to the point where a disc swap is requested, so I cannot fully confirm that this works 100% in-game yet.

The whole reason I've never bothered with m3u support is because the 3DO does not support disc swapping.

This is fundamental to the design of the system. When the CDROM drive tray is closed the OS reboots the whole console. There is no such thing as in-game disc swapping like other consoles.

If people REALLY want this we can add it but it provides no additional functionality to simply loading up the other disc using normal content selector. At most it helps make a single game NVRAM when using the per-game NVRAM mode.

@trapexit
Copy link
Copy Markdown
Collaborator

trapexit commented Jun 3, 2026

This code duplicates a number of states that already exist within the internal disc management logic and the ODE emulation I've added. Not good to layer 3 different ways of dealing with disc images. If this is to be done correctly it should probably work with the ODE and cdrom emulation.

@rtomasa
Copy link
Copy Markdown
Contributor Author

rtomasa commented Jun 3, 2026

That makes sense. I reworked the media switching path to avoid having a separate libretro-side tray/media state machine on top of the existing CD-ROM and ODE logic.

So the remaining libretro M3U state is only the frontend-facing playlist/catalog data needed by the libretro disk-control API: image count, selected index, paths, and labels.

Main changes:

  • Removed the separate g_DISK_TRAY_OPEN state and direct cdimage_replace() path from libretro.c.
  • Disk-control eject now updates the existing CD-ROM media state and requests a reset with no mounted image, so opening the tray boots back to the BIOS/no-disc state.
  • Disk-control insert/close now requests media launch through the existing ODE/CD-ROM restart path.
  • Added a launch flag so real ODE launches still update the content path, while frontend M3U swaps keep the .m3u as the content path/NVRAM key.
  • Exposed minimal CD-ROM media helpers through the xbus CD-ROM plugin instead of duplicating tray state in libretro.c.

So M3U still provides the useful frontend grouping and shared per-game NVRAM behavior, but tray state and media change/reset behavior now flow through the existing CD-ROM/ODE machinery.

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