seleuco / MAME4droid-2024

MAME4droid 2024 is developed by David Valdeita (Seleuco) as a port of the latest MAME emulator by MAMEDev and contributors. It emulates arcade games and systems like ZX Spectrum, Amstrad CPC, MSX etc. This version of MAME support over 40000 different ROMs.
GNU General Public License v2.0
89 stars 14 forks source link

Adding additional ROM folders #2

Closed SRC267 closed 3 months ago

SRC267 commented 8 months ago

So I have a separate folder for SNK Neo Geo titles, i don't really want to merge them with Arcade ROMs, because I set it like that for the RetroArch app playlist.

I checked general settings > configure folders, but there's no way to navigate to the location on the SD card, this isn't an issue with PC MAME, you are able to add more folder directories.

It will be nice to add it from the mame4droid settings where it says change ROMs path.

seleuco commented 8 months ago

This version of android has scoped storage implemented. If you choose the option to install on the SD then MAME4droid is using scoped storage that allows the reading of the ROMs safely and that allows it to be published on Google Play with SD support something that Retroarch does not have.

Access using scoped storage is slow and difficult to implement. For it to work minimally well, the ROM directory is read and saved for future readings. Implementing multiple directories for each thing would be crazy to implement and bad for the user experience as you would have to request multiple permissions.

It is for this reason that I decided to have a single roms directory but with the possibility of defining other things such as artworks or samples in subdirectories within the ROMS directory.

Unfortunately I can't define more things (other subdirectories than artwork, samples, software) without modifying the MAME code base which I don't want to do to be able to easily update to new versions.

The only way I can think of is to modify the mame.ini file (conecting to your phone by ADB on PC) so you can define another roms subdirectory within the roms subdirectory (for neogeo) that is already defined on the SD. I have not tried this with ROMS recursion but I have tried it to add icons, snapshots, etc. and it has worked for me.

Example: assumption than your roms are in SD at /storage/emulated/0/MAME4droid) and your installation is /storage/emulated/0/Android/data/com.seleuco.mame4d2024/files

1/ create the mame.ini: Go to general settings and press save settings it will be created at /storage/emulated/0/Android/data/com.seleuco.mame4d2024/files

2/ search for:

#

CORE SEARCH PATH OPTIONS

# homepath . rompath "/storage/emulated/0/MAME4droid;./roms"

3 / add the new rompath /storage/emulated/0/MAME4droid/neogeo

then rompath wil be:

rompath "/storage/emulated/0/MAME4droid;./roms;/storage/emulated/0/MAME4droid/neogeo"

Tell me if works :)

SRC267 commented 8 months ago

Just tried it, my rom path is:

/storage/6631-6132/Games/MAME;./roms;/storage/6631-6132/Games/SNK - Neo Geo

The line added > "/storage/6631-6132/Games/SNK - Neo Geo" doesn't seem to show in the mame menu, perhaps it's the folder name "SNK - Neo Geo" that's not making mame read it, maybe needs underscores ?

seleuco commented 8 months ago

any news about it? finally work for you? You can also try as MAME4droid has permission for /storage/6631-6132/Games/MAME refactor to /storage/6631-6132/Games/MAME/mainroms and /storage/6631-6132/Games/MAME/NeoGeoROMs

SRC267 commented 8 months ago

No luck, tried different combinations and even tried adding a . between > ;/

seleuco commented 8 months ago

When I have a little time. I will try on my device.

El jue, 11 ene 2024, 4:54, SRC267 @.***> escribió:

No luck, tried different combinations and even tried adding a . between > ;/

— Reply to this email directly, view it on GitHub https://github.com/seleuco/MAME4droid-2024/issues/2#issuecomment-1886184752, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQGONGU6UEFPTQTVGOZVDTYN5PBDAVCNFSM6AAAAABBEHF4OKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBWGE4DINZVGI . You are receiving this because you modified the open/close state.Message ID: @.***>

seleuco commented 8 months ago

Ok. I realized where the problem was. Its very stupid :). I'm setting the paths in the emulator and that takes precedence over the mame.ini file.

I just deployed a new version 1.6.6 which will be available in a few hours that has a new option on advanced settings that you can enable to disable this behavior and so the mame.ini paths will be read. I have tried it and it has worked correctly for me. I have created a "main" directory and another "others" directory hanging from the original previusly authorized directory in the SD.

When you can download the application and try it, confirm to me that it is solved ;)

SRC267 commented 8 months ago

Okay so I updated the app, opened advanced settings and enabled the new mame.ini option for paths.

Here's the full line for rompath in the mame.ini text file: /storage/6631-6132/Games/MAME;./roms;/storage/6631-6132/Games/NeoGeo

It still doesn't show the NeoGeo titles in the menu. Unless I've messed the path up, does it look okay to you? Initially the folder was SNK - Neo Geo, that's my preferred folder title, then changed it to NeoGeo, to see if it helped fix it, but still no luck.

seleuco commented 8 months ago

¿are they showed now in mame ui configure folders? mine yes.

first try something simple ... something like i did:

my original authorized path was /storage/emulated/0/MAME/

i added a new "main" and "others" so my rompath is now is (i dont have others inside main. My roms directories are siblings)

rompath /storage/emulated/0/MAME/main;/storage/emulated/0/MAME/others;./roms

SRC267 commented 8 months ago

No, it doesn't work. Tried different ways, and removed data to try again. I have both paths on the SD card. Maybe that's why it's acting up

seleuco commented 8 months ago

