Added a script to generate the MAME related resources (devices/bioses/names) from a series of DAT files.
`mameres.py` ingests several XML based DAT files and produces the 3 MAME resource files. The operation merges the info from all given files.
For `mamenames.xml`, the `realname` precendence is based on the 1st occurence of the romset in the DAT files, so the order of the files is important.
The resources added in this commit are based on (in this order):
* MAME 240 (Jan-2022) (games, bioses and devices)
* FinalBurn Neo (11 Feb 2022) (games and bioses)
* Mame2003 Libretro (11 Feb 2022) (games and bioses)
Note: the devices file was generated from the 'MAME 0.240.dat' file, since it contains both MESS and Arcade systems.
This is a re-work of PR#269 and PR#314:
* originally proposed by @eagle0wl and discussed/tested with @zigurana during #269, with the motivation being to accomodate texts in languages that don't use spaces between successive characters and words (e.g. Japanese/Chinese).
* @zigurana created a smaller PR in #314 (now closed), but hasn't been updated after @tomaz82's work that changed the Unicode (UTF8) string handling functions (see #297).
I've taken the changes from @zigurana's PR (#269) and updated the code to use `Utils::String::chars2Unicode`.
I added a smaller change for parsing the text. Since we analyze each Unicode code point now (instead of a string), I replaced the `sizeText` call with a simpler function, which gets the size for just the codepoint being scanned. `lineWidth` is consequently incremended for each Unicode code point or reset on a new line.
The performance of `textWrap` looks similar or better than the previous implementation (based in whitespace tokenization) and the results are similar to what was tested during the initial PR (#269).
**NOTE**: the line breaking for non-whitespace texts is a simple split around Unicode code points. Each language may have additional rules for line breaking in texts (i.e. some characters are not allowed at the end/beginning of a line, etc.). These rules are not implemented in this update, it would require additional text analysis.
Some details on line breaking rules for Japanese/Chinese/Korean languages can be consulted at https://en.wikipedia.org/wiki/Line_breaking_rules_in_East_Asian_languages
Original descriptions for the changes on which this modification is based:
* from @eagl0wl's #269, _refine text wordwrap_:
> refined single-multibyte text wordwrap.
> You can now properly wrap Japanese character strings.
> You can see some screenshot. If necessary, I can present more screenshots.
> http://eagle0wl.hatenadiary.jp/entry/2017/10/24/003606
* from @zigurana's #314, _Line-breaking (wrapping) for non ascii strings_
> New PR (replacing #269).
Closes: #269
Supercedes: #269
* renamed image to media and added setting rename function
* replaced references to 'image' with 'media' and removed hardcoded video extensions
* fixed a bug when checking a null path
This ensures that configurations created before HIDAPI drivers were enabled by default (2.0.12)
will work when EmulationStation uses a newer SDL2 version.
Using the HIDAPI drivers may produce a different name for joysticks and pottentially changes the mapping.
Example using a PS4 (Dualshock 4) controller:
- without HIDAPI, the controller is named "Wireless Controller", with HIDAPI enabled is named "PS4 Controller"
- without HIDAPI, the D-Pad is detected as a HAT, but with the drivers enabled it's detected as a series of buttons
- the device GUID is different between the 2 configurations
The different name would probably break also the input configuration script for RetroArch, which doesn't use SDL2 as default input driver and would receive a wrong name and wrong mappings.
Note that the HIDAPI drivers are available just for a few controller models (PS4/PS4/Amazon Luna/Stadia/Xbox360(w)/Xbox One/Steam),
but these controllers are widely used and breaking their configuration would cause much confusion.
- Use C++11 built-in ranlux48 and random_device for seeding
- Shuffles systems (aso.) like a card deck and picks top system until empty, then shuffles again
- Fixes the flaws of the current random implementation: Real 1/N chance for an element in a set of N
- Minor refactorings