Project VPC (some personal python scripts)
-
I am working on some scripts for my personal use, which I will
laterexplain in more detail later & within their time of presentation...
For now, consider this to be a dummy placeholder for later use (as I haven't got the time right now, and am linking the first script within another topic)...The Scripts/Code is provided as is(!), and if they are working for me (in the context I use them), it is unlikely that I may modify them any further.
Feel free to to do so on your own (and clean up the code whilst doing so ;') ).Edit/Addendum:
The Project will include three scripts:- VPC_CreateDat - Commandline - This will extract/merge some information from a mame.xml and catver.ini and generates the basic (_Ref.)dat file for the other scripts
- VPC_ListFilter - GUI based - Will take a VPC_Ref.dat and an optional romfolder. Various filter options can be set and it will write out a new VPC_dat, including only the desired items and/or copies matching roms from the targetfolder to a new folder (match only by name, it won't validate the files)
- VPCalc - GUI based - Will take a VPC.dat and calculates the Pixel Aspect Ratio from the provided SAR (in classic Video Context: "Storage Aspect Ratio", here I am inclined to name it "Source Aspect Ratio") and then (for single display, raster based roms) tries to find all resolutions possible (with correct DAR) for a given display resolution and where one axis should be integer scaled (choosable; Default: vertical axis for horizontal games, vis versa for vertical ones). And provide a way to copy the selected Viewport Calculation to the Clipboard (to be pasted into the corresponding retropie rom.config file).
Scripted in Python 3.8; in addition they will utilize the following python packages (all installable via pip):
from the SciPy stack: Pandas -> all three scripts
PySimpleGUI -> VPC_ListFilter, VPC
mpmath -> VPC
clipboard -> VPC
(Edit: Under *nix it may be necessary to install tkinter for python)P.S.: I know and am aware of, that for the functionality of the first two, there are far better alternatives out there in the wild, i only needed them for the third (well, the second one was a must, as the prefiltering of the first became a PITA over the various xml variants), which was my prime target/goal in this project. Debatable, its usefulness may only be reasonable to me. Though, my hope is, it may inspire some of you to venture forth and build upon existing ones, or to do some scripts of your own.
-
VPC_CreateDAT.py <mame.xml> <catver.ini>
VPC_CreateDAT will merge some data from a mame.xml and a corresponding catver.ini.
Some ROMs will be automatically excluded from the output dat:
- ROMs marked within the xml as not runnable, mechanical, without a display and/or containing a softlist
- If the xml includes information for disk.status, only those with chds marked as good are included
- blacklisted category (catver)
(see set_blacklist, set_blacklistMISC and parse_roms within the script)
Created Outputfiles: <name_of_xml_file>_REF.dat, <name_of_xml_file>_uniqueCATs.txt
(TAB seperated) Columns inside the *_REF.dat:
<from mame.xml> (availability of the information varies over mame versions) ROM.......... rom/filename without extention (.zip/.7z) Desc......... rom full description Screen....... Type of Display H|V.......... H(orizontal) | V(ertical) Orientation of the Display sx, sy....... Source Resolution Pixel(x-axis), Pixel(y-axis) refresh...... Refresh Rate for the Display cloneof...... name of the parent rom sampleof..... name of sampleset used chd.......... name of the chd file (chd folder name is identical to (parent) romname) chd(sha1).... sha1 checksum for the chd content, as reported by chdman driver....... status (driver) emulation.... status (emulation) graphic...... status (graphic) sound........ status (sound) multidisplay. rom has more then one display? <from catver.ini> (In Brackets: Value the data is set to if rom has no match in catver) Category..... Broad Category (_NotInCatver_) Subtype...... Subgenres listed for the rom (<_generic:>) Mature....... ROM was marked as Mature? (-?-)
(TIP: whence importing to a spreadsheet application, be sure to set at least all filename identifiers (rom/cloneof/sampleof/chd) to text, so that number only romnames with leading 0's are properly read)
*_uniqueCATs.txt will contain information about what categories where included in the datfile, and which ones where filtered/excluded (excludes from the xml (runable/mechanical/etc.) are done prior to the catver blacklists check, so those won't be included in building the cat_exclude list(s). So, those may be incomplete in regards to the full list of categories within the source catver.ini)
-
@Ashpool Hey this is great idea! I have been using simple arcade multifilter in combination with catver.ini and mame.xml to filer out my roms.
-
@Rion Thanks for the Feedback...
But as this was a rushed release, because of me trying to be helpfull, it has taken me a while to come up with the next step...The VPCalc script itself was ready in the time I opened this topic, but me and readmes are only friends in context of me reading them, not writing such.... (and then, in (CP)2020 CP2077 came to be)... well, as life is passing by, instead of having the filter scripted and at least in beta stage by now, I may have that one ready in 202101/02 ... here we are with the viewport calculator: Project VPC: VPCalc at least. ...
As
I had to useused some markdown/html patchwork to create the readme which is, so far and for now, working on git, but unusable here.... I am only providing the link for now...Edit: And a look at the UI:
Besides me living in Night City at the moment, the UI for the filtering App/Script is in its alpha and ready to be populated/used by/with further scripting.... sneak preview:
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.