I think you are doing something wrong. One thing I think you can get wrong is that you need to have the parent directory authorized. You have to selec it in the change rom path option from Mame4droid the directory that will contain the two siblings directories. the one from the normal mame roms and the other from neogeo. if not, Mame4droid will not see them because the parent directory is not authorized to be read.

/storage/6631-6132/Games/ should be selected in change rom path.

SRC267 commented 8 months ago

mame.ini paths

Here's the ini path I've set, I have it ticked in the app, the menu is now blank when I selected change rom paths in general, as the ini should override that.

Menu path settings

seleuco commented 8 months ago

Not. You are confusing "installation path" with "ROMs path". Installation path is were the mame assets are installed. You shouldn't touch that. You should leave it as it was at the beginning. If you don't remember, uninstall the application completely. Touching this option makes the mame.ini file different instead of the one you were originally modifying. Also, if the path is not writable you will have reading problems.

You have to point "general->change ROMS path" to "/storage/6631-6132/Games" selecting "EXTERNAL STORAGE" option.

you have to set in mame ini:

/storage/6631-6132/Games/MAME;/storage/6631-6132/Games/NeoGeo;./roms

where "MAME" has your main mame folder roms and "neogeo" has your neogeo roms.

Ensure you hace enabled"advanced -> use mame.ini fo paths" if you do an uninstall and modifty again mame.ini since it would have been deleted.

Ensure you have the folders setted correctly looking in MAME ui "General settings -> Configure folders -> ROMs"

If you have a lot of files inside "/storage/6631-6132/Games" it will be slow the launch of mame4droid as it has to caching all files inside "Games" and if you have not enouth memory it could hung. In this case, you should use a diferent folder structure aproach like pointing to".... Games/MAME" with "... Games/MAME/main" and "... GAMES/MAME/NeoGeo" in the mame ini moving your main MAME files to new main folder and the same with neogeo. MAME folder only will have the two subfolders main and neogeo.

SRC267 commented 8 months ago

This did the trick. Finally. The mistake I made was opening the MAME folder as the path and not the Games one, selecting Games as the main one rectified the issue.

seleuco commented 8 months ago

Yes!!! I'm happy we worked it out :)

FlykeSpice commented 6 months ago

I think it would be better, instead of just reserving the user selected folder for roms, the selected folder will be where Mame's root'll be installed (roms, bios, where saves and ini configurations will be located).

Keeping aside mame configurations files & saves in an inacessible internal directory is a bad idea, the user can't transfer the save files and customize the configuration files, it would be better overall making the public folder mame's root.

seleuco commented 6 months ago

Yes. You right but android has security limitations to write / read on external storage. You have to use scoped storage which is slow and complex and I have to read all external files at startup and build a virtual file system to get this to work. Mostly people only want a folder where put their ROMs.

El vie, 16 feb 2024, 17:53, FlykeSpice @.***> escribió:

I think it would be better, instead of just reserving the user selected folder for roms, the selected folder will be where Mame's root'll be installed (roms, bios, where saves and ini configurations will be located).

Keeping aside mame configurations files & saves on an inacessible internal directory is a bad idea, the user can't transfer the save files and customize the configuration files, it would be better overall making the public folder mame's root.

— Reply to this email directly, view it on GitHub https://github.com/seleuco/MAME4droid-2024/issues/2#issuecomment-1948873604, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQGONBSY3PTNDFANI4SXTDYT6FHHAVCNFSM6AAAAABBEHF4OKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBYHA3TGNRQGQ . You are receiving this because you modified the open/close state.Message ID: @.***>

SRC267 commented 3 months ago

Hi again, in one of your updates to the app it said to uninstall/reinstall to get changes to the UI, I did that. It helped with my database scraping so that was helpful, because prior to that it wasn't working, despite having my ROMs on the external storage. Anyways for some reason it's not picking up my Neo Geo folder anymore. I backed up my old mame.ini file before uninstalling, installed MAME, set it all up again, replaced the new mame.ini file with the old one, made sure to toggle the advanced setting to use MAME.ini

Screenshot_20240602-200904.png

Maybe something has changed to the structure in which the app reads them?

Screenshot_20240602-201227.png

seleuco commented 3 months ago

Hi...

I don't consciously change anything that could affect that. :?

The only thing I can think of is that it could be something about permissions. Recreate the mame.ini from the application itself by deleting you backed one and put your paths again.

It is normal that scraping works for you now since it only looks at files in the default path. It is assumed that if you are an advanced user and have access to the directories, it is best for you to upload the images you want directly.

It is assumed that if you are an advanced user and have access to the directories, it is best for everyone to upload the images they want. It also complicated things a lot and most people would not take advantage of having a more sophisticated scraping system.

SRC267 commented 3 months ago

Okay so I created a new mame.ini from the app, added the folders but still missing the secondary Neo Geo folder. I tried the paths with quotation marks and without, still not showing. I have a few .neo files included in the neo geo folder with my .zip files, but that should really affect it reading the folder. I only have them in there to test the Geolith emulator core in RetroArch that only runs .neo files. Also, just now I added a new game to the list, and media scraping is not picking up the games artwork (Chaos Heat) I toggled on/off the scraping settings, I just get a prompt saying "media scraping ends" every boot.

Path used: "/storage/6631-6132/Games/MAME;/storage/6631-6132/Games/SNK - Neo Geo;./roms"

seleuco commented 3 months ago

You are missing something... :?

have you established the SAF root correctly? remember it should be parent...

You have to point "general->change ROMS path" to "/storage/6631-6132/Games" selecting "EXTERNAL STORAGE" option.

SRC267 commented 3 months ago

Fixed. Yea, had it already set to external. However I had it set to just the MAME folder rather than the entire Games folder. Rookie mistake!