libretro / opera-libretro

Port of 4DO/libfreedo to libretro.
65 stars 38 forks source link

M3U Support #14

Open newoski opened 9 years ago

newoski commented 9 years ago

Hi,

Would it be possible to add m3u support to this core, similar to PlayStation, for multidisc games?

Thanks so much!

trapexit commented 6 years ago

I may look into this but having added #41 this is less necessary AFAIU.

ChrisRx commented 6 years ago

I've started looking into adding this feature in this fork, using pcsx_rearmed as an basis for implementing disk control. The issue that I am running into now is trying to figure out how to hot swap the disks. Installing 4DO on another computer it seems like hot swapping isn't a part of that either, as it seems to just load the image and reinitialize freedo. Does anyone happen to have any experience with freedo and communicating with it that a new disk has been loaded? Right now I'm currently looking in Iso.c and trying to see if I send eject commands but open to any ideas anyone may have.

The worst case scenario is I can have it perform a reset whenever the disk is changed via disk control, and it will operate in a manner similar to the other freedo using frontends out there in respects to disk swapping (although I would like to try and figure out hot swapping the disks if possible).

trapexit commented 6 years ago

I'm currently reworking Iso.c so I wouldn't code against it at the moment. That said there doesn't appear to be any API for managing the state of the drive like that. I'll look into it though.

What would trigger the disc change?

ChrisRx commented 6 years ago

Thanks for the heads up on Iso.c, I will definitely keep that in mind!

I'm currently in the process of purchasing a 3DO to try and discern the real behavior, but I figured it would be like other consoles that have an "Insert Disk " screen that it either 1) subscribes to an available event stream and attempts to reload the new disk upon something like a lid close event or 2) once the disk has been put in the X/A button attempts to check and load the disk.

I'm expecting number 2 scenario to work, but when I change the disk to the requested disk for Wing Commander III when it asks me for disk 1, it never checks and reloads the disk. It might be just something I'm doing wrong with my initial disk control code, so I'll try and play around with it (unless you are familiar with what might prevent it from reloading upon disk swap).

trapexit commented 6 years ago

I have a 3do but I can't recall how it behaves when a game asks to swap a disc. Given some devices have mechanical drives and others manual I'm not sure the software controls the drive.

If it did have some status or event which indicate the drive is open then it would probably be in the XbusStatus variable or something in the xbus code.

ChrisRx commented 6 years ago

With that said regarding the different drives, I think the case where the user just presses a button at the "Insert Disk" screen should probably at least work, do you have any idea why calling retro_cdimage_close() and then retro_cdimage_open() would cause it to lock up or throw an error? I sometimes get an error immediately after switching the disk via disk control (by ejecting, changing the index and then closing the virtual tray in rgui) that is Bad video cel:wc3/sprites/newman.000 - FILE:sigplay.c LINE:34, making me think that the way I am calling it is not loading the image into the stream interface correctly. Also thanks for offering your expertise on this, it is very appreciated!

trapexit commented 6 years ago

Those functions are only for loading the image physically (so to speak). It's not setting up / reinitializing the emulated drive. It's still using all the old info for disc size and such. It also isn't being logically triggered that there was a drive open / close.

trapexit commented 6 years ago

There isn't an API to manage the state of the emulated drive. If we're going to have this disc swapping behavior we should create one. I imagine it'd be a Command (found in IsoXbus) but I don't have the time right now to investigate. Will do so this evening.

trapexit commented 6 years ago

There are eject and inject tray commands in the cdrom emulation but I'm not sure how in the original systems this was managed. The eject is just resetting some flags and inject isn't doing anything. I'm not sure how the original system recognizes the drive is changing state. Whether it reads the cdrom's state or if it's something else which then triggers a behavior in the drive.

Darknior commented 6 years ago

Not an easy work to do ... :( But if you can fix it, there will be excellent :) And why don't you read an other CD emulator like MegaCD or NecCD or others? That will not help?

trapexit commented 6 years ago

No, not likely. These are low level emulators. The interfaces to the CDROM are not standard. Besides... even if the CDROM had some standard interface it doesn't mean I know how the hardware interacted with it.

There are a limited number of game which are multi disc on the 3DO and after I added shared saves it should be less of an issue to load up the other image and continue playing. I'm not opposed to the feature but more work needs to be done to emulate the platform and given the limited information available on the system its not likely to be all that easy. If someone has a save file or state from just before a disc swap that could help me investigate this.

ghost commented 4 years ago

