Zarh / ManaGunZ

ManaGunZ
197 stars 47 forks source link

[FR] Adding an option to mount BD/DVD ISOs in MGZ #65

Closed ghost closed 2 years ago

ghost commented 3 years ago

For decrypted films and data ISOs. Perhaps it can be a file-manager only feature in order to avoid modifying the UI styles of MGZ (and to avoid cluttering up the UI). I believe the original Iris Manager and Irisman support the feature, but I haven't found the exact function that handles it.

ghost commented 3 years ago

Alright, digging through the source code of Irisman I see that mounting DVD/BD ISOs is handled by cobra/mamba itself (by calling cobra_mount_bd_disc_image or cobra_mount_dvd_disc_image). In Irisman, it is called in the launch_iso_game function in the mount_game.h file. I also see that MGZ handles mounting with cobra through the cobra_MountISO function in the main.c file, which is only written to detect PS3/PS2/PS1/PSP games. I guess that, along with file handling and UI, the MountGame function could be made to detect BD/DVD ISOs and send an appropriate emul to cobra_MountISO, and the cobra_MountISO could call the appropriate cobra functions. To be honest, it's probably more complicated than that, but I'm not yet too familiar with PS3 homebrewing.

Zarh commented 3 years ago

I didn't want to add this feature on MGZ but I'll add it to the filemanager like you suggested ;)

Zarh commented 3 years ago

Any idea how I can detect if it's a BD or a DVD ?

I don't like the idea of using the directory or file name...

Zarh commented 3 years ago

For now, I'm going to add these two options:

ghost commented 3 years ago

Any idea how I can detect if it's a BD or a DVD ?

I don't like the idea of using the directory or file name...

Not sure. According to Wikipedia, Blu-Rays initially used BDFS as their fs before switching to UDF. If most Blu-Rays discs are created using software developed by Sony, I would assume that most Blu-Rays also include an ISO-9660 fs, like we see in PS3 discs. You could perhaps look for an ISO-9660 fs in the image and detect whether it's an ISO or not, and then let the user choose to use either mount as BD or mount as DVD. The only thing I would be afraid of is any weird images which only have UDF/BDFS. But perhaps that can be detected as well. However, I've found that official specification about the UDF format is hard to come by for free, so perhaps trying to find a way to detect UDF might be too time-consuming to be worth it.

Also, I don't know what the difference is between mounting an ISO as a DVD or a Blu-Ray. I would assume that, inside the PS3, the functions are the same except for the icon that is displayed on XMB and other additional features Blu-Rays may have. @aldostools may know a bit more about any differences, since he's dealt with them in Irisman and wMM. I know data discs in ISO-9660 format are properly mounted as Blu-Rays, so perhaps only the "Mount as Blu-Ray" option is needed? But then again, why did Cobra developers bother with the Mount as DVD option? Hm...

aldostools commented 3 years ago

As far as I know, in Cobra DVD and BD use the same ISO9660 format. The main difference is the media type sent in the SCSI event and way the GameOS handle that media type when the emulated disc is mounted.

In DVD the file system limitation is 8.5GB (for DVD-DL) and 50GB for BD-R DL. Also the directory structure is different for videos. However I haven't confirmed if these limitations apply when an ISO is mounted through Cobra.

As I normally use these formats mainly for data files (e.g. packages or ROMS), I always prefer to mount the ISO as Blu-ray.

Zarh commented 3 years ago

Thank you guys. So, it's seems to be better to always mount the iso like BD. According to what you said, I don't think it will 'break' a DVD backup iso if we mount it as BD.

I already added the 2 différents options earlier. Next, step is to test some backup movie I have to confirm if what I wrote previously is right.

Zarh commented 2 years ago

From my few test, I think it's better to keep both options. I only tested movies.

Because when I mount a iso DVD as BD, the PS3 doesn't recognise the movie and it display the disc as "Disc of data" (don't know the exact translation in english). Then I can browse the files/directory to read the movie. When I mount the iso as DVD i can't browse the directory, when I click on the icon it just read the movie as it's supposed to do. Same for the reverse scenario...

I wanted to detect the disc format if the presence of directories AUDIO_TS / VIDEO_TS / BDMV... but I think it's not the only ones and I can't find on google a proper way to detect the format... that's why I'll just let the user choose himself ;)

aldostools commented 2 years ago

If you want to add an "auto dectect" option, you could use the method that I use in webMAN MOD to autodetect the disc type when the ISO is located in a random folder:

Mount the ISO as EMU_BD If PS3_GAME or PS3_GM01 exists, type = EMU_PS3 If VIDEO_TS exists, type = EMU_DVD If SYSTEM.CNF exists, type = EMU_PS2_DVD If PSP_GAME, type = EMU_PSP If ISO failed to mount dev_bdvd (because sector size is not 2048), then it's EMU_PSX

If a disc type is detected different to EMU_BD, unmount the disc and mount it again with the detected disc type.

ghost commented 2 years ago

Thanks for the new feature @Zarh!! And thank you for all the work you put into this project.