theypsilon / _arcade-organizer

A script for organizing _Arcade for MiSTer
GNU General Public License v3.0
36 stars 6 forks source link

Add initial implementation of Rotations sub-menu #26

Closed jeremyrayner closed 3 years ago

jeremyrayner commented 3 years ago

Hiya, Thanks for your terrific work on the MiSTer scripts.

I have made a small PullRequest which adds one new feature to the Arcade Organizer... sub-menus for Rotations.

Basically, if you use a CRT without using the VGA scaler, the original rotation of the screen matters. If you go to the trouble of rotating your CRT physically with the left side at the top (ROT90), for example to play Donkey Kong, it isn't always obvious that you can play PacMan and others with the same physical setup. And also that Space Invaders or 1942 for example actually require the CRT to be physically rotated the other way (ROT270). Also it means you can browse all of the Horizontal MRA files, without encountering Vertical MRAs which are not easy to play without physical changes.

The changes enclosed add a new submenu in the '_Organized' folder for 'Rotations' It all centres around a new file called 'mame-rotations.txt' which is generated by yourselves occasionally, and cached in github (included in this commit).

The pre-built 'mame-rotations.txt' file is downloaded during the Arcade Organizer script execution on the MiSTer, and the organizer script will use this information to decide which folder to put the MRA softlinks into.

I think the easiest way for people to then have these sub-menus added to their existing MiSTer setup, would be to move or remove the '_Organized' folder, and then rerun either the full update_all which calls the update_arcade_organizer script.

I've tested locally by copying the mame-rotations.txt into Scripts/.cache/arcade-organizer folder on the MiSTer And by forcing _arcade_organizer.sh and update_arcade_organizer.sh to be using my local test copies. Hopefully I have integrated everything correctly, it presumes that the mame-rotations.txt will be available from the main _arcade-organizer repo once merged.

Please review, ask any questions, and merge if you are happy.

I hope this helps, thanks for your time,

Jez discord: Jez#4176 twitter: @j6wbs

MAME-GETTER commented 3 years ago

I am interested in this idea. However I do not like the idea of having to keep up a mame-rotations.txt

We need to figure out a way to detect games that need a rotation automatically.

I am open to entertaining a discussion on how games can be listed in the mame-rotations.txt automagicly as they are added to MiSTer.

Maybe a mame.dat could help populate this to mame-rotations.txt

Lets keep refining this idea.

MAME-GETTER commented 3 years ago

Here is an xml of all the vertical games form MAME .195 that I exported from it, Sorry its the only version of MAME I have installed right now but this list should work fine.

I suggest you parse out the games and their rotation from the xml to mame-rotations.txt.

The MRA list the ROM used in it so we have that varable to work with.

Then add code the the Arcade_Orgaizer that looks for ROMs in the mame-rotations.txt. if the user has both the MRA's listed ROM + ROM file add them to the vertical directories.

The reverse could be used for horizontal games if they have a rom but its not in the mame-rotations.txt add them to the Horizontal Directory.

You need to careful that this new scan does not add significant time the arcade organizer running.

The advantage to this method is that we dont have to maintain mame-rotations.txtas its likly eveygame MiSTer is getting is already in the mame-rotations.txt and the links are based up on what the user has ROMs and MRAs for.

exported.zip

jeremyrayner commented 3 years ago

Hiya, I completely agree about the desire not to maintain the list of rotations ourselves. My dream would be that the MRA themselves would have rotational information included within the xml schema. The PullRequest was the first step down that path...

I have already written a script to automatically extract the rotations from MAME sources, so that we don’t have to maintain this ourselves. You can see this in the PullRequest at https://github.com/MAME-GETTER/_arcade-organizer/blob/7c040031f4f7b59715df7936f5043019bcc50b50/rotations/regenerate_mame-rotations.sh

This script clones the main MAME repo, steps through the MAME drivers folder building up the MRA setname to rotation mappings automatically. It does this for every entry in MAME today, and stores it in mame-rotations.txt for caching within GitHub. This list is for every game in MAME, so includes way more than the 300 or so official MRAs already. The end user doesn’t need to clone the MAME drivers to build it up, as the output is stored back in GitHub, so they just get this pre-processed mapping file. Try cloning my repo, cd into the rotations subfolder and removing mame-rotations.txt locally, and then running ./regenerate-mame-rotations.sh to see it rebuilding the information from MAME sources. If all the same info is in a MAME dat file, then we could use that instead of the MAME drivers folder.

Thanks for your time in looking in to this, it really is appreciated,

All the best,

Jez

MJY71 commented 3 years ago

"My dream would be that the MRA themselves would have rotational information included within the xml schema."

I completely agree with that. That's where all the other pertinent information about the game is stored, after all... and it comes from the same source. And who knows... maybe some day MiSTer can have an auto-rotate option utilizing that information like MAME.