I'm looking forward for m3u support! Also a big plus would be to support CHD format! :) Merci...

trapexit commented 4 years ago

It does support CHD.

Darknior commented 3 years ago

There was a long time no one has speak about it ...

https://github.com/libretro/opera-libretro/pull/106

Some news about M3u Support ? I have not all the games, just a best off, and i can count 8 games in more than two CDs :) Now we have CHD support and games working really fine, it's really a feature we miss. I really wish some one will found a solution for it :)

bebess commented 3 years ago

specialy for daedelus encounter :) (there is like 15 games that has 2 discs or more)

please make this feature :)

cleverestx commented 3 years ago

Any progress on m3u support? My few multidisc 3DO CHD games are sad... Thank you.

trapexit commented 3 years ago

As mentioned in the thread before... until the hardware is figured out, which it hasn't yet, any implementation is nothing more than changing the disk and restarting the emu just like going and loading the other disc yourself.

I feel like I'm missing something. When using m3u files you simply get the Disc Control menu. Are people saying that's easier materially better than just going to the normal content loading menu?

Sanaki commented 3 years ago

I would imagine part of it is wanting saves to be shared between discs without having to use the shared save option. That said, #96 is another enemy to that desire. There's also the ldci implementation that allows the core to auto-load your last-used disc without having to remember which you were on.

trapexit commented 3 years ago

96 was due to RA itself. Not working with the start without content setting that was added to Opera so that people could enter the BIOS. It's been fixed AFIACT, just tried it, and the ticket should be closed.

Darknior commented 3 years ago

As mentioned in the thread before... until the hardware is figured out, which it hasn't yet, any implementation is nothing more than changing the disk and restarting the emu just like going and loading the other disc yourself.

I feel like I'm missing something. When using m3u files you simply get the Disc Control menu. Are people saying that's easier materially better than just going to the normal content loading menu?

For sure it is really an important feature.

Being able to change CDs from the emulator is a widely used option. With the menu or with the shortcuts we can ejects the CD one advances one moves back and one closes the drawer. It's the best, no need to quit the game. And as mentioned previously, the saves follow, as much as the SAVESTATE which they do not work if you change CD when leaving the game since the name of the CD changes :( And finally for all those who use graphical interface, it is much more beautiful to display a single CD with its M3U and its front cover in the menu, than 5 times the same CD, it increases the list of games for nothing.

trapexit commented 3 years ago

With the menu or with the shortcuts we can ejects the CD one advances one moves back and one closes the drawer. It's the best, no need to quit the game.

As I said a number of times already: without the hardware emulated this literally can not be done. Unless someone else wants to do the investigation and reverse engineering you will have to wait for me to find the time to do so.

If all people care about is not having multiple entries in a list then fine... I won't do it right and just reboot the emulator every time like is done today when people change disks.

Darknior commented 3 years ago

As I said a number of times already: without the hardware emulated this literally can not be done. Maybe i have misunderstanding this ... Is it impossible to change CD with a real 3DO ? The real 3DO must be restarted when we want to change CD ???? I never had 3DO for real and you teach me something :)

Sanaki commented 3 years ago

That's the current assumption, but the number of people with working 3DOs -and- intact copies of multi-disc 3DO games is limited. Even if the hardware behavior differs, determining exactly -how- the hardware does what it does is not as simple as it may seem at a glance.

trapexit commented 3 years ago

Maybe i have misunderstanding this ... Is it impossible to change CD with a real 3DO ? The real 3DO must be restarted when we want to change CD ???? I never had 3DO for real and you teach me something :)

That's not what I'm saying at all.

I'm saying that the 3DO systems have, like many systems, the ability to tell a disc is inserted or not. To eject or retract the drive. None of that is implemented properly. It just always reports a disc is in the drive. To properly do disc swapping proper emulation of the hardware is necessary. Otherwise the best possible is changing disc images and rebooting the emulation. Which would be like restarting the console and changing the disc. If most (all?) games didn't already support that model then getting the emulation working would be critical for usage. But games do work so it hasn't been.

Sanaki commented 3 years ago

Ah, my mistake. I thought you had indicated the system always restarted itself to the best of your knowledge, but needed further investigation to verify that as well.

trapexit commented 3 years ago

As I recall some games do just restart the system. I've not sat down and played through all the multidisc games to test.

chrisfrost77 commented 2 years ago

As I recall some games do just restart the system. I've not sat down and played through all the multidisc games to test.

Sorry to chime in on an old thread, I just signed up purely for this topic.

