When no Game system is visible, choosing a random system in the carousel will lead to a crash.
Added an extra check before the random shuffle is performed.
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