I owned 3DO's for over 20 years and I can give a little perspective if it helps. On the original Panasonic FZ-1 the CD tray was motorized, therefore would automatically eject the disk when prompting for a new one, and pressing any button on the controller would close the tray and access the disk. Alternatively, you could manually open and close the tray yourself if you wanted to with the eject button. This was the only model of 3DO to do this.

All other models, including the Goldstar, Sanyo, etc., were top loading CD trays which had to be manually opened and closed. In all cases, there was a prompt on the screen for disk change by way of an image of the 3DO with the tray open and an arrow representing changing the disc. The console never reset upon disc change, it merely carried on where the game let off, so long as the game prompted you to do so.

It's also worth noting that there were a surprising number of multidisc games on the 3DO, including (but not limited to)

etc.,

trapexit commented 2 years ago

here was a prompt on the screen for disk change by way of an image of the 3DO with the tray open and an arrow representing changing the disc. The console never reset upon disc change, it merely carried on where the game let off, so long as the game prompted you to do so.

This isn't true. The OS will reset the system when the disc is changed. It is technically possible to have that not happen but it was not available to the developers. You can look over the SDK APIs. There is nothing regarding disc management.

chrisfrost77 commented 2 years ago

here was a prompt on the screen for disk change by way of an image of the 3DO with the tray open and an arrow representing changing the disc. The console never reset upon disc change, it merely carried on where the game let off, so long as the game prompted you to do so.

This isn't true. The OS will reset the system when the disc is changed. It is technically possible to have that not happen but it was not available to the developers. You can look over the SDK APIs. There is nothing regarding disc management.

Hi Trapexit

Thank you for your reply. Whilst I have watched your videos and read your comments, nothing in those specified which version of the console this was. As I mentioned before, I had the FZ-1 and that was my experience. Goldstar and Sanyo may have been different.

trapexit commented 2 years ago

I'm sorry but unless you had a special version of 3DO's operating system on your console it's just not accurate. We have the OS source code.

https://github.com/trapexit/portfolio_os/blob/04548e7fa10de6f5779a14eb2fe1cc9d11a75bc3/src/app/oper/xbusdevice.c#L286

https://github.com/trapexit/portfolio_os/blob/04548e7fa10de6f5779a14eb2fe1cc9d11a75bc3/src/app/oper/softreset.s#L23

When the media access / change is noticed it triggers a soft reset.

I have a US Panasonic FZ-1 that I've had for over 20 years as well a Sanyo IMP-21J Try. I've never not seen it reboot on disc change. Take a random game, eject it when it's not trying to read from the disc in a serious way, it will just sit there. Close the tray and it will reboot as soon as the tray finishes closing and before it even starts to read the disc. This is not controllable by the user software. It is hard coded behavior in the operating system and running in supervisor mode.

31337-4554551n commented 1 year ago

Hi, I'd just like to confirm: So it's impossible to play past disk 1 on any multidisk game, or there is a way other than m3u that we can use to progress to other disks?

trapexit commented 1 year ago

You just load the other disks. There is nothing special needed.

The 3DO OS reboots the whole system when the disk is changed. Every multi disk title has a copy of the game is bootable. The game saves to NVRAM and then reads it back when the new disk boots.

If that doesn't work for you then likely you have per image nvram set.

dszakallas commented 1 year ago

Hi, I implemented M3U / disk control interface support the naive way, i.e just reboot the emulation on disk change. Also changed the nvram load/save to be independent of disk, so sharing between disks should work with per-game NVRAM too. So far I only tested on my RPI4, disk swapping seem to work, also the last used image is saved to .ldci file.

It's on my fork, https://github.com/dszakallas/opera-libretro/tree/naive-disk-control, if you would like to test it. Like @trapexit said, it's not proper emulation and for people who only care about not having multiple entries in a list and using the disk control interface for swapping disks instead.

https://github.com/libretro/opera-libretro/compare/master...dszakallas:opera-libretro:naive-disk-control?expand=1

bebess commented 1 year ago

good news ! @dszakallas how to test your version ? does the dll updated in retroarch ?

bebess commented 1 year ago

i update to the last core version and m3u dont work

hokuem commented 10 months ago

Hi @trapexit, is the naive disk control something that can be merged to the main project? Not sure how to leverage this on Retropie, thank you.

trapexit commented 10 months ago

No one has submitted a PR. I can look at porting it over when I get through with some other changes I'm working on.

bebess commented 10 months ago

No one has submitted a PR. I can look at porting it over when I get through with some other changes I'm working on.

would love to try it :)