summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-04-23 11:25:03 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-04-23 11:26:47 +0200
commit1c726824f2b2cc7c6c03ff975e548b72f9b2c0a9 (patch)
tree020f20da5a8cd822065c1839bc7a53f826803a3d /src/frontend/mame
parent01657a63c13c79c5f045ba4ecb4c2fd7f7c5a1f8 (diff)
Split UI and frontend part from core [Miodrag Milanovic]
Diffstat (limited to 'src/frontend/mame')
-rw-r--r--src/frontend/mame/audit.cpp604
-rw-r--r--src/frontend/mame/audit.h168
-rw-r--r--src/frontend/mame/cheat.cpp1446
-rw-r--r--src/frontend/mame/cheat.h337
-rw-r--r--src/frontend/mame/clifront.cpp2051
-rw-r--r--src/frontend/mame/clifront.h75
-rw-r--r--src/frontend/mame/info.cpp1601
-rw-r--r--src/frontend/mame/info.h68
-rw-r--r--src/frontend/mame/language.cpp79
-rw-r--r--src/frontend/mame/language.h31
-rw-r--r--src/frontend/mame/luaengine.cpp2623
-rw-r--r--src/frontend/mame/luaengine.h252
-rw-r--r--src/frontend/mame/mame.cpp393
-rw-r--r--src/frontend/mame/mame.h92
-rw-r--r--src/frontend/mame/mameopts.cpp426
-rw-r--r--src/frontend/mame/mameopts.h78
-rw-r--r--src/frontend/mame/pluginopts.cpp97
-rw-r--r--src/frontend/mame/pluginopts.h29
-rw-r--r--src/frontend/mame/ui/auditmenu.cpp204
-rw-r--r--src/frontend/mame/ui/auditmenu.h41
-rw-r--r--src/frontend/mame/ui/barcode.cpp154
-rw-r--r--src/frontend/mame/ui/barcode.h31
-rw-r--r--src/frontend/mame/ui/cheatopt.cpp320
-rw-r--r--src/frontend/mame/ui/cheatopt.h49
-rw-r--r--src/frontend/mame/ui/custmenu.cpp583
-rw-r--r--src/frontend/mame/ui/custmenu.h131
-rw-r--r--src/frontend/mame/ui/custui.cpp1068
-rw-r--r--src/frontend/mame/ui/custui.h178
-rw-r--r--src/frontend/mame/ui/datfile.cpp680
-rw-r--r--src/frontend/mame/ui/datfile.h96
-rw-r--r--src/frontend/mame/ui/datmenu.cpp296
-rw-r--r--src/frontend/mame/ui/datmenu.h52
-rw-r--r--src/frontend/mame/ui/defimg.h262
-rw-r--r--src/frontend/mame/ui/devctrl.h153
-rw-r--r--src/frontend/mame/ui/devopt.cpp279
-rw-r--r--src/frontend/mame/ui/devopt.h30
-rw-r--r--src/frontend/mame/ui/dirmenu.cpp665
-rw-r--r--src/frontend/mame/ui/dirmenu.h97
-rw-r--r--src/frontend/mame/ui/filemngr.cpp218
-rw-r--r--src/frontend/mame/ui/filemngr.h37
-rw-r--r--src/frontend/mame/ui/filesel.cpp888
-rw-r--r--src/frontend/mame/ui/filesel.h148
-rw-r--r--src/frontend/mame/ui/floppycntrl.cpp170
-rw-r--r--src/frontend/mame/ui/floppycntrl.h36
-rw-r--r--src/frontend/mame/ui/icorender.h233
-rw-r--r--src/frontend/mame/ui/imgcntrl.cpp343
-rw-r--r--src/frontend/mame/ui/imgcntrl.h62
-rw-r--r--src/frontend/mame/ui/info.cpp110
-rw-r--r--src/frontend/mame/ui/info.h37
-rw-r--r--src/frontend/mame/ui/info_pty.cpp43
-rw-r--r--src/frontend/mame/ui/info_pty.h24
-rw-r--r--src/frontend/mame/ui/inifile.cpp454
-rw-r--r--src/frontend/mame/ui/inifile.h117
-rw-r--r--src/frontend/mame/ui/inputmap.cpp930
-rw-r--r--src/frontend/mame/ui/inputmap.h155
-rw-r--r--src/frontend/mame/ui/mainmenu.cpp284
-rw-r--r--src/frontend/mame/ui/mainmenu.h59
-rw-r--r--src/frontend/mame/ui/menu.cpp2965
-rw-r--r--src/frontend/mame/ui/menu.h284
-rw-r--r--src/frontend/mame/ui/miscmenu.cpp983
-rw-r--r--src/frontend/mame/ui/miscmenu.h154
-rw-r--r--src/frontend/mame/ui/moptions.cpp90
-rw-r--r--src/frontend/mame/ui/moptions.h139
-rw-r--r--src/frontend/mame/ui/optsmenu.cpp390
-rw-r--r--src/frontend/mame/ui/optsmenu.h53
-rw-r--r--src/frontend/mame/ui/pluginopt.cpp113
-rw-r--r--src/frontend/mame/ui/pluginopt.h38
-rw-r--r--src/frontend/mame/ui/selector.cpp257
-rw-r--r--src/frontend/mame/ui/selector.h52
-rw-r--r--src/frontend/mame/ui/selgame.cpp2493
-rw-r--r--src/frontend/mame/ui/selgame.h85
-rw-r--r--src/frontend/mame/ui/selsoft.cpp2148
-rw-r--r--src/frontend/mame/ui/selsoft.h110
-rw-r--r--src/frontend/mame/ui/simpleselgame.cpp446
-rw-r--r--src/frontend/mame/ui/simpleselgame.h48
-rw-r--r--src/frontend/mame/ui/sliders.cpp283
-rw-r--r--src/frontend/mame/ui/sliders.h39
-rw-r--r--src/frontend/mame/ui/slotopt.cpp210
-rw-r--r--src/frontend/mame/ui/slotopt.h35
-rw-r--r--src/frontend/mame/ui/sndmenu.cpp171
-rw-r--r--src/frontend/mame/ui/sndmenu.h42
-rw-r--r--src/frontend/mame/ui/starimg.h38
-rw-r--r--src/frontend/mame/ui/submenu.cpp368
-rw-r--r--src/frontend/mame/ui/submenu.h160
-rw-r--r--src/frontend/mame/ui/swlist.cpp458
-rw-r--r--src/frontend/mame/ui/swlist.h84
-rw-r--r--src/frontend/mame/ui/tapectrl.cpp182
-rw-r--r--src/frontend/mame/ui/tapectrl.h30
-rw-r--r--src/frontend/mame/ui/toolbar.h110
-rw-r--r--src/frontend/mame/ui/ui.cpp2738
-rw-r--r--src/frontend/mame/ui/ui.h223
-rw-r--r--src/frontend/mame/ui/uicmd14.pngbin0 -> 3254 bytes
-rw-r--r--src/frontend/mame/ui/utils.cpp181
-rw-r--r--src/frontend/mame/ui/utils.h256
-rw-r--r--src/frontend/mame/ui/videoopt.cpp232
-rw-r--r--src/frontend/mame/ui/videoopt.h48
-rw-r--r--src/frontend/mame/ui/viewgfx.cpp1162
-rw-r--r--src/frontend/mame/ui/viewgfx.h32
98 files changed, 38097 insertions, 0 deletions
diff --git a/src/frontend/mame/audit.cpp b/src/frontend/mame/audit.cpp
new file mode 100644
index 00000000000..60781ae7710
--- /dev/null
+++ b/src/frontend/mame/audit.cpp
@@ -0,0 +1,604 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+/***************************************************************************
+
+ audit.c
+
+ ROM set auditing functions.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "emuopts.h"
+#include "audit.h"
+#include "chd.h"
+#include "sound/samples.h"
+#include "softlist.h"
+
+//**************************************************************************
+// CORE FUNCTIONS
+//**************************************************************************
+
+//-------------------------------------------------
+// media_auditor - constructor
+//-------------------------------------------------
+
+media_auditor::media_auditor(const driver_enumerator &enumerator)
+ : m_enumerator(enumerator),
+ m_validation(AUDIT_VALIDATE_FULL),
+ m_searchpath(nullptr)
+{
+}
+
+
+//-------------------------------------------------
+// audit_media - audit the media described by the
+// currently-enumerated driver
+//-------------------------------------------------
+
+media_auditor::summary media_auditor::audit_media(const char *validation)
+{
+ // start fresh
+ m_record_list.reset();
+
+ // store validation for later
+ m_validation = validation;
+
+// temporary hack until romload is update: get the driver path and support it for
+// all searches
+const char *driverpath = m_enumerator.config().root_device().searchpath();
+
+ int found = 0;
+ int required = 0;
+ int shared_found = 0;
+ int shared_required = 0;
+
+ // iterate over devices and regions
+ for (device_t &device : device_iterator(m_enumerator.config().root_device()))
+ {
+ // determine the search path for this source and iterate through the regions
+ m_searchpath = device.searchpath();
+
+ // now iterate over regions and ROMs within
+ for (const rom_entry *region = rom_first_region(device); region != nullptr; region = rom_next_region(region))
+ {
+// temporary hack: add the driver path & region name
+std::string combinedpath = std::string(device.searchpath()).append(";").append(driverpath);
+if (device.shortname())
+ combinedpath.append(";").append(device.shortname());
+m_searchpath = combinedpath.c_str();
+
+ for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
+ {
+ const char *name = ROM_GETNAME(rom);
+ hash_collection hashes(ROM_GETHASHDATA(rom));
+ device_t *shared_device = find_shared_device(device, name, hashes, ROM_GETLENGTH(rom));
+
+ // count the number of files with hashes
+ if (!hashes.flag(hash_collection::FLAG_NO_DUMP) && !ROM_ISOPTIONAL(rom))
+ {
+ required++;
+ if (shared_device != nullptr)
+ shared_required++;
+ }
+
+ // audit a file
+ audit_record *record = nullptr;
+ if (ROMREGION_ISROMDATA(region))
+ record = audit_one_rom(rom);
+
+ // audit a disk
+ else if (ROMREGION_ISDISKDATA(region))
+ record = audit_one_disk(rom);
+
+ if (record != nullptr)
+ {
+ // count the number of files that are found.
+ if (record->status() == audit_record::STATUS_GOOD || (record->status() == audit_record::STATUS_FOUND_INVALID && find_shared_device(device, name, record->actual_hashes(), record->actual_length()) == nullptr))
+ {
+ found++;
+ if (shared_device != nullptr)
+ shared_found++;
+ }
+
+ record->set_shared_device(shared_device);
+ }
+ }
+ }
+ }
+
+ // if we only find files that are in the parent & either the set has no unique files or the parent is not found, then assume we don't have the set at all
+ if (found == shared_found && required > 0 && (required != shared_required || shared_found == 0))
+ {
+ m_record_list.reset();
+ return NOTFOUND;
+ }
+
+ // return a summary
+ return summarize(m_enumerator.driver().name);
+}
+
+
+//-------------------------------------------------
+// audit_device - audit the device
+//-------------------------------------------------
+
+media_auditor::summary media_auditor::audit_device(device_t &device, const char *validation)
+{
+ // start fresh
+ m_record_list.reset();
+
+ // store validation for later
+ m_validation = validation;
+ m_searchpath = device.shortname();
+
+ int found = 0;
+ int required = 0;
+
+ // now iterate over regions and ROMs within
+ for (const rom_entry *region = rom_first_region(device); region != nullptr; region = rom_next_region(region))
+ {
+ for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
+ {
+ hash_collection hashes(ROM_GETHASHDATA(rom));
+
+ // count the number of files with hashes
+ if (!hashes.flag(hash_collection::FLAG_NO_DUMP) && !ROM_ISOPTIONAL(rom))
+ {
+ required++;
+ }
+
+ // audit a file
+ audit_record *record = nullptr;
+ if (ROMREGION_ISROMDATA(region))
+ record = audit_one_rom(rom);
+
+ // audit a disk
+ else if (ROMREGION_ISDISKDATA(region))
+ record = audit_one_disk(rom);
+
+ // count the number of files that are found.
+ if (record != nullptr && (record->status() == audit_record::STATUS_GOOD || record->status() == audit_record::STATUS_FOUND_INVALID))
+ {
+ found++;
+ }
+ }
+ }
+
+ if (found == 0 && required > 0)
+ {
+ m_record_list.reset();
+ return NOTFOUND;
+ }
+
+ // return a summary
+ return summarize(device.shortname());
+}
+
+
+//-------------------------------------------------
+// audit_software
+//-------------------------------------------------
+media_auditor::summary media_auditor::audit_software(const char *list_name, software_info *swinfo, const char *validation)
+{
+ // start fresh
+ m_record_list.reset();
+
+ // store validation for later
+ m_validation = validation;
+
+ std::string combinedpath(swinfo->shortname());
+ combinedpath.append(";");
+ combinedpath.append(list_name);
+ combinedpath.append(PATH_SEPARATOR);
+ combinedpath.append(swinfo->shortname());
+ std::string locationtag(list_name);
+ locationtag.append("%");
+ locationtag.append(swinfo->shortname());
+ locationtag.append("%");
+ if (swinfo->parentname() != nullptr)
+ {
+ locationtag.append(swinfo->parentname());
+ combinedpath.append(";").append(swinfo->parentname()).append(";").append(list_name).append(PATH_SEPARATOR).append(swinfo->parentname());
+ }
+ m_searchpath = combinedpath.c_str();
+
+ int found = 0;
+ int required = 0;
+
+ // now iterate over software parts
+ for (software_part &part : swinfo->parts())
+ {
+ // now iterate over regions
+ for ( const rom_entry *region = part.romdata(); region; region = rom_next_region( region ) )
+ {
+ // now iterate over rom definitions
+ for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
+ {
+ hash_collection hashes(ROM_GETHASHDATA(rom));
+
+ // count the number of files with hashes
+ if (!hashes.flag(hash_collection::FLAG_NO_DUMP) && !ROM_ISOPTIONAL(rom))
+ {
+ required++;
+ }
+
+ // audit a file
+ audit_record *record = nullptr;
+ if (ROMREGION_ISROMDATA(region))
+ {
+ record = audit_one_rom(rom);
+ }
+ // audit a disk
+ else if (ROMREGION_ISDISKDATA(region))
+ {
+ record = audit_one_disk(rom, locationtag.c_str());
+ }
+
+ // count the number of files that are found.
+ if (record != nullptr && (record->status() == audit_record::STATUS_GOOD || record->status() == audit_record::STATUS_FOUND_INVALID))
+ {
+ found++;
+ }
+ }
+ }
+ }
+
+ if (found == 0 && required > 0)
+ {
+ m_record_list.reset();
+ return NOTFOUND;
+ }
+
+ // return a summary
+ return summarize(list_name);
+}
+
+
+//-------------------------------------------------
+// audit_samples - validate the samples for the
+// currently-enumerated driver
+//-------------------------------------------------
+
+media_auditor::summary media_auditor::audit_samples()
+{
+ // start fresh
+ m_record_list.reset();
+
+ int required = 0;
+ int found = 0;
+
+ // iterate over sample entries
+ for (samples_device &device : samples_device_iterator(m_enumerator.config().root_device()))
+ {
+ // by default we just search using the driver name
+ std::string searchpath(m_enumerator.driver().name);
+
+ // add the alternate path if present
+ samples_iterator iter(device);
+ if (iter.altbasename() != nullptr)
+ searchpath.append(";").append(iter.altbasename());
+
+ // iterate over samples in this entry
+ for (const char *samplename = iter.first(); samplename != nullptr; samplename = iter.next())
+ {
+ required++;
+
+ // create a new record
+ audit_record &record = m_record_list.append(*global_alloc(audit_record(samplename, audit_record::MEDIA_SAMPLE)));
+
+ // look for the files
+ emu_file file(m_enumerator.options().sample_path(), OPEN_FLAG_READ | OPEN_FLAG_NO_PRELOAD);
+ path_iterator path(searchpath.c_str());
+ std::string curpath;
+ while (path.next(curpath, samplename))
+ {
+ // attempt to access the file (.flac) or (.wav)
+ osd_file::error filerr = file.open(curpath.c_str(), ".flac");
+ if (filerr != osd_file::error::NONE)
+ filerr = file.open(curpath.c_str(), ".wav");
+
+ if (filerr == osd_file::error::NONE)
+ {
+ record.set_status(audit_record::STATUS_GOOD, audit_record::SUBSTATUS_GOOD);
+ found++;
+ }
+ else
+ record.set_status(audit_record::STATUS_NOT_FOUND, audit_record::SUBSTATUS_NOT_FOUND);
+ }
+ }
+ }
+
+ if (found == 0 && required > 0)
+ {
+ m_record_list.reset();
+ return NOTFOUND;
+ }
+
+ // return a summary
+ return summarize(m_enumerator.driver().name);
+}
+
+
+//-------------------------------------------------
+// summary - generate a summary, with an optional
+// string format
+//-------------------------------------------------
+
+media_auditor::summary media_auditor::summarize(const char *name, std::string *output)
+{
+ if (m_record_list.count() == 0)
+ {
+ return NONE_NEEDED;
+ }
+
+ // loop over records
+ summary overall_status = CORRECT;
+ for (audit_record &record : m_record_list)
+ {
+ summary best_new_status = INCORRECT;
+
+ // skip anything that's fine
+ if (record.substatus() == audit_record::SUBSTATUS_GOOD)
+ continue;
+
+ // output the game name, file name, and length (if applicable)
+ if (output != nullptr)
+ {
+ output->append(string_format("%-12s: %s", name, record.name()));
+ if (record.expected_length() > 0)
+ output->append(string_format(" (%d bytes)", record.expected_length()));
+ output->append(" - ");
+ }
+
+ // use the substatus for finer details
+ switch (record.substatus())
+ {
+ case audit_record::SUBSTATUS_GOOD_NEEDS_REDUMP:
+ if (output != nullptr) output->append("NEEDS REDUMP\n");
+ best_new_status = BEST_AVAILABLE;
+ break;
+
+ case audit_record::SUBSTATUS_FOUND_NODUMP:
+ if (output != nullptr) output->append("NO GOOD DUMP KNOWN\n");
+ best_new_status = BEST_AVAILABLE;
+ break;
+
+ case audit_record::SUBSTATUS_FOUND_BAD_CHECKSUM:
+ if (output != nullptr)
+ {
+ output->append("INCORRECT CHECKSUM:\n");
+ output->append(string_format("EXPECTED: %s\n", record.expected_hashes().macro_string().c_str()));
+ output->append(string_format(" FOUND: %s\n", record.actual_hashes().macro_string().c_str()));
+ }
+ break;
+
+ case audit_record::SUBSTATUS_FOUND_WRONG_LENGTH:
+ if (output != nullptr) output->append(string_format("INCORRECT LENGTH: %d bytes\n", record.actual_length()));
+ break;
+
+ case audit_record::SUBSTATUS_NOT_FOUND:
+ if (output != nullptr)
+ {
+ device_t *shared_device = record.shared_device();
+ if (shared_device == nullptr)
+ output->append("NOT FOUND\n");
+ else
+ output->append(string_format("NOT FOUND (%s)\n", shared_device->shortname()));
+ }
+ break;
+
+ case audit_record::SUBSTATUS_NOT_FOUND_NODUMP:
+ if (output != nullptr) output->append("NOT FOUND - NO GOOD DUMP KNOWN\n");
+ best_new_status = BEST_AVAILABLE;
+ break;
+
+ case audit_record::SUBSTATUS_NOT_FOUND_OPTIONAL:
+ if (output != nullptr) output->append("NOT FOUND BUT OPTIONAL\n");
+ best_new_status = BEST_AVAILABLE;
+ break;
+
+ default:
+ assert(false);
+ }
+
+ // downgrade the overall status if necessary
+ overall_status = MAX(overall_status, best_new_status);
+ }
+ return overall_status;
+}
+
+
+//-------------------------------------------------
+// audit_one_rom - validate a single ROM entry
+//-------------------------------------------------
+
+audit_record *media_auditor::audit_one_rom(const rom_entry *rom)
+{
+ // allocate and append a new record
+ audit_record &record = m_record_list.append(*global_alloc(audit_record(*rom, audit_record::MEDIA_ROM)));
+
+ // see if we have a CRC and extract it if so
+ UINT32 crc = 0;
+ bool has_crc = record.expected_hashes().crc(crc);
+
+ // find the file and checksum it, getting the file length along the way
+ emu_file file(m_enumerator.options().media_path(), OPEN_FLAG_READ | OPEN_FLAG_NO_PRELOAD);
+ file.set_restrict_to_mediapath(true);
+ path_iterator path(m_searchpath);
+ std::string curpath;
+ while (path.next(curpath, record.name()))
+ {
+ // open the file if we can
+ osd_file::error filerr;
+ if (has_crc)
+ filerr = file.open(curpath.c_str(), crc);
+ else
+ filerr = file.open(curpath.c_str());
+
+ // if it worked, get the actual length and hashes, then stop
+ if (filerr == osd_file::error::NONE)
+ {
+ record.set_actual(file.hashes(m_validation), file.size());
+ break;
+ }
+ }
+
+ // compute the final status
+ compute_status(record, rom, record.actual_length() != 0);
+ return &record;
+}
+
+
+//-------------------------------------------------
+// audit_one_disk - validate a single disk entry
+//-------------------------------------------------
+
+audit_record *media_auditor::audit_one_disk(const rom_entry *rom, const char *locationtag)
+{
+ // allocate and append a new record
+ audit_record &record = m_record_list.append(*global_alloc(audit_record(*rom, audit_record::MEDIA_DISK)));
+
+ // open the disk
+ chd_file source;
+ chd_error err = chd_error(open_disk_image(m_enumerator.options(), &m_enumerator.driver(), rom, source, locationtag));
+
+ // if we succeeded, get the hashes
+ if (err == CHDERR_NONE)
+ {
+ hash_collection hashes;
+
+ // if there's a SHA1 hash, add them to the output hash
+ if (source.sha1() != sha1_t::null)
+ hashes.add_sha1(source.sha1());
+
+ // update the actual values
+ record.set_actual(hashes);
+ }
+
+ // compute the final status
+ compute_status(record, rom, err == CHDERR_NONE);
+ return &record;
+}
+
+
+//-------------------------------------------------
+// compute_status - compute a detailed status
+// based on the information we have
+//-------------------------------------------------
+
+void media_auditor::compute_status(audit_record &record, const rom_entry *rom, bool found)
+{
+ // if not found, provide more details
+ if (!found)
+ {
+ // no good dump
+ if (record.expected_hashes().flag(hash_collection::FLAG_NO_DUMP))
+ record.set_status(audit_record::STATUS_NOT_FOUND, audit_record::SUBSTATUS_NOT_FOUND_NODUMP);
+
+ // optional ROM
+ else if (ROM_ISOPTIONAL(rom))
+ record.set_status(audit_record::STATUS_NOT_FOUND, audit_record::SUBSTATUS_NOT_FOUND_OPTIONAL);
+
+ // just plain old not found
+ else
+ record.set_status(audit_record::STATUS_NOT_FOUND, audit_record::SUBSTATUS_NOT_FOUND);
+ }
+
+ // if found, provide more details
+ else
+ {
+ // length mismatch
+ if (record.expected_length() != record.actual_length())
+ record.set_status(audit_record::STATUS_FOUND_INVALID, audit_record::SUBSTATUS_FOUND_WRONG_LENGTH);
+
+ // found but needs a dump
+ else if (record.expected_hashes().flag(hash_collection::FLAG_NO_DUMP))
+ record.set_status(audit_record::STATUS_GOOD, audit_record::SUBSTATUS_FOUND_NODUMP);
+
+ // incorrect hash
+ else if (record.expected_hashes() != record.actual_hashes())
+ record.set_status(audit_record::STATUS_FOUND_INVALID, audit_record::SUBSTATUS_FOUND_BAD_CHECKSUM);
+
+ // correct hash but needs a redump
+ else if (record.expected_hashes().flag(hash_collection::FLAG_BAD_DUMP))
+ record.set_status(audit_record::STATUS_GOOD, audit_record::SUBSTATUS_GOOD_NEEDS_REDUMP);
+
+ // just plain old good
+ else
+ record.set_status(audit_record::STATUS_GOOD, audit_record::SUBSTATUS_GOOD);
+ }
+}
+
+
+//-------------------------------------------------
+// find_shared_device - return the source that
+// shares a media entry with the same hashes
+//-------------------------------------------------
+
+device_t *media_auditor::find_shared_device(device_t &device, const char *name, const hash_collection &romhashes, UINT64 romlength)
+{
+ bool dumped = !romhashes.flag(hash_collection::FLAG_NO_DUMP);
+
+ // special case for non-root devices
+ device_t *highest_device = nullptr;
+ if (device.owner() != nullptr)
+ {
+ for (const rom_entry *region = rom_first_region(device); region != nullptr; region = rom_next_region(region))
+ for (const rom_entry *rom = rom_first_file(region); rom != nullptr; rom = rom_next_file(rom))
+ if (ROM_GETLENGTH(rom) == romlength)
+ {
+ hash_collection hashes(ROM_GETHASHDATA(rom));
+ if ((dumped && hashes == romhashes) || (!dumped && ROM_GETNAME(rom) == name))
+ highest_device = &device;
+ }
+ }
+ else
+ {
+ // iterate up the parent chain
+ for (int drvindex = m_enumerator.find(m_enumerator.driver().parent); drvindex != -1; drvindex = m_enumerator.find(m_enumerator.driver(drvindex).parent))
+ {
+ for (device_t &scandevice : device_iterator(m_enumerator.config(drvindex).root_device()))
+ for (const rom_entry *region = rom_first_region(scandevice); region; region = rom_next_region(region))
+ for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
+ if (ROM_GETLENGTH(rom) == romlength)
+ {
+ hash_collection hashes(ROM_GETHASHDATA(rom));
+ if ((dumped && hashes == romhashes) || (!dumped && ROM_GETNAME(rom) == name))
+ highest_device = &scandevice;
+ }
+ }
+ }
+
+ return highest_device;
+}
+
+
+//-------------------------------------------------
+// audit_record - constructor
+//-------------------------------------------------
+
+audit_record::audit_record(const rom_entry &media, media_type type)
+ : m_next(nullptr),
+ m_type(type),
+ m_status(STATUS_ERROR),
+ m_substatus(SUBSTATUS_ERROR),
+ m_name(ROM_GETNAME(&media)),
+ m_explength(rom_file_size(&media)),
+ m_length(0),
+ m_shared_device(nullptr)
+{
+ m_exphashes.from_internal_string(ROM_GETHASHDATA(&media));
+}
+
+audit_record::audit_record(const char *name, media_type type)
+ : m_next(nullptr),
+ m_type(type),
+ m_status(STATUS_ERROR),
+ m_substatus(SUBSTATUS_ERROR),
+ m_name(name),
+ m_explength(0),
+ m_length(0),
+ m_shared_device(nullptr)
+{
+}
diff --git a/src/frontend/mame/audit.h b/src/frontend/mame/audit.h
new file mode 100644
index 00000000000..83421f8cc6e
--- /dev/null
+++ b/src/frontend/mame/audit.h
@@ -0,0 +1,168 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+/***************************************************************************
+
+ audit.h
+
+ ROM, disk, and sample auditing functions.
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __AUDIT_H__
+#define __AUDIT_H__
+
+#include "drivenum.h"
+#include "hash.h"
+
+
+
+//**************************************************************************
+// CONSTANTS
+//**************************************************************************
+
+// hashes to use for validation
+#define AUDIT_VALIDATE_FAST "R" /* CRC only */
+#define AUDIT_VALIDATE_FULL "RS" /* CRC + SHA1 */
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+
+// ======================> audit_record
+
+// holds the result of auditing a single item
+class audit_record
+{
+ friend class simple_list<audit_record>;
+
+public:
+ // media types
+ enum media_type
+ {
+ MEDIA_ROM = 0,
+ MEDIA_DISK,
+ MEDIA_SAMPLE
+ };
+
+ // status values
+ enum audit_status
+ {
+ STATUS_GOOD = 0,
+ STATUS_FOUND_INVALID,
+ STATUS_NOT_FOUND,
+ STATUS_ERROR
+ };
+
+ // substatus values
+ enum audit_substatus
+ {
+ SUBSTATUS_GOOD = 0,
+ SUBSTATUS_GOOD_NEEDS_REDUMP,
+ SUBSTATUS_FOUND_NODUMP,
+ SUBSTATUS_FOUND_BAD_CHECKSUM,
+ SUBSTATUS_FOUND_WRONG_LENGTH,
+ SUBSTATUS_NOT_FOUND,
+ SUBSTATUS_NOT_FOUND_NODUMP,
+ SUBSTATUS_NOT_FOUND_OPTIONAL,
+ SUBSTATUS_ERROR = 100
+ };
+
+ // construction/destruction
+ audit_record(const rom_entry &media, media_type type);
+ audit_record(const char *name, media_type type);
+
+ // getters
+ audit_record *next() const { return m_next; }
+ media_type type() const { return m_type; }
+ audit_status status() const { return m_status; }
+ audit_substatus substatus() const { return m_substatus; }
+ const char *name() const { return m_name; }
+ UINT64 expected_length() const { return m_explength; }
+ UINT64 actual_length() const { return m_length; }
+ const hash_collection &expected_hashes() const { return m_exphashes; }
+ const hash_collection &actual_hashes() const { return m_hashes; }
+ device_t *shared_device() const { return m_shared_device; }
+
+ // setters
+ void set_status(audit_status status, audit_substatus substatus)
+ {
+ m_status = status;
+ m_substatus = substatus;
+ }
+
+ void set_actual(const hash_collection &hashes, UINT64 length = 0)
+ {
+ m_hashes = hashes;
+ m_length = length;
+ }
+
+ void set_shared_device(device_t *shared_device)
+ {
+ m_shared_device = shared_device;
+ }
+
+private:
+ // internal state
+ audit_record * m_next;
+ media_type m_type; /* type of item that was audited */
+ audit_status m_status; /* status of audit on this item */
+ audit_substatus m_substatus; /* finer-detail status */
+ const char * m_name; /* name of item */
+ UINT64 m_explength; /* expected length of item */
+ UINT64 m_length; /* actual length of item */
+ hash_collection m_exphashes; /* expected hash data */
+ hash_collection m_hashes; /* actual hash information */
+ device_t * m_shared_device; /* device that shares the rom */
+};
+
+
+// ======================> media_auditor
+
+// class which manages auditing of items
+class media_auditor
+{
+public:
+ // summary values
+ enum summary
+ {
+ CORRECT = 0,
+ NONE_NEEDED,
+ BEST_AVAILABLE,
+ INCORRECT,
+ NOTFOUND
+ };
+
+ // construction/destruction
+ media_auditor(const driver_enumerator &enumerator);
+
+ // getters
+ const simple_list<audit_record> &records() const { return m_record_list; }
+
+ // audit operations
+ summary audit_media(const char *validation = AUDIT_VALIDATE_FULL);
+ summary audit_device(device_t &device, const char *validation = AUDIT_VALIDATE_FULL);
+ summary audit_software(const char *list_name, software_info *swinfo, const char *validation = AUDIT_VALIDATE_FULL);
+ summary audit_samples();
+ summary summarize(const char *name,std::string *output = nullptr);
+
+private:
+ // internal helpers
+ audit_record *audit_one_rom(const rom_entry *rom);
+ audit_record *audit_one_disk(const rom_entry *rom, const char *locationtag = nullptr);
+ void compute_status(audit_record &record, const rom_entry *rom, bool found);
+ device_t *find_shared_device(device_t &device, const char *name, const hash_collection &romhashes, UINT64 romlength);
+
+ // internal state
+ simple_list<audit_record> m_record_list;
+ const driver_enumerator & m_enumerator;
+ const char * m_validation;
+ const char * m_searchpath;
+};
+
+
+#endif /* __AUDIT_H__ */
diff --git a/src/frontend/mame/cheat.cpp b/src/frontend/mame/cheat.cpp
new file mode 100644
index 00000000000..099e6344d59
--- /dev/null
+++ b/src/frontend/mame/cheat.cpp
@@ -0,0 +1,1446 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+/***************************************************************************
+
+ cheat.c
+
+ MAME cheat system.
+
+****************************************************************************
+
+ Cheat XML format:
+
+ <mamecheat version="1">
+ <cheat desc="blah">
+ <parameter min="minval(0)" max="maxval(numitems)" step="stepval(1)">
+ <item value="itemval(previtemval|minval+stepval)">text</item>
+ ...
+ </parameter>
+ <script state="on|off|run|change(run)">
+ <action condition="condexpr(1)">expression</action>
+ ...
+ <output condition="condexpr(1)" format="format(required)" line="line(0)" align="left|center|right(left)">
+ <argument count="count(1)">expression</argument>
+ </output>
+ ...
+ </script>
+ ...
+ <comment>
+ ... text ...
+ </comment>
+ </cheat>
+ ...
+ </mamecheat>
+
+****************************************************************************
+
+ Expressions are standard debugger expressions. Note that & and
+ < must be escaped per XML rules. Within attributes you must use
+ &amp; and &lt;. For tags, you can also use <![CDATA[ ... ]]>.
+
+ Each cheat has its own context-specific variables:
+
+ temp0-temp9 -- 10 temporary variables for any use
+ param -- the current value of the cheat parameter
+ frame -- the current frame index
+ argindex -- for arguments with multiple iterations, this is the index
+
+ By default, each cheat has 10 temporary variables that are
+ persistent while executing its scripts. Additional temporary
+ variables may be requested via the 'tempvariables' attribute
+ on the cheat.
+
+****************************************************************************
+
+ Cheats are generally broken down into categories based on
+ which actions are defined and whether or not there is a
+ parameter present:
+
+ ---- Actions -----
+ On Off Run Chg Param? Type
+ === === === === ====== =================================
+ N N N ? None Text-only (displays text in menu)
+ Y N N ? None Oneshot (select to activate)
+ Y Y N ? None On/Off (select to toggle)
+ ? ? Y ? None On/Off (select to toggle)
+
+ ? N N Y Any Oneshot parameter (select to alter)
+ ? Y ? ? Value Value parameter (off or a live value)
+ ? ? Y ? Value Value parameter (off or a live value)
+ ? Y ? ? List Item list parameter (off or a live value)
+ ? ? Y ? List Item list parameter (off or a live value)
+
+***************************************************************************/
+
+#include "emu.h"
+#include "emuopts.h"
+#include "xmlfile.h"
+#include "ui/ui.h"
+#include "ui/menu.h"
+#include "cheat.h"
+#include "debug/debugcpu.h"
+
+#include <ctype.h>
+
+
+
+//**************************************************************************
+// PARAMETERS
+//**************************************************************************
+
+// turn this on to enable removing duplicate cheats; not sure if we should
+#define REMOVE_DUPLICATE_CHEATS 0
+
+
+
+//**************************************************************************
+// NUMBER AND FORMAT
+//**************************************************************************
+
+//-------------------------------------------------
+// format - format an integer according to
+// the format
+//-------------------------------------------------
+
+inline std::string number_and_format::format() const
+{
+ switch (m_format)
+ {
+ default:
+ case XML_INT_FORMAT_DECIMAL:
+ return string_format("%d", (UINT32)m_value);
+
+ case XML_INT_FORMAT_DECIMAL_POUND:
+ return string_format("#%d", (UINT32)m_value);
+
+ case XML_INT_FORMAT_HEX_DOLLAR:
+ return string_format("$%X", (UINT32)m_value);
+
+ case XML_INT_FORMAT_HEX_C:
+ return string_format("0x%X", (UINT32)m_value);
+ }
+}
+
+
+
+//**************************************************************************
+// CHEAT PARAMETER
+//**************************************************************************
+
+//-------------------------------------------------
+// cheat_parameter - constructor
+//-------------------------------------------------
+
+cheat_parameter::cheat_parameter(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node &paramnode)
+ : m_value(0)
+{
+ // read the core attributes
+ m_minval = number_and_format(xml_get_attribute_int(&paramnode, "min", 0), xml_get_attribute_int_format(&paramnode, "min"));
+ m_maxval = number_and_format(xml_get_attribute_int(&paramnode, "max", 0), xml_get_attribute_int_format(&paramnode, "max"));
+ m_stepval = number_and_format(xml_get_attribute_int(&paramnode, "step", 1), xml_get_attribute_int_format(&paramnode, "step"));
+
+ // iterate over items
+ for (xml_data_node *itemnode = xml_get_sibling(paramnode.child, "item"); itemnode != nullptr; itemnode = xml_get_sibling(itemnode->next, "item"))
+ {
+ // check for NULL text
+ if (itemnode->value == nullptr || itemnode->value[0] == 0)
+ throw emu_fatalerror("%s.xml(%d): item is missing text\n", filename, itemnode->line);
+
+ // check for non-existant value
+ if (xml_get_attribute(itemnode, "value") == nullptr)
+ throw emu_fatalerror("%s.xml(%d): item is value\n", filename, itemnode->line);
+
+ // extract the parameters
+ UINT64 value = xml_get_attribute_int(itemnode, "value", 0);
+ int format = xml_get_attribute_int_format(itemnode, "value");
+
+ // allocate and append a new item
+ item &curitem = m_itemlist.append(*global_alloc(item(itemnode->value, value, format)));
+
+ // ensure the maximum expands to suit
+ m_maxval = MAX(m_maxval, curitem.value());
+ }
+
+ // add a variable to the symbol table for our value
+ symbols.add("param", symbol_table::READ_ONLY, &m_value);
+}
+
+
+//-------------------------------------------------
+// text - return the current text for a parameter
+//-------------------------------------------------
+
+const char *cheat_parameter::text()
+{
+ // are we a value cheat?
+ if (!has_itemlist())
+ {
+ m_curtext = string_format("%d (0x%X)", UINT32(m_value), UINT32(m_value));
+ }
+ else
+ {
+ // if not, we're an item cheat
+ m_curtext = string_format("??? (%d)", UINT32(m_value));
+ for (item &curitem : m_itemlist)
+ if (curitem.value() == m_value)
+ {
+ m_curtext.assign(curitem.text());
+ break;
+ }
+ }
+ return m_curtext.c_str();
+}
+
+
+//-------------------------------------------------
+// save - save a single cheat parameter
+//-------------------------------------------------
+
+void cheat_parameter::save(emu_file &cheatfile) const
+{
+ // output the parameter tag
+ cheatfile.printf("\t\t<parameter");
+
+ // if no items, just output min/max/step
+ if (!has_itemlist())
+ {
+ if (m_minval != 0)
+ cheatfile.printf(" min=\"%s\"", m_minval.format().c_str());
+ if (m_maxval != 0)
+ cheatfile.printf(" max=\"%s\"", m_maxval.format().c_str());
+ if (m_stepval != 1)
+ cheatfile.printf(" step=\"%s\"", m_stepval.format().c_str());
+ cheatfile.printf("/>\n");
+ }
+
+ // iterate over items
+ else
+ {
+ for (const item &curitem : m_itemlist)
+ cheatfile.printf("\t\t\t<item value=\"%s\">%s</item>\n", curitem.value().format().c_str(), curitem.text());
+ cheatfile.printf("\t\t</parameter>\n");
+ }
+}
+
+
+//-------------------------------------------------
+// set_minimum_state - set the minimum state
+//-------------------------------------------------
+
+bool cheat_parameter::set_minimum_state()
+{
+ UINT64 origvalue = m_value;
+
+ // set based on whether we have an item list
+ m_value = (!has_itemlist()) ? m_minval : m_itemlist.first()->value();
+
+ return (m_value != origvalue);
+}
+
+
+//-------------------------------------------------
+// set_minimum_state - set the previous state
+//-------------------------------------------------
+
+bool cheat_parameter::set_prev_state()
+{
+ UINT64 origvalue = m_value;
+
+ // are we a value cheat?
+ if (!has_itemlist())
+ {
+ if (m_value < m_minval + m_stepval)
+ m_value = m_minval;
+ else
+ m_value -= m_stepval;
+ }
+
+ // if not, we're an item cheat
+ else
+ {
+ item *curitem, *previtem = nullptr;
+ for (curitem = m_itemlist.first(); curitem != nullptr; previtem = curitem, curitem = curitem->next())
+ if (curitem->value() == m_value)
+ break;
+ if (previtem != nullptr)
+ m_value = previtem->value();
+ }
+
+ return (m_value != origvalue);
+}
+
+
+//-------------------------------------------------
+// set_next_state - advance to the next state
+//-------------------------------------------------
+
+bool cheat_parameter::set_next_state()
+{
+ UINT64 origvalue = m_value;
+
+ // are we a value cheat?
+ if (!has_itemlist())
+ {
+ if (m_value > m_maxval - m_stepval)
+ m_value = m_maxval;
+ else
+ m_value += m_stepval;
+ }
+
+ // if not, we're an item cheat
+ else
+ {
+ item *curitem;
+ for (curitem = m_itemlist.first(); curitem != nullptr; curitem = curitem->next())
+ if (curitem->value() == m_value)
+ break;
+ if (curitem != nullptr && curitem->next() != nullptr)
+ m_value = curitem->next()->value();
+ }
+
+ return (m_value != origvalue);
+}
+
+
+
+//**************************************************************************
+// CHEAT SCRIPT
+//**************************************************************************
+
+//-------------------------------------------------
+// cheat_script - constructor
+//-------------------------------------------------
+
+cheat_script::cheat_script(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node &scriptnode)
+ : m_state(SCRIPT_STATE_RUN)
+{
+ // read the core attributes
+ const char *state = xml_get_attribute_string(&scriptnode, "state", "run");
+ if (strcmp(state, "on") == 0)
+ m_state = SCRIPT_STATE_ON;
+ else if (strcmp(state, "off") == 0)
+ m_state = SCRIPT_STATE_OFF;
+ else if (strcmp(state, "change") == 0)
+ m_state = SCRIPT_STATE_CHANGE;
+ else if (strcmp(state, "run") != 0)
+ throw emu_fatalerror("%s.xml(%d): invalid script state '%s'\n", filename, scriptnode.line, state);
+
+ // iterate over nodes within the script
+ for (xml_data_node *entrynode = scriptnode.child; entrynode != nullptr; entrynode = entrynode->next)
+ {
+ // handle action nodes
+ if (strcmp(entrynode->name, "action") == 0)
+ m_entrylist.append(*global_alloc(script_entry(manager, symbols, filename, *entrynode, true)));
+
+ // handle output nodes
+ else if (strcmp(entrynode->name, "output") == 0)
+ m_entrylist.append(*global_alloc(script_entry(manager, symbols, filename, *entrynode, false)));
+
+ // anything else is ignored
+ else
+ {
+ osd_printf_warning("%s.xml(%d): unknown script item '%s' will be lost if saved\n", filename, entrynode->line, entrynode->name);
+ continue;
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// execute - execute ourself
+//-------------------------------------------------
+
+void cheat_script::execute(cheat_manager &manager, UINT64 &argindex)
+{
+ // do nothing if disabled
+ if (!manager.enabled())
+ return;
+
+ // iterate over entries
+ for (script_entry &entry : m_entrylist)
+ entry.execute(manager, argindex);
+}
+
+
+//-------------------------------------------------
+// save - save a single cheat script
+//-------------------------------------------------
+
+void cheat_script::save(emu_file &cheatfile) const
+{
+ // output the script tag
+ cheatfile.printf("\t\t<script");
+ switch (m_state)
+ {
+ case SCRIPT_STATE_OFF: cheatfile.printf(" state=\"off\""); break;
+ case SCRIPT_STATE_ON: cheatfile.printf(" state=\"on\""); break;
+ default:
+ case SCRIPT_STATE_RUN: cheatfile.printf(" state=\"run\""); break;
+ case SCRIPT_STATE_CHANGE: cheatfile.printf(" state=\"change\""); break;
+ }
+ cheatfile.printf(">\n");
+
+ // output entries
+ for (const script_entry &entry : m_entrylist)
+ entry.save(cheatfile);
+
+ // close the tag
+ cheatfile.printf("\t\t</script>\n");
+}
+
+
+//-------------------------------------------------
+// script_entry - constructor
+//-------------------------------------------------
+
+cheat_script::script_entry::script_entry(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node &entrynode, bool isaction)
+ : m_next(nullptr),
+ m_condition(&symbols),
+ m_expression(&symbols)
+{
+ const char *expression = nullptr;
+ try
+ {
+ // read the condition if present
+ expression = xml_get_attribute_string(&entrynode, "condition", nullptr);
+ if (expression != nullptr)
+ m_condition.parse(expression);
+
+ // if this is an action, parse the expression
+ if (isaction)
+ {
+ expression = entrynode.value;
+ if (expression == nullptr || expression[0] == 0)
+ throw emu_fatalerror("%s.xml(%d): missing expression in action tag\n", filename, entrynode.line);
+ m_expression.parse(expression);
+ }
+
+ // otherwise, parse the attributes and arguments
+ else
+ {
+ // extract format
+ const char *format = xml_get_attribute_string(&entrynode, "format", nullptr);
+ if (format == nullptr || format[0] == 0)
+ throw emu_fatalerror("%s.xml(%d): missing format in output tag\n", filename, entrynode.line);
+ m_format.assign(format);
+
+ // extract other attributes
+ m_line = xml_get_attribute_int(&entrynode, "line", 0);
+ m_justify = JUSTIFY_LEFT;
+ const char *align = xml_get_attribute_string(&entrynode, "align", "left");
+ if (strcmp(align, "center") == 0)
+ m_justify = JUSTIFY_CENTER;
+ else if (strcmp(align, "right") == 0)
+ m_justify = JUSTIFY_RIGHT;
+ else if (strcmp(align, "left") != 0)
+ throw emu_fatalerror("%s.xml(%d): invalid alignment '%s' specified\n", filename, entrynode.line, align);
+
+ // then parse arguments
+ int totalargs = 0;
+ for (xml_data_node *argnode = xml_get_sibling(entrynode.child, "argument"); argnode != nullptr; argnode = xml_get_sibling(argnode->next, "argument"))
+ {
+ output_argument &curarg = m_arglist.append(*global_alloc(output_argument(manager, symbols, filename, *argnode)));
+
+ // verify we didn't overrun the argument count
+ totalargs += curarg.count();
+ if (totalargs > MAX_ARGUMENTS)
+ throw emu_fatalerror("%s.xml(%d): too many arguments (found %d, max is %d)\n", filename, argnode->line, totalargs, MAX_ARGUMENTS);
+ }
+
+ // validate the format against the arguments
+ validate_format(filename, entrynode.line);
+ }
+ }
+ catch (expression_error &err)
+ {
+ throw emu_fatalerror("%s.xml(%d): error parsing cheat expression \"%s\" (%s)\n", filename, entrynode.line, expression, err.code_string());
+ }
+}
+
+
+//-------------------------------------------------
+// execute - execute a single script entry
+//-------------------------------------------------
+
+void cheat_script::script_entry::execute(cheat_manager &manager, UINT64 &argindex)
+{
+ // evaluate the condition
+ if (!m_condition.is_empty())
+ {
+ try
+ {
+ UINT64 result = m_condition.execute();
+ if (result == 0)
+ return;
+ }
+ catch (expression_error &err)
+ {
+ osd_printf_warning("Error executing conditional expression \"%s\": %s\n", m_condition.original_string(), err.code_string());
+ return;
+ }
+ }
+
+ // if there is an action, execute it
+ if (!m_expression.is_empty())
+ {
+ try
+ {
+ m_expression.execute();
+ }
+ catch (expression_error &err)
+ {
+ osd_printf_warning("Error executing expression \"%s\": %s\n", m_expression.original_string(), err.code_string());
+ }
+ }
+
+ // if there is a string to display, compute it
+ if (!m_format.empty())
+ {
+ // iterate over arguments and evaluate them
+ UINT64 params[MAX_ARGUMENTS];
+ int curarg = 0;
+ for (output_argument &arg : m_arglist)
+ curarg += arg.values(argindex, &params[curarg]);
+
+ // generate the astring
+ manager.get_output_astring(m_line, m_justify) = string_format(m_format,
+ (UINT32)params[0], (UINT32)params[1], (UINT32)params[2], (UINT32)params[3],
+ (UINT32)params[4], (UINT32)params[5], (UINT32)params[6], (UINT32)params[7],
+ (UINT32)params[8], (UINT32)params[9], (UINT32)params[10], (UINT32)params[11],
+ (UINT32)params[12], (UINT32)params[13], (UINT32)params[14], (UINT32)params[15],
+ (UINT32)params[16], (UINT32)params[17], (UINT32)params[18], (UINT32)params[19],
+ (UINT32)params[20], (UINT32)params[21], (UINT32)params[22], (UINT32)params[23],
+ (UINT32)params[24], (UINT32)params[25], (UINT32)params[26], (UINT32)params[27],
+ (UINT32)params[28], (UINT32)params[29], (UINT32)params[30], (UINT32)params[31]);
+ }
+}
+
+
+//-------------------------------------------------
+// save - save a single action or output
+//-------------------------------------------------
+
+void cheat_script::script_entry::save(emu_file &cheatfile) const
+{
+ // output an action
+ if (m_format.empty())
+ {
+ cheatfile.printf("\t\t\t<action");
+ if (!m_condition.is_empty())
+ cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(m_condition).c_str());
+ cheatfile.printf(">%s</action>\n", cheat_manager::quote_expression(m_expression).c_str());
+ }
+
+ // output an output
+ else
+ {
+ cheatfile.printf("\t\t\t<output format=\"%s\"", m_format.c_str());
+ if (!m_condition.is_empty())
+ cheatfile.printf(" condition=\"%s\"", cheat_manager::quote_expression(m_condition).c_str());
+ if (m_line != 0)
+ cheatfile.printf(" line=\"%d\"", m_line);
+ if (m_justify == JUSTIFY_CENTER)
+ cheatfile.printf(" align=\"center\"");
+ else if (m_justify == JUSTIFY_RIGHT)
+ cheatfile.printf(" align=\"right\"");
+ if (m_arglist.count() == 0)
+ cheatfile.printf(" />\n");
+
+ // output arguments
+ else
+ {
+ cheatfile.printf(">\n");
+ for (const output_argument &curarg : m_arglist)
+ curarg.save(cheatfile);
+ cheatfile.printf("\t\t\t</output>\n");
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// validate_format - check that a format string
+// has the correct number and type of arguments
+//-------------------------------------------------
+
+void cheat_script::script_entry::validate_format(const char *filename, int line)
+{
+ // first count arguments
+ int argsprovided = 0;
+ for (const output_argument &curarg : m_arglist)
+ argsprovided += curarg.count();
+
+ // now scan the string for valid argument usage
+ const char *p = strchr(m_format.c_str(), '%');
+ int argscounted = 0;
+ while (p != nullptr)
+ {
+ // skip past any valid attributes
+ p++;
+ while (strchr("lh0123456789.-+ #", *p) != nullptr)
+ p++;
+
+ // look for a valid type
+ if (strchr("cdiouxX", *p) == nullptr)
+ throw emu_fatalerror("%s.xml(%d): invalid format specification \"%s\"\n", filename, line, m_format.c_str());
+ argscounted++;
+
+ // look for the next one
+ p = strchr(p, '%');
+ }
+
+ // did we match?
+ if (argscounted < argsprovided)
+ throw emu_fatalerror("%s.xml(%d): too many arguments provided (%d) for format \"%s\"\n", filename, line, argsprovided, m_format.c_str());
+ if (argscounted > argsprovided)
+ throw emu_fatalerror("%s.xml(%d): not enough arguments provided (%d) for format \"%s\"\n", filename, line, argsprovided, m_format.c_str());
+}
+
+
+//-------------------------------------------------
+// output_argument - constructor
+//-------------------------------------------------
+
+cheat_script::script_entry::output_argument::output_argument(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node &argnode)
+ : m_next(nullptr),
+ m_expression(&symbols),
+ m_count(0)
+{
+ // first extract attributes
+ m_count = xml_get_attribute_int(&argnode, "count", 1);
+
+ // read the expression
+ const char *expression = argnode.value;
+ if (expression == nullptr || expression[0] == 0)
+ throw emu_fatalerror("%s.xml(%d): missing expression in argument tag\n", filename, argnode.line);
+
+ // parse it
+ try
+ {
+ m_expression.parse(expression);
+ }
+ catch (expression_error &err)
+ {
+ throw emu_fatalerror("%s.xml(%d): error parsing cheat expression \"%s\" (%s)\n", filename, argnode.line, expression, err.code_string());
+ }
+}
+
+
+//-------------------------------------------------
+// value - return the evaluated value of the
+// given output argument
+//-------------------------------------------------
+
+int cheat_script::script_entry::output_argument::values(UINT64 &argindex, UINT64 *result)
+{
+ for (argindex = 0; argindex < m_count; argindex++)
+ {
+ try
+ {
+ result[argindex] = m_expression.execute();
+ }
+ catch (expression_error &err)
+ {
+ osd_printf_warning("Error executing argument expression \"%s\": %s\n", m_expression.original_string(), err.code_string());
+ }
+ }
+ return m_count;
+}
+
+
+//-------------------------------------------------
+// save - save a single output argument
+//-------------------------------------------------
+
+void cheat_script::script_entry::output_argument::save(emu_file &cheatfile) const
+{
+ cheatfile.printf("\t\t\t\t<argument");
+ if (m_count != 1)
+ cheatfile.printf(" count=\"%d\"", (int)m_count);
+ cheatfile.printf(">%s</argument>\n", cheat_manager::quote_expression(m_expression).c_str());
+}
+
+
+
+//**************************************************************************
+// CHEAT ENTRY
+//**************************************************************************
+
+//-------------------------------------------------
+// cheat_entry - constructor
+//-------------------------------------------------
+
+cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, const char *filename, xml_data_node &cheatnode)
+ : m_manager(manager),
+ m_next(nullptr),
+ m_symbols(&manager.machine(), &globaltable),
+ m_state(SCRIPT_STATE_OFF),
+ m_numtemp(DEFAULT_TEMP_VARIABLES),
+ m_argindex(0)
+{
+ // reset scripts
+ try
+ {
+ // pull the variable count out ahead of things
+ int tempcount = xml_get_attribute_int(&cheatnode, "tempvariables", DEFAULT_TEMP_VARIABLES);
+ if (tempcount < 1)
+ throw emu_fatalerror("%s.xml(%d): invalid tempvariables attribute (%d)\n", filename, cheatnode.line, tempcount);
+
+ // allocate memory for the cheat
+ m_numtemp = tempcount;
+
+ // get the description
+ const char *description = xml_get_attribute_string(&cheatnode, "desc", nullptr);
+ if (description == nullptr || description[0] == 0)
+ throw emu_fatalerror("%s.xml(%d): empty or missing desc attribute on cheat\n", filename, cheatnode.line);
+ m_description = description;
+
+ // create the symbol table
+ m_symbols.add("argindex", symbol_table::READ_ONLY, &m_argindex);
+ for (int curtemp = 0; curtemp < tempcount; curtemp++) {
+ m_symbols.add(string_format("temp%d", curtemp).c_str(), symbol_table::READ_WRITE);
+ }
+
+ // read the first comment node
+ xml_data_node *commentnode = xml_get_sibling(cheatnode.child, "comment");
+ if (commentnode != nullptr)
+ {
+ // set the value if not NULL
+ if (commentnode->value != nullptr && commentnode->value[0] != 0)
+ m_comment.assign(commentnode->value);
+
+ // only one comment is kept
+ commentnode = xml_get_sibling(commentnode->next, "comment");
+ if (commentnode != nullptr)
+ osd_printf_warning("%s.xml(%d): only one comment node is retained; ignoring additional nodes\n", filename, commentnode->line);
+ }
+
+ // read the first parameter node
+ xml_data_node *paramnode = xml_get_sibling(cheatnode.child, "parameter");
+ if (paramnode != nullptr)
+ {
+ // load this parameter
+ m_parameter.reset(global_alloc(cheat_parameter(manager, m_symbols, filename, *paramnode)));
+
+ // only one parameter allowed
+ paramnode = xml_get_sibling(paramnode->next, "parameter");
+ if (paramnode != nullptr)
+ osd_printf_warning("%s.xml(%d): only one parameter node allowed; ignoring additional nodes\n", filename, paramnode->line);
+ }
+
+ // read the script nodes
+ for (xml_data_node *scriptnode = xml_get_sibling(cheatnode.child, "script"); scriptnode != nullptr; scriptnode = xml_get_sibling(scriptnode->next, "script"))
+ {
+ // load this entry
+ auto curscript = global_alloc(cheat_script(manager, m_symbols, filename, *scriptnode));
+
+ // if we have a script already for this slot, it is an error
+ std::unique_ptr<cheat_script> &slot = script_for_state(curscript->state());
+ if (slot != nullptr)
+ osd_printf_warning("%s.xml(%d): only one on script allowed; ignoring additional scripts\n", filename, scriptnode->line);
+ else
+ slot.reset(curscript);
+ }
+ }
+ catch (emu_fatalerror &)
+ {
+ // call our destructor to clean up and re-throw
+ this->~cheat_entry();
+ throw;
+ }
+}
+
+
+//-------------------------------------------------
+// ~cheat_entry - destructor
+//-------------------------------------------------
+
+cheat_entry::~cheat_entry()
+{
+}
+
+
+//-------------------------------------------------
+// save - save a single cheat entry
+//-------------------------------------------------
+
+void cheat_entry::save(emu_file &cheatfile) const
+{
+ // determine if we have scripts
+ bool has_scripts = (m_off_script != nullptr || m_on_script != nullptr || m_run_script != nullptr || m_change_script != nullptr);
+
+ // output the cheat tag
+ cheatfile.printf("\t<cheat desc=\"%s\"", m_description.c_str());
+ if (m_numtemp != DEFAULT_TEMP_VARIABLES)
+ cheatfile.printf(" tempvariables=\"%d\"", m_numtemp);
+ if (m_comment.empty() && m_parameter == nullptr && !has_scripts)
+ cheatfile.printf(" />\n");
+ else
+ {
+ cheatfile.printf(">\n");
+
+ // save the comment
+ if (!m_comment.empty())
+ cheatfile.printf("\t\t<comment><![CDATA[\n%s\n\t\t]]></comment>\n", m_comment.c_str());
+
+ // output the parameter, if present
+ if (m_parameter != nullptr)
+ m_parameter->save(cheatfile);
+
+ // output the script nodes
+ if (m_on_script != nullptr)
+ m_on_script->save(cheatfile);
+ if (m_off_script != nullptr)
+ m_off_script->save(cheatfile);
+ if (m_change_script != nullptr)
+ m_change_script->save(cheatfile);
+ if (m_run_script != nullptr)
+ m_run_script->save(cheatfile);
+
+ // close the cheat tag
+ cheatfile.printf("\t</cheat>\n");
+ }
+}
+
+
+//-------------------------------------------------
+// activate - activate a oneshot cheat
+//-------------------------------------------------
+
+bool cheat_entry::activate()
+{
+ bool changed = false;
+
+ // if cheats have been toggled off no point in even trying to do anything
+ if (!m_manager.enabled())
+ return changed;
+
+ // if we're a oneshot cheat, execute the "on" script and indicate change
+ if (is_oneshot())
+ {
+ execute_on_script();
+ changed = true;
+ m_manager.machine().popmessage("Activated %s", m_description.c_str());
+ }
+
+ // if we're a oneshot parameter cheat and we're active, execute the "state change" script and indicate change
+ else if (is_oneshot_parameter() && m_state != SCRIPT_STATE_OFF)
+ {
+ execute_change_script();
+ changed = true;
+ m_manager.machine().popmessage("Activated\n %s = %s", m_description.c_str(), m_parameter->text());
+ }
+
+ return changed;
+}
+
+
+//-------------------------------------------------
+// select_default_state - select the default
+// state for a cheat, or activate a oneshot cheat
+//-------------------------------------------------
+
+bool cheat_entry::select_default_state()
+{
+ bool changed = false;
+
+ // if we're a oneshot cheat, there is no default state
+ if (is_oneshot())
+ ;
+
+ // all other types switch to the "off" state
+ else
+ changed = set_state(SCRIPT_STATE_OFF);
+
+ return changed;
+}
+
+
+//-------------------------------------------------
+// select_previous_state - select the previous
+// state for a cheat
+//-------------------------------------------------
+
+bool cheat_entry::select_previous_state()
+{
+ bool changed = false;
+
+ // if we're a oneshot, there is no previous state
+ if (is_oneshot())
+ ;
+
+ // if we're on/off, toggle to off
+ else if (is_onoff())
+ changed = set_state(SCRIPT_STATE_OFF);
+
+ // if we have a parameter, set the previous state
+ else if (m_parameter != nullptr)
+ {
+ // if we're at our minimum, turn off
+ if (m_parameter->is_minimum())
+ changed = set_state(SCRIPT_STATE_OFF);
+ else
+ {
+ // if we changed, ensure we are in the running state and signal state change
+ changed = m_parameter->set_prev_state();
+ if (changed)
+ {
+ set_state(SCRIPT_STATE_RUN);
+ if (!is_oneshot_parameter())
+ execute_change_script();
+ }
+ }
+ }
+ return changed;
+}
+
+
+//-------------------------------------------------
+// select_next_state - select the next state for
+// a cheat
+//-------------------------------------------------
+
+bool cheat_entry::select_next_state()
+{
+ bool changed = false;
+
+ // if we're a oneshot, there is no next state
+ if (is_oneshot())
+ ;
+
+ // if we're on/off, toggle to running state
+ else if (is_onoff())
+ changed = set_state(SCRIPT_STATE_RUN);
+
+ // if we have a parameter, set the next state
+ else if (m_parameter != nullptr)
+ {
+ // if we're off, switch on to the minimum state
+ if (m_state == SCRIPT_STATE_OFF)
+ {
+ changed = set_state(SCRIPT_STATE_RUN);
+ m_parameter->set_minimum_state();
+ }
+
+ // otherwise, switch to the next state
+ else
+ changed = m_parameter->set_next_state();
+
+ // if we changed, signal a state change
+ if (changed && !is_oneshot_parameter())
+ execute_change_script();
+ }
+ return changed;
+}
+
+
+//-------------------------------------------------
+// menu_text - return the text needed to display
+// this cheat in a menu item
+//-------------------------------------------------
+
+void cheat_entry::menu_text(std::string &description, std::string &state, UINT32 &flags)
+{
+ // description is standard
+ description.assign(m_description);
+ state.clear();
+ flags = 0;
+
+ // some cheat entries are just text for display
+ if (is_text_only())
+ {
+ if (!description.empty())
+ {
+ strtrimspace(description);
+ if (description.empty())
+ description.assign(MENU_SEPARATOR_ITEM);
+ }
+ flags = MENU_FLAG_DISABLE;
+ }
+
+ // if we have no parameter and no run or off script, it's a oneshot cheat
+ else if (is_oneshot())
+ state.assign("Set");
+
+ // if we have no parameter, it's just on/off
+ else if (is_onoff())
+ {
+ state.assign((m_state == SCRIPT_STATE_RUN) ? "On" : "Off");
+ flags = (m_state != 0) ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW;
+ }
+
+ // if we have a value parameter, compute it
+ else if (m_parameter != nullptr)
+ {
+ if (m_state == SCRIPT_STATE_OFF)
+ {
+ state.assign(is_oneshot_parameter() ? "Set" : "Off");
+ flags = MENU_FLAG_RIGHT_ARROW;
+ }
+ else
+ {
+ state.assign(m_parameter->text());
+ flags = MENU_FLAG_LEFT_ARROW;
+ if (!m_parameter->is_maximum())
+ flags |= MENU_FLAG_RIGHT_ARROW;
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// set_state - switch to the given state
+//-------------------------------------------------
+
+bool cheat_entry::set_state(script_state newstate)
+{
+ // if we're already in the state, indicate no change
+ if (m_state == newstate)
+ return false;
+
+ // change to the state and run the appropriate script
+ m_state = newstate;
+ if (newstate == SCRIPT_STATE_OFF)
+ execute_off_script();
+ else if (newstate == SCRIPT_STATE_ON || newstate == SCRIPT_STATE_RUN)
+ execute_on_script();
+ return true;
+}
+
+
+//-------------------------------------------------
+// script_for_state - get a reference to the
+// given script pointer
+//-------------------------------------------------
+
+std::unique_ptr<cheat_script> &cheat_entry::script_for_state(script_state state)
+{
+ switch (state)
+ {
+ case SCRIPT_STATE_ON: return m_on_script;
+ case SCRIPT_STATE_OFF: return m_off_script;
+ case SCRIPT_STATE_CHANGE: return m_change_script;
+ default:
+ case SCRIPT_STATE_RUN: return m_run_script;
+ }
+}
+
+
+//-------------------------------------------------
+// is_duplicate - determine if a new cheat entry
+// is already included in the list
+//-------------------------------------------------
+
+bool cheat_entry::is_duplicate() const
+{
+ for (cheat_entry &scannode : manager().entries())
+ if (strcmp(scannode.description(), description()) == 0)
+ return true;
+ return false;
+}
+
+
+//**************************************************************************
+// CHEAT MANAGER
+//**************************************************************************
+
+const int cheat_manager::CHEAT_VERSION;
+
+
+//-------------------------------------------------
+// cheat_manager - constructor
+//-------------------------------------------------
+
+cheat_manager::cheat_manager(running_machine &machine)
+ : m_machine(machine),
+ m_disabled(true),
+ m_symtable(&machine)
+{
+ // if the cheat engine is disabled, we're done
+ if (!machine.options().cheat())
+ return;
+
+ m_output.resize(UI_TARGET_FONT_ROWS*2);
+ m_justify.resize(UI_TARGET_FONT_ROWS*2);
+
+ // request a callback
+ machine.add_notifier(MACHINE_NOTIFY_FRAME, machine_notify_delegate(FUNC(cheat_manager::frame_update), this));
+
+ // create a global symbol table
+ m_symtable.add("frame", symbol_table::READ_ONLY, &m_framecount);
+ m_symtable.add("frombcd", nullptr, 1, 1, execute_frombcd);
+ m_symtable.add("tobcd", nullptr, 1, 1, execute_tobcd);
+
+ // we rely on the debugger expression callbacks; if the debugger isn't
+ // enabled, we must jumpstart them manually
+ if ((machine.debug_flags & DEBUG_FLAG_ENABLED) == 0)
+ debug_cpu_init(machine);
+
+ // configure for memory access (shared with debugger)
+ debug_cpu_configure_memory(machine, m_symtable);
+
+ // load the cheats
+ reload();
+}
+
+
+//-------------------------------------------------
+// set_enable - globally enable or disable the
+// cheat engine
+//-------------------------------------------------
+
+void cheat_manager::set_enable(bool enable)
+{
+ // if the cheat engine is disabled, we're done
+ if (!machine().options().cheat())
+ return;
+
+ // if we're enabled currently and we don't want to be, turn things off
+ if (!m_disabled && !enable)
+ {
+ // iterate over running cheats and execute any OFF Scripts
+ for (cheat_entry &cheat : m_cheatlist)
+ if (cheat.state() == SCRIPT_STATE_RUN)
+ cheat.execute_off_script();
+ machine().popmessage("Cheats Disabled");
+ m_disabled = true;
+ }
+
+ // if we're disabled currently and we want to be enabled, turn things on
+ else if (m_disabled && enable)
+ {
+ // iterate over running cheats and execute any ON Scripts
+ m_disabled = false;
+ for (cheat_entry &cheat : m_cheatlist)
+ if (cheat.state() == SCRIPT_STATE_RUN)
+ cheat.execute_on_script();
+ machine().popmessage("Cheats Enabled");
+ }
+}
+
+
+//-------------------------------------------------
+// reload - re-initialize the cheat engine, and
+// and reload the cheat file(s)
+//-------------------------------------------------
+
+void cheat_manager::reload()
+{
+ // if the cheat engine is disabled, we're done
+ if (!machine().options().cheat())
+ return;
+
+ // free everything
+ m_cheatlist.reset();
+
+ // reset state
+ m_framecount = 0;
+ m_numlines = 0;
+ m_lastline = 0;
+ m_disabled = false;
+
+ // load the cheat file, if it's a system that has a software list then try softlist_name/shortname.xml first,
+ // if it fails to load then try to load via crc32 - basename/crc32.xml ( eg. 01234567.xml )
+ for (device_image_interface &image : image_interface_iterator(machine().root_device()))
+ if (image.exists())
+ {
+ // if we are loading through a software list, try to load softlist_name/shortname.xml
+ // this allows the coexistence of arcade cheats with cheats for home conversions which
+ // have the same shortname
+ if (image.software_entry() != nullptr)
+ {
+ load_cheats(string_format("%s%s%s", image.software_list_name(), PATH_SEPARATOR, image.basename()).c_str());
+ break;
+ }
+ // else we are loading outside the software list, try to load machine_basename/crc32.xml
+ else
+ {
+ UINT32 crc = image.crc();
+ if (crc != 0)
+ {
+ load_cheats(string_format("%s%s%08X", machine().basename(), PATH_SEPARATOR, crc).c_str());
+ break;
+ }
+ }
+ }
+
+ // if we haven't found the cheats yet, load by basename
+ if (m_cheatlist.count() == 0)
+ load_cheats(machine().basename());
+
+ // temporary: save the file back out as output.xml for comparison
+ if (m_cheatlist.count() != 0)
+ save_all("output");
+}
+
+
+//-------------------------------------------------
+// cheat_list_save - save a cheat file from
+// memory to the given filename
+//-------------------------------------------------
+
+bool cheat_manager::save_all(const char *filename)
+{
+ // open the file with the proper name
+ emu_file cheatfile(machine().options().cheat_path(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ osd_file::error filerr = cheatfile.open(filename, ".xml");
+
+ // if that failed, return nothing
+ if (filerr != osd_file::error::NONE)
+ return false;
+
+ // wrap the rest of catch errors
+ try
+ {
+ // output the outer layers
+ cheatfile.printf("<?xml version=\"1.0\"?>\n");
+ cheatfile.printf("<!-- This file is autogenerated; comments and unknown tags will be stripped -->\n");
+ cheatfile.printf("<mamecheat version=\"%d\">\n", CHEAT_VERSION);
+
+ // iterate over cheats in the list and save them
+ for (cheat_entry &cheat : m_cheatlist)
+ cheat.save(cheatfile);
+
+ // close out the file
+ cheatfile.printf("</mamecheat>\n");
+ return true;
+ }
+
+ // catch errors and cleanup
+ catch (emu_fatalerror &err)
+ {
+ osd_printf_error("%s\n", err.string());
+ cheatfile.remove_on_close();
+ }
+ return false;
+}
+
+
+//-------------------------------------------------
+// render_text - called by the UI system to
+// render text
+//-------------------------------------------------
+
+void cheat_manager::render_text(render_container &container)
+{
+ // render any text and free it along the way
+ for (int linenum = 0; linenum < m_output.size(); linenum++)
+ if (!m_output[linenum].empty())
+ {
+ // output the text
+ mame_machine_manager::instance()->ui().draw_text_full(&container, m_output[linenum].c_str(),
+ 0.0f, (float)linenum * mame_machine_manager::instance()->ui().get_line_height(), 1.0f,
+ m_justify[linenum], WRAP_NEVER, DRAW_OPAQUE,
+ ARGB_WHITE, ARGB_BLACK, nullptr, nullptr);
+ }
+}
+
+
+//-------------------------------------------------
+// get_output_astring - return a reference to
+// the given row's string, and set the
+// justification
+//-------------------------------------------------
+
+std::string &cheat_manager::get_output_astring(int row, int justify)
+{
+ // if the row is not specified, grab the next one
+ if (row == 0)
+ row = (m_lastline >= 0) ? m_lastline + 1 : m_lastline - 1;
+
+ // remember the last request
+ m_lastline = row;
+
+ // invert if negative
+ row = (row < 0) ? m_numlines + row : row - 1;
+
+ // clamp within range
+ row = MAX(row, 0);
+ row = MIN(row, m_numlines - 1);
+
+ // return the appropriate string
+ m_justify[row] = justify;
+ return m_output[row];
+}
+
+
+//-------------------------------------------------
+// quote_expression - quote an expression
+// string so that it is valid to embed in an XML
+// document
+//-------------------------------------------------
+
+std::string cheat_manager::quote_expression(const parsed_expression &expression)
+{
+ std::string str = expression.original_string();
+
+ strreplace(str, " && ", " and ");
+ strreplace(str, " &&", " and ");
+ strreplace(str, "&& ", " and ");
+ strreplace(str, "&&", " and ");
+
+ strreplace(str, " & ", " band ");
+ strreplace(str, " &", " band ");
+ strreplace(str, "& ", " band ");
+ strreplace(str, "&", " band ");
+
+ strreplace(str, " <= ", " le ");
+ strreplace(str, " <=", " le ");
+ strreplace(str, "<= ", " le ");
+ strreplace(str, "<=", " le ");
+
+ strreplace(str, " < ", " lt ");
+ strreplace(str, " <", " lt ");
+ strreplace(str, "< ", " lt ");
+ strreplace(str, "<", " lt ");
+
+ strreplace(str, " << ", " lshift ");
+ strreplace(str, " <<", " lshift ");
+ strreplace(str, "<< ", " lshift ");
+ strreplace(str, "<<", " lshift ");
+
+ return str;
+}
+
+
+//-------------------------------------------------
+// execute_frombcd - convert a value from BCD
+//-------------------------------------------------
+
+UINT64 cheat_manager::execute_frombcd(symbol_table &table, void *ref, int params, const UINT64 *param)
+{
+ UINT64 value = param[0];
+ UINT64 multiplier = 1;
+ UINT64 result = 0;
+
+ while (value != 0)
+ {
+ result += (value & 0x0f) * multiplier;
+ value >>= 4;
+ multiplier *= 10;
+ }
+ return result;
+}
+
+
+//-------------------------------------------------
+// execute_tobcd - convert a value to BCD
+//-------------------------------------------------
+
+UINT64 cheat_manager::execute_tobcd(symbol_table &table, void *ref, int params, const UINT64 *param)
+{
+ UINT64 value = param[0];
+ UINT64 result = 0;
+ UINT8 shift = 0;
+
+ while (value != 0)
+ {
+ result += (value % 10) << shift;
+ value /= 10;
+ shift += 4;
+ }
+ return result;
+}
+
+
+//-------------------------------------------------
+// frame_update - per-frame callback
+//-------------------------------------------------
+
+void cheat_manager::frame_update()
+{
+ // set up for accumulating output
+ m_lastline = 0;
+ m_numlines = floor(1.0f / mame_machine_manager::instance()->ui().get_line_height());
+ m_numlines = MIN(m_numlines, m_output.size());
+ for (auto & elem : m_output)
+ elem.clear();
+
+ // iterate over running cheats and execute them
+ for (cheat_entry &cheat : m_cheatlist)
+ cheat.frame_update();
+
+ // increment the frame counter
+ m_framecount++;
+}
+
+
+//-------------------------------------------------
+// load_cheats - load a cheat file into memory
+// and create the cheat entry list
+//-------------------------------------------------
+
+void cheat_manager::load_cheats(const char *filename)
+{
+ xml_data_node *rootnode = nullptr;
+ std::string searchstr(machine().options().cheat_path());
+ path_iterator path(searchstr.c_str());
+ std::string curpath;
+ while (path.next(curpath))
+ {
+ searchstr.append(";").append(curpath).append(PATH_SEPARATOR).append("cheat");
+ }
+ emu_file cheatfile(searchstr.c_str(), OPEN_FLAG_READ);
+ try
+ {
+ // open the file with the proper name
+ osd_file::error filerr = cheatfile.open(filename, ".xml");
+
+ // loop over all instrances of the files found in our search paths
+ while (filerr == osd_file::error::NONE)
+ {
+ osd_printf_verbose("Loading cheats file from %s\n", cheatfile.fullpath());
+
+ // read the XML file into internal data structures
+ xml_parse_options options = { nullptr };
+ xml_parse_error error;
+ options.error = &error;
+ rootnode = xml_file_read(cheatfile, &options);
+
+ // if unable to parse the file, just bail
+ if (rootnode == nullptr)
+ throw emu_fatalerror("%s.xml(%d): error parsing XML (%s)\n", filename, error.error_line, error.error_message);
+
+ // find the layout node
+ xml_data_node *mamecheatnode = xml_get_sibling(rootnode->child, "mamecheat");
+ if (mamecheatnode == nullptr)
+ throw emu_fatalerror("%s.xml: missing mamecheatnode node", filename);
+
+ // validate the config data version
+ int version = xml_get_attribute_int(mamecheatnode, "version", 0);
+ if (version != CHEAT_VERSION)
+ throw emu_fatalerror("%s.xml(%d): Invalid cheat XML file: unsupported version", filename, mamecheatnode->line);
+
+ // parse all the elements
+ for (xml_data_node *cheatnode = xml_get_sibling(mamecheatnode->child, "cheat"); cheatnode != nullptr; cheatnode = xml_get_sibling(cheatnode->next, "cheat"))
+ {
+ // load this entry
+ cheat_entry *curcheat = global_alloc(cheat_entry(*this, m_symtable, filename, *cheatnode));
+
+ // make sure we're not a duplicate
+ if (REMOVE_DUPLICATE_CHEATS && curcheat->is_duplicate())
+ {
+ osd_printf_verbose("Ignoring duplicate cheat '%s' from file %s\n", curcheat->description(), cheatfile.fullpath());
+ global_free(curcheat);
+ }
+ else // add to the end of the list
+ m_cheatlist.append(*curcheat);
+ }
+
+ // free the file and loop for the next one
+ xml_file_free(rootnode);
+
+ // open the next file in sequence
+ filerr = cheatfile.open_next();
+ }
+ }
+
+ // handle errors cleanly
+ catch (emu_fatalerror &err)
+ {
+ osd_printf_error("%s\n", err.string());
+ m_cheatlist.reset();
+ if (rootnode != nullptr)
+ xml_file_free(rootnode);
+ }
+}
diff --git a/src/frontend/mame/cheat.h b/src/frontend/mame/cheat.h
new file mode 100644
index 00000000000..dac90e17286
--- /dev/null
+++ b/src/frontend/mame/cheat.h
@@ -0,0 +1,337 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+/***************************************************************************
+
+ cheat.h
+
+ Cheat system.
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __CHEAT_H__
+#define __CHEAT_H__
+
+#include "debug/express.h"
+#include "ui/ui.h"
+
+
+//**************************************************************************
+// CONSTANTS
+//**************************************************************************
+
+enum script_state
+{
+ SCRIPT_STATE_OFF = 0,
+ SCRIPT_STATE_ON,
+ SCRIPT_STATE_RUN,
+ SCRIPT_STATE_CHANGE,
+ SCRIPT_STATE_COUNT
+};
+DECLARE_ENUM_OPERATORS(script_state)
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class cheat_manager;
+
+
+// ======================> number_and_format
+
+// helper class to remember a format along with a number
+class number_and_format
+{
+public:
+ // construction/destruction
+ number_and_format(UINT64 value = 0, int format = 0)
+ : m_value(value),
+ m_format(format) { }
+
+ // pass-through to look like a regular number
+ operator UINT64 &() { return m_value; }
+ operator const UINT64 &() const { return m_value; }
+
+ // format the number according to its format
+ std::string format() const;
+
+private:
+ // internal state
+ UINT64 m_value;
+ int m_format;
+};
+
+
+// ======================> cheat_parameter
+
+// a parameter for a cheat, which can be set in the UI
+class cheat_parameter
+{
+public:
+ // construction/destruction
+ cheat_parameter(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node &paramnode);
+
+ // queries
+ const char *text();
+ bool has_itemlist() const { return (m_itemlist.count() != 0); }
+ bool is_minimum() const { return (m_value == ((m_itemlist.count() == 0) ? m_minval : m_itemlist.first()->value())); }
+ bool is_maximum() const { return (m_value == ((m_itemlist.count() == 0) ? m_maxval : m_itemlist.last()->value())); }
+
+ // state setters
+ bool set_minimum_state();
+ bool set_prev_state();
+ bool set_next_state();
+
+ // actions
+ void save(emu_file &cheatfile) const;
+
+private:
+ // a single item in a parameter item list
+ class item
+ {
+ friend class simple_list<item>;
+
+ public:
+ // construction/destruction
+ item(const char *text, UINT64 value, int valformat)
+ : m_next(nullptr),
+ m_text(text),
+ m_value(value, valformat) { }
+
+ // getters
+ item *next() const { return m_next; }
+ const number_and_format &value() const { return m_value; }
+ const char *text() const { return m_text.c_str(); }
+
+ private:
+ // internal state
+ item * m_next; // next item in list
+ std::string m_text; // name of the item
+ number_and_format m_value; // value of the item
+ };
+
+ // internal state
+ number_and_format m_minval; // minimum value
+ number_and_format m_maxval; // maximum value
+ number_and_format m_stepval; // step value
+ UINT64 m_value; // live value of the parameter
+ std::string m_curtext; // holding for a value string
+ simple_list<item> m_itemlist; // list of items
+};
+
+
+// ======================> cheat_script
+
+// a script entry, specifying which state to execute under
+class cheat_script
+{
+ friend class simple_list<cheat_script>;
+
+public:
+ // construction/destruction
+ cheat_script(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node &scriptnode);
+
+ // getters
+ script_state state() const { return m_state; }
+
+ // actions
+ void execute(cheat_manager &manager, UINT64 &argindex);
+ void save(emu_file &cheatfile) const;
+
+private:
+ // an entry within the script
+ class script_entry
+ {
+ friend class simple_list<script_entry>;
+
+ public:
+ // construction/destruction
+ script_entry(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node &entrynode, bool isaction);
+
+ // getters
+ script_entry *next() const { return m_next; }
+
+ // actions
+ void execute(cheat_manager &manager, UINT64 &argindex);
+ void save(emu_file &cheatfile) const;
+
+ private:
+ // an argument for output
+ class output_argument
+ {
+ friend class simple_list<output_argument>;
+
+ public:
+ // construction/destruction
+ output_argument(cheat_manager &manager, symbol_table &symbols, const char *filename, xml_data_node &argnode);
+
+ // getters
+ output_argument *next() const { return m_next; }
+ int count() const { return m_count; }
+ int values(UINT64 &argindex, UINT64 *result);
+
+ // actions
+ void save(emu_file &cheatfile) const;
+
+ private:
+ // internal state
+ output_argument * m_next; // link to next argument
+ parsed_expression m_expression; // expression for argument
+ UINT64 m_count; // number of repetitions
+ };
+
+ // internal helpers
+ void validate_format(const char *filename, int line);
+
+ // internal state
+ script_entry * m_next; // link to next entry
+ parsed_expression m_condition; // condition under which this is executed
+ parsed_expression m_expression; // expression to execute
+ std::string m_format; // string format to print
+ simple_list<output_argument> m_arglist; // list of arguments
+ INT8 m_line; // which line to print on
+ UINT8 m_justify; // justification when printing
+
+ // constants
+ static const int MAX_ARGUMENTS = 32;
+ };
+
+ // internal state
+ simple_list<script_entry> m_entrylist; // list of actions to perform
+ script_state m_state; // which state this script is for
+};
+
+
+// ======================> cheat_entry
+
+// a single cheat
+class cheat_entry
+{
+ friend class simple_list<cheat_entry>;
+
+public:
+ // construction/destruction
+ cheat_entry(cheat_manager &manager, symbol_table &globaltable, const char *filename, xml_data_node &cheatnode);
+ ~cheat_entry();
+
+ // getters
+ cheat_manager &manager() const { return m_manager; }
+ cheat_entry *next() const { return m_next; }
+ script_state state() const { return m_state; }
+ const char *description() const { return m_description.c_str(); }
+ const char *comment() const { return m_comment.c_str(); }
+
+ // script detection
+ bool has_run_script() const { return (m_run_script != nullptr); }
+ bool has_on_script() const { return (m_on_script != nullptr); }
+ bool has_off_script() const { return (m_off_script != nullptr); }
+ bool has_change_script() const { return (m_change_script != nullptr); }
+
+ // script execution
+ void execute_off_script() { if (has_off_script()) m_off_script->execute(m_manager, m_argindex); }
+ void execute_on_script() { if (has_on_script()) m_on_script->execute(m_manager, m_argindex); }
+ void execute_run_script() { if (has_run_script()) m_run_script->execute(m_manager, m_argindex); }
+ void execute_change_script() { if (has_change_script()) m_change_script->execute(m_manager, m_argindex); }
+
+ // cheat classification
+ bool is_text_only() const { return (m_parameter == nullptr && !has_run_script() && !has_off_script() && !has_on_script()); }
+ bool is_oneshot() const { return (m_parameter == nullptr && !has_run_script() && !has_off_script() && has_on_script()); }
+ bool is_onoff() const { return (m_parameter == nullptr && (has_run_script() || (has_off_script() && has_on_script()))); }
+ bool is_value_parameter() const { return (m_parameter != nullptr && !m_parameter->has_itemlist()); }
+ bool is_itemlist_parameter() const { return (m_parameter != nullptr && m_parameter->has_itemlist()); }
+ bool is_oneshot_parameter() const { return (m_parameter != nullptr && !has_run_script() && !has_off_script() && has_change_script()); }
+ bool is_duplicate() const;
+
+ // actions
+ bool activate();
+ bool select_default_state();
+ bool select_previous_state();
+ bool select_next_state();
+ void save(emu_file &cheatfile) const;
+
+ // UI helpers
+ void menu_text(std::string &description, std::string &state, UINT32 &flags);
+
+ // per-frame update
+ void frame_update() { if (m_state == SCRIPT_STATE_RUN) execute_run_script(); }
+
+private:
+ // internal helpers
+ bool set_state(script_state newstate);
+ std::unique_ptr<cheat_script> &script_for_state(script_state state);
+
+ // internal state
+ cheat_manager & m_manager; // reference to our manager
+ cheat_entry * m_next; // next cheat entry
+ std::string m_description; // string description/menu title
+ std::string m_comment; // comment data
+ std::unique_ptr<cheat_parameter> m_parameter; // parameter
+ std::unique_ptr<cheat_script> m_on_script; // script to run when turning on
+ std::unique_ptr<cheat_script> m_off_script; // script to run when turning off
+ std::unique_ptr<cheat_script> m_change_script; // script to run when value changes
+ std::unique_ptr<cheat_script> m_run_script; // script to run each frame when on
+ symbol_table m_symbols; // symbol table for this cheat
+ script_state m_state; // current cheat state
+ UINT32 m_numtemp; // number of temporary variables
+ UINT64 m_argindex; // argument index variable
+
+ // constants
+ static const int DEFAULT_TEMP_VARIABLES = 10;
+};
+
+
+// ======================> cheat_manager
+
+// private machine-global data
+class cheat_manager
+{
+public:
+ // construction/destruction
+ cheat_manager(running_machine &machine);
+
+ // getters
+ running_machine &machine() const { return m_machine; }
+ bool enabled() const { return !m_disabled; }
+ const simple_list<cheat_entry> &entries() const { return m_cheatlist; }
+
+ // setters
+ void set_enable(bool enable = true);
+
+ // actions
+ void reload();
+ bool save_all(const char *filename);
+ void render_text(render_container &container);
+
+ // output helpers
+ std::string &get_output_astring(int row, int justify);
+
+ // global helpers
+ static std::string quote_expression(const parsed_expression &expression);
+ static UINT64 execute_frombcd(symbol_table &table, void *ref, int params, const UINT64 *param);
+ static UINT64 execute_tobcd(symbol_table &table, void *ref, int params, const UINT64 *param);
+
+private:
+ // internal helpers
+ void frame_update();
+ void load_cheats(const char *filename);
+
+ // internal state
+ running_machine & m_machine; // reference to our machine
+ simple_list<cheat_entry> m_cheatlist; // cheat list
+ UINT64 m_framecount; // frame count
+ std::vector<std::string> m_output; // array of output strings
+ std::vector<UINT8> m_justify; // justification for each string
+ UINT8 m_numlines; // number of lines available for output
+ INT8 m_lastline; // last line used for output
+ bool m_disabled; // true if the cheat engine is disabled
+ symbol_table m_symtable; // global symbol table
+
+ // constants
+ static constexpr int CHEAT_VERSION = 1;
+};
+
+
+#endif /* __CHEAT_H__ */
diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp
new file mode 100644
index 00000000000..9d81306aa60
--- /dev/null
+++ b/src/frontend/mame/clifront.cpp
@@ -0,0 +1,2051 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+/***************************************************************************
+
+ clifront.c
+
+ Command-line interface frontend for MAME.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "mame.h"
+#include "chd.h"
+#include "emuopts.h"
+#include "mameopts.h"
+#include "jedparse.h"
+#include "audit.h"
+#include "info.h"
+#include "unzip.h"
+#include "validity.h"
+#include "sound/samples.h"
+#include "clifront.h"
+#include "xmlfile.h"
+
+#include "drivenum.h"
+
+#include "osdepend.h"
+#include "softlist.h"
+
+#include "ui/moptions.h"
+
+#include <new>
+#include <ctype.h>
+
+
+//**************************************************************************
+// CONSTANTS
+//**************************************************************************
+
+// core commands
+#define CLICOMMAND_HELP "help"
+#define CLICOMMAND_VALIDATE "validate"
+
+// configuration commands
+#define CLICOMMAND_CREATECONFIG "createconfig"
+#define CLICOMMAND_SHOWCONFIG "showconfig"
+#define CLICOMMAND_SHOWUSAGE "showusage"
+
+// frontend commands
+#define CLICOMMAND_LISTXML "listxml"
+#define CLICOMMAND_LISTFULL "listfull"
+#define CLICOMMAND_LISTSOURCE "listsource"
+#define CLICOMMAND_LISTCLONES "listclones"
+#define CLICOMMAND_LISTBROTHERS "listbrothers"
+#define CLICOMMAND_LISTCRC "listcrc"
+#define CLICOMMAND_LISTROMS "listroms"
+#define CLICOMMAND_LISTSAMPLES "listsamples"
+#define CLICOMMAND_VERIFYROMS "verifyroms"
+#define CLICOMMAND_VERIFYSAMPLES "verifysamples"
+#define CLICOMMAND_ROMIDENT "romident"
+#define CLICOMMAND_LISTDEVICES "listdevices"
+#define CLICOMMAND_LISTSLOTS "listslots"
+#define CLICOMMAND_LISTMEDIA "listmedia" // needed by MESS
+#define CLICOMMAND_LISTSOFTWARE "listsoftware"
+#define CLICOMMAND_VERIFYSOFTWARE "verifysoftware"
+#define CLICOMMAND_GETSOFTLIST "getsoftlist"
+#define CLICOMMAND_VERIFYSOFTLIST "verifysoftlist"
+
+
+//**************************************************************************
+// COMMAND-LINE OPTIONS
+//**************************************************************************
+
+static const options_entry cli_option_entries[] =
+{
+ /* core commands */
+ { nullptr, nullptr, OPTION_HEADER, "CORE COMMANDS" },
+ { CLICOMMAND_HELP ";h;?", "0", OPTION_COMMAND, "show help message" },
+ { CLICOMMAND_VALIDATE ";valid", "0", OPTION_COMMAND, "perform driver validation on all game drivers" },
+
+ /* configuration commands */
+ { nullptr, nullptr, OPTION_HEADER, "CONFIGURATION COMMANDS" },
+ { CLICOMMAND_CREATECONFIG ";cc", "0", OPTION_COMMAND, "create the default configuration file" },
+ { CLICOMMAND_SHOWCONFIG ";sc", "0", OPTION_COMMAND, "display running parameters" },
+ { CLICOMMAND_SHOWUSAGE ";su", "0", OPTION_COMMAND, "show this help" },
+
+ /* frontend commands */
+ { nullptr, nullptr, OPTION_HEADER, "FRONTEND COMMANDS" },
+ { CLICOMMAND_LISTXML ";lx", "0", OPTION_COMMAND, "all available info on driver in XML format" },
+ { CLICOMMAND_LISTFULL ";ll", "0", OPTION_COMMAND, "short name, full name" },
+ { CLICOMMAND_LISTSOURCE ";ls", "0", OPTION_COMMAND, "driver sourcefile" },
+ { CLICOMMAND_LISTCLONES ";lc", "0", OPTION_COMMAND, "show clones" },
+ { CLICOMMAND_LISTBROTHERS ";lb", "0", OPTION_COMMAND, "show \"brothers\", or other drivers from same sourcefile" },
+ { CLICOMMAND_LISTCRC, "0", OPTION_COMMAND, "CRC-32s" },
+ { CLICOMMAND_LISTROMS ";lr", "0", OPTION_COMMAND, "list required roms for a driver" },
+ { CLICOMMAND_LISTSAMPLES, "0", OPTION_COMMAND, "list optional samples for a driver" },
+ { CLICOMMAND_VERIFYROMS, "0", OPTION_COMMAND, "report romsets that have problems" },
+ { CLICOMMAND_VERIFYSAMPLES, "0", OPTION_COMMAND, "report samplesets that have problems" },
+ { CLICOMMAND_ROMIDENT, "0", OPTION_COMMAND, "compare files with known MAME roms" },
+ { CLICOMMAND_LISTDEVICES ";ld", "0", OPTION_COMMAND, "list available devices" },
+ { CLICOMMAND_LISTSLOTS ";lslot", "0", OPTION_COMMAND, "list available slots and slot devices" },
+ { CLICOMMAND_LISTMEDIA ";lm", "0", OPTION_COMMAND, "list available media for the system" },
+ { CLICOMMAND_LISTSOFTWARE ";lsoft", "0", OPTION_COMMAND, "list known software for the system" },
+ { CLICOMMAND_VERIFYSOFTWARE ";vsoft", "0", OPTION_COMMAND, "verify known software for the system" },
+ { CLICOMMAND_GETSOFTLIST ";glist", "0", OPTION_COMMAND, "retrieve software list by name" },
+ { CLICOMMAND_VERIFYSOFTLIST ";vlist", "0", OPTION_COMMAND, "verify software list by name" },
+ { nullptr }
+};
+
+
+// media_identifier class identifies media by hash via a search in
+// the driver database
+class media_identifier
+{
+public:
+ // construction/destruction
+ media_identifier(emu_options &options);
+
+ // getters
+ int total() const { return m_total; }
+ int matches() const { return m_matches; }
+ int nonroms() const { return m_nonroms; }
+
+ // operations
+ void reset() { m_total = m_matches = m_nonroms = 0; }
+ void identify(const char *name);
+ void identify_file(const char *name);
+ void identify_data(const char *name, const UINT8 *data, int length);
+ int find_by_hash(const hash_collection &hashes, int length);
+
+private:
+ // internal state
+ driver_enumerator m_drivlist;
+ int m_total;
+ int m_matches;
+ int m_nonroms;
+};
+
+
+//**************************************************************************
+// CLI FRONTEND
+//**************************************************************************
+
+//-------------------------------------------------
+// cli_frontend - constructor
+//-------------------------------------------------
+
+cli_frontend::cli_frontend(emu_options &options, osd_interface &osd)
+ : m_options(options),
+ m_osd(osd),
+ m_result(EMU_ERR_NONE)
+{
+ m_options.add_entries(cli_option_entries);
+}
+
+
+//-------------------------------------------------
+// ~cli_frontend - destructor
+//-------------------------------------------------
+
+cli_frontend::~cli_frontend()
+{
+ // nuke any device options since they will leak memory
+ mame_options::remove_device_options(m_options);
+}
+
+//-------------------------------------------------
+// execute - execute a game via the standard
+// command line interface
+//-------------------------------------------------
+
+int cli_frontend::execute(int argc, char **argv)
+{
+ // wrap the core execution in a try/catch to field all fatal errors
+ m_result = EMU_ERR_NONE;
+ mame_machine_manager *manager = mame_machine_manager::instance(m_options, m_osd);
+
+ try
+ {
+ // first parse options to be able to get software from it
+ std::string option_errors;
+ mame_options::parse_command_line(m_options,argc, argv, option_errors);
+
+ mame_options::parse_standard_inis(m_options,option_errors);
+
+ load_translation(m_options);
+
+ manager->start_luaengine();
+
+ if (*(m_options.software_name()) != 0)
+ {
+ const game_driver *system = m_options.system();
+ if (system == nullptr && *(m_options.system_name()) != 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.system_name());
+
+ machine_config config(*system, m_options);
+ software_list_device_iterator iter(config.root_device());
+ if (iter.count() == 0)
+ throw emu_fatalerror(EMU_ERR_FATALERROR, "Error: unknown option: %s\n", m_options.software_name());
+
+ bool found = false;
+ for (software_list_device &swlistdev : iter)
+ {
+ software_info *swinfo = swlistdev.find(m_options.software_name());
+ if (swinfo != nullptr)
+ {
+ // loop through all parts
+ for (software_part &swpart : swinfo->parts())
+ {
+ const char *mount = swpart.feature("automount");
+ if (swpart.is_compatible(swlistdev))
+ {
+ if (mount == nullptr || strcmp(mount,"no") != 0)
+ {
+ // search for an image device with the right interface
+ for (device_image_interface &image : image_interface_iterator(config.root_device()))
+ {
+ const char *interface = image.image_interface();
+ if (interface != nullptr)
+ {
+ if (swpart.matches_interface(interface))
+ {
+ const char *option = m_options.value(image.brief_instance_name());
+
+ // mount only if not already mounted
+ if (*option == 0)
+ {
+ std::string val = string_format("%s:%s:%s", swlistdev.list_name(), m_options.software_name(), swpart.name());
+
+ // call this in order to set slot devices according to mounting
+ mame_options::parse_slot_devices(m_options, argc, argv, option_errors, image.instance_name(), val.c_str(), &swpart);
+ break;
+ }
+ }
+ }
+ }
+ }
+ found = true;
+ }
+ }
+ }
+
+ if (found)
+ break;
+ }
+ if (!found)
+ {
+ software_list_device::display_matches(config, nullptr, m_options.software_name());
+ throw emu_fatalerror(EMU_ERR_FATALERROR, nullptr);
+ }
+ }
+
+ // parse the command line, adding any system-specific options
+ if (!mame_options::parse_command_line(m_options,argc, argv, option_errors))
+ {
+ // if we failed, check for no command and a system name first; in that case error on the name
+ if (*(m_options.command()) == 0 && m_options.system() == nullptr && *(m_options.system_name()) != 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.system_name());
+
+ // otherwise, error on the options
+ throw emu_fatalerror(EMU_ERR_INVALID_CONFIG, "%s", strtrimspace(option_errors).c_str());
+ }
+ if (!option_errors.empty())
+ osd_printf_error("Error in command line:\n%s\n", strtrimspace(option_errors).c_str());
+
+ // determine the base name of the EXE
+ std::string exename = core_filename_extract_base(argv[0], true);
+
+ // if we have a command, execute that
+ if (*(m_options.command()) != 0)
+ execute_commands(exename.c_str());
+
+ // otherwise, check for a valid system
+ else
+ {
+ // We need to preprocess the config files once to determine the web server's configuration
+ // and file locations
+ if (m_options.read_config())
+ {
+ m_options.revert(OPTION_PRIORITY_INI);
+ mame_options::parse_standard_inis(m_options,option_errors);
+ }
+ if (!option_errors.empty())
+ osd_printf_error("Error in command line:\n%s\n", strtrimspace(option_errors).c_str());
+
+ // if we can't find it, give an appropriate error
+ const game_driver *system = m_options.system();
+ if (system == nullptr && *(m_options.system_name()) != 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "Unknown system '%s'", m_options.system_name());
+
+ // otherwise just run the game
+ m_result = manager->execute();
+ }
+ }
+
+ // handle exceptions of various types
+ catch (emu_fatalerror &fatal)
+ {
+ std::string str(fatal.string());
+ strtrimspace(str);
+ osd_printf_error("%s\n", str.c_str());
+ m_result = (fatal.exitcode() != 0) ? fatal.exitcode() : EMU_ERR_FATALERROR;
+
+ // if a game was specified, wasn't a wildcard, and our error indicates this was the
+ // reason for failure, offer some suggestions
+ if (m_result == EMU_ERR_NO_SUCH_GAME && *(m_options.system_name()) != 0 && strchr(m_options.system_name(), '*') == nullptr && m_options.system() == nullptr)
+ {
+ // get the top 16 approximate matches
+ driver_enumerator drivlist(m_options);
+ int matches[16];
+ drivlist.find_approximate_matches(m_options.system_name(), ARRAY_LENGTH(matches), matches);
+
+ // print them out
+ osd_printf_error("\n\"%s\" approximately matches the following\n"
+ "supported machines (best match first):\n\n", m_options.system_name());
+ for (auto & matche : matches)
+ if (matche != -1)
+ osd_printf_error("%-18s%s\n", drivlist.driver(matche).name, drivlist.driver(matche).description);
+ }
+ }
+ catch (emu_exception &)
+ {
+ osd_printf_error("Caught unhandled emulator exception\n");
+ m_result = EMU_ERR_FATALERROR;
+ }
+ catch (add_exception &aex)
+ {
+ osd_printf_error("Tag '%s' already exists in tagged_list\n", aex.tag());
+ m_result = EMU_ERR_FATALERROR;
+ }
+ catch (std::exception &ex)
+ {
+ osd_printf_error("Caught unhandled %s exception: %s\n", typeid(ex).name(), ex.what());
+ m_result = EMU_ERR_FATALERROR;
+ }
+ catch (...)
+ {
+ osd_printf_error("Caught unhandled exception\n");
+ m_result = EMU_ERR_FATALERROR;
+ }
+
+ util::archive_file::cache_clear();
+ global_free(manager);
+
+ return m_result;
+}
+
+
+//-------------------------------------------------
+// listxml - output the XML data for one or more
+// games
+//-------------------------------------------------
+
+void cli_frontend::listxml(const char *gamename)
+{
+ // determine which drivers to output; return an error if none found
+ driver_enumerator drivlist(m_options, gamename);
+ if (drivlist.count() == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+
+ // create the XML and print it to stdout
+ info_xml_creator creator(drivlist);
+ creator.output(stdout);
+}
+
+
+//-------------------------------------------------
+// listfull - output the name and description of
+// one or more games
+//-------------------------------------------------
+
+void cli_frontend::listfull(const char *gamename)
+{
+ // determine which drivers to output; return an error if none found
+ driver_enumerator drivlist(m_options, gamename);
+ if (drivlist.count() == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+
+ // print the header
+ osd_printf_info("Name: Description:\n");
+
+ // iterate through drivers and output the info
+ while (drivlist.next())
+ if ((drivlist.driver().flags & MACHINE_NO_STANDALONE) == 0)
+ osd_printf_info("%-18s\"%s\"\n", drivlist.driver().name, drivlist.driver().description);
+}
+
+
+//-------------------------------------------------
+// listsource - output the name and source
+// filename of one or more games
+//-------------------------------------------------
+
+void cli_frontend::listsource(const char *gamename)
+{
+ // determine which drivers to output; return an error if none found
+ driver_enumerator drivlist(m_options, gamename);
+ if (drivlist.count() == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+
+ // iterate through drivers and output the info
+ while (drivlist.next())
+ osd_printf_info("%-16s %s\n", drivlist.driver().name, core_filename_extract_base(drivlist.driver().source_file).c_str());
+}
+
+
+//-------------------------------------------------
+// listclones - output the name and parent of all
+// clones matching the given pattern
+//-------------------------------------------------
+
+void cli_frontend::listclones(const char *gamename)
+{
+ // start with a filtered list of drivers
+ driver_enumerator drivlist(m_options, gamename);
+ int original_count = drivlist.count();
+
+ // iterate through the remaining ones to see if their parent matches
+ while (drivlist.next_excluded())
+ {
+ // if we have a non-bios clone and it matches, keep it
+ int clone_of = drivlist.clone();
+ if (clone_of != -1 && (drivlist.driver(clone_of).flags & MACHINE_IS_BIOS_ROOT) == 0)
+ if (drivlist.matches(gamename, drivlist.driver(clone_of).name))
+ drivlist.include();
+ }
+
+ // return an error if none found
+ if (drivlist.count() == 0)
+ {
+ // see if we match but just weren't a clone
+ if (original_count == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+ else
+ osd_printf_info("Found %d matches for '%s' but none were clones\n", drivlist.count(), gamename);
+ return;
+ }
+
+ // print the header
+ osd_printf_info("Name: Clone of:\n");
+
+ // iterate through drivers and output the info
+ drivlist.reset();
+ while (drivlist.next())
+ {
+ int clone_of = drivlist.clone();
+ if (clone_of != -1 && (drivlist.driver(clone_of).flags & MACHINE_IS_BIOS_ROOT) == 0)
+ osd_printf_info("%-16s %-8s\n", drivlist.driver().name, drivlist.driver(clone_of).name);
+ }
+}
+
+
+//-------------------------------------------------
+// listbrothers - for each matching game, output
+// the list of other games that share the same
+// source file
+//-------------------------------------------------
+
+void cli_frontend::listbrothers(const char *gamename)
+{
+ // start with a filtered list of drivers; return an error if none found
+ driver_enumerator initial_drivlist(m_options, gamename);
+ if (initial_drivlist.count() == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+
+ // for the final list, start with an empty driver list
+ driver_enumerator drivlist(m_options);
+ drivlist.exclude_all();
+
+ // scan through the initially-selected drivers
+ while (initial_drivlist.next())
+ {
+ // if we are already marked in the final list, we don't need to do anything
+ if (drivlist.included(initial_drivlist.current()))
+ continue;
+
+ // otherwise, walk excluded items in the final list and mark any that match
+ drivlist.reset();
+ while (drivlist.next_excluded())
+ if (strcmp(drivlist.driver().source_file, initial_drivlist.driver().source_file) == 0)
+ drivlist.include();
+ }
+
+ // print the header
+ osd_printf_info("Source file: Name: Parent:\n");
+
+ // output the entries found
+ drivlist.reset();
+ while (drivlist.next())
+ {
+ int clone_of = drivlist.clone();
+ osd_printf_info("%-16s %-16s %-16s\n", core_filename_extract_base(drivlist.driver().source_file).c_str(), drivlist.driver().name, (clone_of == -1 ? "" : drivlist.driver(clone_of).name));
+ }
+}
+
+
+//-------------------------------------------------
+// listcrc - output the CRC and name of all ROMs
+// referenced by the emulator
+//-------------------------------------------------
+
+void cli_frontend::listcrc(const char *gamename)
+{
+ // determine which drivers to output; return an error if none found
+ driver_enumerator drivlist(m_options, gamename);
+ if (drivlist.count() == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+
+ // iterate through matches, and then through ROMs
+ while (drivlist.next())
+ {
+ for (device_t &device : device_iterator(drivlist.config().root_device()))
+ for (const rom_entry *region = rom_first_region(device); region; region = rom_next_region(region))
+ for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
+ {
+ // if we have a CRC, display it
+ UINT32 crc;
+ if (hash_collection(ROM_GETHASHDATA(rom)).crc(crc))
+ osd_printf_info("%08x %-16s \t %-8s \t %s\n", crc, ROM_GETNAME(rom), device.shortname(), device.name());
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// listroms - output the list of ROMs referenced
+// by a given game or set of games
+//-------------------------------------------------
+
+void cli_frontend::listroms(const char *gamename)
+{
+ // determine which drivers to output; return an error if none found
+ driver_enumerator drivlist(m_options, gamename);
+ if (drivlist.count() == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+
+ // iterate through matches
+ bool first = true;
+ while (drivlist.next())
+ {
+ // print a header
+ if (!first)
+ osd_printf_info("\n");
+ first = false;
+ osd_printf_info("ROMs required for driver \"%s\".\n"
+ "Name Size Checksum\n", drivlist.driver().name);
+
+ // iterate through roms
+ for (device_t &device : device_iterator(drivlist.config().root_device()))
+ for (const rom_entry *region = rom_first_region(device); region; region = rom_next_region(region))
+ for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
+ {
+ // accumulate the total length of all chunks
+ int length = -1;
+ if (ROMREGION_ISROMDATA(region))
+ length = rom_file_size(rom);
+
+ // start with the name
+ const char *name = ROM_GETNAME(rom);
+ osd_printf_info("%-20s ", name);
+
+ // output the length next
+ if (length >= 0)
+ osd_printf_info("%7d", length);
+ else
+ osd_printf_info(" ");
+
+ // output the hash data
+ hash_collection hashes(ROM_GETHASHDATA(rom));
+ if (!hashes.flag(hash_collection::FLAG_NO_DUMP))
+ {
+ if (hashes.flag(hash_collection::FLAG_BAD_DUMP))
+ osd_printf_info(" BAD");
+ osd_printf_info(" %s", hashes.macro_string().c_str());
+ }
+ else
+ osd_printf_info(" NO GOOD DUMP KNOWN");
+
+ // end with a CR
+ osd_printf_info("\n");
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// listsamples - output the list of samples
+// referenced by a given game or set of games
+//-------------------------------------------------
+
+void cli_frontend::listsamples(const char *gamename)
+{
+ // determine which drivers to output; return an error if none found
+ driver_enumerator drivlist(m_options, gamename);
+ if (drivlist.count() == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+
+ // iterate over drivers, looking for SAMPLES devices
+ bool first = true;
+ while (drivlist.next())
+ {
+ // see if we have samples
+ samples_device_iterator iter(drivlist.config().root_device());
+ if (iter.count() == 0)
+ continue;
+
+ // print a header
+ if (!first)
+ osd_printf_info("\n");
+ first = false;
+ osd_printf_info("Samples required for driver \"%s\".\n", drivlist.driver().name);
+
+ // iterate over samples devices and print the samples from each one
+ for (samples_device &device : iter)
+ {
+ samples_iterator sampiter(device);
+ for (const char *samplename = sampiter.first(); samplename != nullptr; samplename = sampiter.next())
+ osd_printf_info("%s\n", samplename);
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// listdevices - output the list of devices
+// referenced by a given game or set of games
+//-------------------------------------------------
+
+int cli_frontend::compare_devices(const void *i1, const void *i2)
+{
+ device_t *dev1 = *(device_t **)i1;
+ device_t *dev2 = *(device_t **)i2;
+ return strcmp(dev1->tag(), dev2->tag());
+}
+
+void cli_frontend::listdevices(const char *gamename)
+{
+ // determine which drivers to output; return an error if none found
+ driver_enumerator drivlist(m_options, gamename);
+ if (drivlist.count() == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+
+ // iterate over drivers, looking for SAMPLES devices
+ bool first = true;
+ while (drivlist.next())
+ {
+ // print a header
+ if (!first)
+ printf("\n");
+ first = false;
+ printf("Driver %s (%s):\n", drivlist.driver().name, drivlist.driver().description);
+
+ // build a list of devices
+ std::vector<device_t *> device_list;
+ for (device_t &device : device_iterator(drivlist.config().root_device()))
+ device_list.push_back(&device);
+
+ // sort them by tag
+ qsort(&device_list[0], device_list.size(), sizeof(device_list[0]), compare_devices);
+
+ // dump the results
+ for (auto device : device_list)
+ {
+ // extract the tag, stripping the leading colon
+ const char *tag = device->tag();
+ if (*tag == ':')
+ tag++;
+
+ // determine the depth
+ int depth = 1;
+ if (*tag == 0)
+ {
+ tag = "<root>";
+ depth = 0;
+ }
+ else
+ {
+ for (const char *c = tag; *c != 0; c++)
+ if (*c == ':')
+ {
+ tag = c + 1;
+ depth++;
+ }
+ }
+ printf(" %*s%-*s %s", depth * 2, "", 30 - depth * 2, tag, device->name());
+
+ // add more information
+ UINT32 clock = device->clock();
+ if (clock >= 1000000000)
+ printf(" @ %d.%02d GHz\n", clock / 1000000000, (clock / 10000000) % 100);
+ else if (clock >= 1000000)
+ printf(" @ %d.%02d MHz\n", clock / 1000000, (clock / 10000) % 100);
+ else if (clock >= 1000)
+ printf(" @ %d.%02d kHz\n", clock / 1000, (clock / 10) % 100);
+ else if (clock > 0)
+ printf(" @ %d Hz\n", clock);
+ else
+ printf("\n");
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// listslots - output the list of slot devices
+// referenced by a given game or set of games
+//-------------------------------------------------
+
+void cli_frontend::listslots(const char *gamename)
+{
+ // determine which drivers to output; return an error if none found
+ driver_enumerator drivlist(m_options, gamename);
+ if (drivlist.count() == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+
+ // print header
+ printf(" SYSTEM SLOT NAME SLOT OPTIONS SLOT DEVICE NAME \n");
+ printf("---------- ----------- -------------- ----------------------\n");
+
+ // iterate over drivers
+ while (drivlist.next())
+ {
+ // iterate
+ bool first = true;
+ for (const device_slot_interface &slot : slot_interface_iterator(drivlist.config().root_device()))
+ {
+ if (slot.fixed()) continue;
+ // output the line, up to the list of extensions
+ printf("%-13s%-10s ", first ? drivlist.driver().name : "", slot.device().tag()+1);
+
+ bool first_option = true;
+
+ // get the options and print them
+ for (const device_slot_option &option : slot.option_list())
+ {
+ if (option.selectable())
+ {
+ device_t *dev = (*option.devtype())(drivlist.config(), "dummy", &drivlist.config().root_device(), 0);
+ dev->config_complete();
+ if (first_option) {
+ printf("%-15s %s\n", option.name(),dev->name());
+ } else {
+ printf("%-23s %-15s %s\n", "",option.name(),dev->name());
+ }
+ global_free(dev);
+
+ first_option = false;
+ }
+ }
+ if (first_option)
+ printf("%-15s %s\n", "[none]","No options available");
+ // end the line
+ printf("\n");
+ first = false;
+ }
+
+ // if we didn't get any at all, just print a none line
+ if (first)
+ printf("%-13s(none)\n", drivlist.driver().name);
+ }
+}
+
+
+//-------------------------------------------------
+// listmedia - output the list of image devices
+// referenced by a given game or set of games
+//-------------------------------------------------
+
+void cli_frontend::listmedia(const char *gamename)
+{
+ // determine which drivers to output; return an error if none found
+ driver_enumerator drivlist(m_options, gamename);
+ if (drivlist.count() == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+
+ // print header
+ printf(" SYSTEM MEDIA NAME (brief) IMAGE FILE EXTENSIONS SUPPORTED \n");
+ printf("---------- -------------------- ------------------------------------\n");
+
+ // iterate over drivers
+ while (drivlist.next())
+ {
+ // iterate
+ bool first = true;
+ for (const device_image_interface &imagedev : image_interface_iterator(drivlist.config().root_device()))
+ {
+ if (!imagedev.user_loadable())
+ continue;
+
+ // extract the shortname with parentheses
+ std::string paren_shortname = string_format("(%s)", imagedev.brief_instance_name());
+
+ // output the line, up to the list of extensions
+ printf("%-13s%-12s%-8s ", first ? drivlist.driver().name : "", imagedev.instance_name(), paren_shortname.c_str());
+
+ // get the extensions and print them
+ std::string extensions(imagedev.file_extensions());
+ for (int start = 0, end = extensions.find_first_of(',');; start = end + 1, end = extensions.find_first_of(',', start))
+ {
+ std::string curext(extensions, start, (end == -1) ? extensions.length() - start : end - start);
+ printf(".%-5s", curext.c_str());
+ if (end == -1)
+ break;
+ }
+
+ // end the line
+ printf("\n");
+ first = false;
+ }
+
+ // if we didn't get any at all, just print a none line
+ if (first)
+ printf("%-13s(none)\n", drivlist.driver().name);
+ }
+}
+
+//-------------------------------------------------
+// verifyroms - verify the ROM sets of one or
+// more games
+//-------------------------------------------------
+void cli_frontend::verifyroms(const char *gamename)
+{
+ // determine which drivers to output;
+ driver_enumerator drivlist(m_options, gamename);
+
+ int correct = 0;
+ int incorrect = 0;
+ int notfound = 0;
+ int matched = 0;
+
+ // iterate over drivers
+ media_auditor auditor(drivlist);
+ while (drivlist.next())
+ {
+ matched++;
+
+ // audit the ROMs in this set
+ media_auditor::summary summary = auditor.audit_media(AUDIT_VALIDATE_FAST);
+
+ // if not found, count that and leave it at that
+ if (summary == media_auditor::NOTFOUND)
+ notfound++;
+
+ // else display information about what we discovered
+ else
+ {
+ // output the summary of the audit
+ std::string summary_string;
+ auditor.summarize(drivlist.driver().name,&summary_string);
+ osd_printf_info("%s", summary_string.c_str());
+
+ // output the name of the driver and its clone
+ osd_printf_info("romset %s ", drivlist.driver().name);
+ int clone_of = drivlist.clone();
+ if (clone_of != -1)
+ osd_printf_info("[%s] ", drivlist.driver(clone_of).name);
+
+ // switch off of the result
+ switch (summary)
+ {
+ case media_auditor::INCORRECT:
+ osd_printf_info("is bad\n");
+ incorrect++;
+ break;
+
+ case media_auditor::CORRECT:
+ osd_printf_info("is good\n");
+ correct++;
+ break;
+
+ case media_auditor::BEST_AVAILABLE:
+ case media_auditor::NONE_NEEDED:
+ osd_printf_info("is best available\n");
+ correct++;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+
+ if (!matched || strchr(gamename, '*') || strchr(gamename, '?'))
+ {
+ driver_enumerator dummy_drivlist(m_options);
+ std::unordered_set<std::string> device_map;
+ while (dummy_drivlist.next())
+ {
+ machine_config &config = dummy_drivlist.config();
+ for (device_t &dev : device_iterator(config.root_device()))
+ {
+ if (dev.owner() != nullptr && (*(dev.shortname()) != 0) && dev.rom_region() != nullptr && (device_map.insert(dev.shortname()).second)) {
+ if (core_strwildcmp(gamename, dev.shortname()) == 0)
+ {
+ matched++;
+
+ // audit the ROMs in this set
+ media_auditor::summary summary = auditor.audit_device(dev, AUDIT_VALIDATE_FAST);
+
+ // if not found, count that and leave it at that
+ if (summary == media_auditor::NOTFOUND)
+ notfound++;
+ // else display information about what we discovered
+ else if (summary != media_auditor::NONE_NEEDED)
+ {
+ // output the summary of the audit
+ std::string summary_string;
+ auditor.summarize(dev.shortname(),&summary_string);
+ osd_printf_info("%s", summary_string.c_str());
+
+ // display information about what we discovered
+ osd_printf_info("romset %s ", dev.shortname());
+
+ // switch off of the result
+ switch (summary)
+ {
+ case media_auditor::INCORRECT:
+ osd_printf_info("is bad\n");
+ incorrect++;
+ break;
+
+ case media_auditor::CORRECT:
+ osd_printf_info("is good\n");
+ correct++;
+ break;
+
+ case media_auditor::BEST_AVAILABLE:
+ osd_printf_info("is best available\n");
+ correct++;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ for (const device_slot_interface &slot : slot_interface_iterator(config.root_device()))
+ {
+ for (const device_slot_option &option : slot.option_list())
+ {
+ std::string temptag("_");
+ temptag.append(option.name());
+ device_t *dev = const_cast<machine_config &>(config).device_add(&config.root_device(), temptag.c_str(), option.devtype(), 0);
+
+ // notify this device and all its subdevices that they are now configured
+ for (device_t &device : device_iterator(*dev))
+ if (!device.configured())
+ device.config_complete();
+
+ if (device_map.insert(dev->shortname()).second) {
+ if (core_strwildcmp(gamename, dev->shortname()) == 0)
+ {
+ matched++;
+ if (dev->rom_region() != nullptr)
+ {
+ // audit the ROMs in this set
+ media_auditor::summary summary = auditor.audit_device(*dev, AUDIT_VALIDATE_FAST);
+
+ // if not found, count that and leave it at that
+ if (summary == media_auditor::NOTFOUND)
+ notfound++;
+
+ // else display information about what we discovered
+ else if(summary != media_auditor::NONE_NEEDED)
+ {
+ // output the summary of the audit
+ std::string summary_string;
+ auditor.summarize(dev->shortname(),&summary_string);
+ osd_printf_info("%s", summary_string.c_str());
+
+ // display information about what we discovered
+ osd_printf_info("romset %s ", dev->shortname());
+
+ // switch off of the result
+ switch (summary)
+ {
+ case media_auditor::INCORRECT:
+ osd_printf_info("is bad\n");
+ incorrect++;
+ break;
+
+ case media_auditor::CORRECT:
+ osd_printf_info("is good\n");
+ correct++;
+ break;
+
+ case media_auditor::BEST_AVAILABLE:
+ osd_printf_info("is best available\n");
+ correct++;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ }
+ } else {
+ // check for subdevices with ROMs (a few devices are missed otherwise, e.g. MPU401)
+ for (device_t &device : device_iterator(*dev))
+ {
+ for (device_t &subdev : device_iterator(device))
+ {
+ if (subdev.owner() == &device && subdev.rom_region() != nullptr && subdev.shortname() != nullptr && subdev.shortname()[0] != '\0')
+ {
+ if (device_map.insert(subdev.shortname()).second)
+ {
+ if (core_strwildcmp(gamename, subdev.shortname()) == 0)
+ {
+ matched++;
+
+ // audit the ROMs in this set
+ media_auditor::summary summary = auditor.audit_device(subdev, AUDIT_VALIDATE_FAST);
+
+ // if not found, count that and leave it at that
+ if (summary == media_auditor::NOTFOUND)
+ notfound++;
+
+ // else display information about what we discovered
+ else if (summary != media_auditor::NONE_NEEDED)
+ {
+ // output the summary of the audit
+ std::string summary_string;
+ auditor.summarize(subdev.shortname(),&summary_string);
+ osd_printf_info("%s", summary_string.c_str());
+
+ // display information about what we discovered
+ osd_printf_info("romset %s ", subdev.shortname());
+
+ // switch off of the result
+ switch (summary)
+ {
+ case media_auditor::INCORRECT:
+ osd_printf_info("is bad\n");
+ incorrect++;
+ break;
+
+ case media_auditor::CORRECT:
+ osd_printf_info("is good\n");
+ correct++;
+ break;
+
+ case media_auditor::BEST_AVAILABLE:
+ osd_printf_info("is best available\n");
+ correct++;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ const_cast<machine_config &>(config).device_remove(&config.root_device(), temptag.c_str());
+ }
+ }
+ }
+ }
+
+ // clear out any cached files
+ util::archive_file::cache_clear();
+
+ // return an error if none found
+ if (matched == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+
+ // if we didn't get anything at all, display a generic end message
+ if (matched > 0 && correct == 0 && incorrect == 0)
+ {
+ if (notfound > 0)
+ throw emu_fatalerror(EMU_ERR_MISSING_FILES, "romset \"%s\" not found!\n", gamename);
+ else
+ throw emu_fatalerror(EMU_ERR_MISSING_FILES, "romset \"%s\" has no roms!\n", gamename);
+ }
+
+ // otherwise, print a summary
+ else
+ {
+ if (incorrect > 0)
+ throw emu_fatalerror(EMU_ERR_MISSING_FILES, "%d romsets found, %d were OK.\n", correct + incorrect, correct);
+ osd_printf_info("%d romsets found, %d were OK.\n", correct, correct);
+ }
+}
+
+
+//-------------------------------------------------
+// info_verifysamples - verify the sample sets of
+// one or more games
+//-------------------------------------------------
+
+void cli_frontend::verifysamples(const char *gamename)
+{
+ // determine which drivers to output; return an error if none found
+ driver_enumerator drivlist(m_options, gamename);
+
+ int correct = 0;
+ int incorrect = 0;
+ int notfound = 0;
+ int matched = 0;
+
+ // iterate over drivers
+ media_auditor auditor(drivlist);
+ while (drivlist.next())
+ {
+ matched++;
+
+ // audit the samples in this set
+ media_auditor::summary summary = auditor.audit_samples();
+
+ // if not found, count that and leave it at that
+ if (summary == media_auditor::NOTFOUND)
+ notfound++;
+
+ // else display information about what we discovered
+ else if (summary != media_auditor::NONE_NEEDED)
+ {
+ // output the summary of the audit
+ std::string summary_string;
+ auditor.summarize(drivlist.driver().name,&summary_string);
+ osd_printf_info("%s", summary_string.c_str());
+
+ // output the name of the driver and its clone
+ osd_printf_info("sampleset %s ", drivlist.driver().name);
+ int clone_of = drivlist.clone();
+ if (clone_of != -1)
+ osd_printf_info("[%s] ", drivlist.driver(clone_of).name);
+
+ // switch off of the result
+ switch (summary)
+ {
+ case media_auditor::INCORRECT:
+ osd_printf_info("is bad\n");
+ incorrect++;
+ break;
+
+ case media_auditor::CORRECT:
+ osd_printf_info("is good\n");
+ correct++;
+ break;
+
+ case media_auditor::BEST_AVAILABLE:
+ osd_printf_info("is best available\n");
+ correct++;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+
+ // clear out any cached files
+ util::archive_file::cache_clear();
+
+ // return an error if none found
+ if (matched == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+
+ // if we didn't get anything at all, display a generic end message
+ if (matched > 0 && correct == 0 && incorrect == 0)
+ {
+ if (notfound > 0)
+ throw emu_fatalerror(EMU_ERR_MISSING_FILES, "sampleset \"%s\" not found!\n", gamename);
+ else
+ throw emu_fatalerror(EMU_ERR_MISSING_FILES, "sampleset \"%s\" not required!\n", gamename);
+ }
+
+ // otherwise, print a summary
+ else
+ {
+ if (incorrect > 0)
+ throw emu_fatalerror(EMU_ERR_MISSING_FILES, "%d samplesets found, %d were OK.\n", correct + incorrect, correct);
+ osd_printf_info("%d samplesets found, %d were OK.\n", correct, correct);
+ }
+}
+#define SOFTLIST_XML_BEGIN "<?xml version=\"1.0\"?>\n" \
+ "<!DOCTYPE softwarelists [\n" \
+ "<!ELEMENT softwarelists (softwarelist*)>\n" \
+ "\t<!ELEMENT softwarelist (software+)>\n" \
+ "\t\t<!ATTLIST softwarelist name CDATA #REQUIRED>\n" \
+ "\t\t<!ATTLIST softwarelist description CDATA #IMPLIED>\n" \
+ "\t\t<!ELEMENT software (description, year, publisher, info*, sharedfeat*, part*)>\n" \
+ "\t\t\t<!ATTLIST software name CDATA #REQUIRED>\n" \
+ "\t\t\t<!ATTLIST software cloneof CDATA #IMPLIED>\n" \
+ "\t\t\t<!ATTLIST software supported (yes|partial|no) \"yes\">\n" \
+ "\t\t\t<!ELEMENT description (#PCDATA)>\n" \
+ "\t\t\t<!ELEMENT year (#PCDATA)>\n" \
+ "\t\t\t<!ELEMENT publisher (#PCDATA)>\n" \
+ "\t\t\t<!ELEMENT info EMPTY>\n" \
+ "\t\t\t\t<!ATTLIST info name CDATA #REQUIRED>\n" \
+ "\t\t\t\t<!ATTLIST info value CDATA #IMPLIED>\n" \
+ "\t\t\t<!ELEMENT sharedfeat EMPTY>\n" \
+ "\t\t\t\t<!ATTLIST sharedfeat name CDATA #REQUIRED>\n" \
+ "\t\t\t\t<!ATTLIST sharedfeat value CDATA #IMPLIED>\n" \
+ "\t\t\t<!ELEMENT part (feature*, dataarea*, diskarea*, dipswitch*)>\n" \
+ "\t\t\t\t<!ATTLIST part name CDATA #REQUIRED>\n" \
+ "\t\t\t\t<!ATTLIST part interface CDATA #REQUIRED>\n" \
+ "\t\t\t\t<!ELEMENT feature EMPTY>\n" \
+ "\t\t\t\t\t<!ATTLIST feature name CDATA #REQUIRED>\n" \
+ "\t\t\t\t\t<!ATTLIST feature value CDATA #IMPLIED>\n" \
+ "\t\t\t\t<!ELEMENT dataarea (rom*)>\n" \
+ "\t\t\t\t\t<!ATTLIST dataarea name CDATA #REQUIRED>\n" \
+ "\t\t\t\t\t<!ATTLIST dataarea size CDATA #REQUIRED>\n" \
+ "\t\t\t\t\t<!ATTLIST dataarea databits (8|16|32|64) \"8\">\n" \
+ "\t\t\t\t\t<!ATTLIST dataarea endian (big|little) \"little\">\n" \
+ "\t\t\t\t\t<!ELEMENT rom EMPTY>\n" \
+ "\t\t\t\t\t\t<!ATTLIST rom name CDATA #IMPLIED>\n" \
+ "\t\t\t\t\t\t<!ATTLIST rom size CDATA #IMPLIED>\n" \
+ "\t\t\t\t\t\t<!ATTLIST rom length CDATA #IMPLIED>\n" \
+ "\t\t\t\t\t\t<!ATTLIST rom crc CDATA #IMPLIED>\n" \
+ "\t\t\t\t\t\t<!ATTLIST rom sha1 CDATA #IMPLIED>\n" \
+ "\t\t\t\t\t\t<!ATTLIST rom offset CDATA #IMPLIED>\n" \
+ "\t\t\t\t\t\t<!ATTLIST rom value CDATA #IMPLIED>\n" \
+ "\t\t\t\t\t\t<!ATTLIST rom status (baddump|nodump|good) \"good\">\n" \
+ "\t\t\t\t\t\t<!ATTLIST rom loadflag (load16_byte|load16_word|load16_word_swap|load32_byte|load32_word|load32_word_swap|load32_dword|load64_word|load64_word_swap|reload|fill|continue|reload_plain) #IMPLIED>\n" \
+ "\t\t\t\t<!ELEMENT diskarea (disk*)>\n" \
+ "\t\t\t\t\t<!ATTLIST diskarea name CDATA #REQUIRED>\n" \
+ "\t\t\t\t\t<!ELEMENT disk EMPTY>\n" \
+ "\t\t\t\t\t\t<!ATTLIST disk name CDATA #REQUIRED>\n" \
+ "\t\t\t\t\t\t<!ATTLIST disk sha1 CDATA #IMPLIED>\n" \
+ "\t\t\t\t\t\t<!ATTLIST disk status (baddump|nodump|good) \"good\">\n" \
+ "\t\t\t\t\t\t<!ATTLIST disk writeable (yes|no) \"no\">\n" \
+ "\t\t\t\t<!ELEMENT dipswitch (dipvalue*)>\n" \
+ "\t\t\t\t\t<!ATTLIST dipswitch name CDATA #REQUIRED>\n" \
+ "\t\t\t\t\t<!ATTLIST dipswitch tag CDATA #REQUIRED>\n" \
+ "\t\t\t\t\t<!ATTLIST dipswitch mask CDATA #REQUIRED>\n" \
+ "\t\t\t\t\t<!ELEMENT dipvalue EMPTY>\n" \
+ "\t\t\t\t\t\t<!ATTLIST dipvalue name CDATA #REQUIRED>\n" \
+ "\t\t\t\t\t\t<!ATTLIST dipvalue value CDATA #REQUIRED>\n" \
+ "\t\t\t\t\t\t<!ATTLIST dipvalue default (yes|no) \"no\">\n" \
+ "]>\n\n" \
+ "<softwarelists>\n"
+
+void cli_frontend::output_single_softlist(FILE *out, software_list_device &swlistdev)
+{
+ fprintf(out, "\t<softwarelist name=\"%s\" description=\"%s\">\n", swlistdev.list_name(), xml_normalize_string(swlistdev.description()));
+ for (software_info &swinfo : swlistdev.get_info())
+ {
+ fprintf(out, "\t\t<software name=\"%s\"", swinfo.shortname());
+ if (swinfo.parentname() != nullptr)
+ fprintf(out, " cloneof=\"%s\"", swinfo.parentname());
+ if (swinfo.supported() == SOFTWARE_SUPPORTED_PARTIAL)
+ fprintf(out, " supported=\"partial\"");
+ if (swinfo.supported() == SOFTWARE_SUPPORTED_NO)
+ fprintf(out, " supported=\"no\"");
+ fprintf(out, ">\n" );
+ fprintf(out, "\t\t\t<description>%s</description>\n", xml_normalize_string(swinfo.longname()));
+ fprintf(out, "\t\t\t<year>%s</year>\n", xml_normalize_string(swinfo.year()));
+ fprintf(out, "\t\t\t<publisher>%s</publisher>\n", xml_normalize_string(swinfo.publisher()));
+
+ for (feature_list_item &flist : swinfo.other_info())
+ fprintf( out, "\t\t\t<info name=\"%s\" value=\"%s\"/>\n", flist.name(), xml_normalize_string( flist.value() ) );
+
+ for (software_part &part : swinfo.parts())
+ {
+ fprintf(out, "\t\t\t<part name=\"%s\"", part.name());
+ if (part.interface() != nullptr)
+ fprintf(out, " interface=\"%s\"", part.interface());
+
+ fprintf(out, ">\n");
+
+ for (feature_list_item &flist : part.featurelist())
+ fprintf(out, "\t\t\t\t<feature name=\"%s\" value=\"%s\" />\n", flist.name(), xml_normalize_string(flist.value()));
+
+ /* TODO: display rom region information */
+ for (const rom_entry *region = part.romdata(); region; region = rom_next_region(region))
+ {
+ int is_disk = ROMREGION_ISDISKDATA(region);
+
+ if (!is_disk)
+ fprintf( out, "\t\t\t\t<dataarea name=\"%s\" size=\"%d\">\n", ROMREGION_GETTAG(region), ROMREGION_GETLENGTH(region) );
+ else
+ fprintf( out, "\t\t\t\t<diskarea name=\"%s\">\n", ROMREGION_GETTAG(region) );
+
+ for ( const rom_entry *rom = rom_first_file( region ); rom && !ROMENTRY_ISREGIONEND(rom); rom++ )
+ {
+ if ( ROMENTRY_ISFILE(rom) )
+ {
+ if (!is_disk)
+ fprintf( out, "\t\t\t\t\t<rom name=\"%s\" size=\"%d\"", xml_normalize_string(ROM_GETNAME(rom)), rom_file_size(rom) );
+ else
+ fprintf( out, "\t\t\t\t\t<disk name=\"%s\"", xml_normalize_string(ROM_GETNAME(rom)) );
+
+ /* dump checksum information only if there is a known dump */
+ hash_collection hashes(ROM_GETHASHDATA(rom));
+ if ( !hashes.flag(hash_collection::FLAG_NO_DUMP) )
+ fprintf( out, " %s", hashes.attribute_string().c_str() );
+ else
+ fprintf( out, " status=\"nodump\"" );
+
+ if (is_disk)
+ fprintf( out, " writeable=\"%s\"", (ROM_GETFLAGS(rom) & DISK_READONLYMASK) ? "no" : "yes");
+
+ if ((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(1))
+ fprintf( out, " loadflag=\"load16_byte\"" );
+
+ if ((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(3))
+ fprintf( out, " loadflag=\"load32_byte\"" );
+
+ if (((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(2)) && ((ROM_GETFLAGS(rom) & ROM_GROUPMASK) == ROM_GROUPWORD))
+ {
+ if (!(ROM_GETFLAGS(rom) & ROM_REVERSEMASK))
+ fprintf( out, " loadflag=\"load32_word\"" );
+ else
+ fprintf( out, " loadflag=\"load32_word_swap\"" );
+ }
+
+ if (((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_SKIP(6)) && ((ROM_GETFLAGS(rom) & ROM_GROUPMASK) == ROM_GROUPWORD))
+ {
+ if (!(ROM_GETFLAGS(rom) & ROM_REVERSEMASK))
+ fprintf( out, " loadflag=\"load64_word\"" );
+ else
+ fprintf( out, " loadflag=\"load64_word_swap\"" );
+ }
+
+ if (((ROM_GETFLAGS(rom) & ROM_SKIPMASK) == ROM_NOSKIP) && ((ROM_GETFLAGS(rom) & ROM_GROUPMASK) == ROM_GROUPWORD))
+ {
+ if (!(ROM_GETFLAGS(rom) & ROM_REVERSEMASK))
+ fprintf( out, " loadflag=\"load32_dword\"" );
+ else
+ fprintf( out, " loadflag=\"load16_word_swap\"" );
+ }
+
+ fprintf( out, "/>\n" );
+ }
+ else if ( ROMENTRY_ISRELOAD(rom) )
+ {
+ fprintf( out, "\t\t\t\t\t<rom size=\"%d\" offset=\"0x%x\" loadflag=\"reload\" />\n", ROM_GETLENGTH(rom), ROM_GETOFFSET(rom) );
+ }
+ else if ( ROMENTRY_ISFILL(rom) )
+ {
+ fprintf( out, "\t\t\t\t\t<rom size=\"%d\" offset=\"0x%x\" loadflag=\"fill\" />\n", ROM_GETLENGTH(rom), ROM_GETOFFSET(rom) );
+ }
+ }
+
+ if (!is_disk)
+ fprintf( out, "\t\t\t\t</dataarea>\n" );
+ else
+ fprintf( out, "\t\t\t\t</diskarea>\n" );
+ }
+
+ fprintf( out, "\t\t\t</part>\n" );
+ }
+
+ fprintf( out, "\t\t</software>\n" );
+ }
+ fprintf(out, "\t</softwarelist>\n" );
+}
+/*-------------------------------------------------
+ info_listsoftware - output the list of
+ software supported by a given game or set of
+ games
+ TODO: Add all information read from the source files
+ Possible improvement: use a sorted list for
+ identifying duplicate lists.
+-------------------------------------------------*/
+
+void cli_frontend::listsoftware(const char *gamename)
+{
+ FILE *out = stdout;
+ std::unordered_set<std::string> list_map;
+ bool isfirst = true;
+
+ // determine which drivers to output; return an error if none found
+ driver_enumerator drivlist(m_options, gamename);
+ if (drivlist.count() == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+
+ while (drivlist.next())
+ {
+ for (software_list_device &swlistdev : software_list_device_iterator(drivlist.config().root_device()))
+ if (list_map.insert(swlistdev.list_name()).second)
+ if (!swlistdev.get_info().empty())
+ {
+ if (isfirst) { fprintf(out, SOFTLIST_XML_BEGIN); isfirst = false; }
+ output_single_softlist(out, swlistdev);
+ }
+ }
+
+ if (!isfirst)
+ fprintf( out, "</softwarelists>\n" );
+ else
+ fprintf( out, "No software lists found for this system\n" );
+}
+
+
+/*-------------------------------------------------
+ verifysoftware - verify roms from the software
+ list of the specified driver(s)
+-------------------------------------------------*/
+void cli_frontend::verifysoftware(const char *gamename)
+{
+ std::unordered_set<std::string> list_map;
+
+ int correct = 0;
+ int incorrect = 0;
+ int notfound = 0;
+ int matched = 0;
+ int nrlists = 0;
+
+ // determine which drivers to process; return an error if none found
+ driver_enumerator drivlist(m_options, gamename);
+ if (drivlist.count() == 0)
+ {
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+ }
+
+ media_auditor auditor(drivlist);
+ while (drivlist.next())
+ {
+ matched++;
+
+ for (software_list_device &swlistdev : software_list_device_iterator(drivlist.config().root_device()))
+ if (swlistdev.list_type() == SOFTWARE_LIST_ORIGINAL_SYSTEM)
+ if (list_map.insert(swlistdev.list_name()).second)
+ if (!swlistdev.get_info().empty())
+ {
+ nrlists++;
+ for (software_info &swinfo : swlistdev.get_info())
+ {
+ media_auditor::summary summary = auditor.audit_software(swlistdev.list_name(), &swinfo, AUDIT_VALIDATE_FAST);
+
+ // if not found, count that and leave it at that
+ if (summary == media_auditor::NOTFOUND)
+ {
+ notfound++;
+ }
+ // else display information about what we discovered
+ else if(summary != media_auditor::NONE_NEEDED)
+ {
+ // output the summary of the audit
+ std::string summary_string;
+ auditor.summarize(swinfo.shortname(), &summary_string);
+ osd_printf_info("%s", summary_string.c_str());
+
+ // display information about what we discovered
+ osd_printf_info("romset %s:%s ", swlistdev.list_name(), swinfo.shortname());
+
+ // switch off of the result
+ switch (summary)
+ {
+ case media_auditor::INCORRECT:
+ osd_printf_info("is bad\n");
+ incorrect++;
+ break;
+
+ case media_auditor::CORRECT:
+ osd_printf_info("is good\n");
+ correct++;
+ break;
+
+ case media_auditor::BEST_AVAILABLE:
+ osd_printf_info("is best available\n");
+ correct++;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // clear out any cached files
+ util::archive_file::cache_clear();
+
+ // return an error if none found
+ if (matched == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching games found for '%s'", gamename);
+
+ // if we didn't get anything at all, display a generic end message
+ if (matched > 0 && correct == 0 && incorrect == 0)
+ {
+ throw emu_fatalerror(EMU_ERR_MISSING_FILES, "romset \"%s\" has no software entries defined!\n", gamename);
+ }
+ // otherwise, print a summary
+ else
+ {
+ if (incorrect > 0)
+ throw emu_fatalerror(EMU_ERR_MISSING_FILES, "%d romsets found in %d software lists, %d were OK.\n", correct + incorrect, nrlists, correct);
+ osd_printf_info("%d romsets found in %d software lists, %d romsets were OK.\n", correct, nrlists, correct);
+ }
+
+}
+
+/*-------------------------------------------------
+ getsoftlist - retrieve software list by name
+-------------------------------------------------*/
+
+void cli_frontend::getsoftlist(const char *gamename)
+{
+ FILE *out = stdout;
+ std::unordered_set<std::string> list_map;
+ bool isfirst = TRUE;
+
+ driver_enumerator drivlist(m_options);
+ while (drivlist.next())
+ {
+ for (software_list_device &swlistdev : software_list_device_iterator(drivlist.config().root_device()))
+ if (core_strwildcmp(gamename, swlistdev.list_name()) == 0 && list_map.insert(swlistdev.list_name()).second)
+ if (!swlistdev.get_info().empty())
+ {
+ if (isfirst) { fprintf( out, SOFTLIST_XML_BEGIN); isfirst = FALSE; }
+ output_single_softlist(out, swlistdev);
+ }
+ }
+
+ if (!isfirst)
+ fprintf( out, "</softwarelists>\n" );
+ else
+ fprintf( out, "No such software lists found\n" );
+}
+
+
+/*-------------------------------------------------
+ verifysoftlist - verify software list by name
+-------------------------------------------------*/
+void cli_frontend::verifysoftlist(const char *gamename)
+{
+ std::unordered_set<std::string> list_map;
+ int correct = 0;
+ int incorrect = 0;
+ int notfound = 0;
+ int matched = 0;
+
+ driver_enumerator drivlist(m_options);
+ media_auditor auditor(drivlist);
+
+ while (drivlist.next())
+ {
+ for (software_list_device &swlistdev : software_list_device_iterator(drivlist.config().root_device()))
+ if (core_strwildcmp(gamename, swlistdev.list_name()) == 0 && list_map.insert(swlistdev.list_name()).second)
+ if (!swlistdev.get_info().empty())
+ {
+ matched++;
+
+ // Get the actual software list contents
+ for (software_info &swinfo : swlistdev.get_info())
+ {
+ media_auditor::summary summary = auditor.audit_software(swlistdev.list_name(), &swinfo, AUDIT_VALIDATE_FAST);
+
+ // if not found, count that and leave it at that
+ if (summary == media_auditor::NOTFOUND)
+ {
+ notfound++;
+ }
+ // else display information about what we discovered
+ else if (summary != media_auditor::NONE_NEEDED)
+ {
+ // output the summary of the audit
+ std::string summary_string;
+ auditor.summarize(swinfo.shortname(), &summary_string);
+ osd_printf_info("%s", summary_string.c_str());
+
+ // display information about what we discovered
+ osd_printf_info("romset %s:%s ", swlistdev.list_name(), swinfo.shortname());
+
+ // switch off of the result
+ switch (summary)
+ {
+ case media_auditor::INCORRECT:
+ osd_printf_info("is bad\n");
+ incorrect++;
+ break;
+
+ case media_auditor::CORRECT:
+ osd_printf_info("is good\n");
+ correct++;
+ break;
+
+ case media_auditor::BEST_AVAILABLE:
+ osd_printf_info("is best available\n");
+ correct++;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // clear out any cached files
+ util::archive_file::cache_clear();
+
+ // return an error if none found
+ if (matched == 0)
+ throw emu_fatalerror(EMU_ERR_NO_SUCH_GAME, "No matching software lists found for '%s'", gamename);
+
+ // if we didn't get anything at all, display a generic end message
+ if (matched > 0 && correct == 0 && incorrect == 0)
+ {
+ throw emu_fatalerror(EMU_ERR_MISSING_FILES, "no romsets found for software list \"%s\"!\n", gamename);
+ }
+ // otherwise, print a summary
+ else
+ {
+ if (incorrect > 0)
+ throw emu_fatalerror(EMU_ERR_MISSING_FILES, "%d romsets found in %d software lists, %d were OK.\n", correct + incorrect, matched, correct);
+ osd_printf_info("%d romsets found in %d software lists, %d romsets were OK.\n", correct, matched, correct);
+ }
+}
+
+//-------------------------------------------------
+// romident - identify ROMs by looking for
+// matches in our internal database
+//-------------------------------------------------
+
+void cli_frontend::romident(const char *filename)
+{
+ media_identifier ident(m_options);
+
+ // identify the file, then output results
+ osd_printf_info("Identifying %s....\n", filename);
+ ident.identify(filename);
+
+ // return the appropriate error code
+ if (ident.matches() == ident.total())
+ return;
+ else if (ident.matches() == ident.total() - ident.nonroms())
+ throw emu_fatalerror(EMU_ERR_IDENT_NONROMS, "Out of %d files, %d matched, %d are not roms.\n",ident.total(),ident.matches(),ident.nonroms());
+ else if (ident.matches() > 0)
+ throw emu_fatalerror(EMU_ERR_IDENT_PARTIAL, "Out of %d files, %d matched, %d did not match.\n",ident.total(),ident.matches(),ident.total()-ident.matches());
+ else
+ throw emu_fatalerror(EMU_ERR_IDENT_NONE, "No roms matched.\n");
+}
+
+
+//-------------------------------------------------
+// execute_commands - execute various frontend
+// commands
+//-------------------------------------------------
+
+void cli_frontend::execute_commands(const char *exename)
+{
+ // help?
+ if (strcmp(m_options.command(), CLICOMMAND_HELP) == 0)
+ {
+ display_help(exename);
+ return;
+ }
+
+ // showusage?
+ if (strcmp(m_options.command(), CLICOMMAND_SHOWUSAGE) == 0)
+ {
+ osd_printf_info("Usage: %s [machine] [media] [software] [options]",exename);
+ osd_printf_info("\n\nOptions:\n%s", m_options.output_help().c_str());
+ return;
+ }
+
+ // validate?
+ if (strcmp(m_options.command(), CLICOMMAND_VALIDATE) == 0)
+ {
+ validity_checker valid(m_options);
+ valid.set_validate_all(true);
+ const char *sysname = m_options.system_name();
+ bool result = valid.check_all_matching((sysname[0] == 0) ? "*" : sysname);
+ if (!result)
+ throw emu_fatalerror(EMU_ERR_FAILED_VALIDITY, "Validity check failed (%d errors, %d warnings in total)\n", valid.errors(), valid.warnings());
+ return;
+ }
+
+ // other commands need the INIs parsed
+ std::string option_errors;
+ mame_options::parse_standard_inis(m_options,option_errors);
+ if (!option_errors.empty())
+ osd_printf_error("%s\n", option_errors.c_str());
+
+ // createconfig?
+ if (strcmp(m_options.command(), CLICOMMAND_CREATECONFIG) == 0)
+ {
+ // attempt to open the output file
+ emu_file file(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ if (file.open(emulator_info::get_configname(), ".ini") != osd_file::error::NONE)
+ throw emu_fatalerror("Unable to create file %s.ini\n",emulator_info::get_configname());
+
+ // generate the updated INI
+ file.puts(m_options.output_ini().c_str());
+
+ ui_options ui_opts;
+ emu_file file_ui(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ if (file_ui.open("ui.ini") != osd_file::error::NONE)
+ throw emu_fatalerror("Unable to create file ui.ini\n");
+
+ // generate the updated INI
+ file_ui.puts(ui_opts.output_ini().c_str());
+
+ plugin_options plugin_opts;
+ path_iterator iter(m_options.plugins_path());
+ std::string pluginpath;
+ while (iter.next(pluginpath))
+ {
+ plugin_opts.parse_json(pluginpath);
+ }
+ emu_file file_plugin(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ if (file_plugin.open("plugin.ini") != osd_file::error::NONE)
+ throw emu_fatalerror("Unable to create file plugin.ini\n");
+
+ // generate the updated INI
+ file_plugin.puts(plugin_opts.output_ini().c_str());
+
+ return;
+ }
+
+ // showconfig?
+ if (strcmp(m_options.command(), CLICOMMAND_SHOWCONFIG) == 0)
+ {
+ // print the INI text
+ printf("%s\n", m_options.output_ini().c_str());
+ return;
+ }
+
+ // all other commands call out to one of these helpers
+ static const struct
+ {
+ const char *option;
+ void (cli_frontend::*function)(const char *gamename);
+ } info_commands[] =
+ {
+ { CLICOMMAND_LISTXML, &cli_frontend::listxml },
+ { CLICOMMAND_LISTFULL, &cli_frontend::listfull },
+ { CLICOMMAND_LISTSOURCE, &cli_frontend::listsource },
+ { CLICOMMAND_LISTCLONES, &cli_frontend::listclones },
+ { CLICOMMAND_LISTBROTHERS, &cli_frontend::listbrothers },
+ { CLICOMMAND_LISTCRC, &cli_frontend::listcrc },
+ { CLICOMMAND_LISTDEVICES, &cli_frontend::listdevices },
+ { CLICOMMAND_LISTSLOTS, &cli_frontend::listslots },
+ { CLICOMMAND_LISTROMS, &cli_frontend::listroms },
+ { CLICOMMAND_LISTSAMPLES, &cli_frontend::listsamples },
+ { CLICOMMAND_VERIFYROMS, &cli_frontend::verifyroms },
+ { CLICOMMAND_VERIFYSAMPLES, &cli_frontend::verifysamples },
+ { CLICOMMAND_LISTMEDIA, &cli_frontend::listmedia },
+ { CLICOMMAND_LISTSOFTWARE, &cli_frontend::listsoftware },
+ { CLICOMMAND_VERIFYSOFTWARE,&cli_frontend::verifysoftware },
+ { CLICOMMAND_ROMIDENT, &cli_frontend::romident },
+ { CLICOMMAND_GETSOFTLIST, &cli_frontend::getsoftlist },
+ { CLICOMMAND_VERIFYSOFTLIST,&cli_frontend::verifysoftlist },
+ };
+
+ // find the command
+ for (auto & info_command : info_commands)
+ if (strcmp(m_options.command(), info_command.option) == 0)
+ {
+ // parse any relevant INI files before proceeding
+ const char *sysname = m_options.system_name();
+ (this->*info_command.function)((sysname[0] == 0) ? "*" : sysname);
+ return;
+ }
+
+ if (!m_osd.execute_command(m_options.command()))
+ // if we get here, we don't know what has been requested
+ throw emu_fatalerror(EMU_ERR_INVALID_CONFIG, "Unknown command '%s' specified", m_options.command());
+}
+
+
+//-------------------------------------------------
+// display_help - display help to standard
+// output
+//-------------------------------------------------
+
+void cli_frontend::display_help(const char *exename)
+{
+ osd_printf_info("%s v%s\n%s\n\n", emulator_info::get_appname(),build_version,emulator_info::get_copyright_info());
+ osd_printf_info("This software reproduces, more or less faithfully, the behaviour of a wide range\n"
+ "of machines. But hardware is useless without software, so images of the ROMs and\n"
+ "other media which run on that hardware are also required.\n\n");
+ osd_printf_info("Usage: %s [machine] [media] [software] [options]",exename);
+ osd_printf_info("\n\n"
+ " %s -showusage for a brief list of options\n"
+ " %s -showconfig for a list of configuration options\n"
+ " %s -listmedia for a full list of supported media\n"
+ " %s -createconfig to create a %s.ini\n\n"
+ "For usage instructions, please consult the files config.txt and windows.txt.\n",exename,
+ exename,exename,exename,emulator_info::get_configname());
+}
+
+
+//-------------------------------------------------
+// display_suggestions - display 10 possible
+// matches for a given invalid gamename
+//-------------------------------------------------
+
+void cli_frontend::display_suggestions(const char *gamename)
+{
+}
+
+
+//**************************************************************************
+// MEDIA IDENTIFIER
+//**************************************************************************
+
+//-------------------------------------------------
+// media_identifier - constructor
+//-------------------------------------------------
+
+media_identifier::media_identifier(emu_options &options)
+ : m_drivlist(options),
+ m_total(0),
+ m_matches(0),
+ m_nonroms(0)
+{
+}
+
+
+//-------------------------------------------------
+// identify - identify a directory, ZIP file,
+// or raw file
+//-------------------------------------------------
+
+void media_identifier::identify(const char *filename)
+{
+ // first try to open as a directory
+ osd_directory *directory = osd_opendir(filename);
+ if (directory != nullptr)
+ {
+ // iterate over all files in the directory
+ for (const osd_directory_entry *entry = osd_readdir(directory); entry != nullptr; entry = osd_readdir(directory))
+ if (entry->type == ENTTYPE_FILE)
+ {
+ std::string curfile = std::string(filename).append(PATH_SEPARATOR).append(entry->name);
+ identify(curfile.c_str());
+ }
+
+ // close the directory and be done
+ osd_closedir(directory);
+ }
+
+ // if that failed, and the filename ends with .zip, identify as a ZIP file
+ if (core_filename_ends_with(filename, ".7z") || core_filename_ends_with(filename, ".zip"))
+ {
+ // first attempt to examine it as a valid _7Z file
+ util::archive_file::ptr archive;
+ util::archive_file::error err;
+ if (core_filename_ends_with(filename, ".7z"))
+ err = util::archive_file::open_7z(filename, archive);
+ else
+ err = util::archive_file::open_zip(filename, archive);
+ if ((err == util::archive_file::error::NONE) && archive)
+ {
+ std::vector<std::uint8_t> data;
+
+ // loop over entries in the .7z, skipping empty files and directories
+ for (int i = archive->first_file(); i >= 0; i = archive->next_file())
+ {
+ const std::uint64_t length(archive->current_uncompressed_length());
+ if (!archive->current_is_directory() && (length != 0) && (std::uint32_t(length) == length))
+ {
+ // decompress data into RAM and identify it
+ try
+ {
+ data.resize(std::size_t(length));
+ err = archive->decompress(&data[0], std::uint32_t(length));
+ if (err == util::archive_file::error::NONE)
+ identify_data(archive->current_name().c_str(), &data[0], length);
+ }
+ catch (...)
+ {
+ // resizing the buffer could cause a bad_alloc if archive contains large files
+ }
+ data.clear();
+ }
+ }
+ }
+
+ // clear out any cached files
+ archive.reset();
+ util::archive_file::cache_clear();
+ }
+
+ // otherwise, identify as a raw file
+ else
+ identify_file(filename);
+}
+
+
+//-------------------------------------------------
+// identify_file - identify a file
+//-------------------------------------------------
+
+void media_identifier::identify_file(const char *name)
+{
+ // CHD files need to be parsed and their hashes extracted from the header
+ if (core_filename_ends_with(name, ".chd"))
+ {
+ // output the name
+ osd_printf_info("%-20s", core_filename_extract_base(name).c_str());
+ m_total++;
+
+ // attempt to open as a CHD; fail if not
+ chd_file chd;
+ chd_error err = chd.open(name);
+ if (err != CHDERR_NONE)
+ {
+ osd_printf_info("NOT A CHD\n");
+ m_nonroms++;
+ return;
+ }
+
+ // error on writable CHDs
+ if (!chd.compressed())
+ {
+ osd_printf_info("is a writeable CHD\n");
+ return;
+ }
+
+ // otherwise, get the hash collection for this CHD
+ hash_collection hashes;
+ if (chd.sha1() != sha1_t::null)
+ hashes.add_sha1(chd.sha1());
+
+ // determine whether this file exists
+ int found = find_by_hash(hashes, chd.logical_bytes());
+ if (found == 0)
+ osd_printf_info("NO MATCH\n");
+ else
+ m_matches++;
+ }
+
+ // all other files have their hashes computed directly
+ else
+ {
+ // load the file and process if it opens and has a valid length
+ UINT32 length;
+ void *data;
+ const osd_file::error filerr = util::core_file::load(name, &data, length);
+ if (filerr == osd_file::error::NONE && length > 0)
+ {
+ identify_data(name, reinterpret_cast<UINT8 *>(data), length);
+ osd_free(data);
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// identify_data - identify a buffer full of
+// data; if it comes from a .JED file, parse the
+// fusemap into raw data first
+//-------------------------------------------------
+
+void media_identifier::identify_data(const char *name, const UINT8 *data, int length)
+{
+ // if this is a '.jed' file, process it into raw bits first
+ dynamic_buffer tempjed;
+ jed_data jed;
+ if (core_filename_ends_with(name, ".jed") && jed_parse(data, length, &jed) == JEDERR_NONE)
+ {
+ // now determine the new data length and allocate temporary memory for it
+ length = jedbin_output(&jed, nullptr, 0);
+ tempjed.resize(length);
+ jedbin_output(&jed, &tempjed[0], length);
+ data = &tempjed[0];
+ }
+
+ // compute the hash of the data
+ hash_collection hashes;
+ hashes.compute(data, length, hash_collection::HASH_TYPES_CRC_SHA1);
+
+ // output the name
+ m_total++;
+ osd_printf_info("%-20s", core_filename_extract_base(name).c_str());
+
+ // see if we can find a match in the ROMs
+ int found = find_by_hash(hashes, length);
+
+ // if we didn't find it, try to guess what it might be
+ if (found == 0)
+ osd_printf_info("NO MATCH\n");
+
+ // if we did find it, count it as a match
+ else
+ m_matches++;
+}
+
+
+//-------------------------------------------------
+// find_by_hash - scan for a file in the list
+// of drivers by hash
+//-------------------------------------------------
+
+int media_identifier::find_by_hash(const hash_collection &hashes, int length)
+{
+ int found = 0;
+ std::unordered_set<std::string> listnames;
+ std::unordered_set<std::string> shortnames;
+
+ // iterate over drivers
+ m_drivlist.reset();
+ while (m_drivlist.next())
+ {
+ // iterate over devices, regions and files within the region
+ for (device_t &device : device_iterator(m_drivlist.config().root_device()))
+ {
+ if (shortnames.insert(device.shortname()).second)
+ {
+ for (const rom_entry *region = rom_first_region(device); region != nullptr; region = rom_next_region(region))
+ for (const rom_entry *rom = rom_first_file(region); rom != nullptr; rom = rom_next_file(rom))
+ {
+ hash_collection romhashes(ROM_GETHASHDATA(rom));
+ if (!romhashes.flag(hash_collection::FLAG_NO_DUMP) && hashes == romhashes)
+ {
+ bool baddump = romhashes.flag(hash_collection::FLAG_BAD_DUMP);
+
+ // output information about the match
+ if (found)
+ osd_printf_info(" ");
+ osd_printf_info("= %s%-20s %-10s %s\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), m_drivlist.driver().name, m_drivlist.driver().description);
+ found++;
+ }
+ }
+ }
+ }
+
+ // next iterate over softlists
+ for (software_list_device &swlistdev : software_list_device_iterator(m_drivlist.config().root_device()))
+ {
+ if (listnames.insert(swlistdev.list_name()).second)
+ {
+ for (software_info &swinfo : swlistdev.get_info())
+ for (software_part &part : swinfo.parts())
+ for (const rom_entry *region = part.romdata(); region != nullptr; region = rom_next_region(region))
+ for (const rom_entry *rom = rom_first_file(region); rom != nullptr; rom = rom_next_file(rom))
+ {
+ hash_collection romhashes(ROM_GETHASHDATA(rom));
+ if (hashes == romhashes)
+ {
+ bool baddump = romhashes.flag(hash_collection::FLAG_BAD_DUMP);
+
+ // output information about the match
+ if (found)
+ osd_printf_info(" ");
+ osd_printf_info("= %s%-20s %s:%s %s\n", baddump ? "(BAD) " : "", ROM_GETNAME(rom), swlistdev.list_name(), swinfo.shortname(), swinfo.longname());
+ found++;
+ }
+ }
+ }
+ }
+ }
+
+ return found;
+}
diff --git a/src/frontend/mame/clifront.h b/src/frontend/mame/clifront.h
new file mode 100644
index 00000000000..2a7da7fcb78
--- /dev/null
+++ b/src/frontend/mame/clifront.h
@@ -0,0 +1,75 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+/***************************************************************************
+
+ clifront.h
+
+ Command-line interface frontend for MAME.
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __CLIFRONT_H__
+#define __CLIFRONT_H__
+
+#include "emu.h"
+#include "emuopts.h"
+
+// don't include osd_interface in header files
+class osd_interface;
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+
+// cli_frontend handles command-line processing and emulator execution
+class cli_frontend
+{
+public:
+ // construction/destruction
+ cli_frontend(emu_options &options, osd_interface &osd);
+ ~cli_frontend();
+
+ // execute based on the incoming argc/argv
+ int execute(int argc, char **argv);
+
+ // direct access to the command operations
+ void listxml(const char *gamename = "*");
+ void listfull(const char *gamename = "*");
+ void listsource(const char *gamename = "*");
+ void listclones(const char *gamename = "*");
+ void listbrothers(const char *gamename = "*");
+ void listcrc(const char *gamename = "*");
+ void listroms(const char *gamename = "*");
+ void listsamples(const char *gamename = "*");
+ static int compare_devices(const void *i1, const void *i2);
+ void listdevices(const char *gamename = "*");
+ void listslots(const char *gamename = "*");
+ void listmedia(const char *gamename = "*");
+ void listsoftware(const char *gamename = "*");
+ void verifysoftware(const char *gamename = "*");
+ void verifyroms(const char *gamename = "*");
+ void verifysamples(const char *gamename = "*");
+ void romident(const char *filename);
+ void getsoftlist(const char *gamename = "*");
+ void verifysoftlist(const char *gamename = "*");
+
+private:
+ // internal helpers
+ void execute_commands(const char *exename);
+ void display_help(const char *exename);
+ void display_suggestions(const char *gamename);
+ void output_single_softlist(FILE *out, software_list_device &swlist);
+
+ // internal state
+ emu_options & m_options;
+ osd_interface & m_osd;
+ int m_result;
+};
+
+
+
+
+#endif /* __CLIFRONT_H__ */
diff --git a/src/frontend/mame/info.cpp b/src/frontend/mame/info.cpp
new file mode 100644
index 00000000000..ee77890d63b
--- /dev/null
+++ b/src/frontend/mame/info.cpp
@@ -0,0 +1,1601 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles,Paul Priest
+/***************************************************************************
+
+ info.c
+
+ Dumps the MAME internal data as an XML file.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "mame.h"
+#include "emuopts.h"
+#include "mameopts.h"
+#include "machine/ram.h"
+#include "sound/samples.h"
+#include "info.h"
+#include "xmlfile.h"
+#include "config.h"
+#include "softlist.h"
+
+#include <ctype.h>
+
+#define XML_ROOT "mame"
+#define XML_TOP "machine"
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+// DTD string describing the data
+const char info_xml_creator::s_dtd_string[] =
+"<!DOCTYPE __XML_ROOT__ [\n"
+"<!ELEMENT __XML_ROOT__ (__XML_TOP__+)>\n"
+"\t<!ATTLIST __XML_ROOT__ build CDATA #IMPLIED>\n"
+"\t<!ATTLIST __XML_ROOT__ debug (yes|no) \"no\">\n"
+"\t<!ATTLIST __XML_ROOT__ mameconfig CDATA #REQUIRED>\n"
+"\t<!ELEMENT __XML_TOP__ (description, year?, manufacturer?, biosset*, rom*, disk*, device_ref*, sample*, chip*, display*, sound?, input?, dipswitch*, configuration*, port*, adjuster*, driver?, device*, slot*, softwarelist*, ramoption*)>\n"
+"\t\t<!ATTLIST __XML_TOP__ name CDATA #REQUIRED>\n"
+"\t\t<!ATTLIST __XML_TOP__ sourcefile CDATA #IMPLIED>\n"
+"\t\t<!ATTLIST __XML_TOP__ isbios (yes|no) \"no\">\n"
+"\t\t<!ATTLIST __XML_TOP__ isdevice (yes|no) \"no\">\n"
+"\t\t<!ATTLIST __XML_TOP__ ismechanical (yes|no) \"no\">\n"
+"\t\t<!ATTLIST __XML_TOP__ runnable (yes|no) \"yes\">\n"
+"\t\t<!ATTLIST __XML_TOP__ cloneof CDATA #IMPLIED>\n"
+"\t\t<!ATTLIST __XML_TOP__ romof CDATA #IMPLIED>\n"
+"\t\t<!ATTLIST __XML_TOP__ sampleof CDATA #IMPLIED>\n"
+"\t\t<!ELEMENT description (#PCDATA)>\n"
+"\t\t<!ELEMENT year (#PCDATA)>\n"
+"\t\t<!ELEMENT manufacturer (#PCDATA)>\n"
+"\t\t<!ELEMENT biosset EMPTY>\n"
+"\t\t\t<!ATTLIST biosset name CDATA #REQUIRED>\n"
+"\t\t\t<!ATTLIST biosset description CDATA #REQUIRED>\n"
+"\t\t\t<!ATTLIST biosset default (yes|no) \"no\">\n"
+"\t\t<!ELEMENT rom EMPTY>\n"
+"\t\t\t<!ATTLIST rom name CDATA #REQUIRED>\n"
+"\t\t\t<!ATTLIST rom bios CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST rom size CDATA #REQUIRED>\n"
+"\t\t\t<!ATTLIST rom crc CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST rom sha1 CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST rom merge CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST rom region CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST rom offset CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST rom status (baddump|nodump|good) \"good\">\n"
+"\t\t\t<!ATTLIST rom optional (yes|no) \"no\">\n"
+"\t\t<!ELEMENT disk EMPTY>\n"
+"\t\t\t<!ATTLIST disk name CDATA #REQUIRED>\n"
+"\t\t\t<!ATTLIST disk sha1 CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST disk merge CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST disk region CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST disk index CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST disk writable (yes|no) \"no\">\n"
+"\t\t\t<!ATTLIST disk status (baddump|nodump|good) \"good\">\n"
+"\t\t\t<!ATTLIST disk optional (yes|no) \"no\">\n"
+"\t\t<!ELEMENT device_ref EMPTY>\n"
+"\t\t\t<!ATTLIST device_ref name CDATA #REQUIRED>\n"
+"\t\t<!ELEMENT sample EMPTY>\n"
+"\t\t\t<!ATTLIST sample name CDATA #REQUIRED>\n"
+"\t\t<!ELEMENT chip EMPTY>\n"
+"\t\t\t<!ATTLIST chip name CDATA #REQUIRED>\n"
+"\t\t\t<!ATTLIST chip tag CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST chip type (cpu|audio) #REQUIRED>\n"
+"\t\t\t<!ATTLIST chip clock CDATA #IMPLIED>\n"
+"\t\t<!ELEMENT display EMPTY>\n"
+"\t\t\t<!ATTLIST display tag CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST display type (raster|vector|lcd|unknown) #REQUIRED>\n"
+"\t\t\t<!ATTLIST display rotate (0|90|180|270) #REQUIRED>\n"
+"\t\t\t<!ATTLIST display flipx (yes|no) \"no\">\n"
+"\t\t\t<!ATTLIST display width CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST display height CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST display refresh CDATA #REQUIRED>\n"
+"\t\t\t<!ATTLIST display pixclock CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST display htotal CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST display hbend CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST display hbstart CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST display vtotal CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST display vbend CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST display vbstart CDATA #IMPLIED>\n"
+"\t\t<!ELEMENT sound EMPTY>\n"
+"\t\t\t<!ATTLIST sound channels CDATA #REQUIRED>\n"
+"\t\t<!ELEMENT input (control*)>\n"
+"\t\t\t<!ATTLIST input service (yes|no) \"no\">\n"
+"\t\t\t<!ATTLIST input tilt (yes|no) \"no\">\n"
+"\t\t\t<!ATTLIST input players CDATA #REQUIRED>\n"
+"\t\t\t<!ATTLIST input coins CDATA #IMPLIED>\n"
+"\t\t\t<!ELEMENT control EMPTY>\n"
+"\t\t\t\t<!ATTLIST control type CDATA #REQUIRED>\n"
+"\t\t\t\t<!ATTLIST control player CDATA #IMPLIED>\n"
+"\t\t\t\t<!ATTLIST control buttons CDATA #IMPLIED>\n"
+"\t\t\t\t<!ATTLIST control minimum CDATA #IMPLIED>\n"
+"\t\t\t\t<!ATTLIST control maximum CDATA #IMPLIED>\n"
+"\t\t\t\t<!ATTLIST control sensitivity CDATA #IMPLIED>\n"
+"\t\t\t\t<!ATTLIST control keydelta CDATA #IMPLIED>\n"
+"\t\t\t\t<!ATTLIST control reverse (yes|no) \"no\">\n"
+"\t\t\t\t<!ATTLIST control ways CDATA #IMPLIED>\n"
+"\t\t\t\t<!ATTLIST control ways2 CDATA #IMPLIED>\n"
+"\t\t\t\t<!ATTLIST control ways3 CDATA #IMPLIED>\n"
+"\t\t<!ELEMENT dipswitch (dipvalue*)>\n"
+"\t\t\t<!ATTLIST dipswitch name CDATA #REQUIRED>\n"
+"\t\t\t<!ATTLIST dipswitch tag CDATA #REQUIRED>\n"
+"\t\t\t<!ATTLIST dipswitch mask CDATA #REQUIRED>\n"
+"\t\t\t<!ELEMENT dipvalue EMPTY>\n"
+"\t\t\t\t<!ATTLIST dipvalue name CDATA #REQUIRED>\n"
+"\t\t\t\t<!ATTLIST dipvalue value CDATA #REQUIRED>\n"
+"\t\t\t\t<!ATTLIST dipvalue default (yes|no) \"no\">\n"
+"\t\t<!ELEMENT configuration (confsetting*)>\n"
+"\t\t\t<!ATTLIST configuration name CDATA #REQUIRED>\n"
+"\t\t\t<!ATTLIST configuration tag CDATA #REQUIRED>\n"
+"\t\t\t<!ATTLIST configuration mask CDATA #REQUIRED>\n"
+"\t\t\t<!ELEMENT confsetting EMPTY>\n"
+"\t\t\t\t<!ATTLIST confsetting name CDATA #REQUIRED>\n"
+"\t\t\t\t<!ATTLIST confsetting value CDATA #REQUIRED>\n"
+"\t\t\t\t<!ATTLIST confsetting default (yes|no) \"no\">\n"
+"\t\t<!ELEMENT port (analog*)>\n"
+"\t\t\t<!ATTLIST port tag CDATA #REQUIRED>\n"
+"\t\t\t<!ELEMENT analog EMPTY>\n"
+"\t\t\t\t<!ATTLIST analog mask CDATA #REQUIRED>\n"
+"\t\t<!ELEMENT adjuster EMPTY>\n"
+"\t\t\t<!ATTLIST adjuster name CDATA #REQUIRED>\n"
+"\t\t\t<!ATTLIST adjuster default CDATA #REQUIRED>\n"
+"\t\t<!ELEMENT driver EMPTY>\n"
+"\t\t\t<!ATTLIST driver status (good|imperfect|preliminary) #REQUIRED>\n"
+"\t\t\t<!ATTLIST driver emulation (good|imperfect|preliminary) #REQUIRED>\n"
+"\t\t\t<!ATTLIST driver color (good|imperfect|preliminary) #REQUIRED>\n"
+"\t\t\t<!ATTLIST driver sound (good|imperfect|preliminary) #REQUIRED>\n"
+"\t\t\t<!ATTLIST driver graphic (good|imperfect|preliminary) #REQUIRED>\n"
+"\t\t\t<!ATTLIST driver cocktail (good|imperfect|preliminary) #IMPLIED>\n"
+"\t\t\t<!ATTLIST driver protection (good|imperfect|preliminary) #IMPLIED>\n"
+"\t\t\t<!ATTLIST driver savestate (supported|unsupported) #REQUIRED>\n"
+"\t\t<!ELEMENT device (instance*, extension*)>\n"
+"\t\t\t<!ATTLIST device type CDATA #REQUIRED>\n"
+"\t\t\t<!ATTLIST device tag CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST device fixed_image CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST device mandatory CDATA #IMPLIED>\n"
+"\t\t\t<!ATTLIST device interface CDATA #IMPLIED>\n"
+"\t\t\t<!ELEMENT instance EMPTY>\n"
+"\t\t\t\t<!ATTLIST instance name CDATA #REQUIRED>\n"
+"\t\t\t\t<!ATTLIST instance briefname CDATA #REQUIRED>\n"
+"\t\t\t<!ELEMENT extension EMPTY>\n"
+"\t\t\t\t<!ATTLIST extension name CDATA #REQUIRED>\n"
+"\t\t<!ELEMENT slot (slotoption*)>\n"
+"\t\t\t<!ATTLIST slot name CDATA #REQUIRED>\n"
+"\t\t\t<!ELEMENT slotoption EMPTY>\n"
+"\t\t\t\t<!ATTLIST slotoption name CDATA #REQUIRED>\n"
+"\t\t\t\t<!ATTLIST slotoption devname CDATA #REQUIRED>\n"
+"\t\t\t\t<!ATTLIST slotoption default (yes|no) \"no\">\n"
+"\t\t<!ELEMENT softwarelist EMPTY>\n"
+"\t\t\t<!ATTLIST softwarelist name CDATA #REQUIRED>\n"
+"\t\t\t<!ATTLIST softwarelist status (original|compatible) #REQUIRED>\n"
+"\t\t\t<!ATTLIST softwarelist filter CDATA #IMPLIED>\n"
+"\t\t<!ELEMENT ramoption (#PCDATA)>\n"
+"\t\t\t<!ATTLIST ramoption default CDATA #IMPLIED>\n"
+"]>";
+
+
+//**************************************************************************
+// INFO XML CREATOR
+//**************************************************************************
+
+//-------------------------------------------------
+// info_xml_creator - constructor
+//-------------------------------------------------
+
+info_xml_creator::info_xml_creator(driver_enumerator &drivlist)
+ : m_output(nullptr),
+ m_drivlist(drivlist),
+ m_lookup_options(m_drivlist.options())
+{
+ mame_options::remove_device_options(m_lookup_options);
+}
+
+
+//-------------------------------------------------
+// output_mame_xml - print the XML information
+// for all known games
+//-------------------------------------------------
+
+void info_xml_creator::output(FILE *out, bool nodevices)
+{
+ m_output = out;
+
+ // output the DTD
+ fprintf(m_output, "<?xml version=\"1.0\"?>\n");
+ std::string dtd(s_dtd_string);
+ strreplace(dtd, "__XML_ROOT__", XML_ROOT);
+ strreplace(dtd, "__XML_TOP__", XML_TOP);
+
+ fprintf(m_output, "%s\n\n", dtd.c_str());
+
+ // top-level tag
+ fprintf(m_output, "<%s build=\"%s\" debug=\""
+#ifdef MAME_DEBUG
+ "yes"
+#else
+ "no"
+#endif
+ "\" mameconfig=\"%d\">\n",
+ XML_ROOT,
+ xml_normalize_string(build_version),
+ CONFIG_VERSION
+ );
+
+ // iterate through the drivers, outputting one at a time
+ while (m_drivlist.next())
+ output_one();
+
+ // output devices (both devices with roms and slot devices)
+ if (!nodevices)
+ output_devices();
+
+ // close the top level tag
+ fprintf(m_output, "</%s>\n",XML_ROOT);
+}
+
+
+//-------------------------------------------------
+// output_one - print the XML information
+// for one particular game driver
+//-------------------------------------------------
+
+void info_xml_creator::output_one()
+{
+ // no action if not a game
+ const game_driver &driver = m_drivlist.driver();
+ if (driver.flags & MACHINE_NO_STANDALONE)
+ return;
+
+ // allocate input ports
+ machine_config &config = m_drivlist.config();
+ ioport_list portlist;
+ std::string errors;
+ device_iterator iter(config.root_device());
+ for (device_t &device : iter)
+ portlist.append(device, errors);
+
+ // renumber player numbers for controller ports
+ int player_offset = 0;
+ // but treat keyboard count separately from players' number
+ int kbd_offset = 0;
+ for (device_t &device : iter)
+ {
+ int nplayers = 0;
+ bool new_kbd = false;
+ for (ioport_port &port : portlist)
+ if (&port.device() == &device)
+ for (ioport_field &field : port.fields())
+ if (field.type() >= IPT_START && field.type() < IPT_ANALOG_LAST)
+ {
+ if (field.type() == IPT_KEYBOARD)
+ {
+ if (!new_kbd) new_kbd = TRUE;
+ field.set_player(field.player() + kbd_offset);
+ }
+ else
+ {
+ nplayers = MAX(nplayers, field.player() + 1);
+ field.set_player(field.player() + player_offset);
+ }
+ }
+ player_offset += nplayers;
+ if (new_kbd) kbd_offset++;
+ }
+
+ // print the header and the game name
+ fprintf(m_output, "\t<%s",XML_TOP);
+ fprintf(m_output, " name=\"%s\"", xml_normalize_string(driver.name));
+
+ // strip away any path information from the source_file and output it
+ const char *start = strrchr(driver.source_file, '/');
+ if (start == nullptr)
+ start = strrchr(driver.source_file, '\\');
+ if (start == nullptr)
+ start = driver.source_file - 1;
+ fprintf(m_output, " sourcefile=\"%s\"", xml_normalize_string(start + 1));
+
+ // append bios and runnable flags
+ if (driver.flags & MACHINE_IS_BIOS_ROOT)
+ fprintf(m_output, " isbios=\"yes\"");
+ if (driver.flags & MACHINE_NO_STANDALONE)
+ fprintf(m_output, " runnable=\"no\"");
+ if (driver.flags & MACHINE_MECHANICAL)
+ fprintf(m_output, " ismechanical=\"yes\"");
+
+ // display clone information
+ int clone_of = m_drivlist.find(driver.parent);
+ if (clone_of != -1 && !(m_drivlist.driver(clone_of).flags & MACHINE_IS_BIOS_ROOT))
+ fprintf(m_output, " cloneof=\"%s\"", xml_normalize_string(m_drivlist.driver(clone_of).name));
+ if (clone_of != -1)
+ fprintf(m_output, " romof=\"%s\"", xml_normalize_string(m_drivlist.driver(clone_of).name));
+
+ // display sample information and close the game tag
+ output_sampleof();
+ fprintf(m_output, ">\n");
+
+ // output game description
+ if (driver.description != nullptr)
+ fprintf(m_output, "\t\t<description>%s</description>\n", xml_normalize_string(driver.description));
+
+ // print the year only if is a number or another allowed character (? or +)
+ if (driver.year != nullptr && strspn(driver.year, "0123456789?+") == strlen(driver.year))
+ fprintf(m_output, "\t\t<year>%s</year>\n", xml_normalize_string(driver.year));
+
+ // print the manufacturer information
+ if (driver.manufacturer != nullptr)
+ fprintf(m_output, "\t\t<manufacturer>%s</manufacturer>\n", xml_normalize_string(driver.manufacturer));
+
+ // now print various additional information
+ output_bios();
+ output_rom(m_drivlist.config().root_device());
+ output_device_roms();
+ output_sample(m_drivlist.config().root_device());
+ output_chips(m_drivlist.config().root_device(), "");
+ output_display(m_drivlist.config().root_device(), "");
+ output_sound(m_drivlist.config().root_device());
+ output_input(portlist);
+ output_switches(portlist, "", IPT_DIPSWITCH, "dipswitch", "dipvalue");
+ output_switches(portlist, "", IPT_CONFIG, "configuration", "confsetting");
+ output_ports(portlist);
+ output_adjusters(portlist);
+ output_driver();
+ output_images(m_drivlist.config().root_device(), "");
+ output_slots(m_drivlist.config().root_device(), "");
+ output_software_list();
+ output_ramoptions();
+
+ // close the topmost tag
+ fprintf(m_output, "\t</%s>\n",XML_TOP);
+}
+
+
+//-------------------------------------------------
+// output_one_device - print the XML info for
+// a single device
+//-------------------------------------------------
+
+void info_xml_creator::output_one_device(device_t &device, const char *devtag)
+{
+ bool has_speaker = FALSE, has_input = FALSE;
+ // check if the device adds speakers to the system
+ sound_interface_iterator snditer(device);
+ if (snditer.first() != nullptr)
+ has_speaker = TRUE;
+ // generate input list
+ ioport_list portlist;
+ std::string errors;
+ for (device_t &dev : device_iterator(device))
+ portlist.append(dev, errors);
+ // check if the device adds player inputs (other than dsw and configs) to the system
+ for (ioport_port &port : portlist)
+ for (ioport_field &field : port.fields())
+ if (field.type() >= IPT_START1 && field.type() < IPT_UI_FIRST)
+ {
+ has_input = TRUE;
+ break;
+ }
+
+ // start to output info
+ fprintf(m_output, "\t<%s", XML_TOP);
+ fprintf(m_output, " name=\"%s\"", xml_normalize_string(device.shortname()));
+ std::string src(device.source());
+ strreplace(src,"../", "");
+ fprintf(m_output, " sourcefile=\"%s\"", xml_normalize_string(src.c_str()));
+ fprintf(m_output, " isdevice=\"yes\"");
+ fprintf(m_output, " runnable=\"no\"");
+ output_sampleof();
+ fprintf(m_output, ">\n");
+ fprintf(m_output, "\t\t<description>%s</description>\n", xml_normalize_string(device.name()));
+
+ output_rom(device);
+
+ samples_device *samples = dynamic_cast<samples_device*>(&device);
+ if (samples==nullptr) output_sample(device); // ignore samples_device itself
+
+ output_chips(device, devtag);
+ output_display(device, devtag);
+ if (has_speaker)
+ output_sound(device);
+ if (has_input)
+ output_input(portlist);
+ output_switches(portlist, devtag, IPT_DIPSWITCH, "dipswitch", "dipvalue");
+ output_switches(portlist, devtag, IPT_CONFIG, "configuration", "confsetting");
+ output_adjusters(portlist);
+ output_images(device, devtag);
+ output_slots(device, devtag);
+ fprintf(m_output, "\t</%s>\n", XML_TOP);
+}
+
+
+//-------------------------------------------------
+// output_devices - print the XML info for devices
+// with roms and for devices that can be mounted
+// in slots
+// The current solution works to some extent, but
+// it is limited by the fact that devices are only
+// acknowledged when attached to a driver (so that
+// for instance sub-sub-devices could never appear
+// in the xml input if they are not also attached
+// directly to a driver as device or sub-device)
+//-------------------------------------------------
+
+void info_xml_creator::output_devices()
+{
+ m_drivlist.reset();
+ std::unordered_set<std::string> shortnames;
+
+ while (m_drivlist.next())
+ {
+ // first, run through devices with roms which belongs to the default configuration
+ for (device_t &device : device_iterator(m_drivlist.config().root_device()))
+ {
+ if (device.owner() != nullptr && device.shortname() != nullptr && device.shortname()[0]!='\0')
+ {
+ if (shortnames.insert(device.shortname()).second)
+ output_one_device(device, device.tag());
+ }
+ }
+
+ // then, run through slot devices
+ for (const device_slot_interface &slot : slot_interface_iterator(m_drivlist.config().root_device()))
+ {
+ for (const device_slot_option &option : slot.option_list())
+ {
+ std::string temptag("_");
+ temptag.append(option.name());
+ device_t *dev = const_cast<machine_config &>(m_drivlist.config()).device_add(&m_drivlist.config().root_device(), temptag.c_str(), option.devtype(), 0);
+
+ // notify this device and all its subdevices that they are now configured
+ for (device_t &device : device_iterator(*dev))
+ if (!device.configured())
+ device.config_complete();
+
+ if (shortnames.insert(dev->shortname()).second)
+ output_one_device(*dev, temptag.c_str());
+
+ // also, check for subdevices with ROMs (a few devices are missed otherwise, e.g. MPU401)
+ for (device_t &device : device_iterator(*dev))
+ {
+ if (device.owner() == dev && device.shortname() != nullptr && device.shortname()[0]!='\0')
+ {
+ if (shortnames.insert(device.shortname()).second)
+ output_one_device(device, device.tag());
+ }
+ }
+
+ const_cast<machine_config &>(m_drivlist.config()).device_remove(&m_drivlist.config().root_device(), temptag.c_str());
+ }
+ }
+ }
+}
+
+
+//------------------------------------------------
+// output_device_roms - when a driver uses roms
+// included in a device set, print a reference
+//-------------------------------------------------
+
+void info_xml_creator::output_device_roms()
+{
+ for (device_t &device : device_iterator(m_drivlist.config().root_device()))
+ if (device.owner() != nullptr && device.shortname() != nullptr && device.shortname()[0] != '\0')
+ fprintf(m_output, "\t\t<device_ref name=\"%s\"/>\n", xml_normalize_string(device.shortname()));
+}
+
+
+//------------------------------------------------
+// output_sampleof - print the 'sampleof'
+// attribute, if appropriate
+//-------------------------------------------------
+
+void info_xml_creator::output_sampleof()
+{
+ // iterate over sample devices
+ for (samples_device &device : samples_device_iterator(m_drivlist.config().root_device()))
+ {
+ samples_iterator sampiter(device);
+ if (sampiter.altbasename() != nullptr)
+ {
+ fprintf(m_output, " sampleof=\"%s\"", xml_normalize_string(sampiter.altbasename()));
+
+ // must stop here, as there can only be one attribute of the same name
+ return;
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// output_bios - print the BIOS set for a
+// game
+//-------------------------------------------------
+
+void info_xml_creator::output_bios()
+{
+ // skip if no ROMs
+ if (m_drivlist.driver().rom == nullptr)
+ return;
+
+ // first determine the default BIOS name
+ std::string defaultname;
+ for (const rom_entry *rom = m_drivlist.driver().rom; !ROMENTRY_ISEND(rom); rom++)
+ if (ROMENTRY_ISDEFAULT_BIOS(rom))
+ defaultname = ROM_GETNAME(rom);
+
+ // iterate over ROM entries and look for BIOSes
+ for (const rom_entry *rom = m_drivlist.driver().rom; !ROMENTRY_ISEND(rom); rom++)
+ if (ROMENTRY_ISSYSTEM_BIOS(rom))
+ {
+ // output extracted name and descriptions
+ fprintf(m_output, "\t\t<biosset");
+ fprintf(m_output, " name=\"%s\"", xml_normalize_string(ROM_GETNAME(rom)));
+ fprintf(m_output, " description=\"%s\"", xml_normalize_string(ROM_GETHASHDATA(rom)));
+ if (defaultname == ROM_GETNAME(rom))
+ fprintf(m_output, " default=\"yes\"");
+ fprintf(m_output, "/>\n");
+ }
+}
+
+
+//-------------------------------------------------
+// output_rom - print the roms section of
+// the XML output
+//-------------------------------------------------
+
+void info_xml_creator::output_rom(device_t &device)
+{
+ // iterate over 3 different ROM "types": BIOS, ROMs, DISKs
+ for (int rom_type = 0; rom_type < 3; rom_type++)
+ for (const rom_entry *region = rom_first_region(device); region != nullptr; region = rom_next_region(region))
+ {
+ bool is_disk = ROMREGION_ISDISKDATA(region);
+
+ // disk regions only work for disks
+ if ((is_disk && rom_type != 2) || (!is_disk && rom_type == 2))
+ continue;
+
+ // iterate through ROM entries
+ for (const rom_entry *rom = rom_first_file(region); rom != nullptr; rom = rom_next_file(rom))
+ {
+ bool is_bios = ROM_GETBIOSFLAGS(rom);
+ const char *name = ROM_GETNAME(rom);
+ int offset = ROM_GETOFFSET(rom);
+ const char *merge_name = nullptr;
+ char bios_name[100];
+
+ // BIOS ROMs only apply to bioses
+ if ((is_bios && rom_type != 0) || (!is_bios && rom_type == 0))
+ continue;
+
+ // if we have a valid ROM and we are a clone, see if we can find the parent ROM
+ hash_collection hashes(ROM_GETHASHDATA(rom));
+ if (!hashes.flag(hash_collection::FLAG_NO_DUMP))
+ merge_name = get_merge_name(hashes);
+ if (&device != &m_drivlist.config().root_device())
+ merge_name = nullptr;
+ // scan for a BIOS name
+ bios_name[0] = 0;
+ if (!is_disk && is_bios)
+ {
+ // scan backwards through the ROM entries
+ for (const rom_entry *brom = rom - 1; brom != m_drivlist.driver().rom; brom--)
+ if (ROMENTRY_ISSYSTEM_BIOS(brom))
+ {
+ strcpy(bios_name, ROM_GETNAME(brom));
+ break;
+ }
+ }
+
+ std::ostringstream output;
+
+ // opening tag
+ if (!is_disk)
+ output << "\t\t<rom";
+ else
+ output << "\t\t<disk";
+
+ // add name, merge, bios, and size tags */
+ if (name != nullptr && name[0] != 0)
+ util::stream_format(output, " name=\"%s\"", xml_normalize_string(name));
+ if (merge_name != nullptr)
+ util::stream_format(output, " merge=\"%s\"", xml_normalize_string(merge_name));
+ if (bios_name[0] != 0)
+ util::stream_format(output, " bios=\"%s\"", xml_normalize_string(bios_name));
+ if (!is_disk)
+ util::stream_format(output, " size=\"%d\"", rom_file_size(rom));
+
+ // dump checksum information only if there is a known dump
+ if (!hashes.flag(hash_collection::FLAG_NO_DUMP))
+ {
+ // iterate over hash function types and print m_output their values
+ output << " " << hashes.attribute_string();
+ }
+ else
+ output << " status=\"nodump\"";
+
+ // append a region name
+ util::stream_format(output, " region=\"%s\"", ROMREGION_GETTAG(region));
+
+ // for non-disk entries, print offset
+ if (!is_disk)
+ util::stream_format(output, " offset=\"%x\"", offset);
+
+ // for disk entries, add the disk index
+ else
+ {
+ util::stream_format(output, " index=\"%x\"", DISK_GETINDEX(rom));
+ util::stream_format(output, " writable=\"%s\"", DISK_ISREADONLY(rom) ? "no" : "yes");
+ }
+
+ // add optional flag
+ if (ROM_ISOPTIONAL(rom))
+ output << " optional=\"yes\"";
+
+ output << "/>\n";
+
+ fprintf(m_output, "%s", output.str().c_str());
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// output_sample - print a list of all
+// samples referenced by a game_driver
+//-------------------------------------------------
+
+void info_xml_creator::output_sample(device_t &device)
+{
+ // iterate over sample devices
+ for (samples_device &samples : samples_device_iterator(device))
+ {
+ samples_iterator iter(samples);
+ std::unordered_set<std::string> already_printed;
+ for (const char *samplename = iter.first(); samplename != nullptr; samplename = iter.next())
+ {
+ // filter out duplicates
+ if (!already_printed.insert(samplename).second)
+ continue;
+
+ // output the sample name
+ fprintf(m_output, "\t\t<sample name=\"%s\"/>\n", xml_normalize_string(samplename));
+ }
+ }
+}
+
+
+/*-------------------------------------------------
+ output_chips - print a list of CPU and
+ sound chips used by a game
+-------------------------------------------------*/
+
+void info_xml_creator::output_chips(device_t &device, const char *root_tag)
+{
+ // iterate over executable devices
+ for (device_execute_interface &exec : execute_interface_iterator(device))
+ {
+ if (strcmp(exec.device().tag(), device.tag()))
+ {
+ std::string newtag(exec.device().tag()), oldtag(":");
+ newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length());
+
+ fprintf(m_output, "\t\t<chip");
+ fprintf(m_output, " type=\"cpu\"");
+ fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag.c_str()));
+ fprintf(m_output, " name=\"%s\"", xml_normalize_string(exec.device().name()));
+ fprintf(m_output, " clock=\"%d\"", exec.device().clock());
+ fprintf(m_output, "/>\n");
+ }
+ }
+
+ // iterate over sound devices
+ for (device_sound_interface &sound : sound_interface_iterator(device))
+ {
+ if (strcmp(sound.device().tag(), device.tag()))
+ {
+ std::string newtag(sound.device().tag()), oldtag(":");
+ newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length());
+
+ fprintf(m_output, "\t\t<chip");
+ fprintf(m_output, " type=\"audio\"");
+ fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag.c_str()));
+ fprintf(m_output, " name=\"%s\"", xml_normalize_string(sound.device().name()));
+ if (sound.device().clock() != 0)
+ fprintf(m_output, " clock=\"%d\"", sound.device().clock());
+ fprintf(m_output, "/>\n");
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// output_display - print a list of all the
+// displays
+//-------------------------------------------------
+
+void info_xml_creator::output_display(device_t &device, const char *root_tag)
+{
+ // iterate over screens
+ for (const screen_device &screendev : screen_device_iterator(device))
+ {
+ if (strcmp(screendev.tag(), device.tag()))
+ {
+ std::string newtag(screendev.tag()), oldtag(":");
+ newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length());
+
+ fprintf(m_output, "\t\t<display");
+ fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag.c_str()));
+
+ switch (screendev.screen_type())
+ {
+ case SCREEN_TYPE_RASTER: fprintf(m_output, " type=\"raster\""); break;
+ case SCREEN_TYPE_VECTOR: fprintf(m_output, " type=\"vector\""); break;
+ case SCREEN_TYPE_LCD: fprintf(m_output, " type=\"lcd\""); break;
+ default: fprintf(m_output, " type=\"unknown\""); break;
+ }
+
+ // output the orientation as a string
+ switch (m_drivlist.driver().flags & ORIENTATION_MASK)
+ {
+ case ORIENTATION_FLIP_X:
+ fprintf(m_output, " rotate=\"0\" flipx=\"yes\"");
+ break;
+ case ORIENTATION_FLIP_Y:
+ fprintf(m_output, " rotate=\"180\" flipx=\"yes\"");
+ break;
+ case ORIENTATION_FLIP_X|ORIENTATION_FLIP_Y:
+ fprintf(m_output, " rotate=\"180\"");
+ break;
+ case ORIENTATION_SWAP_XY:
+ fprintf(m_output, " rotate=\"90\" flipx=\"yes\"");
+ break;
+ case ORIENTATION_SWAP_XY|ORIENTATION_FLIP_X:
+ fprintf(m_output, " rotate=\"90\"");
+ break;
+ case ORIENTATION_SWAP_XY|ORIENTATION_FLIP_Y:
+ fprintf(m_output, " rotate=\"270\"");
+ break;
+ case ORIENTATION_SWAP_XY|ORIENTATION_FLIP_X|ORIENTATION_FLIP_Y:
+ fprintf(m_output, " rotate=\"270\" flipx=\"yes\"");
+ break;
+ default:
+ fprintf(m_output, " rotate=\"0\"");
+ break;
+ }
+
+ // output width and height only for games that are not vector
+ if (screendev.screen_type() != SCREEN_TYPE_VECTOR)
+ {
+ const rectangle &visarea = screendev.visible_area();
+ fprintf(m_output, " width=\"%d\"", visarea.width());
+ fprintf(m_output, " height=\"%d\"", visarea.height());
+ }
+
+ // output refresh rate
+ fprintf(m_output, " refresh=\"%f\"", ATTOSECONDS_TO_HZ(screendev.refresh_attoseconds()));
+
+ // output raw video parameters only for games that are not vector
+ // and had raw parameters specified
+ if (screendev.screen_type() != SCREEN_TYPE_VECTOR && !screendev.oldstyle_vblank_supplied())
+ {
+ int pixclock = screendev.width() * screendev.height() * ATTOSECONDS_TO_HZ(screendev.refresh_attoseconds());
+
+ fprintf(m_output, " pixclock=\"%d\"", pixclock);
+ fprintf(m_output, " htotal=\"%d\"", screendev.width());
+ fprintf(m_output, " hbend=\"%d\"", screendev.visible_area().min_x);
+ fprintf(m_output, " hbstart=\"%d\"", screendev.visible_area().max_x+1);
+ fprintf(m_output, " vtotal=\"%d\"", screendev.height());
+ fprintf(m_output, " vbend=\"%d\"", screendev.visible_area().min_y);
+ fprintf(m_output, " vbstart=\"%d\"", screendev.visible_area().max_y+1);
+ }
+ fprintf(m_output, " />\n");
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// output_sound - print a list of all the
+// speakers
+//------------------------------------------------
+
+void info_xml_creator::output_sound(device_t &device)
+{
+ speaker_device_iterator spkiter(device);
+ int speakers = spkiter.count();
+
+ // if we have no sound, zero m_output the speaker count
+ sound_interface_iterator snditer(device);
+ if (snditer.first() == nullptr)
+ speakers = 0;
+
+ fprintf(m_output, "\t\t<sound channels=\"%d\"/>\n", speakers);
+}
+
+
+//-------------------------------------------------
+// output_input - print a summary of a game's
+// input
+//-------------------------------------------------
+
+void info_xml_creator::output_input(const ioport_list &portlist)
+{
+ // enumerated list of control types
+ // NOTE: the order is chosen so that 'spare' button inputs are assigned to the
+ // most-likely-correct input device when info is output (you can think of it as
+ // a sort of likelihood order of having buttons)
+ enum
+ {
+ CTRL_DIGITAL_BUTTONS,
+ CTRL_DIGITAL_JOYSTICK,
+ CTRL_ANALOG_JOYSTICK,
+ CTRL_ANALOG_LIGHTGUN,
+ CTRL_ANALOG_DIAL,
+ CTRL_ANALOG_POSITIONAL,
+ CTRL_ANALOG_TRACKBALL,
+ CTRL_ANALOG_MOUSE,
+ CTRL_ANALOG_PADDLE,
+ CTRL_ANALOG_PEDAL,
+ CTRL_DIGITAL_KEYPAD,
+ CTRL_DIGITAL_KEYBOARD,
+ CTRL_DIGITAL_MAHJONG,
+ CTRL_DIGITAL_HANAFUDA,
+ CTRL_DIGITAL_GAMBLING,
+ CTRL_COUNT
+ };
+
+ enum
+ {
+ CTRL_P1,
+ CTRL_P2,
+ CTRL_P3,
+ CTRL_P4,
+ CTRL_P5,
+ CTRL_P6,
+ CTRL_P7,
+ CTRL_P8,
+ CTRL_PCOUNT
+ };
+
+ // directions
+ const UINT8 DIR_UP = 0x01;
+ const UINT8 DIR_DOWN = 0x02;
+ const UINT8 DIR_LEFT = 0x04;
+ const UINT8 DIR_RIGHT = 0x08;
+
+ // initialize the list of control types
+ struct
+ {
+ const char * type; // general type of input
+ int player; // player which the input belongs to
+ int nbuttons; // total number of buttons
+ int maxbuttons; // max index of buttons (using IPT_BUTTONn) [probably to be removed soonish]
+ int ways; // directions for joystick
+ bool analog; // is analog input?
+ UINT8 helper[3]; // for dual joysticks [possibly to be removed soonish]
+ INT32 min; // analog minimum value
+ INT32 max; // analog maximum value
+ INT32 sensitivity; // default analog sensitivity
+ INT32 keydelta; // default analog keydelta
+ bool reverse; // default analog reverse setting
+ } control_info[CTRL_COUNT * CTRL_PCOUNT];
+
+ memset(&control_info, 0, sizeof(control_info));
+
+ // tracking info as we iterate
+ int nplayer = 0;
+ int ncoin = 0;
+ bool service = false;
+ bool tilt = false;
+
+ // iterate over the ports
+ for (ioport_port &port : portlist)
+ {
+ int ctrl_type = CTRL_DIGITAL_BUTTONS;
+ bool ctrl_analog = FALSE;
+ for (ioport_field &field : port.fields())
+ {
+
+ // track the highest player number
+ if (nplayer < field.player() + 1)
+ nplayer = field.player() + 1;
+
+ // switch off of the type
+ switch (field.type())
+ {
+ // map joysticks
+ case IPT_JOYSTICK_UP:
+ ctrl_type = CTRL_DIGITAL_JOYSTICK;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "joy";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].ways = field.way();
+ control_info[field.player() * CTRL_COUNT + ctrl_type].helper[0] |= DIR_UP;
+ break;
+ case IPT_JOYSTICK_DOWN:
+ ctrl_type = CTRL_DIGITAL_JOYSTICK;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "joy";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].ways = field.way();
+ control_info[field.player() * CTRL_COUNT + ctrl_type].helper[0] |= DIR_DOWN;
+ break;
+ case IPT_JOYSTICK_LEFT:
+ ctrl_type = CTRL_DIGITAL_JOYSTICK;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "joy";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].ways = field.way();
+ control_info[field.player() * CTRL_COUNT + ctrl_type].helper[0] |= DIR_LEFT;
+ break;
+ case IPT_JOYSTICK_RIGHT:
+ ctrl_type = CTRL_DIGITAL_JOYSTICK;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "joy";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].ways = field.way();
+ control_info[field.player() * CTRL_COUNT + ctrl_type].helper[0] |= DIR_RIGHT;
+ break;
+
+ case IPT_JOYSTICKLEFT_UP:
+ ctrl_type = CTRL_DIGITAL_JOYSTICK;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "joy";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].ways = field.way();
+ control_info[field.player() * CTRL_COUNT + ctrl_type].helper[1] |= DIR_UP;
+ break;
+ case IPT_JOYSTICKLEFT_DOWN:
+ ctrl_type = CTRL_DIGITAL_JOYSTICK;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "joy";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].ways = field.way();
+ control_info[field.player() * CTRL_COUNT + ctrl_type].helper[1] |= DIR_DOWN;
+ break;
+ case IPT_JOYSTICKLEFT_LEFT:
+ ctrl_type = CTRL_DIGITAL_JOYSTICK;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "joy";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].ways = field.way();
+ control_info[field.player() * CTRL_COUNT + ctrl_type].helper[1] |= DIR_LEFT;
+ break;
+ case IPT_JOYSTICKLEFT_RIGHT:
+ ctrl_type = CTRL_DIGITAL_JOYSTICK;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "joy";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].ways = field.way();
+ control_info[field.player() * CTRL_COUNT + ctrl_type].helper[1] |= DIR_RIGHT;
+ break;
+
+ case IPT_JOYSTICKRIGHT_UP:
+ ctrl_type = CTRL_DIGITAL_JOYSTICK;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "joy";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].ways = field.way();
+ control_info[field.player() * CTRL_COUNT + ctrl_type].helper[2] |= DIR_UP;
+ break;
+ case IPT_JOYSTICKRIGHT_DOWN:
+ ctrl_type = CTRL_DIGITAL_JOYSTICK;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "joy";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].ways = field.way();
+ control_info[field.player() * CTRL_COUNT + ctrl_type].helper[2] |= DIR_DOWN;
+ break;
+ case IPT_JOYSTICKRIGHT_LEFT:
+ ctrl_type = CTRL_DIGITAL_JOYSTICK;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "joy";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].ways = field.way();
+ control_info[field.player() * CTRL_COUNT + ctrl_type].helper[2] |= DIR_LEFT;
+ break;
+ case IPT_JOYSTICKRIGHT_RIGHT:
+ ctrl_type = CTRL_DIGITAL_JOYSTICK;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "joy";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].ways = field.way();
+ control_info[field.player() * CTRL_COUNT + ctrl_type].helper[2] |= DIR_RIGHT;
+ break;
+
+ // map analog inputs
+ case IPT_AD_STICK_X:
+ case IPT_AD_STICK_Y:
+ case IPT_AD_STICK_Z:
+ ctrl_analog = TRUE;
+ ctrl_type = CTRL_ANALOG_JOYSTICK;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "stick";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].analog = TRUE;
+ break;
+
+ case IPT_PADDLE:
+ case IPT_PADDLE_V:
+ ctrl_analog = TRUE;
+ ctrl_type = CTRL_ANALOG_PADDLE;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "paddle";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].analog = TRUE;
+ break;
+
+ case IPT_PEDAL:
+ case IPT_PEDAL2:
+ case IPT_PEDAL3:
+ ctrl_analog = TRUE;
+ ctrl_type = CTRL_ANALOG_PEDAL;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "pedal";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].analog = TRUE;
+ break;
+
+ case IPT_LIGHTGUN_X:
+ case IPT_LIGHTGUN_Y:
+ ctrl_analog = TRUE;
+ ctrl_type = CTRL_ANALOG_LIGHTGUN;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "lightgun";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].analog = TRUE;
+ break;
+
+ case IPT_POSITIONAL:
+ case IPT_POSITIONAL_V:
+ ctrl_analog = TRUE;
+ ctrl_type = CTRL_ANALOG_POSITIONAL;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "positional";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].analog = TRUE;
+ break;
+
+ case IPT_DIAL:
+ case IPT_DIAL_V:
+ ctrl_analog = TRUE;
+ ctrl_type = CTRL_ANALOG_DIAL;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "dial";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].analog = TRUE;
+ break;
+
+ case IPT_TRACKBALL_X:
+ case IPT_TRACKBALL_Y:
+ ctrl_analog = TRUE;
+ ctrl_type = CTRL_ANALOG_TRACKBALL;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "trackball";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].analog = TRUE;
+ break;
+
+ case IPT_MOUSE_X:
+ case IPT_MOUSE_Y:
+ ctrl_analog = TRUE;
+ ctrl_type = CTRL_ANALOG_MOUSE;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "mouse";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].analog = TRUE;
+ break;
+
+ // map buttons
+ case IPT_BUTTON1:
+ case IPT_BUTTON2:
+ case IPT_BUTTON3:
+ case IPT_BUTTON4:
+ case IPT_BUTTON5:
+ case IPT_BUTTON6:
+ case IPT_BUTTON7:
+ case IPT_BUTTON8:
+ case IPT_BUTTON9:
+ case IPT_BUTTON10:
+ case IPT_BUTTON11:
+ case IPT_BUTTON12:
+ case IPT_BUTTON13:
+ case IPT_BUTTON14:
+ case IPT_BUTTON15:
+ case IPT_BUTTON16:
+ ctrl_analog = FALSE;
+ if (control_info[field.player() * CTRL_COUNT + ctrl_type].type == nullptr)
+ {
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "only_buttons";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].analog = FALSE;
+ }
+ control_info[field.player() * CTRL_COUNT + ctrl_type].maxbuttons = MAX(control_info[field.player() * CTRL_COUNT + ctrl_type].maxbuttons, field.type() - IPT_BUTTON1 + 1);
+ control_info[field.player() * CTRL_COUNT + ctrl_type].nbuttons++;
+ break;
+
+ // track maximum coin index
+ case IPT_COIN1:
+ case IPT_COIN2:
+ case IPT_COIN3:
+ case IPT_COIN4:
+ case IPT_COIN5:
+ case IPT_COIN6:
+ case IPT_COIN7:
+ case IPT_COIN8:
+ ncoin = MAX(ncoin, field.type() - IPT_COIN1 + 1);
+ break;
+
+ // track presence of keypads and keyboards
+ case IPT_KEYPAD:
+ ctrl_type = CTRL_DIGITAL_KEYPAD;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "keypad";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].nbuttons++;
+ break;
+
+ case IPT_KEYBOARD:
+ ctrl_type = CTRL_DIGITAL_KEYBOARD;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "keyboard";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].nbuttons++;
+ break;
+
+ // additional types
+ case IPT_SERVICE:
+ service = true;
+ break;
+
+ case IPT_TILT:
+ tilt = true;
+ break;
+
+ default:
+ if (field.type() > IPT_MAHJONG_FIRST && field.type() < IPT_MAHJONG_LAST)
+ {
+ ctrl_type = CTRL_DIGITAL_MAHJONG;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "mahjong";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].nbuttons++;
+ }
+ else if (field.type() > IPT_HANAFUDA_FIRST && field.type() < IPT_HANAFUDA_LAST)
+ {
+ ctrl_type = CTRL_DIGITAL_HANAFUDA;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "hanafuda";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].nbuttons++;
+ }
+ else if (field.type() > IPT_GAMBLING_FIRST && field.type() < IPT_GAMBLING_LAST)
+ {
+ ctrl_type = CTRL_DIGITAL_GAMBLING;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].type = "gambling";
+ control_info[field.player() * CTRL_COUNT + ctrl_type].player = field.player() + 1;
+ control_info[field.player() * CTRL_COUNT + ctrl_type].nbuttons++;
+ }
+ break;
+ }
+
+ if (ctrl_analog)
+ {
+ // get the analog stats
+ if (field.minval() != 0)
+ control_info[field.player() * CTRL_COUNT + ctrl_type].min = field.minval();
+ if (field.maxval() != 0)
+ control_info[field.player() * CTRL_COUNT + ctrl_type].max = field.maxval();
+ if (field.sensitivity() != 0)
+ control_info[field.player() * CTRL_COUNT + ctrl_type].sensitivity = field.sensitivity();
+ if (field.delta() != 0)
+ control_info[field.player() * CTRL_COUNT + ctrl_type].keydelta = field.delta();
+ if (field.analog_reverse() != 0)
+ control_info[field.player() * CTRL_COUNT + ctrl_type].reverse = TRUE;
+ }
+ }
+ }
+
+ // Clean-up those entries, if any, where buttons were defined in a separate port than the actual controller they belong to.
+ // This is quite often the case, especially for arcades where controls can be easily mapped to separate input ports on PCB.
+ // If such situation would only happen for joystick, it would be possible to work it around by initializing differently
+ // ctrl_type above, but it is quite common among analog inputs as well (for instance, this is the tipical situation
+ // for lightguns) and therefore we really need this separate loop.
+ for (int i = 0; i < CTRL_PCOUNT; i++)
+ {
+ bool fix_done = FALSE;
+ for (int j = 1; j < CTRL_COUNT; j++)
+ if (control_info[i * CTRL_COUNT].type != nullptr && control_info[i * CTRL_COUNT + j].type != nullptr && !fix_done)
+ {
+ control_info[i * CTRL_COUNT + j].nbuttons += control_info[i * CTRL_COUNT].nbuttons;
+ control_info[i * CTRL_COUNT + j].maxbuttons = MAX(control_info[i * CTRL_COUNT + j].maxbuttons, control_info[i * CTRL_COUNT].maxbuttons);
+
+ memset(&control_info[i * CTRL_COUNT], 0, sizeof(control_info[0]));
+ fix_done = TRUE;
+ }
+ }
+
+ // Output the input info
+ // First basic info
+ fprintf(m_output, "\t\t<input");
+ fprintf(m_output, " players=\"%d\"", nplayer);
+ if (ncoin != 0)
+ fprintf(m_output, " coins=\"%d\"", ncoin);
+ if (service)
+ fprintf(m_output, " service=\"yes\"");
+ if (tilt)
+ fprintf(m_output, " tilt=\"yes\"");
+ fprintf(m_output, ">\n");
+
+ // Then controller specific ones
+ for (auto & elem : control_info)
+ if (elem.type != nullptr)
+ {
+ //printf("type %s - player %d - buttons %d\n", elem.type, elem.player, elem.nbuttons);
+ if (elem.analog)
+ {
+ fprintf(m_output, "\t\t\t<control type=\"%s\"", xml_normalize_string(elem.type));
+ if (nplayer > 1)
+ fprintf(m_output, " player=\"%d\"", elem.player);
+ if (elem.nbuttons > 0)
+ fprintf(m_output, " buttons=\"%d\"", strcmp(elem.type, "stick") ? elem.nbuttons : elem.maxbuttons);
+ if (elem.min != 0 || elem.max != 0)
+ {
+ fprintf(m_output, " minimum=\"%d\"", elem.min);
+ fprintf(m_output, " maximum=\"%d\"", elem.max);
+ }
+ if (elem.sensitivity != 0)
+ fprintf(m_output, " sensitivity=\"%d\"", elem.sensitivity);
+ if (elem.keydelta != 0)
+ fprintf(m_output, " keydelta=\"%d\"", elem.keydelta);
+ if (elem.reverse)
+ fprintf(m_output, " reverse=\"yes\"");
+
+ fprintf(m_output, "/>\n");
+ }
+ else
+ {
+ if (elem.helper[1] == 0 && elem.helper[2] != 0) { elem.helper[1] = elem.helper[2]; elem.helper[2] = 0; }
+ if (elem.helper[0] == 0 && elem.helper[1] != 0) { elem.helper[0] = elem.helper[1]; elem.helper[1] = 0; }
+ if (elem.helper[1] == 0 && elem.helper[2] != 0) { elem.helper[1] = elem.helper[2]; elem.helper[2] = 0; }
+ const char *joys = (elem.helper[2] != 0) ? "triple" : (elem.helper[1] != 0) ? "double" : "";
+ fprintf(m_output, "\t\t\t<control type=\"%s%s\"", joys, xml_normalize_string(elem.type));
+ if (nplayer > 1)
+ fprintf(m_output, " player=\"%d\"", elem.player);
+ if (elem.nbuttons > 0)
+ fprintf(m_output, " buttons=\"%d\"", strcmp(elem.type, "joy") ? elem.nbuttons : elem.maxbuttons);
+ for (int lp = 0; lp < 3 && elem.helper[lp] != 0; lp++)
+ {
+ const char *plural = (lp==2) ? "3" : (lp==1) ? "2" : "";
+ const char *ways;
+ std::string helper;
+ switch (elem.helper[lp] & (DIR_UP | DIR_DOWN | DIR_LEFT | DIR_RIGHT))
+ {
+ case DIR_UP | DIR_DOWN | DIR_LEFT | DIR_RIGHT:
+ helper = string_format("%d", (elem.ways == 0) ? 8 : elem.ways);
+ ways = helper.c_str();
+ break;
+ case DIR_LEFT | DIR_RIGHT:
+ ways = "2";
+ break;
+ case DIR_UP | DIR_DOWN:
+ ways = "vertical2";
+ break;
+ case DIR_UP:
+ case DIR_DOWN:
+ case DIR_LEFT:
+ case DIR_RIGHT:
+ ways = "1";
+ break;
+ case DIR_UP | DIR_DOWN | DIR_LEFT:
+ case DIR_UP | DIR_DOWN | DIR_RIGHT:
+ case DIR_UP | DIR_LEFT | DIR_RIGHT:
+ case DIR_DOWN | DIR_LEFT | DIR_RIGHT:
+ ways = (elem.ways == 4) ? "3 (half4)" : "5 (half8)";
+ break;
+ default:
+ ways = "strange2";
+ break;
+ }
+ fprintf(m_output, " ways%s=\"%s\"", plural, ways);
+ }
+ fprintf(m_output, "/>\n");
+ }
+ }
+
+ fprintf(m_output, "\t\t</input>\n");
+}
+
+
+//-------------------------------------------------
+// output_switches - print the configurations or
+// DIP switch settings
+//-------------------------------------------------
+
+void info_xml_creator::output_switches(const ioport_list &portlist, const char *root_tag, int type, const char *outertag, const char *innertag)
+{
+ // iterate looking for DIP switches
+ for (ioport_port &port : portlist)
+ for (ioport_field &field : port.fields())
+ if (field.type() == type)
+ {
+ std::ostringstream output;
+
+ std::string newtag(port.tag()), oldtag(":");
+ newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length());
+
+ // output the switch name information
+ std::string normalized_field_name(xml_normalize_string(field.name()));
+ std::string normalized_newtag(xml_normalize_string(newtag.c_str()));
+ util::stream_format(output,"\t\t<%s name=\"%s\" tag=\"%s\" mask=\"%u\">\n", outertag, normalized_field_name.c_str(), normalized_newtag.c_str(), field.mask());
+
+ // loop over settings
+ for (ioport_setting &setting : field.settings())
+ {
+ util::stream_format(output,"\t\t\t<%s name=\"%s\" value=\"%u\"%s/>\n", innertag, xml_normalize_string(setting.name()), setting.value(), setting.value() == field.defvalue() ? " default=\"yes\"" : "");
+ }
+
+ // terminate the switch entry
+ util::stream_format(output,"\t\t</%s>\n", outertag);
+
+ fprintf(m_output, "%s", output.str().c_str());
+ }
+}
+
+//-------------------------------------------------
+// output_ports - print the structure of input
+// ports in the driver
+//-------------------------------------------------
+void info_xml_creator::output_ports(const ioport_list &portlist)
+{
+ // cycle through ports
+ for (ioport_port &port : portlist)
+ {
+ fprintf(m_output,"\t\t<port tag=\"%s\">\n", xml_normalize_string(port.tag()));
+ for (ioport_field &field : port.fields())
+ {
+ if(field.is_analog())
+ fprintf(m_output,"\t\t\t<analog mask=\"%u\"/>\n", field.mask());
+ }
+ // close element
+ fprintf(m_output,"\t\t</port>\n");
+ }
+
+}
+
+//-------------------------------------------------
+// output_adjusters - print the Analog
+// Adjusters for a game
+//-------------------------------------------------
+
+void info_xml_creator::output_adjusters(const ioport_list &portlist)
+{
+ // iterate looking for Adjusters
+ for (ioport_port &port : portlist)
+ for (ioport_field &field : port.fields())
+ if (field.type() == IPT_ADJUSTER)
+ fprintf(m_output, "\t\t<adjuster name=\"%s\" default=\"%d\"/>\n", xml_normalize_string(field.name()), field.defvalue());
+}
+
+
+//-------------------------------------------------
+// output_driver - print driver status
+//-------------------------------------------------
+
+void info_xml_creator::output_driver()
+{
+ fprintf(m_output, "\t\t<driver");
+
+ /* The status entry is an hint for frontend authors */
+ /* to select working and not working games without */
+ /* the need to know all the other status entries. */
+ /* Games marked as status=good are perfectly emulated, games */
+ /* marked as status=imperfect are emulated with only */
+ /* some minor issues, games marked as status=preliminary */
+ /* don't work or have major emulation problems. */
+
+ if (m_drivlist.driver().flags & (MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_NO_SOUND | MACHINE_WRONG_COLORS | MACHINE_MECHANICAL))
+ fprintf(m_output, " status=\"preliminary\"");
+ else if (m_drivlist.driver().flags & (MACHINE_IMPERFECT_COLORS | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS))
+ fprintf(m_output, " status=\"imperfect\"");
+ else
+ fprintf(m_output, " status=\"good\"");
+
+ if (m_drivlist.driver().flags & MACHINE_NOT_WORKING)
+ fprintf(m_output, " emulation=\"preliminary\"");
+ else
+ fprintf(m_output, " emulation=\"good\"");
+
+ if (m_drivlist.driver().flags & MACHINE_WRONG_COLORS)
+ fprintf(m_output, " color=\"preliminary\"");
+ else if (m_drivlist.driver().flags & MACHINE_IMPERFECT_COLORS)
+ fprintf(m_output, " color=\"imperfect\"");
+ else
+ fprintf(m_output, " color=\"good\"");
+
+ if (m_drivlist.driver().flags & MACHINE_NO_SOUND)
+ fprintf(m_output, " sound=\"preliminary\"");
+ else if (m_drivlist.driver().flags & MACHINE_IMPERFECT_SOUND)
+ fprintf(m_output, " sound=\"imperfect\"");
+ else
+ fprintf(m_output, " sound=\"good\"");
+
+ if (m_drivlist.driver().flags & MACHINE_IMPERFECT_GRAPHICS)
+ fprintf(m_output, " graphic=\"imperfect\"");
+ else
+ fprintf(m_output, " graphic=\"good\"");
+
+ if (m_drivlist.driver().flags & MACHINE_NO_COCKTAIL)
+ fprintf(m_output, " cocktail=\"preliminary\"");
+
+ if (m_drivlist.driver().flags & MACHINE_UNEMULATED_PROTECTION)
+ fprintf(m_output, " protection=\"preliminary\"");
+
+ if (m_drivlist.driver().flags & MACHINE_SUPPORTS_SAVE)
+ fprintf(m_output, " savestate=\"supported\"");
+ else
+ fprintf(m_output, " savestate=\"unsupported\"");
+
+ fprintf(m_output, "/>\n");
+}
+
+
+//-------------------------------------------------
+// output_images - prints m_output all info on
+// image devices
+//-------------------------------------------------
+
+void info_xml_creator::output_images(device_t &device, const char *root_tag)
+{
+ for (const device_image_interface &imagedev : image_interface_iterator(device))
+ {
+ if (strcmp(imagedev.device().tag(), device.tag()))
+ {
+ bool loadable = imagedev.user_loadable();
+ std::string newtag(imagedev.device().tag()), oldtag(":");
+ newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length());
+
+ // print m_output device type
+ fprintf(m_output, "\t\t<device type=\"%s\"", xml_normalize_string(imagedev.image_type_name()));
+
+ // does this device have a tag?
+ if (imagedev.device().tag())
+ fprintf(m_output, " tag=\"%s\"", xml_normalize_string(newtag.c_str()));
+
+ // is this device available as media switch?
+ if (!loadable)
+ fprintf(m_output, " fixed_image=\"1\"");
+
+ // is this device mandatory?
+ if (imagedev.must_be_loaded())
+ fprintf(m_output, " mandatory=\"1\"");
+
+ if (imagedev.image_interface() && imagedev.image_interface()[0])
+ fprintf(m_output, " interface=\"%s\"", xml_normalize_string(imagedev.image_interface()));
+
+ // close the XML tag
+ fprintf(m_output, ">\n");
+
+ if (loadable)
+ {
+ const char *name = imagedev.instance_name();
+ const char *shortname = imagedev.brief_instance_name();
+
+ fprintf(m_output, "\t\t\t<instance");
+ fprintf(m_output, " name=\"%s\"", xml_normalize_string(name));
+ fprintf(m_output, " briefname=\"%s\"", xml_normalize_string(shortname));
+ fprintf(m_output, "/>\n");
+
+ std::string extensions(imagedev.file_extensions());
+
+ char *ext = strtok((char *)extensions.c_str(), ",");
+ while (ext != nullptr)
+ {
+ fprintf(m_output, "\t\t\t<extension");
+ fprintf(m_output, " name=\"%s\"", xml_normalize_string(ext));
+ fprintf(m_output, "/>\n");
+ ext = strtok(nullptr, ",");
+ }
+ }
+ fprintf(m_output, "\t\t</device>\n");
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// output_images - prints all info about slots
+//-------------------------------------------------
+
+void info_xml_creator::output_slots(device_t &device, const char *root_tag)
+{
+ for (const device_slot_interface &slot : slot_interface_iterator(device))
+ {
+ if (slot.fixed()) continue; // or shall we list these as non-configurable?
+
+ if (strcmp(slot.device().tag(), device.tag()))
+ {
+ std::string newtag(slot.device().tag()), oldtag(":");
+ newtag = newtag.substr(newtag.find(oldtag.append(root_tag)) + oldtag.length());
+
+ // print m_output device type
+ fprintf(m_output, "\t\t<slot name=\"%s\">\n", xml_normalize_string(newtag.c_str()));
+
+ /*
+ if (slot.slot_interface()[0])
+ fprintf(m_output, " interface=\"%s\"", xml_normalize_string(slot.slot_interface()));
+ */
+
+ for (const device_slot_option &option : slot.option_list())
+ {
+ if (option.selectable())
+ {
+ device_t *dev = const_cast<machine_config &>(m_drivlist.config()).device_add(&m_drivlist.config().root_device(), "dummy", option.devtype(), 0);
+ if (!dev->configured())
+ dev->config_complete();
+
+ fprintf(m_output, "\t\t\t<slotoption");
+ fprintf(m_output, " name=\"%s\"", xml_normalize_string(option.name()));
+ fprintf(m_output, " devname=\"%s\"", xml_normalize_string(dev->shortname()));
+ if (slot.default_option() != nullptr && strcmp(slot.default_option(),option.name())==0)
+ fprintf(m_output, " default=\"yes\"");
+ fprintf(m_output, "/>\n");
+ const_cast<machine_config &>(m_drivlist.config()).device_remove(&m_drivlist.config().root_device(), "dummy");
+ }
+ }
+
+ fprintf(m_output, "\t\t</slot>\n");
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// output_software_list - print the information
+// for all known software lists for this system
+//-------------------------------------------------
+
+void info_xml_creator::output_software_list()
+{
+ for (const software_list_device &swlist : software_list_device_iterator(m_drivlist.config().root_device()))
+ {
+ fprintf(m_output, "\t\t<softwarelist name=\"%s\" ", swlist.list_name());
+ fprintf(m_output, "status=\"%s\" ", (swlist.list_type() == SOFTWARE_LIST_ORIGINAL_SYSTEM) ? "original" : "compatible");
+ if (swlist.filter())
+ fprintf(m_output, "filter=\"%s\" ", swlist.filter());
+ fprintf(m_output, "/>\n");
+ }
+}
+
+
+
+//-------------------------------------------------
+// output_ramoptions - prints m_output all RAM
+// options for this system
+//-------------------------------------------------
+
+void info_xml_creator::output_ramoptions()
+{
+ for (const ram_device &ram : ram_device_iterator(m_drivlist.config().root_device()))
+ {
+ fprintf(m_output, "\t\t<ramoption default=\"1\">%u</ramoption>\n", ram.default_size());
+
+ if (ram.extra_options() != nullptr)
+ {
+ std::string options(ram.extra_options());
+ for (int start = 0, end = options.find_first_of(',');; start = end + 1, end = options.find_first_of(',', start))
+ {
+ std::string option;
+ option.assign(options.substr(start, (end == -1) ? -1 : end - start));
+ fprintf(m_output, "\t\t<ramoption>%u</ramoption>\n", ram_device::parse_string(option.c_str()));
+ if (end == -1)
+ break;
+ }
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// get_merge_name - get the rom name from a
+// parent set
+//-------------------------------------------------
+
+const char *info_xml_creator::get_merge_name(const hash_collection &romhashes)
+{
+ // walk the parent chain
+ const char *merge_name = nullptr;
+ for (int clone_of = m_drivlist.find(m_drivlist.driver().parent); clone_of != -1; clone_of = m_drivlist.find(m_drivlist.driver(clone_of).parent))
+ {
+ // look in the parent's ROMs
+ device_t *device = &m_drivlist.config(clone_of, m_lookup_options).root_device();
+ for (const rom_entry *pregion = rom_first_region(*device); pregion != nullptr; pregion = rom_next_region(pregion))
+ for (const rom_entry *prom = rom_first_file(pregion); prom != nullptr; prom = rom_next_file(prom))
+ {
+ hash_collection phashes(ROM_GETHASHDATA(prom));
+ if (!phashes.flag(hash_collection::FLAG_NO_DUMP) && romhashes == phashes)
+ {
+ // stop when we find a match
+ merge_name = ROM_GETNAME(prom);
+ break;
+ }
+ }
+ }
+
+ return merge_name;
+}
diff --git a/src/frontend/mame/info.h b/src/frontend/mame/info.h
new file mode 100644
index 00000000000..78082ec033b
--- /dev/null
+++ b/src/frontend/mame/info.h
@@ -0,0 +1,68 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+/***************************************************************************
+
+ info.h
+
+ Dumps the MAME internal data as an XML file.
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __INFO_H__
+#define __INFO_H__
+
+#include "drivenum.h"
+
+
+//**************************************************************************
+// FUNCTION PROTOTYPES
+//**************************************************************************
+
+// helper class to putput
+class info_xml_creator
+{
+public:
+ // construction/destruction
+ info_xml_creator(driver_enumerator &drivlist);
+
+ // output
+ void output(FILE *out, bool nodevices = false);
+
+private:
+ // internal helper
+ void output_one();
+ void output_sampleof();
+ void output_bios();
+ void output_rom(device_t &device);
+ void output_device_roms();
+ void output_sample(device_t &device);
+ void output_chips(device_t &device, const char *root_tag);
+ void output_display(device_t &device, const char *root_tag);
+ void output_sound(device_t &device);
+ void output_input(const ioport_list &portlist);
+ void output_switches(const ioport_list &portlist, const char *root_tag, int type, const char *outertag, const char *innertag);
+ void output_ports(const ioport_list &portlist);
+ void output_adjusters(const ioport_list &portlist);
+ void output_driver();
+ void output_images(device_t &device, const char *root_tag);
+ void output_slots(device_t &device, const char *root_tag);
+ void output_software_list();
+ void output_ramoptions();
+
+ void output_one_device(device_t &device, const char *devtag);
+ void output_devices();
+
+ const char *get_merge_name(const hash_collection &romhashes);
+
+ // internal state
+ FILE * m_output;
+ driver_enumerator & m_drivlist;
+ emu_options m_lookup_options;
+
+ static const char s_dtd_string[];
+};
+
+
+#endif /* __INFO_H__ */
diff --git a/src/frontend/mame/language.cpp b/src/frontend/mame/language.cpp
new file mode 100644
index 00000000000..5c9686a646e
--- /dev/null
+++ b/src/frontend/mame/language.cpp
@@ -0,0 +1,79 @@
+// license:BSD-3-Clause
+// copyright-holders:Miodrag Milanovic
+/***************************************************************************
+
+ language.cpp
+
+ Multi-language support.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "emuopts.h"
+
+static std::unordered_map<std::string, std::string> g_translation;
+
+const char *lang_translate(const char *word)
+{
+ if (g_translation.find(word) == g_translation.end())
+ {
+ return word;
+ }
+ return g_translation[word].c_str();
+}
+
+const UINT32 MO_MAGIC = 0x950412de;
+const UINT32 MO_MAGIC_REVERSED = 0xde120495;
+
+inline UINT32 endianchange(UINT32 value) {
+ UINT32 b0 = (value >> 0) & 0xff;
+ UINT32 b1 = (value >> 8) & 0xff;
+ UINT32 b2 = (value >> 16) & 0xff;
+ UINT32 b3 = (value >> 24) & 0xff;
+
+ return (b0 << 24) | (b1 << 16) | (b2 << 8) | b3;
+}
+
+void load_translation(emu_options &m_options)
+{
+ g_translation.clear();
+ emu_file file(m_options.language_path(), OPEN_FLAG_READ);
+ auto name = std::string(m_options.language());
+ strreplace(name, " ", "_");
+ strreplace(name, "(", "");
+ strreplace(name, ")", "");
+ if (file.open(name.c_str(), PATH_SEPARATOR "strings.mo") == osd_file::error::NONE)
+ {
+ UINT64 size = file.size();
+ UINT32 *buffer = global_alloc_array(UINT32, size / 4 + 1);
+ file.read(buffer, size);
+ file.close();
+
+ if (buffer[0] != MO_MAGIC && buffer[0] != MO_MAGIC_REVERSED)
+ {
+ global_free_array(buffer);
+ return;
+ }
+ if (buffer[0] == MO_MAGIC_REVERSED)
+ {
+ for (auto i = 0; i < (size / 4) + 1; ++i)
+ {
+ buffer[i] = endianchange(buffer[i]);
+ }
+ }
+
+ UINT32 number_of_strings = buffer[2];
+ UINT32 original_table_offset = buffer[3] >> 2;
+ UINT32 translation_table_offset = buffer[4] >> 2;
+
+ const char *data = reinterpret_cast<const char*>(buffer);
+
+ for (auto i = 1; i < number_of_strings; ++i)
+ {
+ std::string original = (const char *)data + buffer[original_table_offset + 2 * i + 1];
+ std::string translation = (const char *)data + buffer[translation_table_offset + 2 * i + 1];
+ g_translation.insert(std::pair<std::string, std::string>(original, translation));
+ }
+ global_free_array(buffer);
+ }
+}
diff --git a/src/frontend/mame/language.h b/src/frontend/mame/language.h
new file mode 100644
index 00000000000..2a9d934576b
--- /dev/null
+++ b/src/frontend/mame/language.h
@@ -0,0 +1,31 @@
+// license:BSD-3-Clause
+// copyright-holders:Miodrag Milanovic
+/***************************************************************************
+
+ language.h
+
+ Multi-language support.
+
+***************************************************************************/
+#pragma once
+
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
+#ifndef __LANGUAGE_H__
+#define __LANGUAGE_H__
+
+//**************************************************************************
+// LOCALIZATION SUPPORT
+//**************************************************************************
+
+#define _(param) lang_translate(param)
+// Fake one to make possible using it in static text definitions, on those
+// lang_translate must be called afterwards
+#define __(param) param
+
+void load_translation(emu_options &option);
+const char *lang_translate(const char *word);
+
+#endif /*__LANGUAGE_H__*/
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp
new file mode 100644
index 00000000000..b8d8644218a
--- /dev/null
+++ b/src/frontend/mame/luaengine.cpp
@@ -0,0 +1,2623 @@
+// license:BSD-3-Clause
+// copyright-holders:Miodrag Milanovic,Luca Bruno
+/***************************************************************************
+
+ luaengine.c
+
+ Controls execution of the core MAME system.
+
+***************************************************************************/
+
+#include <limits>
+#include <thread>
+#include <lua.hpp>
+#include "luabridge/Source/LuaBridge/LuaBridge.h"
+#include <signal.h>
+#include "emu.h"
+#include "mame.h"
+#include "cheat.h"
+#include "drivenum.h"
+#include "emuopts.h"
+#include "ui/ui.h"
+#include "luaengine.h"
+#include <mutex>
+
+#ifdef __clang__
+#pragma clang diagnostic ignored "-Wshift-count-overflow"
+#endif
+//**************************************************************************
+// LUA ENGINE
+//**************************************************************************
+
+#if !defined(LUA_PROMPT)
+#define LUA_PROMPT "> "
+#define LUA_PROMPT2 ">> "
+#endif
+
+#if !defined(LUA_MAXINPUT)
+#define LUA_MAXINPUT 512
+#endif
+
+#define lua_readline(b,p) \
+ (fputs(p, stdout), fflush(stdout), /* show prompt */ \
+ fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */
+
+static lua_State *globalL = nullptr;
+
+#define luai_writestring(s,l) fwrite((s), sizeof(char), (l), stdout)
+#define luai_writeline() (luai_writestring("\n", 1), fflush(stdout))
+
+const char *const lua_engine::tname_ioport = "lua.ioport";
+lua_engine* lua_engine::luaThis = nullptr;
+
+extern "C" {
+ int luaopen_lsqlite3(lua_State *L);
+ int luaopen_zlib(lua_State *L);
+ int luaopen_lfs(lua_State *L);
+}
+
+static void lstop(lua_State *L, lua_Debug *ar)
+{
+ (void)ar; /* unused arg. */
+ lua_sethook(L, nullptr, 0, 0);
+ luaL_error(L, "interrupted!");
+}
+
+
+static void laction(int i)
+{
+ signal(i, SIG_DFL); /* if another SIGINT happens before lstop,
+ terminate process (default action) */
+ lua_sethook(globalL, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1);
+}
+
+int lua_engine::report(int status) {
+ if (status != LUA_OK && !lua_isnil(m_lua_state, -1))
+ {
+ const char *msg = lua_tostring(m_lua_state, -1);
+ if (msg == nullptr) msg = "(error object is not a string)";
+ lua_writestringerror("%s\n", msg);
+ lua_pop(m_lua_state, 1);
+ /* force a complete garbage collection in case of errors */
+ lua_gc(m_lua_state, LUA_GCCOLLECT, 0);
+ }
+ return status;
+}
+
+
+static int traceback (lua_State *L)
+{
+ const char *msg = lua_tostring(L, 1);
+ if (msg)
+ luaL_traceback(L, L, msg, 1);
+ else if (!lua_isnoneornil(L, 1))
+ { /* is there an error object? */
+ if (!luaL_callmeta(L, 1, "__tostring")) /* try its 'tostring' metamethod */
+ lua_pushliteral(L, "(no error message)");
+ }
+ return 1;
+}
+
+
+int lua_engine::docall(int narg, int nres)
+{
+ int status;
+ int base = lua_gettop(m_lua_state) - narg; /* function index */
+ lua_pushcfunction(m_lua_state, traceback); /* push traceback function */
+ lua_insert(m_lua_state, base); /* put it under chunk and args */
+ globalL = m_lua_state; /* to be available to 'laction' */
+ signal(SIGINT, laction);
+ status = lua_pcall(m_lua_state, narg, nres, base);
+ signal(SIGINT, SIG_DFL);
+ lua_remove(m_lua_state, base); /* remove traceback function */
+ return status;
+}
+
+namespace luabridge
+{
+template <>
+struct Stack <osd_file::error>
+{
+ static void push(lua_State *L, osd_file::error error)
+ {
+ std::string strerror;
+ switch(error)
+ {
+ case osd_file::error::NONE:
+ lua_pushboolean(L, false);
+ return;
+ case osd_file::error::FAILURE:
+ strerror = "failure";
+ break;
+ case osd_file::error::OUT_OF_MEMORY:
+ strerror = "out_of_memory";
+ break;
+ case osd_file::error::NOT_FOUND:
+ strerror = "not_found";
+ break;
+ case osd_file::error::ACCESS_DENIED:
+ strerror = "access_denied";
+ break;
+ case osd_file::error::ALREADY_OPEN:
+ strerror = "already_open";
+ break;
+ case osd_file::error::TOO_MANY_FILES:
+ strerror = "too_many_files";
+ break;
+ case osd_file::error::INVALID_DATA:
+ strerror = "invalid_data";
+ break;
+ case osd_file::error::INVALID_ACCESS:
+ strerror = "invalid_access";
+ break;
+ default:
+ strerror = "unknown_error";
+ break;
+ }
+ lua_pushstring(L, strerror.c_str());
+ }
+};
+template <>
+struct Stack <map_handler_type>
+{
+ static void push(lua_State *L, map_handler_type error)
+ {
+ std::string type;
+ switch(error)
+ {
+ case AMH_NONE:
+ type = "none";
+ break;
+ case AMH_RAM:
+ type = "ram";
+ break;
+ case AMH_ROM:
+ type = "rom";
+ break;
+ case AMH_NOP:
+ type = "nop";
+ break;
+ case AMH_UNMAP:
+ type = "unmap";
+ break;
+ case AMH_DEVICE_DELEGATE:
+ type = "delegate";
+ break;
+ case AMH_PORT:
+ type = "port";
+ break;
+ case AMH_BANK:
+ type = "bank";
+ break;
+ case AMH_DEVICE_SUBMAP:
+ type = "submap";
+ break;
+ default:
+ type = "unknown";
+ break;
+ }
+ lua_pushstring(L, type.c_str());
+ }
+};
+}
+/* mark in error messages for incomplete statements */
+#define EOFMARK "<eof>"
+#define marklen (sizeof(EOFMARK)/sizeof(char) - 1)
+
+int lua_engine::incomplete(int status)
+{
+ if (status == LUA_ERRSYNTAX)
+ {
+ size_t lmsg;
+ const char *msg = lua_tolstring(m_lua_state, -1, &lmsg);
+ if (lmsg >= marklen && strcmp(msg + lmsg - marklen, EOFMARK) == 0)
+ {
+ lua_pop(m_lua_state, 1);
+ return 1;
+ }
+ }
+ return 0; /* else... */
+}
+
+lua_engine::hook::hook()
+{
+ L = nullptr;
+ cb = -1;
+}
+
+void lua_engine::hook::set(lua_State *lua, int idx)
+{
+ if (L)
+ luaL_unref(L, LUA_REGISTRYINDEX, cb);
+
+ if (lua_isnil(lua, idx)) {
+ L = nullptr;
+ cb = -1;
+
+ } else {
+ L = lua;
+ lua_pushvalue(lua, idx);
+ cb = luaL_ref(lua, LUA_REGISTRYINDEX);
+ }
+}
+
+lua_State *lua_engine::hook::precall()
+{
+ lua_State *T = lua_newthread(L);
+ lua_rawgeti(T, LUA_REGISTRYINDEX, cb);
+ return T;
+}
+
+void lua_engine::hook::call(lua_engine *engine, lua_State *T, int nparam)
+{
+ engine->resume(T, nparam, L);
+}
+
+void lua_engine::resume(lua_State *L, int nparam, lua_State *root)
+{
+ int s = lua_resume(L, nullptr, nparam);
+ switch(s) {
+ case LUA_OK:
+ if(!root) {
+ std::map<lua_State *, std::pair<lua_State *, int> >::iterator i = thread_registry.find(L);
+ if(i != thread_registry.end()) {
+ luaL_unref(i->second.first, LUA_REGISTRYINDEX, i->second.second);
+ thread_registry.erase(i);
+ }
+ } else
+ lua_pop(root, 1);
+ break;
+
+ case LUA_YIELD:
+ if(root) {
+ int id = luaL_ref(root, LUA_REGISTRYINDEX);
+ thread_registry[L] = std::pair<lua_State *, int>(root, id);
+ }
+ break;
+
+ default:
+ osd_printf_error("[LUA ERROR] %s\n", lua_tostring(L, -1));
+ lua_pop(L, 1);
+ break;
+ }
+}
+
+void lua_engine::resume(void *lua, INT32 param)
+{
+ resume(static_cast<lua_State *>(lua));
+}
+
+int lua_engine::l_ioport_write(lua_State *L)
+{
+ ioport_field *field = static_cast<ioport_field *>(getparam(L, 1, tname_ioport));
+ luaL_argcheck(L, lua_isnumber(L, 2), 2, "value expected");
+ field->set_value(lua_tointeger(L, 2));
+ return 0;
+}
+
+//-------------------------------------------------
+// emu_app_name - return application name
+//-------------------------------------------------
+
+int lua_engine::l_emu_app_name(lua_State *L)
+{
+ lua_pushstring(L, emulator_info::get_appname_lower());
+ return 1;
+}
+
+//-------------------------------------------------
+// emu_app_version - return application version
+//-------------------------------------------------
+
+int lua_engine::l_emu_app_version(lua_State *L)
+{
+ lua_pushstring(L, bare_build_version);
+ return 1;
+}
+
+
+//-------------------------------------------------
+// emu_gamename - returns game full name
+//-------------------------------------------------
+
+int lua_engine::l_emu_gamename(lua_State *L)
+{
+ lua_pushstring(L, luaThis->machine().system().description);
+ return 1;
+}
+
+//-------------------------------------------------
+// emu_romname - returns rom base name
+//-------------------------------------------------
+
+int lua_engine::l_emu_romname(lua_State *L)
+{
+ lua_pushstring(L, luaThis->machine().basename());
+ return 1;
+}
+
+//-------------------------------------------------
+// emu_softname - returns softlist name
+//-------------------------------------------------
+
+int lua_engine::l_emu_softname(lua_State *L)
+{
+ lua_pushstring(L, luaThis->machine().options().software_name());
+ return 1;
+}
+
+//-------------------------------------------------
+// emu_pause/emu_unpause - pause/unpause game
+//-------------------------------------------------
+
+int lua_engine::l_emu_pause(lua_State *L)
+{
+ luaThis->machine().pause();
+ return 0;
+}
+
+int lua_engine::l_emu_unpause(lua_State *L)
+{
+ luaThis->machine().resume();
+ return 0;
+}
+
+//-------------------------------------------------
+// emu_keypost - post keys to natural keyboard
+//-------------------------------------------------
+
+int lua_engine::l_emu_keypost(lua_State *L)
+{
+ const char *keys = luaL_checkstring(L,1);
+ luaThis->machine().ioport().natkeyboard().post_utf8(keys);
+ return 1;
+}
+
+int lua_engine::l_emu_time(lua_State *L)
+{
+ lua_pushnumber(L, luaThis->machine().time().as_double());
+ return 1;
+}
+
+void lua_engine::emu_after_done(void *_h, INT32 param)
+{
+ hook *h = static_cast<hook *>(_h);
+ h->call(this, h->precall(), 0);
+ delete h;
+}
+
+int lua_engine::emu_after(lua_State *L)
+{
+ luaL_argcheck(L, lua_isnumber(L, 1), 1, "waiting duration expected");
+ struct hook *h = new hook;
+ h->set(L, 2);
+ machine().scheduler().timer_set(attotime::from_double(lua_tonumber(L, 1)), timer_expired_delegate(FUNC(lua_engine::emu_after_done), this), 0, h);
+ return 0;
+}
+
+int lua_engine::l_emu_after(lua_State *L)
+{
+ return luaThis->emu_after(L);
+}
+
+int lua_engine::emu_wait(lua_State *L)
+{
+ luaL_argcheck(L, lua_isnumber(L, 1), 1, "waiting duration expected");
+ machine().scheduler().timer_set(attotime::from_double(lua_tonumber(L, 1)), timer_expired_delegate(FUNC(lua_engine::resume), this), 0, L);
+ return lua_yieldk(L, 0, 0, nullptr);
+}
+
+int lua_engine::l_emu_wait(lua_State *L)
+{
+ return luaThis->emu_wait(L);
+}
+
+void lua_engine::output_notifier(const char *outname, INT32 value)
+{
+ if (hook_output_cb.active()) {
+ lua_State *L = hook_output_cb.precall();
+ lua_pushstring(L, outname);
+ lua_pushnumber(L, value);
+ hook_output_cb.call(this, L, 2);
+ }
+}
+
+void lua_engine::s_output_notifier(const char *outname, INT32 value, void *param)
+{
+ static_cast<lua_engine *>(param)->output_notifier(outname, value);
+}
+
+void lua_engine::emu_hook_output(lua_State *L)
+{
+ luaL_argcheck(L, lua_isfunction(L, 1), 1, "callback function expected");
+ hook_output_cb.set(L, 1);
+
+ if (!output_notifier_set) {
+ machine().output().set_notifier(nullptr, s_output_notifier, this);
+ output_notifier_set = true;
+ }
+}
+
+int lua_engine::l_emu_hook_output(lua_State *L)
+{
+ luaThis->emu_hook_output(L);
+ return 0;
+}
+
+int lua_engine::l_emu_set_hook(lua_State *L)
+{
+ luaThis->emu_set_hook(L);
+ return 0;
+}
+
+void lua_engine::emu_set_hook(lua_State *L)
+{
+ luaL_argcheck(L, lua_isfunction(L, 1) || lua_isnil(L, 1), 1, "callback function expected");
+ luaL_argcheck(L, lua_isstring(L, 2), 2, "message (string) expected");
+ const char *hookname = luaL_checkstring(L,2);
+
+ if (strcmp(hookname, "output") == 0) {
+ hook_output_cb.set(L, 1);
+ if (!output_notifier_set) {
+ machine().output().set_notifier(nullptr, s_output_notifier, this);
+ output_notifier_set = true;
+ }
+ } else if (strcmp(hookname, "frame") == 0) {
+ hook_frame_cb.set(L, 1);
+ } else {
+ lua_writestringerror("%s", "Unknown hook name, aborting.\n");
+ }
+}
+
+//-------------------------------------------------
+// options_entry - return table of option entries
+// -> manager:options().entries
+// -> manager:machine():options().entries
+// -> manager:machine():ui():options().entries
+//-------------------------------------------------
+
+template <typename T>
+luabridge::LuaRef lua_engine::l_options_get_entries(const T *o)
+{
+ T *options = const_cast<T *>(o);
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef entries_table = luabridge::LuaRef::newTable(L);
+
+ int unadorned_index = 0;
+ for (typename T::entry &curentry : *options)
+ {
+ const char *name = curentry.name();
+ bool is_unadorned = false;
+ // check if it's unadorned
+ if (name && strlen(name) && !strcmp(name, options->unadorned(unadorned_index)))
+ {
+ unadorned_index++;
+ is_unadorned = true;
+ }
+ if (!curentry.is_header() && !curentry.is_command() && !curentry.is_internal() && !is_unadorned)
+ entries_table[name] = &curentry;
+ }
+
+ return entries_table;
+}
+
+//-------------------------------------------------
+// machine_get_screens - return table of available screens userdata
+// -> manager:machine().screens[":screen"]
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_machine_get_screens(const running_machine *r)
+{
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef screens_table = luabridge::LuaRef::newTable(L);
+
+ for (device_t *dev = r->first_screen(); dev != nullptr; dev = dev->next()) {
+ screen_device *sc = dynamic_cast<screen_device *>(dev);
+ if (sc && sc->configured() && sc->started() && sc->type()) {
+ screens_table[sc->tag()] = sc;
+ }
+ }
+
+ return screens_table;
+}
+
+//-------------------------------------------------
+// machine_get_devices - return table of available devices userdata
+// -> manager:machine().devices[":maincpu"]
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_machine_get_devices(const running_machine *r)
+{
+ running_machine *m = const_cast<running_machine *>(r);
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef devs_table = luabridge::LuaRef::newTable(L);
+
+ device_t *root = &(m->root_device());
+ devs_table = devtree_dfs(root, devs_table);
+
+ return devs_table;
+}
+
+//-------------------------------------------------
+// machine_get_images - return table of available image devices userdata
+// -> manager:machine().images["flop1"]
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_machine_get_images(const running_machine *r)
+{
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef image_table = luabridge::LuaRef::newTable(L);
+
+ for (device_image_interface &image : image_interface_iterator(r->root_device()))
+ {
+ image_table[image.brief_instance_name()] = &image;
+ image_table[image.instance_name()] = &image;
+ }
+
+ return image_table;
+}
+
+//-------------------------------------------------
+// memory_banks - return memory_banks
+// -> manager:machine():memory().banks["maincpu"]
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_memory_get_banks(const memory_manager *m)
+{
+ memory_manager *mm = const_cast<memory_manager *>(m);
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef table = luabridge::LuaRef::newTable(L);
+
+ for (memory_bank &bank : mm->banks()) {
+ table[bank.tag()] = &bank;
+ }
+
+ return table;
+}
+
+//-------------------------------------------------
+// memory_regions - return memory_regions
+// -> manager:machine():memory().region[":maincpu"]
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_memory_get_regions(const memory_manager *m)
+{
+ memory_manager *mm = const_cast<memory_manager *>(m);
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef table = luabridge::LuaRef::newTable(L);
+
+ for (memory_region &region: mm->regions()) {
+ table[region.name()] = &region;
+ }
+
+ return table;
+}
+
+//-------------------------------------------------
+// machine_cheat_entries - return cheat entries
+// -> manager:machine():cheat().entries[0]
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_cheat_get_entries(const cheat_manager *c)
+{
+ cheat_manager *cm = const_cast<cheat_manager *>(c);
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef entry_table = luabridge::LuaRef::newTable(L);
+
+ int cheatnum = 0;
+ for (cheat_entry &entry : cm->entries()) {
+ entry_table[cheatnum++] = &entry;
+ }
+
+ return entry_table;
+}
+
+//-------------------------------------------------
+// cheat_entry_state - return cheat entry state
+// -> manager:machine():cheat().entries[0]:state()
+//-------------------------------------------------
+
+int lua_engine::lua_cheat_entry::l_get_state(lua_State *L)
+{
+ cheat_entry *ce = luabridge::Stack<cheat_entry *>::get(L, 1);
+
+ switch (ce->state())
+ {
+ case SCRIPT_STATE_ON: lua_pushliteral(L, "on"); break;
+ case SCRIPT_STATE_RUN: lua_pushliteral(L, "run"); break;
+ case SCRIPT_STATE_CHANGE: lua_pushliteral(L, "change"); break;
+ case SCRIPT_STATE_COUNT: lua_pushliteral(L, "count"); break;
+ default: lua_pushliteral(L, "off"); break;
+ }
+
+ return 1;
+}
+
+//-------------------------------------------------
+// machine_ioports - return table of ioports
+// -> manager:machine():ioport().ports[':P1']
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_ioport_get_ports(const ioport_manager *m)
+{
+ ioport_manager *im = const_cast<ioport_manager *>(m);
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef port_table = luabridge::LuaRef::newTable(L);
+
+ for (ioport_port &port : im->ports()) {
+ port_table[port.tag()] = &port;
+ }
+
+ return port_table;
+}
+
+//-------------------------------------------------
+// ioport_fields - return table of ioport fields
+// -> manager:machine().ioport().ports[':P1'].fields[':']
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_ioports_port_get_fields(const ioport_port *i)
+{
+ ioport_port *p = const_cast<ioport_port *>(i);
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef f_table = luabridge::LuaRef::newTable(L);
+
+ for (ioport_field &field : p->fields()) {
+ f_table[field.name()] = &field;
+ }
+
+ return f_table;
+}
+
+//-------------------------------------------------
+// render_get_targets - return table of render targets
+// -> manager:machine():render().targets[0]
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_render_get_targets(const render_manager *r)
+{
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef target_table = luabridge::LuaRef::newTable(L);
+
+ int tc = 0;
+ for (render_target &curr_rt : r->targets())
+ {
+ target_table[tc++] = &curr_rt;
+ }
+
+ return target_table;
+}
+
+// private helper for get_devices - DFS visit all devices in a running machine
+luabridge::LuaRef lua_engine::devtree_dfs(device_t *root, luabridge::LuaRef devs_table)
+{
+ if (root) {
+ for (device_t &dev : root->subdevices()) {
+ if (dev.configured() && dev.started()) {
+ devs_table[dev.tag()] = &dev;
+ devtree_dfs(&dev, devs_table);
+ }
+ }
+ }
+ return devs_table;
+}
+
+//-------------------------------------------------
+// device_get_memspaces - return table of available address spaces userdata
+// -> manager:machine().devices[":maincpu"].spaces["program"]
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_dev_get_memspaces(const device_t *d)
+{
+ device_t *dev = const_cast<device_t *>(d);
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef sp_table = luabridge::LuaRef::newTable(L);
+
+ if(!dynamic_cast<device_memory_interface *>(dev))
+ return sp_table;
+
+ for (address_spacenum sp = AS_0; sp < ADDRESS_SPACES; ++sp) {
+ if (dev->memory().has_space(sp)) {
+ sp_table[dev->memory().space(sp).name()] = &(dev->memory().space(sp));
+ }
+ }
+
+ return sp_table;
+}
+
+//-------------------------------------------------
+// device_get_state - return table of available state userdata
+// -> manager:machine().devices[":maincpu"].state
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_dev_get_states(const device_t *d)
+{
+ device_t *dev = const_cast<device_t *>(d);
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef st_table = luabridge::LuaRef::newTable(L);
+
+ if(!dynamic_cast<device_state_interface *>(dev))
+ return st_table;
+
+ for (device_state_entry &s : dev->state().state_entries())
+ {
+ // XXX: refrain from exporting non-visible entries?
+ st_table[s.symbol()] = &s;
+ }
+
+ return st_table;
+}
+
+//-------------------------------------------------
+// device_get_item - return table of indexed items owned by this device
+// -> manager:machine().devices[":maincpu"].items
+//-------------------------------------------------
+
+luabridge::LuaRef lua_engine::l_dev_get_items(const device_t *d)
+{
+ device_t *dev = const_cast<device_t *>(d);
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef table = luabridge::LuaRef::newTable(L);
+ std::string tag = dev->tag();
+
+ // 10000 is enough?
+ for(int i = 0; i < 10000; i++)
+ {
+ std::string name;
+ const char *item;
+ unsigned int size, count;
+ void *base;
+ item = dev->machine().save().indexed_item(i, base, size, count);
+ if(!item)
+ break;
+ name = &(strchr(item, '/')[1]);
+ if(name.substr(0, name.find("/")) == tag)
+ {
+ name = name.substr(name.find("/") + 1, std::string::npos);
+ table[name] = i;
+ }
+ }
+ return table;
+}
+
+lua_engine::lua_item::lua_item(int index)
+{
+ std::string name;
+ const char *item;
+ item = luaThis->machine().save().indexed_item(index, l_item_base, l_item_size, l_item_count);
+ if(!item)
+ {
+ l_item_base = nullptr;
+ l_item_size = 0;
+ l_item_count= 0;
+ }
+}
+
+int lua_engine::lua_item::l_item_read(lua_State *L)
+{
+ luaL_argcheck(L, lua_isnumber(L, 2), 2, "offset (integer) expected");
+ int offset = lua_tounsigned(L, 2);
+ int ret = 0;
+ if(!l_item_base || (offset > l_item_count))
+ {
+ lua_pushnil(L);
+ return 1;
+ }
+ switch(l_item_size)
+ {
+ case 1:
+ default:
+ ret = ((UINT8 *)l_item_base)[offset];
+ break;
+ case 2:
+ ret = ((UINT16 *)l_item_base)[offset];
+ break;
+ case 4:
+ ret = ((UINT32 *)l_item_base)[offset];
+ break;
+ case 8:
+ ret = ((UINT64 *)l_item_base)[offset];
+ break;
+ }
+ lua_pushunsigned(L, ret);
+ return 1;
+}
+
+int lua_engine::lua_item::l_item_write(lua_State *L)
+{
+ luaL_argcheck(L, lua_isnumber(L, 2), 2, "offset (integer) expected");
+ luaL_argcheck(L, lua_isnumber(L, 3), 3, "value (integer) expected");
+ int offset = lua_tounsigned(L, 2);
+ UINT64 value = lua_tounsigned(L, 3);
+ if(!l_item_base || (offset > l_item_count))
+ return 1;
+ switch(l_item_size)
+ {
+ case 1:
+ default:
+ ((UINT8 *)l_item_base)[offset] = (UINT8)value;
+ break;
+ case 2:
+ ((UINT16 *)l_item_base)[offset] = (UINT16)value;
+ break;
+ case 4:
+ ((UINT32 *)l_item_base)[offset] = (UINT32)value;
+ break;
+ case 8:
+ ((UINT64 *)l_item_base)[offset] = (UINT64)value;
+ break;
+ }
+ return 1;
+}
+
+int lua_engine::lua_item::l_item_read_block(lua_State *L)
+{
+ luaL_argcheck(L, lua_isnumber(L, 2), 2, "offset (integer) expected");
+ luaL_argcheck(L, lua_isnumber(L, 3), 3, "length (integer) expected");
+ int offset = lua_tounsigned(L, 2);
+ int len = lua_tonumber(L, 3);
+ if(!l_item_base || ((offset + len) > (l_item_size * l_item_count)))
+ {
+ lua_pushnil(L);
+ return 1;
+ }
+ luaL_Buffer buff;
+ char *ptr = luaL_buffinitsize(L, &buff, len);
+ memcpy(ptr, l_item_base, len);
+ luaL_pushresultsize(&buff, len);
+ return 1;
+}
+
+//-------------------------------------------------
+// state_get_value - return value of a device state entry
+// -> manager:machine().devices[":maincpu"].state["PC"].value
+//-------------------------------------------------
+
+UINT64 lua_engine::l_state_get_value(const device_state_entry *d)
+{
+ device_state_interface *state = d->parent_state();
+ if(state) {
+ luaThis->machine().save().dispatch_presave();
+ return state->state_int(d->index());
+ } else {
+ return 0;
+ }
+}
+
+//-------------------------------------------------
+// state_set_value - set value of a device state entry
+// -> manager:machine().devices[":maincpu"].state["D0"].value = 0x0c00
+//-------------------------------------------------
+
+void lua_engine::l_state_set_value(device_state_entry *d, UINT64 val)
+{
+ device_state_interface *state = d->parent_state();
+ if(state) {
+ state->set_state_int(d->index(), val);
+ luaThis->machine().save().dispatch_presave();
+ }
+}
+
+//-------------------------------------------------
+// mem_read - templated memory readers for <sign>,<size>
+// -> manager:machine().devices[":maincpu"].spaces["program"]:read_i8(0xC000)
+//-------------------------------------------------
+
+template <typename T>
+int lua_engine::lua_addr_space::l_mem_read(lua_State *L)
+{
+ address_space &sp = luabridge::Stack<address_space &>::get(L, 1);
+ luaL_argcheck(L, lua_isnumber(L, 2), 2, "address (integer) expected");
+ offs_t address = lua_tounsigned(L, 2);
+ T mem_content = 0;
+ switch(sizeof(mem_content) * 8) {
+ case 8:
+ mem_content = sp.read_byte(address);
+ break;
+ case 16:
+ if (WORD_ALIGNED(address)) {
+ mem_content = sp.read_word(address);
+ } else {
+ mem_content = sp.read_word_unaligned(address);
+ }
+ break;
+ case 32:
+ if (DWORD_ALIGNED(address)) {
+ mem_content = sp.read_dword(address);
+ } else {
+ mem_content = sp.read_dword_unaligned(address);
+ }
+ break;
+ case 64:
+ if (QWORD_ALIGNED(address)) {
+ mem_content = sp.read_qword(address);
+ } else {
+ mem_content = sp.read_qword_unaligned(address);
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (std::numeric_limits<T>::is_signed) {
+ lua_pushinteger(L, mem_content);
+ } else {
+ lua_pushunsigned(L, mem_content);
+ }
+
+ return 1;
+
+}
+
+//-------------------------------------------------
+// mem_write - templated memory writer for <sign>,<size>
+// -> manager:machine().devices[":maincpu"].spaces["program"]:write_u16(0xC000, 0xF00D)
+//-------------------------------------------------
+
+template <typename T>
+int lua_engine::lua_addr_space::l_mem_write(lua_State *L)
+{
+ address_space &sp = luabridge::Stack<address_space &>::get(L, 1);
+ luaL_argcheck(L, lua_isnumber(L, 2), 2, "address (integer) expected");
+ luaL_argcheck(L, lua_isnumber(L, 3), 3, "value (integer) expected");
+ offs_t address = lua_tounsigned(L, 2);
+ T val = lua_tounsigned(L, 3);
+
+ switch(sizeof(val) * 8) {
+ case 8:
+ sp.write_byte(address, val);
+ break;
+ case 16:
+ if (WORD_ALIGNED(address)) {
+ sp.write_word(address, val);
+ } else {
+ sp.write_word_unaligned(address, val);
+ }
+ break;
+ case 32:
+ if (DWORD_ALIGNED(address)) {
+ sp.write_dword(address, val);
+ } else {
+ sp.write_dword_unaligned(address, val);
+ }
+ break;
+ case 64:
+ if (QWORD_ALIGNED(address)) {
+ sp.write_qword(address, val);
+ } else {
+ sp.write_qword_unaligned(address, val);
+ }
+ break;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+//-------------------------------------------------
+// mem_direct_read - templated direct memory readers for <sign>,<size>
+// -> manager:machine().devices[":maincpu"].spaces["program"]:read_direct_i8(0xC000)
+//-------------------------------------------------
+
+template <typename T>
+int lua_engine::lua_addr_space::l_direct_mem_read(lua_State *L)
+{
+ address_space &sp = luabridge::Stack<address_space &>::get(L, 1);
+ luaL_argcheck(L, lua_isnumber(L, 2), 2, "address (integer) expected");
+ offs_t address = lua_tounsigned(L, 2);
+ T mem_content = 0;
+ offs_t lowmask = sp.data_width() / 8 - 1;
+ for(int i = 0; i < sizeof(T); i++)
+ {
+ int addr = sp.endianness() == ENDIANNESS_LITTLE ? address + sizeof(T) - 1 - i : address + i;
+ UINT8 *base = (UINT8 *)sp.get_read_ptr(sp.address_to_byte(addr & ~lowmask));
+ if(!base)
+ continue;
+ mem_content <<= 8;
+ if(sp.endianness() == ENDIANNESS_BIG)
+ mem_content |= base[BYTE8_XOR_BE(addr) & lowmask];
+ else
+ mem_content |= base[BYTE8_XOR_LE(addr) & lowmask];
+ }
+
+ if (std::numeric_limits<T>::is_signed) {
+ lua_pushinteger(L, mem_content);
+ } else {
+ lua_pushunsigned(L, mem_content);
+ }
+
+ return 1;
+}
+
+//-------------------------------------------------
+// mem_direct_write - templated memory writer for <sign>,<size>
+// -> manager:machine().devices[":maincpu"].spaces["program"]:write_direct_u16(0xC000, 0xF00D)
+//-------------------------------------------------
+
+template <typename T>
+int lua_engine::lua_addr_space::l_direct_mem_write(lua_State *L)
+{
+ address_space &sp = luabridge::Stack<address_space &>::get(L, 1);
+ luaL_argcheck(L, lua_isnumber(L, 2), 2, "address (integer) expected");
+ luaL_argcheck(L, lua_isnumber(L, 3), 3, "value (integer) expected");
+ offs_t address = lua_tounsigned(L, 2);
+ T val = lua_tounsigned(L, 3);
+ offs_t lowmask = sp.data_width() / 8 - 1;
+ for(int i = 0; i < sizeof(T); i++)
+ {
+ int addr = sp.endianness() == ENDIANNESS_BIG ? address + sizeof(T) - 1 - i : address + i;
+ UINT8 *base = (UINT8 *)sp.get_read_ptr(sp.address_to_byte(addr & ~lowmask));
+ if(!base)
+ continue;
+ if(sp.endianness() == ENDIANNESS_BIG)
+ base[BYTE8_XOR_BE(addr) & lowmask] = val & 0xff;
+ else
+ base[BYTE8_XOR_LE(addr) & lowmask] = val & 0xff;
+ val >>= 8;
+ }
+
+ return 0;
+}
+
+//-------------------------------------------------
+// region_read - templated region readers for <sign>,<size>
+// -> manager:machine():memory().region[":maincpu"]:read_i8(0xC000)
+//-------------------------------------------------
+
+template <typename T>
+int lua_engine::lua_memory_region::l_region_read(lua_State *L)
+{
+ memory_region &region = luabridge::Stack<memory_region &>::get(L, 1);
+ luaL_argcheck(L, lua_isnumber(L, 2), 2, "address (integer) expected");
+ offs_t address = lua_tounsigned(L, 2);
+ T mem_content = 0;
+ offs_t lowmask = region.bytewidth() - 1;
+ for(int i = 0; i < sizeof(T); i++)
+ {
+ int addr = region.endianness() == ENDIANNESS_LITTLE ? address + sizeof(T) - 1 - i : address + i;
+ if(addr >= region.bytes())
+ continue;
+ mem_content <<= 8;
+ if(region.endianness() == ENDIANNESS_BIG)
+ mem_content |= region.u8((BYTE8_XOR_BE(addr) & lowmask) | (addr & ~lowmask));
+ else
+ mem_content |= region.u8((BYTE8_XOR_LE(addr) & lowmask) | (addr & ~lowmask));
+ }
+
+ if (std::numeric_limits<T>::is_signed) {
+ lua_pushinteger(L, mem_content);
+ } else {
+ lua_pushunsigned(L, mem_content);
+ }
+
+ return 1;
+}
+
+//-------------------------------------------------
+// region_write - templated region writer for <sign>,<size>
+// -> manager:machine():memory().region[":maincpu"]:write_u16(0xC000, 0xF00D)
+//-------------------------------------------------
+
+template <typename T>
+int lua_engine::lua_memory_region::l_region_write(lua_State *L)
+{
+ memory_region &region = luabridge::Stack<memory_region &>::get(L, 1);
+ luaL_argcheck(L, lua_isnumber(L, 2), 2, "address (integer) expected");
+ luaL_argcheck(L, lua_isnumber(L, 3), 3, "value (integer) expected");
+ offs_t address = lua_tounsigned(L, 2);
+ T val = lua_tounsigned(L, 3);
+ offs_t lowmask = region.bytewidth() - 1;
+ for(int i = 0; i < sizeof(T); i++)
+ {
+ int addr = region.endianness() == ENDIANNESS_BIG ? address + sizeof(T) - 1 - i : address + i;
+ if(addr >= region.bytes())
+ continue;
+ if(region.endianness() == ENDIANNESS_BIG)
+ region.base()[(BYTE8_XOR_BE(addr) & lowmask) | (addr & ~lowmask)] = val & 0xff;
+ else
+ region.base()[(BYTE8_XOR_BE(addr) & lowmask) | (addr & ~lowmask)] = val & 0xff;
+ val >>= 8;
+ }
+
+ return 0;
+}
+
+luabridge::LuaRef lua_engine::l_addr_space_map(const address_space *space)
+{
+ lua_State *L = luaThis->m_lua_state;
+ luabridge::LuaRef map = luabridge::LuaRef::newTable(L);
+
+ int i = 1;
+ for (address_map_entry &entry : space->map()->m_entrylist)
+ {
+ luabridge::LuaRef mapentry = luabridge::LuaRef::newTable(L);
+ mapentry["offset"] = space->address_to_byte(entry.m_addrstart) & space->bytemask();
+ mapentry["endoff"] = space->address_to_byte(entry.m_addrend) & space->bytemask();
+ mapentry["readtype"] = entry.m_read.m_type;
+ mapentry["writetype"] = entry.m_write.m_type;
+ map[i++] = mapentry;
+ }
+ return map;
+}
+
+int lua_engine::lua_options_entry::l_entry_value(lua_State *L)
+{
+ core_options::entry *e = luabridge::Stack<core_options::entry *>::get(L, 1);
+ if(!e) {
+ return 0;
+ }
+
+ luaL_argcheck(L, !lua_isfunction(L, 2), 2, "optional argument: unsupported value");
+
+ if (!lua_isnone(L, 2))
+ {
+ std::string error;
+ // FIXME: not working with ui_options::entry
+ // TODO: optional arg for priority
+ luaThis->machine().options().set_value(e->name(),
+ lua_isboolean(L, 2) ? (lua_toboolean(L, 2) ? "1" : "0") : lua_tostring(L, 2),
+ OPTION_PRIORITY_CMDLINE, error);
+
+ if (!error.empty())
+ {
+ luaL_error(L, "%s", error.c_str());
+ }
+ }
+
+ switch (e->type())
+ {
+ case OPTION_BOOLEAN:
+ lua_pushboolean(L, (atoi(e->value()) != 0));
+ break;
+ case OPTION_INTEGER:
+ lua_pushnumber(L, atoi(e->value()));
+ break;
+ case OPTION_FLOAT:
+ lua_pushnumber(L, atof(e->value()));
+ break;
+ default:
+ lua_pushstring(L, e->value());
+ break;
+ }
+
+ return 1;
+}
+
+//-------------------------------------------------
+// begin_recording - start avi
+// -> manager:machine():video():begin_recording()
+//-------------------------------------------------
+
+int lua_engine::lua_video::l_begin_recording(lua_State *L)
+{
+ video_manager *vm = luabridge::Stack<video_manager *>::get(L, 1);
+ if (!vm) {
+ return 0;
+ }
+
+ luaL_argcheck(L, lua_isstring(L, 2) || lua_isnone(L, 2), 2, "optional argument: filename, string expected");
+
+ const char *filename = lua_tostring(L, 2);
+ if (!lua_isnone(L, 2)) {
+ std::string vidname(filename);
+ strreplace(vidname, "/", PATH_SEPARATOR);
+ strreplace(vidname, "%g", luaThis->machine().basename());
+ filename = vidname.c_str();
+ } else {
+ filename = nullptr;
+ }
+ vm->begin_recording(filename, video_manager::MF_AVI);
+
+ return 1;
+}
+
+//-------------------------------------------------
+// end_recording - start saving avi
+// -> manager:machine():video():end_recording()
+//-------------------------------------------------
+
+int lua_engine::lua_video::l_end_recording(lua_State *L)
+{
+ video_manager *vm = luabridge::Stack<video_manager *>::get(L, 1);
+ if (!vm) {
+ return 0;
+ }
+
+ if (!vm->is_recording()) {
+ lua_writestringerror("%s", "No active recording to stop");
+ return 0;
+ }
+
+ vm->end_recording(video_manager::MF_AVI);
+ return 1;
+}
+
+//-------------------------------------------------
+// screen_height - return screen visible height
+// -> manager:machine().screens[":screen"]:height()
+//-------------------------------------------------
+
+int lua_engine::lua_screen::l_height(lua_State *L)
+{
+ screen_device *sc = luabridge::Stack<screen_device *>::get(L, 1);
+ if(!sc) {
+ return 0;
+ }
+
+ lua_pushunsigned(L, sc->visible_area().height());
+ return 1;
+}
+
+//-------------------------------------------------
+// screen_width - return screen visible width
+// -> manager:machine().screens[":screen"]:width()
+//-------------------------------------------------
+
+int lua_engine::lua_screen::l_width(lua_State *L)
+{
+ screen_device *sc = luabridge::Stack<screen_device *>::get(L, 1);
+ if(!sc) {
+ return 0;
+ }
+
+ lua_pushunsigned(L, sc->visible_area().width());
+ return 1;
+}
+
+
+//-------------------------------------------------
+// screen_orientation - return screen orientation
+// -> manager:machine().screens[":screen"]:orientation()
+// -> rotation_angle (0, 90, 180, 270)
+// -> flipx (true, false)
+// -> flipy (true, false)
+//-------------------------------------------------
+
+int lua_engine::lua_screen::l_orientation(lua_State *L)
+{
+ UINT32 flags = (luaThis->machine().system().flags & ORIENTATION_MASK);
+
+ int rotation_angle = 0;
+ switch (flags)
+ {
+ case ORIENTATION_FLIP_X:
+ rotation_angle = 0;
+ break;
+ case ORIENTATION_SWAP_XY:
+ case ORIENTATION_SWAP_XY|ORIENTATION_FLIP_X:
+ rotation_angle = 90;
+ break;
+ case ORIENTATION_FLIP_Y:
+ case ORIENTATION_FLIP_X|ORIENTATION_FLIP_Y:
+ rotation_angle = 180;
+ break;
+ case ORIENTATION_SWAP_XY|ORIENTATION_FLIP_Y:
+ case ORIENTATION_SWAP_XY|ORIENTATION_FLIP_X|ORIENTATION_FLIP_Y:
+ rotation_angle = 270;
+ break;
+ }
+
+ lua_createtable(L, 2, 2);
+ lua_pushliteral(L, "rotation_angle");
+ lua_pushinteger(L, rotation_angle);
+
+ lua_settable(L, -3);
+ lua_pushliteral(L, "flipx");
+ lua_pushboolean(L, (flags & ORIENTATION_FLIP_X));
+
+ lua_settable(L, -3);
+ lua_pushliteral(L, "flipy");
+ lua_pushboolean(L, (flags & ORIENTATION_FLIP_Y));
+ lua_settable(L, -3);
+ return 1;
+}
+
+//-------------------------------------------------
+// screen_refresh - return screen refresh rate
+// -> manager:machine().screens[":screen"]:refresh()
+//-------------------------------------------------
+
+int lua_engine::lua_screen::l_refresh(lua_State *L)
+{
+ screen_device *sc = luabridge::Stack<screen_device *>::get(L, 1);
+ if(!sc) {
+ return 0;
+ }
+
+ lua_pushnumber(L, ATTOSECONDS_TO_HZ(sc->refresh_attoseconds()));
+ return 1;
+}
+
+//-------------------------------------------------
+// screen_snapshot - save png bitmap of screen to snapshots folder
+// -> manager:machine().screens[":screen"]:snapshot("filename.png")
+//-------------------------------------------------
+
+int lua_engine::lua_screen::l_snapshot(lua_State *L)
+{
+ screen_device *sc = luabridge::Stack<screen_device *>::get(L, 1);
+ if(!sc || !sc->machine().render().is_live(*sc))
+ {
+ return 0;
+ }
+
+ luaL_argcheck(L, lua_isstring(L, 2) || lua_isnone(L, 2), 2, "optional argument: filename, string expected");
+
+ emu_file file(sc->machine().options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ osd_file::error filerr;
+
+ if (!lua_isnone(L, 2)) {
+ const char *filename = lua_tostring(L, 2);
+ std::string snapstr(filename);
+ strreplace(snapstr, "/", PATH_SEPARATOR);
+ strreplace(snapstr, "%g", sc->machine().basename());
+ filerr = file.open(snapstr.c_str());
+ }
+ else
+ {
+ filerr = sc->machine().video().open_next(file, "png");
+ }
+
+ if (filerr != osd_file::error::NONE)
+ {
+ luaL_error(L, "osd_file::error=%d", filerr);
+ return 0;
+ }
+
+ sc->machine().video().save_snapshot(sc, file);
+ lua_writestringerror("saved %s", file.fullpath());
+ file.close();
+ return 1;
+}
+
+//-------------------------------------------------
+// screen_type - return human readable screen type
+// -> manager:machine().screens[":screen"]:type()
+//-------------------------------------------------
+
+int lua_engine::lua_screen::l_type(lua_State *L)
+{
+ screen_device *sc = luabridge::Stack<screen_device *>::get(L, 1);
+ if(!sc) {
+ return 0;
+ }
+
+ switch (sc->screen_type())
+ {
+ case SCREEN_TYPE_RASTER: lua_pushliteral(L, "raster"); break;
+ case SCREEN_TYPE_VECTOR: lua_pushliteral(L, "vector"); break;
+ case SCREEN_TYPE_LCD: lua_pushliteral(L, "lcd"); break;
+ case SCREEN_TYPE_SVG: lua_pushliteral(L, "svg"); break;
+ default: lua_pushliteral(L, "unknown"); break;
+ }
+
+ return 1;
+}
+
+//-------------------------------------------------
+// draw_box - draw a box on a screen container
+// -> manager:machine().screens[":screen"]:draw_box(x1, y1, x2, y2, bgcolor, linecolor)
+//-------------------------------------------------
+
+int lua_engine::lua_screen::l_draw_box(lua_State *L)
+{
+ screen_device *sc = luabridge::Stack<screen_device *>::get(L, 1);
+ if(!sc) {
+ return 0;
+ }
+
+ // ensure that we got 6 numerical parameters
+ luaL_argcheck(L, lua_isnumber(L, 2), 2, "x1 (integer) expected");
+ luaL_argcheck(L, lua_isnumber(L, 3), 3, "y1 (integer) expected");
+ luaL_argcheck(L, lua_isnumber(L, 4), 4, "x2 (integer) expected");
+ luaL_argcheck(L, lua_isnumber(L, 5), 5, "y2 (integer) expected");
+ luaL_argcheck(L, lua_isnumber(L, 6), 6, "background color (integer) expected");
+ luaL_argcheck(L, lua_isnumber(L, 7), 7, "outline color (integer) expected");
+
+ // retrieve all parameters
+ int sc_width = sc->visible_area().width();
+ int sc_height = sc->visible_area().height();
+ float x1, y1, x2, y2;
+ x1 = MIN(MAX(0, (float) lua_tonumber(L, 2)), sc_width-1) / static_cast<float>(sc_width);
+ y1 = MIN(MAX(0, (float) lua_tonumber(L, 3)), sc_height-1) / static_cast<float>(sc_height);
+ x2 = MIN(MAX(0, (float) lua_tonumber(L, 4)), sc_width-1) / static_cast<float>(sc_width);
+ y2 = MIN(MAX(0, (float) lua_tonumber(L, 5)), sc_height-1) / static_cast<float>(sc_height);
+ UINT32 bgcolor = lua_tounsigned(L, 6);
+ UINT32 fgcolor = lua_tounsigned(L, 7);
+
+ // draw the box
+ render_container &rc = sc->container();
+ mame_machine_manager::instance()->ui().draw_outlined_box(&rc, x1, y1, x2, y2, fgcolor, bgcolor);
+
+ return 0;
+}
+
+//-------------------------------------------------
+// draw_line - draw a line on a screen container
+// -> manager:machine().screens[":screen"]:draw_line(x1, y1, x2, y2, linecolor)
+//-------------------------------------------------
+
+int lua_engine::lua_screen::l_draw_line(lua_State *L)
+{
+ screen_device *sc = luabridge::Stack<screen_device *>::get(L, 1);
+ if(!sc) {
+ return 0;
+ }
+
+ // ensure that we got 5 numerical parameters
+ luaL_argcheck(L, lua_isnumber(L, 2), 2, "x1 (integer) expected");
+ luaL_argcheck(L, lua_isnumber(L, 3), 3, "y1 (integer) expected");
+ luaL_argcheck(L, lua_isnumber(L, 4), 4, "x2 (integer) expected");
+ luaL_argcheck(L, lua_isnumber(L, 5), 5, "y2 (integer) expected");
+ luaL_argcheck(L, lua_isnumber(L, 6), 6, "color (integer) expected");
+
+ // retrieve all parameters
+ int sc_width = sc->visible_area().width();
+ int sc_height = sc->visible_area().height();
+ float x1, y1, x2, y2;
+ x1 = MIN(MAX(0, (float) lua_tonumber(L, 2)), sc_width-1) / static_cast<float>(sc_width);
+ y1 = MIN(MAX(0, (float) lua_tonumber(L, 3)), sc_height-1) / static_cast<float>(sc_height);
+ x2 = MIN(MAX(0, (float) lua_tonumber(L, 4)), sc_width-1) / static_cast<float>(sc_width);
+ y2 = MIN(MAX(0, (float) lua_tonumber(L, 5)), sc_height-1) / static_cast<float>(sc_height);
+ UINT32 color = lua_tounsigned(L, 6);
+
+ // draw the line
+ sc->container().add_line(x1, y1, x2, y2, UI_LINE_WIDTH, rgb_t(color), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
+ return 0;
+}
+
+//-------------------------------------------------
+// draw_text - draw text on a screen container
+// if x is a position, then y is a pixel position, otherwise x and y are screen size relative
+// -> manager:machine().screens[":screen"]:draw_text(x, y, message)
+//-------------------------------------------------
+
+int lua_engine::lua_screen::l_draw_text(lua_State *L)
+{
+ screen_device *sc = luabridge::Stack<screen_device *>::get(L, 1);
+ if(!sc) {
+ return 0;
+ }
+
+ // ensure that we got proper parameters
+ luaL_argcheck(L, lua_isnumber(L, 2) || lua_isstring(L, 2), 2, "x (integer or string) expected");
+ luaL_argcheck(L, lua_isnumber(L, 3), 3, "y (integer) expected");
+ luaL_argcheck(L, lua_isstring(L, 4), 4, "message (string) expected");
+ luaL_argcheck(L, lua_isinteger(L, 5) || lua_isnone(L, 5), 5, "optional argument: text color, integer expected (default: 0xffffffff)");
+
+ // retrieve all parameters
+ int sc_width = sc->visible_area().width();
+ int sc_height = sc->visible_area().height();
+ int justify = JUSTIFY_LEFT;
+ float y, x = 0;
+ if(lua_isnumber(L, 2))
+ {
+ x = MIN(MAX(0, (float) lua_tonumber(L, 2)), sc_width-1) / static_cast<float>(sc_width);
+ y = MIN(MAX(0, (float) lua_tonumber(L, 3)), sc_height-1) / static_cast<float>(sc_height);
+ }
+ else
+ {
+ std::string just_str = lua_tostring(L, 2);
+ if(just_str == "right")
+ justify = JUSTIFY_RIGHT;
+ else if(just_str == "center")
+ justify = JUSTIFY_CENTER;
+ y = lua_tonumber(L, 3);
+ }
+ const char *msg = luaL_checkstring(L,4);
+ rgb_t textcolor = UI_TEXT_COLOR;
+ if (!lua_isnone(L, 5)) {
+ textcolor = rgb_t(lua_tounsigned(L, 5));
+ }
+
+ // draw the text
+ render_container &rc = sc->container();
+ mame_machine_manager::instance()->ui().draw_text_full(&rc, msg, x, y, (1.0f - x),
+ justify, WRAP_WORD, DRAW_NORMAL, textcolor,
+ UI_TEXT_BG_COLOR, nullptr, nullptr);
+ return 0;
+}
+
+int lua_engine::lua_emu_file::l_emu_file_read(lua_State *L)
+{
+ lua_emu_file *file = luabridge::Stack<lua_emu_file *>::get(L, 1);
+ luaL_argcheck(L, lua_isnumber(L, 2), 2, "length (integer) expected");
+ int ret, len = lua_tonumber(L, 2);
+ luaL_Buffer buff;
+ char *ptr = luaL_buffinitsize(L, &buff, len);
+ ret = file->file.read(ptr, len);
+ luaL_pushresultsize(&buff, ret);
+ return 1;
+}
+
+void *lua_engine::checkparam(lua_State *L, int idx, const char *tname)
+{
+ const char *name;
+
+ if(!lua_getmetatable(L, idx))
+ return nullptr;
+
+ lua_rawget(L, LUA_REGISTRYINDEX);
+ name = lua_tostring(L, -1);
+ if(!name || strcmp(name, tname)) {
+ lua_pop(L, 1);
+ return nullptr;
+ }
+ lua_pop(L, 1);
+
+ return *static_cast<void **>(lua_touserdata(L, idx));
+}
+
+void *lua_engine::getparam(lua_State *L, int idx, const char *tname)
+{
+ void *p = checkparam(L, idx, tname);
+ char msg[256];
+ sprintf(msg, "%s expected", tname);
+ luaL_argcheck(L, p, idx, msg);
+ return p;
+}
+
+void lua_engine::push(lua_State *L, void *p, const char *tname)
+{
+ void **pp = static_cast<void **>(lua_newuserdata(L, sizeof(void *)));
+ *pp = p;
+ luaL_getmetatable(L, tname);
+ lua_setmetatable(L, -2);
+}
+
+int lua_engine::l_emu_exit(lua_State *L)
+{
+ luaThis->machine().schedule_exit();
+ return 1;
+}
+
+int lua_engine::l_emu_start(lua_State *L)
+{
+ const char *system_name = luaL_checkstring(L,1);
+
+ int index = driver_list::find(system_name);
+ if (index != -1) {
+ mame_machine_manager::instance()->schedule_new_driver(driver_list::driver(index));
+ luaThis->machine().schedule_hard_reset();
+ }
+ return 1;
+}
+
+int lua_engine::luaopen_ioport(lua_State *L)
+{
+ static const struct luaL_Reg ioport_funcs [] = {
+ { "write", l_ioport_write },
+ { nullptr, nullptr } /* sentinel */
+ };
+
+ luaL_newmetatable(L, tname_ioport);
+ lua_pushvalue(L, -1);
+ lua_pushstring(L, tname_ioport);
+ lua_rawset(L, LUA_REGISTRYINDEX);
+ lua_pushstring(L, "__index");
+ lua_pushvalue(L, -2);
+ lua_settable(L, -3);
+ luaL_setfuncs(L, ioport_funcs, 0);
+ return 1;
+}
+
+struct msg {
+ std::string text;
+ int ready;
+ std::string response;
+ int status;
+ int done;
+} msg;
+
+static std::mutex g_mutex;
+
+void lua_engine::serve_lua()
+{
+ osd_sleep(osd_ticks_per_second() / 1000 * 50);
+ printf("%s v%s\n%s\n%s\n\n", emulator_info::get_appname(),build_version,emulator_info::get_copyright_info(),LUA_COPYRIGHT);
+ fflush(stdout);
+ char buff[LUA_MAXINPUT];
+ std::string oldbuff;
+
+ const char *b = LUA_PROMPT;
+
+ do {
+ // Wait for input
+ fputs(b, stdout); fflush(stdout); /* show prompt */
+ fgets(buff, LUA_MAXINPUT, stdin);
+
+ // Create message
+ {
+ std::lock_guard<std::mutex> lock(g_mutex);
+ if (msg.ready == 0) {
+ msg.text = oldbuff;
+ if (oldbuff.length() != 0) msg.text.append("\n");
+ msg.text.append(buff);
+ msg.ready = 1;
+ msg.done = 0;
+ }
+ }
+
+ // Wait for response
+ int done;
+ do {
+ osd_sleep(osd_ticks_per_second() / 1000);
+ std::lock_guard<std::mutex> lock(g_mutex);
+ done = msg.done;
+ } while (done==0);
+
+ // Do action on client side
+ {
+ std::lock_guard<std::mutex> lock(g_mutex);
+
+ if (msg.status == -1) {
+ b = LUA_PROMPT2;
+ oldbuff = msg.response;
+ }
+ else {
+ b = LUA_PROMPT;
+ oldbuff = "";
+ }
+ msg.done = 0;
+ }
+
+ } while (1);
+}
+
+static void *serve_lua(void *param)
+{
+ lua_engine *engine = (lua_engine *)param;
+ engine->serve_lua();
+ return NULL;
+}
+
+//-------------------------------------------------
+// lua_engine - constructor
+//-------------------------------------------------
+
+lua_engine::lua_engine()
+{
+ m_machine = nullptr;
+ luaThis = this;
+ m_lua_state = luaL_newstate(); /* create state */
+ output_notifier_set = false;
+
+ luaL_checkversion(m_lua_state);
+ lua_gc(m_lua_state, LUA_GCSTOP, 0); /* stop collector during initialization */
+ luaL_openlibs(m_lua_state); /* open libraries */
+
+ // Get package.preload so we can store builtins in it.
+ lua_getglobal(m_lua_state, "package");
+ lua_getfield(m_lua_state, -1, "preload");
+ lua_remove(m_lua_state, -2); // Remove package
+
+ lua_pushcfunction(m_lua_state, luaopen_zlib);
+ lua_setfield(m_lua_state, -2, "zlib");
+
+ lua_pushcfunction(m_lua_state, luaopen_lsqlite3);
+ lua_setfield(m_lua_state, -2, "lsqlite3");
+
+ lua_pushcfunction(m_lua_state, luaopen_lfs);
+ lua_setfield(m_lua_state, -2, "lfs");
+
+ luaopen_ioport(m_lua_state);
+
+ lua_gc(m_lua_state, LUA_GCRESTART, 0);
+ msg.ready = 0;
+ msg.status = 0;
+ msg.done = 0;
+}
+
+//-------------------------------------------------
+// ~lua_engine - destructor
+//-------------------------------------------------
+
+lua_engine::~lua_engine()
+{
+ close();
+}
+
+int lua_engine::compile_with_env(const char *envname, const char *script, const char *env)
+{
+ std::string field = std::string("env_").append(envname);
+ int error;
+ lua_settop(m_lua_state, 0);
+ lua_getfield(m_lua_state, LUA_REGISTRYINDEX, field.c_str());
+
+ if(!lua_istable(m_lua_state, -1))
+ {
+ lua_newtable(m_lua_state);
+ lua_setfield(m_lua_state, LUA_REGISTRYINDEX, field.c_str());
+ lua_getfield(m_lua_state, LUA_REGISTRYINDEX, field.c_str());
+ }
+
+ // optionally load a string to prepare the environment
+ if(env)
+ {
+ error = luaL_loadstring(m_lua_state, env);
+ if(error == LUA_OK)
+ lua_pushvalue(m_lua_state, -2);
+ if((error != LUA_OK) || ((error = lua_pcall(m_lua_state, 1, 0, 0)) != LUA_OK))
+ {
+ if((error == LUA_ERRSYNTAX) || (error == LUA_ERRRUN))
+ printf("%s\n", lua_tostring(m_lua_state, -1));
+ lua_pop(m_lua_state, 1);
+ }
+ lua_getfield(m_lua_state, LUA_REGISTRYINDEX, field.c_str());
+ }
+
+ if((error = luaL_loadstring(m_lua_state, script)) != LUA_OK)
+ {
+ if(error == LUA_ERRSYNTAX)
+ printf("%s\n", lua_tostring(m_lua_state, -1));
+ lua_tostring(m_lua_state, -1);
+ lua_pop(m_lua_state, 2);
+ return -1;
+ }
+ lua_pushvalue(m_lua_state, -2);
+ lua_setupvalue(m_lua_state, -2, 1);
+ int ref = luaL_ref(m_lua_state, -2);
+ lua_pop(m_lua_state, 1);
+ return ref;
+}
+
+template <typename Tout, typename Tin>
+Tout lua_engine::run(const char *env, int ref, Tin in)
+{
+ Tout ret;
+ lua_settop(m_lua_state, 0);
+ luabridge::Stack<Tin>::push(m_lua_state, in);
+ run_internal(env, ref);
+ if(lua_isnil(m_lua_state, 1))
+ ret = Tout(0);
+ else
+ ret = luabridge::Stack<Tout>::get(m_lua_state, 1);
+ lua_pop(m_lua_state, 1);
+ return ret;
+}
+
+template <typename Tout>
+Tout lua_engine::run(const char *env, int ref)
+{
+ Tout ret;
+ lua_settop(m_lua_state, 0);
+ lua_pushnil(m_lua_state);
+ run_internal(env, ref);
+ if(lua_isnil(m_lua_state, 1))
+ ret = Tout(0);
+ else
+ ret = luabridge::Stack<Tout>::get(m_lua_state, 1);
+ lua_pop(m_lua_state, 1);
+ return ret;
+}
+
+template <typename Tin>
+void lua_engine::run(const char *env, int ref, Tin in)
+{
+ lua_settop(m_lua_state, 0);
+ luabridge::Stack<Tin>::push(m_lua_state, in);
+ run_internal(env, ref);
+ lua_pop(m_lua_state, 1);
+}
+
+void lua_engine::run(const char *env, int ref)
+{
+ lua_settop(m_lua_state, 0);
+ lua_pushnil(m_lua_state);
+ run_internal(env, ref);
+ lua_pop(m_lua_state, 1);
+}
+// create specialization so luabridge doesn't have to be included everywhere
+template int lua_engine::run<int>(const char *env, int ref);
+
+void lua_engine::run_internal(const char *env, int ref)
+{
+ std::string field = std::string("env_").append(env);
+ lua_getfield(m_lua_state, LUA_REGISTRYINDEX, field.c_str());
+ if(lua_istable(m_lua_state, -1))
+ {
+ lua_rawgeti(m_lua_state, -1, ref);
+ if(lua_isfunction(m_lua_state, -1))
+ {
+ lua_pushvalue(m_lua_state, -3);
+ int error;
+ if((error = lua_pcall(m_lua_state, 1, 1, 0)) != LUA_OK)
+ {
+ if(error == LUA_ERRRUN)
+ printf("%s\n", lua_tostring(m_lua_state, -1));
+ lua_pop(m_lua_state, 1);
+ lua_pushnil(m_lua_state);
+ }
+ }
+ }
+ lua_replace(m_lua_state, 1);
+ lua_pop(m_lua_state, 1);
+}
+
+void lua_engine::menu_populate(std::string &menu, std::vector<menu_item> &menu_list)
+{
+ std::string field = "menu_pop_" + menu;
+ lua_settop(m_lua_state, 0);
+ lua_getfield(m_lua_state, LUA_REGISTRYINDEX, field.c_str());
+
+ if(!lua_isfunction(m_lua_state, -1))
+ {
+ lua_pop(m_lua_state, 1);
+ return;
+ }
+ int error;
+ if((error = lua_pcall(m_lua_state, 0, 1, 0)) != LUA_OK)
+ {
+ if(error == LUA_ERRRUN)
+ printf("%s\n", lua_tostring(m_lua_state, -1));
+ lua_pop(m_lua_state, 1);
+ return;
+ }
+ if(!lua_istable(m_lua_state, -1))
+ {
+ lua_pop(m_lua_state, 1);
+ return;
+ }
+
+ lua_pushnil(m_lua_state);
+ while(lua_next(m_lua_state, -2))
+ {
+ if(lua_istable(m_lua_state, -1))
+ {
+ menu_item item;
+ lua_rawgeti(m_lua_state, -1, 1);
+ item.text = lua_tostring(m_lua_state, -1);
+ lua_pop(m_lua_state, 1);
+ lua_rawgeti(m_lua_state, -1, 2);
+ item.subtext = lua_tostring(m_lua_state, -1);
+ lua_pop(m_lua_state, 1);
+ lua_rawgeti(m_lua_state, -1, 3);
+ item.flags = lua_tostring(m_lua_state, -1);
+ lua_pop(m_lua_state, 1);
+ menu_list.push_back(item);
+ }
+ lua_pop(m_lua_state, 1);
+ }
+ lua_pop(m_lua_state, 1);
+}
+
+bool lua_engine::menu_callback(std::string &menu, int index, std::string event)
+{
+ std::string field = "menu_cb_" + menu;
+ bool ret = false;
+ lua_settop(m_lua_state, 0);
+ lua_getfield(m_lua_state, LUA_REGISTRYINDEX, field.c_str());
+
+ if(lua_isfunction(m_lua_state, -1))
+ {
+ lua_pushinteger(m_lua_state, index);
+ lua_pushstring(m_lua_state, event.c_str());
+ int error;
+ if((error = lua_pcall(m_lua_state, 2, 1, 0)) != LUA_OK)
+ {
+ if(error == 2)
+ printf("%s\n", lua_tostring(m_lua_state, -1));
+ lua_pop(m_lua_state, 1);
+ return false;
+ }
+ ret = lua_toboolean(m_lua_state, -1);
+ lua_pop(m_lua_state, 1);
+ }
+ return ret;
+}
+
+int lua_engine::l_emu_register_menu(lua_State *L)
+{
+ luaL_argcheck(L, lua_isfunction(L, 1), 1, "callback function expected");
+ luaL_argcheck(L, lua_isfunction(L, 2), 2, "callback function expected");
+ luaL_argcheck(L, lua_isstring(L, 3), 3, "name (string) expected");
+ std::string name = luaL_checkstring(L, 3);
+ std::string cbfield = "menu_cb_" + name;
+ std::string popfield = "menu_pop_" + name;
+ luaThis->m_menu.push_back(std::string(name));
+ lua_pushvalue(L, 1);
+ lua_setfield(L, LUA_REGISTRYINDEX, cbfield.c_str());
+ lua_pushvalue(L, 2);
+ lua_setfield(L, LUA_REGISTRYINDEX, popfield.c_str());
+ return 1;
+}
+
+void lua_engine::execute_function(const char *id)
+{
+ lua_settop(m_lua_state, 0);
+ lua_getfield(m_lua_state, LUA_REGISTRYINDEX, id);
+
+ if (lua_istable(m_lua_state, -1))
+ {
+ lua_pushnil(m_lua_state);
+ while (lua_next(m_lua_state, -2) != 0)
+ {
+ if (lua_isfunction(m_lua_state, -1))
+ {
+ int error;
+ if((error = lua_pcall(m_lua_state, 0, 0, 0)) != LUA_OK)
+ {
+ if(error == 2)
+ printf("%s\n", lua_tostring(m_lua_state, -1));
+ lua_pop(m_lua_state, 1);
+ }
+ }
+ else
+ {
+ lua_pop(m_lua_state, 1);
+ }
+ }
+ }
+}
+
+int lua_engine::register_function(lua_State *L, const char *id)
+{
+ if (!lua_isnil(L, 1))
+ luaL_checktype(L, 1, LUA_TFUNCTION);
+ lua_settop(L, 1);
+ lua_getfield(L, LUA_REGISTRYINDEX, id);
+ if (lua_isnil(L, -1))
+ {
+ lua_newtable(L);
+ }
+ luaL_checktype(L, -1, LUA_TTABLE);
+ int len = lua_rawlen(L, -1);
+ lua_pushnumber(L, len + 1);
+ lua_pushvalue(L, 1);
+ lua_rawset(L, -3); /* Stores the pair in the table */
+
+ lua_pushvalue(L, -1);
+ lua_setfield(L, LUA_REGISTRYINDEX, id);
+ return 1;
+}
+
+int lua_engine::l_emu_register_prestart(lua_State *L)
+{
+ return register_function(L, "LUA_ON_PRESTART");
+}
+
+int lua_engine::l_emu_register_start(lua_State *L)
+{
+ return register_function(L, "LUA_ON_START");
+}
+
+int lua_engine::l_emu_register_stop(lua_State *L)
+{
+ return register_function(L, "LUA_ON_STOP");
+}
+
+int lua_engine::l_emu_register_pause(lua_State *L)
+{
+ return register_function(L, "LUA_ON_PAUSE");
+}
+
+int lua_engine::l_emu_register_resume(lua_State *L)
+{
+ return register_function(L, "LUA_ON_RESUME");
+}
+
+int lua_engine::l_emu_register_frame(lua_State *L)
+{
+ return register_function(L, "LUA_ON_FRAME");
+}
+
+int lua_engine::l_emu_register_frame_done(lua_State *L)
+{
+ return register_function(L, "LUA_ON_FRAME_DONE");
+}
+
+void lua_engine::on_machine_prestart()
+{
+ execute_function("LUA_ON_PRESTART");
+}
+
+void lua_engine::on_machine_start()
+{
+ execute_function("LUA_ON_START");
+}
+
+void lua_engine::on_machine_stop()
+{
+ execute_function("LUA_ON_STOP");
+}
+
+void lua_engine::on_machine_pause()
+{
+ execute_function("LUA_ON_PAUSE");
+}
+
+void lua_engine::on_machine_resume()
+{
+ execute_function("LUA_ON_RESUME");
+}
+
+void lua_engine::on_machine_frame()
+{
+ execute_function("LUA_ON_FRAME");
+}
+
+void lua_engine::on_frame_done()
+{
+ execute_function("LUA_ON_FRAME_DONE");
+}
+
+void lua_engine::update_machine()
+{
+ lua_newtable(m_lua_state);
+ if (m_machine!=nullptr)
+ {
+ // Create the ioport array
+ for (ioport_port &port : machine().ioport().ports())
+ {
+ for (ioport_field &field : port.fields())
+ {
+ if (field.name())
+ {
+ push(m_lua_state, &field, tname_ioport);
+ lua_setfield(m_lua_state, -2, field.name());
+ }
+ }
+ }
+ }
+ lua_setglobal(m_lua_state, "ioport");
+}
+
+void lua_engine::attach_notifiers()
+{
+ machine().add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(lua_engine::on_machine_prestart), this), true);
+ machine().add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(lua_engine::on_machine_start), this));
+ machine().add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(lua_engine::on_machine_stop), this));
+ machine().add_notifier(MACHINE_NOTIFY_PAUSE, machine_notify_delegate(FUNC(lua_engine::on_machine_pause), this));
+ machine().add_notifier(MACHINE_NOTIFY_RESUME, machine_notify_delegate(FUNC(lua_engine::on_machine_resume), this));
+ machine().add_notifier(MACHINE_NOTIFY_FRAME, machine_notify_delegate(FUNC(lua_engine::on_machine_frame), this));
+}
+
+int lua_engine::lua_machine::l_popmessage(lua_State *L)
+{
+ running_machine *m = luabridge::Stack<running_machine *>::get(L, 1);
+ if(!lua_isstring(L, 2))
+ m->popmessage();
+ else
+ m->popmessage("%s", luaL_checkstring(L, 2));
+ return 0;
+}
+
+int lua_engine::lua_machine::l_logerror(lua_State *L)
+{
+ running_machine *m = luabridge::Stack<running_machine *>::get(L, 1);
+ luaL_argcheck(L, lua_isstring(L, 2), 2, "message (string) expected");
+ m->logerror("[luaengine] %s\n", luaL_checkstring(L, 2));
+ return 0;
+}
+
+std::string lua_engine::get_print_buffer(lua_State *L)
+{
+ int nargs = lua_gettop(L);
+
+ const std::string sep = " ";
+
+ std::ostringstream ss;
+ bool first = true;
+
+ for (int i = 1; i <= nargs; i++) {
+ const char* c = lua_tostring(L, i);
+ const std::string str = c ? c : "<nil>";
+ if (first) first = false;
+ else ss << sep;
+ ss << str;
+ }
+
+ return ss.str();
+}
+int lua_engine::l_osd_printf_verbose(lua_State *L)
+{
+ osd_printf_verbose("%s\n",get_print_buffer(L).c_str());
+ return 0;
+}
+
+int lua_engine::l_osd_printf_error(lua_State *L)
+{
+ osd_printf_error("%s\n",get_print_buffer(L).c_str());
+ return 0;
+}
+
+int lua_engine::l_osd_printf_info(lua_State *L)
+{
+ osd_printf_info("%s\n",get_print_buffer(L).c_str());
+ return 0;
+}
+
+int lua_engine::l_osd_printf_debug(lua_State *L)
+{
+ osd_printf_debug("%s\n",get_print_buffer(L).c_str());
+ return 0;
+}
+
+//-------------------------------------------------
+// initialize - initialize lua hookup to emu engine
+//-------------------------------------------------
+
+void lua_engine::initialize()
+{
+ luabridge::getGlobalNamespace (m_lua_state)
+ .beginNamespace ("emu")
+ .addCFunction ("app_name", l_emu_app_name )
+ .addCFunction ("app_version", l_emu_app_version )
+ .addCFunction ("gamename", l_emu_gamename )
+ .addCFunction ("romname", l_emu_romname )
+ .addCFunction ("softname", l_emu_softname )
+ .addCFunction ("keypost", l_emu_keypost )
+ .addCFunction ("hook_output", l_emu_hook_output )
+ .addCFunction ("sethook", l_emu_set_hook )
+ .addCFunction ("time", l_emu_time )
+ .addCFunction ("wait", l_emu_wait )
+ .addCFunction ("after", l_emu_after )
+ .addCFunction ("exit", l_emu_exit )
+ .addCFunction ("start", l_emu_start )
+ .addCFunction ("pause", l_emu_pause )
+ .addCFunction ("unpause", l_emu_unpause )
+ .addCFunction ("register_prestart", l_emu_register_prestart )
+ .addCFunction ("register_start", l_emu_register_start )
+ .addCFunction ("register_stop", l_emu_register_stop )
+ .addCFunction ("register_pause", l_emu_register_pause )
+ .addCFunction ("register_resume",l_emu_register_resume )
+ .addCFunction ("register_frame", l_emu_register_frame )
+ .addCFunction ("register_frame_done", l_emu_register_frame_done )
+ .addCFunction ("register_menu", l_emu_register_menu )
+ .addCFunction ("print_verbose", l_osd_printf_verbose )
+ .addCFunction ("print_error", l_osd_printf_error )
+ .addCFunction ("print_info", l_osd_printf_info )
+ .addCFunction ("print_debug", l_osd_printf_debug )
+ .beginClass <mame_machine_manager> ("manager")
+ .addFunction ("machine", &machine_manager::machine)
+ .addFunction ("options", &machine_manager::options)
+ .addFunction ("plugins", &mame_machine_manager::plugins)
+ .endClass ()
+ .beginClass <lua_machine> ("lua_machine")
+ .addCFunction ("popmessage", &lua_machine::l_popmessage)
+ .addCFunction ("logerror", &lua_machine::l_logerror)
+ .endClass ()
+ .deriveClass <running_machine, lua_machine> ("machine")
+ .addFunction ("exit", &running_machine::schedule_exit)
+ .addFunction ("hard_reset", &running_machine::schedule_hard_reset)
+ .addFunction ("soft_reset", &running_machine::schedule_soft_reset)
+ .addFunction ("save", &running_machine::schedule_save)
+ .addFunction ("load", &running_machine::schedule_load)
+ .addFunction ("system", &running_machine::system)
+ .addFunction ("video", &running_machine::video)
+ .addFunction ("ui", &running_machine::ui)
+ .addFunction ("render", &running_machine::render)
+ .addFunction ("ioport", &running_machine::ioport)
+ .addFunction ("parameters", &running_machine::parameters)
+ .addFunction ("cheat", &mame_machine_manager::cheat)
+ .addFunction ("memory", &running_machine::memory)
+ .addFunction ("options", &running_machine::options)
+ .addFunction ("outputs", &running_machine::output)
+ .addProperty <luabridge::LuaRef, void> ("devices", &lua_engine::l_machine_get_devices)
+ .addProperty <luabridge::LuaRef, void> ("screens", &lua_engine::l_machine_get_screens)
+ .addProperty <luabridge::LuaRef, void> ("images", &lua_engine::l_machine_get_images)
+ .endClass ()
+ .beginClass <game_driver> ("game_driver")
+ .addData ("source_file", &game_driver::source_file)
+ .addData ("parent", &game_driver::parent)
+ .addData ("name", &game_driver::name)
+ .addData ("description", &game_driver::description)
+ .addData ("year", &game_driver::year)
+ .addData ("manufacturer", &game_driver::manufacturer)
+ .addData ("compatible_with", &game_driver::compatible_with)
+ .addData ("default_layout", &game_driver::default_layout)
+ .endClass ()
+ .beginClass <device_t> ("device")
+ .addFunction ("name", &device_t::name)
+ .addFunction ("shortname", &device_t::shortname)
+ .addFunction ("tag", &device_t::tag)
+ .addFunction ("owner", &device_t::owner)
+ .addProperty <luabridge::LuaRef, void> ("spaces", &lua_engine::l_dev_get_memspaces)
+ .addProperty <luabridge::LuaRef, void> ("state", &lua_engine::l_dev_get_states)
+ .addProperty <luabridge::LuaRef, void> ("items", &lua_engine::l_dev_get_items)
+ .endClass()
+ .beginClass <cheat_manager> ("cheat")
+ .addProperty <bool, bool> ("enabled", &cheat_manager::enabled, &cheat_manager::set_enable)
+ .addFunction ("reload", &cheat_manager::reload)
+ .addFunction ("save_all", &cheat_manager::save_all)
+ .addProperty <luabridge::LuaRef, void> ("entries", &lua_engine::l_cheat_get_entries)
+ .endClass()
+ .beginClass <lua_cheat_entry> ("lua_cheat_entry")
+ .addCFunction ("state", &lua_cheat_entry::l_get_state)
+ .endClass()
+ .deriveClass <cheat_entry, lua_cheat_entry> ("cheat_entry")
+ .addFunction ("description", &cheat_entry::description)
+ .addFunction ("comment", &cheat_entry::comment)
+ .addFunction ("has_run_script", &cheat_entry::has_run_script)
+ .addFunction ("has_on_script", &cheat_entry::has_on_script)
+ .addFunction ("has_off_script", &cheat_entry::has_off_script)
+ .addFunction ("has_change_script", &cheat_entry::has_change_script)
+ .addFunction ("execute_off_script", &cheat_entry::execute_off_script)
+ .addFunction ("execute_on_script", &cheat_entry::execute_on_script)
+ .addFunction ("execute_run_script", &cheat_entry::execute_run_script)
+ .addFunction ("execute_change_script", &cheat_entry::execute_change_script)
+ .addFunction ("is_text_only", &cheat_entry::is_text_only)
+ .addFunction ("is_oneshot", &cheat_entry::is_oneshot)
+ .addFunction ("is_onoff", &cheat_entry::is_onoff)
+ .addFunction ("is_value_parameter", &cheat_entry::is_value_parameter)
+ .addFunction ("is_itemlist_parameter", &cheat_entry::is_itemlist_parameter)
+ .addFunction ("is_oneshot_parameter", &cheat_entry::is_oneshot_parameter)
+ .addFunction ("activate", &cheat_entry::activate)
+ .addFunction ("select_default_state", &cheat_entry::select_default_state)
+ .addFunction ("select_previous_state", &cheat_entry::select_previous_state)
+ .addFunction ("select_next_state", &cheat_entry::select_next_state)
+ .endClass()
+ .beginClass <ioport_manager> ("ioport")
+ .addFunction ("has_configs", &ioport_manager::has_configs)
+ .addFunction ("has_analog", &ioport_manager::has_analog)
+ .addFunction ("has_dips", &ioport_manager::has_dips)
+ .addFunction ("has_bioses", &ioport_manager::has_bioses)
+ .addFunction ("has_keyboard", &ioport_manager::has_keyboard)
+ .addFunction ("count_players", &ioport_manager::count_players)
+ .addProperty <luabridge::LuaRef, void> ("ports", &lua_engine::l_ioport_get_ports)
+ .endClass()
+ .beginClass <ioport_port> ("ioport_port")
+ .addFunction ("tag", &ioport_port::tag)
+ .addFunction ("active", &ioport_port::active)
+ .addFunction ("live", &ioport_port::live)
+ .addFunction ("read", &ioport_port::read)
+ .addFunction ("write", &ioport_port::write)
+ .addFunction ("field", &ioport_port::field)
+ .addProperty <luabridge::LuaRef, void> ("fields", &lua_engine::l_ioports_port_get_fields)
+ .endClass()
+ .beginClass <ioport_field> ("ioport_field")
+ .addFunction ("set_value", &ioport_field::set_value)
+ .addProperty ("device", &ioport_field::device)
+ .addProperty ("name", &ioport_field::name)
+ .addProperty <UINT8, UINT8> ("player", &ioport_field::player, &ioport_field::set_player)
+ .addProperty ("mask", &ioport_field::mask)
+ .addProperty ("defvalue", &ioport_field::defvalue)
+ .addProperty ("sensitivity", &ioport_field::sensitivity)
+ .addProperty ("way", &ioport_field::way)
+ .addProperty ("is_analog", &ioport_field::is_analog)
+ .addProperty ("is_digitial_joystick", &ioport_field::is_digital_joystick)
+ .addProperty ("enabled", &ioport_field::enabled)
+ .addProperty ("unused", &ioport_field::unused)
+ .addProperty ("cocktail", &ioport_field::cocktail)
+ .addProperty ("toggle", &ioport_field::toggle)
+ .addProperty ("rotated", &ioport_field::rotated)
+ .addProperty ("analog_reverse", &ioport_field::analog_reverse)
+ .addProperty ("analog_reset", &ioport_field::analog_reset)
+ .addProperty ("analog_wraps", &ioport_field::analog_wraps)
+ .addProperty ("analog_invert", &ioport_field::analog_invert)
+ .addProperty ("impulse", &ioport_field::impulse)
+ .addProperty <double, double> ("crosshair_scale", &ioport_field::crosshair_scale, &ioport_field::set_crosshair_scale)
+ .addProperty <double, double> ("crosshair_offset", &ioport_field::crosshair_offset, &ioport_field::set_crosshair_offset)
+ .endClass()
+ .beginClass <core_options> ("core_options")
+ .addFunction ("help", &core_options::output_help)
+ .addFunction ("command", &core_options::command)
+ .addProperty <luabridge::LuaRef, void> ("entries", &lua_engine::l_options_get_entries)
+ .endClass()
+ .beginClass <lua_options_entry> ("lua_options_entry")
+ .addCFunction ("value", &lua_options_entry::l_entry_value)
+ .endClass()
+ .deriveClass <core_options::entry, lua_options_entry> ("core_options_entry")
+ .addFunction ("description", &core_options::entry::description)
+ .addFunction ("default_value", &core_options::entry::default_value)
+ .addFunction ("minimum", &core_options::entry::minimum)
+ .addFunction ("maximum", &core_options::entry::maximum)
+ .addFunction ("has_range", &core_options::entry::has_range)
+ .endClass()
+ .deriveClass <emu_options, core_options> ("emu_options")
+ .endClass()
+ .deriveClass <ui_options, core_options> ("ui_options")
+ .endClass()
+ .deriveClass <plugin_options, core_options> ("plugin_options")
+ .endClass()
+ .beginClass <parameters_manager> ("parameters")
+ .addFunction ("add", &parameters_manager::add)
+ .addFunction ("lookup", &parameters_manager::lookup)
+ .endClass()
+ .beginClass <lua_video> ("lua_video_manager")
+ .addCFunction ("begin_recording", &lua_video::l_begin_recording)
+ .addCFunction ("end_recording", &lua_video::l_end_recording)
+ .endClass()
+ .deriveClass <video_manager, lua_video> ("video")
+ .addFunction ("snapshot", &video_manager::save_active_screen_snapshots)
+ .addFunction ("is_recording", &video_manager::is_recording)
+ .addFunction ("skip_this_frame", &video_manager::skip_this_frame)
+ .addFunction ("speed_factor", &video_manager::speed_factor)
+ .addFunction ("speed_percent", &video_manager::speed_percent)
+ .addProperty <int, int> ("frameskip", &video_manager::frameskip, &video_manager::set_frameskip)
+ .addProperty <bool, bool> ("throttled", &video_manager::throttled, &video_manager::set_throttled)
+ .addProperty <float, float> ("throttle_rate", &video_manager::throttle_rate, &video_manager::set_throttle_rate)
+ .endClass()
+ .beginClass <lua_addr_space> ("lua_addr_space")
+ .addCFunction ("read_i8", &lua_addr_space::l_mem_read<INT8>)
+ .addCFunction ("read_u8", &lua_addr_space::l_mem_read<UINT8>)
+ .addCFunction ("read_i16", &lua_addr_space::l_mem_read<INT16>)
+ .addCFunction ("read_u16", &lua_addr_space::l_mem_read<UINT16>)
+ .addCFunction ("read_i32", &lua_addr_space::l_mem_read<INT32>)
+ .addCFunction ("read_u32", &lua_addr_space::l_mem_read<UINT32>)
+ .addCFunction ("read_i64", &lua_addr_space::l_mem_read<INT64>)
+ .addCFunction ("read_u64", &lua_addr_space::l_mem_read<UINT64>)
+ .addCFunction ("write_i8", &lua_addr_space::l_mem_write<INT8>)
+ .addCFunction ("write_u8", &lua_addr_space::l_mem_write<UINT8>)
+ .addCFunction ("write_i16", &lua_addr_space::l_mem_write<INT16>)
+ .addCFunction ("write_u16", &lua_addr_space::l_mem_write<UINT16>)
+ .addCFunction ("write_i32", &lua_addr_space::l_mem_write<INT32>)
+ .addCFunction ("write_u32", &lua_addr_space::l_mem_write<UINT32>)
+ .addCFunction ("write_i64", &lua_addr_space::l_mem_write<INT64>)
+ .addCFunction ("write_u64", &lua_addr_space::l_mem_write<UINT64>)
+ .addCFunction ("read_direct_i8", &lua_addr_space::l_direct_mem_read<INT8>)
+ .addCFunction ("read_direct_u8", &lua_addr_space::l_direct_mem_read<UINT8>)
+ .addCFunction ("read_direct_i16", &lua_addr_space::l_direct_mem_read<INT16>)
+ .addCFunction ("read_direct_u16", &lua_addr_space::l_direct_mem_read<UINT16>)
+ .addCFunction ("read_direct_i32", &lua_addr_space::l_direct_mem_read<INT32>)
+ .addCFunction ("read_direct_u32", &lua_addr_space::l_direct_mem_read<UINT32>)
+ .addCFunction ("read_direct_i64", &lua_addr_space::l_direct_mem_read<INT64>)
+ .addCFunction ("read_direct_u64", &lua_addr_space::l_direct_mem_read<UINT64>)
+ .addCFunction ("write_direct_i8", &lua_addr_space::l_direct_mem_write<INT8>)
+ .addCFunction ("write_direct_u8", &lua_addr_space::l_direct_mem_write<UINT8>)
+ .addCFunction ("write_direct_i16", &lua_addr_space::l_direct_mem_write<INT16>)
+ .addCFunction ("write_direct_u16", &lua_addr_space::l_direct_mem_write<UINT16>)
+ .addCFunction ("write_direct_i32", &lua_addr_space::l_direct_mem_write<INT32>)
+ .addCFunction ("write_direct_u32", &lua_addr_space::l_direct_mem_write<UINT32>)
+ .addCFunction ("write_direct_i64", &lua_addr_space::l_direct_mem_write<INT64>)
+ .addCFunction ("write_direct_u64", &lua_addr_space::l_direct_mem_write<UINT64>)
+ .endClass()
+ .deriveClass <address_space, lua_addr_space> ("addr_space")
+ .addFunction("name", &address_space::name)
+ .addProperty <luabridge::LuaRef, void> ("map", &lua_engine::l_addr_space_map)
+ .endClass()
+ .beginClass <render_target> ("target")
+ .addFunction ("width", &render_target::width)
+ .addFunction ("height", &render_target::height)
+ .addFunction ("pixel_aspect", &render_target::pixel_aspect)
+ .addFunction ("hidden", &render_target::hidden)
+ .addFunction ("is_ui_target", &render_target::is_ui_target)
+ .addFunction ("index", &render_target::index)
+ .addProperty <float, float> ("max_update_rate", &render_target::max_update_rate, &render_target::set_max_update_rate)
+ .addProperty <int, int> ("view", &render_target::view, &render_target::set_view)
+ .addProperty <int, int> ("orientation", &render_target::orientation, &render_target::set_orientation)
+ .addProperty <bool, bool> ("backdrops", &render_target::backdrops_enabled, &render_target::set_backdrops_enabled)
+ .addProperty <bool, bool> ("overlays", &render_target::overlays_enabled, &render_target::set_overlays_enabled)
+ .addProperty <bool, bool> ("bezels", &render_target::bezels_enabled, &render_target::set_bezels_enabled)
+ .addProperty <bool, bool> ("marquees", &render_target::marquees_enabled, &render_target::set_marquees_enabled)
+ .addProperty <bool, bool> ("screen_overlay", &render_target::screen_overlay_enabled, &render_target::set_screen_overlay_enabled)
+ .addProperty <bool, bool> ("zoom", &render_target::zoom_to_screen, &render_target::set_zoom_to_screen)
+ .endClass()
+ .beginClass <render_container> ("render_container")
+ .addFunction ("orientation", &render_container::orientation)
+ .addFunction ("xscale", &render_container::xscale)
+ .addFunction ("yscale", &render_container::yscale)
+ .addFunction ("xoffset", &render_container::xoffset)
+ .addFunction ("yoffset", &render_container::yoffset)
+ .addFunction ("is_empty", &render_container::is_empty)
+ .endClass()
+ .beginClass <render_manager> ("render")
+ .addFunction ("max_update_rate", &render_manager::max_update_rate)
+ .addFunction ("ui_target", &render_manager::ui_target)
+ .addFunction ("ui_container", &render_manager::ui_container)
+ .addProperty <luabridge::LuaRef, void> ("targets", &lua_engine::l_render_get_targets)
+ .endClass()
+ .beginClass <mame_ui_manager> ("ui")
+ .addFunction ("is_menu_active", &mame_ui_manager::is_menu_active)
+ .addFunction ("options", &mame_ui_manager::options)
+ .addProperty <bool, bool> ("show_fps", &mame_ui_manager::show_fps, &mame_ui_manager::set_show_fps)
+ .addProperty <bool, bool> ("show_profiler", &mame_ui_manager::show_profiler, &mame_ui_manager::set_show_profiler)
+ .addProperty <bool, bool> ("single_step", &mame_ui_manager::single_step, &mame_ui_manager::set_single_step)
+ .addFunction ("get_line_height", &mame_ui_manager::get_line_height)
+ .endClass()
+ .beginClass <lua_screen> ("lua_screen_dev")
+ .addCFunction ("draw_box", &lua_screen::l_draw_box)
+ .addCFunction ("draw_line", &lua_screen::l_draw_line)
+ .addCFunction ("draw_text", &lua_screen::l_draw_text)
+ .addCFunction ("height", &lua_screen::l_height)
+ .addCFunction ("width", &lua_screen::l_width)
+ .addCFunction ("orientation", &lua_screen::l_orientation)
+ .addCFunction ("refresh", &lua_screen::l_refresh)
+ .addCFunction ("snapshot", &lua_screen::l_snapshot)
+ .addCFunction ("type", &lua_screen::l_type)
+ .endClass()
+ .deriveClass <screen_device, lua_screen> ("screen_dev")
+ .addFunction ("frame_number", &screen_device::frame_number)
+ .addFunction ("name", &screen_device::name)
+ .addFunction ("shortname", &screen_device::shortname)
+ .addFunction ("tag", &screen_device::tag)
+ .addFunction ("xscale", &screen_device::xscale)
+ .addFunction ("yscale", &screen_device::yscale)
+ .endClass()
+ .beginClass <device_state_entry> ("dev_space")
+ .addFunction ("name", &device_state_entry::symbol)
+ .addProperty <UINT64, UINT64> ("value", &lua_engine::l_state_get_value, &lua_engine::l_state_set_value)
+ .addFunction ("is_visible", &device_state_entry::visible)
+ .addFunction ("is_divider", &device_state_entry::divider)
+ .endClass()
+ .beginClass <memory_manager> ("memory")
+ .addProperty <luabridge::LuaRef, void> ("banks", &lua_engine::l_memory_get_banks)
+ .addProperty <luabridge::LuaRef, void> ("regions", &lua_engine::l_memory_get_regions)
+ .endClass()
+ .beginClass <lua_memory_region> ("lua_region")
+ .addCFunction ("read_i8", &lua_memory_region::l_region_read<INT8>)
+ .addCFunction ("read_u8", &lua_memory_region::l_region_read<UINT8>)
+ .addCFunction ("read_i16", &lua_memory_region::l_region_read<INT16>)
+ .addCFunction ("read_u16", &lua_memory_region::l_region_read<UINT16>)
+ .addCFunction ("read_i32", &lua_memory_region::l_region_read<INT32>)
+ .addCFunction ("read_u32", &lua_memory_region::l_region_read<UINT32>)
+ .addCFunction ("read_i64", &lua_memory_region::l_region_read<INT64>)
+ .addCFunction ("read_u64", &lua_memory_region::l_region_read<UINT64>)
+ .addCFunction ("write_i8", &lua_memory_region::l_region_write<INT8>)
+ .addCFunction ("write_u8", &lua_memory_region::l_region_write<UINT8>)
+ .addCFunction ("write_i16", &lua_memory_region::l_region_write<INT16>)
+ .addCFunction ("write_u16", &lua_memory_region::l_region_write<UINT16>)
+ .addCFunction ("write_i32", &lua_memory_region::l_region_write<INT32>)
+ .addCFunction ("write_u32", &lua_memory_region::l_region_write<UINT32>)
+ .addCFunction ("write_i64", &lua_memory_region::l_region_write<INT64>)
+ .addCFunction ("write_u64", &lua_memory_region::l_region_write<UINT64>)
+ .endClass()
+ .beginClass <output_manager> ("output")
+ .addFunction ("set_value", &output_manager::set_value)
+ .addFunction ("set_indexed_value", &output_manager::set_indexed_value)
+ .addFunction ("get_value", &output_manager::get_value)
+ .addFunction ("get_indexed_value", &output_manager::get_indexed_value)
+ .addFunction ("name_to_id", &output_manager::name_to_id)
+ .addFunction ("id_to_name", &output_manager::id_to_name)
+ .endClass()
+ .deriveClass <memory_region, lua_memory_region> ("region")
+ .addProperty <UINT32> ("size", &memory_region::bytes)
+ .endClass()
+ .beginClass <device_image_interface> ("image")
+ .addFunction ("exists", &device_image_interface::exists)
+ .addFunction ("filename", &device_image_interface::filename)
+ .addFunction ("longname", &device_image_interface::longname)
+ .addFunction ("manufacturer", &device_image_interface::manufacturer)
+ .addFunction ("year", &device_image_interface::year)
+ .addFunction ("software_list_name", &device_image_interface::software_list_name)
+ .addFunction ("image_type_name", &device_image_interface::image_type_name)
+ .addFunction ("load", &device_image_interface::load)
+ .addFunction ("unload", &device_image_interface::unload)
+ .addFunction ("crc", &device_image_interface::crc)
+ .addProperty <const device_t &> ("device", static_cast<const device_t &(device_image_interface::*)() const>(&device_image_interface::device))
+ .addProperty <bool> ("is_readable", &device_image_interface::is_readable)
+ .addProperty <bool> ("is_writeable", &device_image_interface::is_writeable)
+ .addProperty <bool> ("is_creatable", &device_image_interface::is_creatable)
+ .addProperty <bool> ("is_reset_on_load", &device_image_interface::is_reset_on_load)
+ .endClass()
+ .beginClass <lua_emu_file> ("file")
+ .addConstructor <void (*)(const char *, UINT32)> ()
+ .addCFunction ("read", &lua_emu_file::l_emu_file_read)
+ .addFunction ("open", &lua_emu_file::open)
+ .addFunction ("open_next", &lua_emu_file::open_next)
+ .addFunction ("seek", &lua_emu_file::seek)
+ .addFunction ("size", &lua_emu_file::size)
+ .addFunction ("filename", &lua_emu_file::filename)
+ .addFunction ("fullpath", &lua_emu_file::fullpath)
+ .endClass()
+ .beginClass <lua_item> ("item")
+ .addConstructor <void (*)(int)> ()
+ .addData ("size", &lua_item::l_item_size, false)
+ .addData ("count", &lua_item::l_item_count, false)
+ .addCFunction ("read", &lua_item::l_item_read)
+ .addCFunction ("read_block", &lua_item::l_item_read_block)
+ .addCFunction ("write", &lua_item::l_item_write)
+ .endClass()
+ .endNamespace();
+
+ luabridge::push (m_lua_state, mame_machine_manager::instance());
+ lua_setglobal(m_lua_state, "manager");
+}
+
+void lua_engine::start_console()
+{
+ std::thread th(::serve_lua, this);
+ th.detach();
+}
+
+//-------------------------------------------------
+// frame_hook - called at each frame refresh, used to draw a HUD
+//-------------------------------------------------
+bool lua_engine::frame_hook()
+{
+ bool is_cb_hooked = false;
+ if (m_machine != nullptr) {
+ // invoke registered callback (if any)
+ is_cb_hooked = hook_frame_cb.active();
+ if (is_cb_hooked) {
+ lua_State *L = hook_frame_cb.precall();
+ hook_frame_cb.call(this, L, 0);
+ }
+ }
+ return is_cb_hooked;
+}
+
+void lua_engine::periodic_check()
+{
+ std::lock_guard<std::mutex> lock(g_mutex);
+ if (msg.ready == 1) {
+ lua_settop(m_lua_state, 0);
+ int status = luaL_loadbuffer(m_lua_state, msg.text.c_str(), msg.text.length(), "=stdin");
+ if (incomplete(status)==0) /* cannot try to add lines? */
+ {
+ if (status == LUA_OK) status = docall(0, LUA_MULTRET);
+ report(status);
+ if (status == LUA_OK && lua_gettop(m_lua_state) > 0) /* any result to print? */
+ {
+ luaL_checkstack(m_lua_state, LUA_MINSTACK, "too many results to print");
+ lua_getglobal(m_lua_state, "print");
+ lua_insert(m_lua_state, 1);
+ if (lua_pcall(m_lua_state, lua_gettop(m_lua_state) - 1, 0, 0) != LUA_OK)
+ lua_writestringerror("%s\n", lua_pushfstring(m_lua_state,
+ "error calling " LUA_QL("print") " (%s)",
+ lua_tostring(m_lua_state, -1)));
+ }
+ }
+ else
+ {
+ status = -1;
+ }
+ msg.status = status;
+ msg.response = msg.text;
+ msg.text = "";
+ msg.ready = 0;
+ msg.done = 1;
+ }
+}
+
+//-------------------------------------------------
+// close - close and cleanup of lua engine
+//-------------------------------------------------
+
+void lua_engine::close()
+{
+ lua_settop(m_lua_state, 0); /* clear stack */
+ lua_close(m_lua_state);
+}
+
+//-------------------------------------------------
+// execute - load and execute script
+//-------------------------------------------------
+
+void lua_engine::load_script(const char *filename)
+{
+ int s = luaL_loadfile(m_lua_state, filename);
+ report(s);
+ update_machine();
+ start();
+}
+
+//-------------------------------------------------
+// execute_string - execute script from string
+//-------------------------------------------------
+
+void lua_engine::load_string(const char *value)
+{
+ int s = luaL_loadstring(m_lua_state, value);
+ report(s);
+ update_machine();
+ start();
+}
+
+//-------------------------------------------------
+// start - execute the loaded script
+//-------------------------------------------------
+
+void lua_engine::start()
+{
+ resume(m_lua_state);
+}
+
+
+//**************************************************************************
+// LuaBridge Stack specializations
+//**************************************************************************
+
+namespace luabridge {
+ template <>
+ struct Stack <unsigned long long> {
+ static inline void push (lua_State* L, unsigned long long value) {
+ lua_pushunsigned(L, static_cast <lua_Unsigned> (value));
+ }
+
+ static inline unsigned long long get (lua_State* L, int index) {
+ return static_cast <unsigned long long> (luaL_checkunsigned (L, index));
+ }
+ };
+}
diff --git a/src/frontend/mame/luaengine.h b/src/frontend/mame/luaengine.h
new file mode 100644
index 00000000000..0f18cb995b1
--- /dev/null
+++ b/src/frontend/mame/luaengine.h
@@ -0,0 +1,252 @@
+// license:BSD-3-Clause
+// copyright-holders:Miodrag Milanovic
+/***************************************************************************
+
+ luaengine.h
+
+ Controls execution of the core MAME system.
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
+#ifndef __LUA_ENGINE_H__
+#define __LUA_ENGINE_H__
+
+#include <map>
+
+// None is typedef'd already in SDL/X11 libs
+#ifdef None
+#undef None
+#endif
+
+class cheat_manager;
+
+struct lua_State;
+namespace luabridge
+{
+ class LuaRef;
+}
+
+class lua_engine
+{
+public:
+ // construction/destruction
+ lua_engine();
+ ~lua_engine();
+
+ void initialize();
+ void start_console();
+ void load_script(const char *filename);
+ void load_string(const char *value);
+
+ void serve_lua();
+ void periodic_check();
+ bool frame_hook();
+ void execute_function(const char *id);
+
+ struct menu_item {
+ std::string text;
+ std::string subtext;
+ std::string flags;
+ };
+ void menu_populate(std::string &menu, std::vector<menu_item> &menu_list);
+ bool menu_callback(std::string &menu, int index, std::string event);
+
+ void resume(lua_State *L, int nparam = 0, lua_State *root = nullptr);
+ void set_machine(running_machine *machine) { m_machine = machine; update_machine(); }
+ std::vector<std::string> &get_menu() { return m_menu; }
+ void attach_notifiers();
+ void on_frame_done();
+
+ int compile_with_env(const char *envname, const char *script, const char *env = nullptr);
+ template <typename Tout, typename Tin> Tout run(const char *envname, int ref, Tin in);
+ template <typename Tout> Tout run(const char *envname, int ref);
+ template <typename Tin> void run(const char *envname, int ref, Tin in);
+ void run(const char *envname, int ref);
+private:
+ struct hook {
+ lua_State *L;
+ int cb;
+
+ hook();
+ void set(lua_State *L, int idx);
+ lua_State *precall();
+ void call(lua_engine *engine, lua_State *T, int nparam);
+ bool active() const { return L != nullptr; }
+ };
+
+ static const char *const tname_ioport;
+
+ // internal state
+ lua_State *m_lua_state;
+ running_machine * m_machine;
+
+ std::vector<std::string> m_menu;
+
+ hook hook_output_cb;
+ bool output_notifier_set;
+
+ hook hook_frame_cb;
+
+ static lua_engine* luaThis;
+
+ std::map<lua_State *, std::pair<lua_State *, int> > thread_registry;
+
+ running_machine &machine() const { return *m_machine; }
+
+ void update_machine();
+
+ void on_machine_prestart();
+ void on_machine_start();
+ void on_machine_stop();
+ void on_machine_pause();
+ void on_machine_resume();
+ void on_machine_frame();
+
+ void output_notifier(const char *outname, INT32 value);
+ static void s_output_notifier(const char *outname, INT32 value, void *param);
+
+ void emu_after_done(void *_h, INT32 param);
+ int emu_after(lua_State *L);
+ int emu_wait(lua_State *L);
+ void emu_hook_output(lua_State *L);
+ void emu_set_hook(lua_State *L);
+
+ static int l_ioport_write(lua_State *L);
+ static int l_emu_after(lua_State *L);
+ static int l_emu_app_name(lua_State *L);
+ static int l_emu_app_version(lua_State *L);
+ static int l_emu_wait(lua_State *L);
+ static int l_emu_time(lua_State *L);
+ static int l_emu_gamename(lua_State *L);
+ static int l_emu_romname(lua_State *L);
+ static int l_emu_softname(lua_State *L);
+ static int l_emu_keypost(lua_State *L);
+ static int l_emu_hook_output(lua_State *L);
+ static int l_emu_exit(lua_State *L);
+ static int l_emu_start(lua_State *L);
+ static int l_emu_pause(lua_State *L);
+ static int l_emu_unpause(lua_State *L);
+ static int l_emu_set_hook(lua_State *L);
+ static int l_emu_register_prestart(lua_State *L);
+ static int l_emu_register_start(lua_State *L);
+ static int l_emu_register_stop(lua_State *L);
+ static int l_emu_register_pause(lua_State *L);
+ static int l_emu_register_resume(lua_State *L);
+ static int l_emu_register_frame(lua_State *L);
+ static int l_emu_register_frame_done(lua_State *L);
+ static int l_emu_register_menu(lua_State *L);
+ static std::string get_print_buffer(lua_State *L);
+ static int l_osd_printf_verbose(lua_State *L);
+ static int l_osd_printf_error(lua_State *L);
+ static int l_osd_printf_info(lua_State *L);
+ static int l_osd_printf_debug(lua_State *L);
+ static int register_function(lua_State *L, const char *id);
+
+ // "emu.machine" namespace
+ static luabridge::LuaRef l_machine_get_devices(const running_machine *r);
+ static luabridge::LuaRef l_machine_get_images(const running_machine *r);
+ static luabridge::LuaRef l_ioport_get_ports(const ioport_manager *i);
+ static luabridge::LuaRef l_render_get_targets(const render_manager *r);
+ static luabridge::LuaRef l_ioports_port_get_fields(const ioport_port *i);
+ static luabridge::LuaRef devtree_dfs(device_t *root, luabridge::LuaRef dev_table);
+ static luabridge::LuaRef l_dev_get_states(const device_t *d);
+ static UINT64 l_state_get_value(const device_state_entry *d);
+ static void l_state_set_value(device_state_entry *d, UINT64 v);
+ static luabridge::LuaRef l_dev_get_memspaces(const device_t *d);
+ struct lua_machine {
+ int l_popmessage(lua_State *L);
+ int l_logerror(lua_State *L);
+ };
+ struct lua_addr_space {
+ template<typename T> int l_mem_read(lua_State *L);
+ template<typename T> int l_mem_write(lua_State *L);
+ template<typename T> int l_direct_mem_read(lua_State *L);
+ template<typename T> int l_direct_mem_write(lua_State *L);
+ };
+ static luabridge::LuaRef l_addr_space_map(const address_space *as);
+
+ static luabridge::LuaRef l_machine_get_screens(const running_machine *r);
+ struct lua_screen {
+ int l_height(lua_State *L);
+ int l_width(lua_State *L);
+ int l_orientation(lua_State *L);
+ int l_refresh(lua_State *L);
+ int l_type(lua_State *L);
+ int l_snapshot(lua_State *L);
+ int l_draw_box(lua_State *L);
+ int l_draw_line(lua_State *L);
+ int l_draw_text(lua_State *L);
+ };
+ static luabridge::LuaRef l_dev_get_items(const device_t *d);
+
+ struct lua_video {
+ int l_begin_recording(lua_State *L);
+ int l_end_recording(lua_State *L);
+ };
+
+ static luabridge::LuaRef l_cheat_get_entries(const cheat_manager *c);
+ struct lua_cheat_entry {
+ int l_get_state(lua_State *L);
+ };
+
+ template<typename T> static luabridge::LuaRef l_options_get_entries(const T *o);
+ struct lua_options_entry {
+ int l_entry_value(lua_State *L);
+ };
+
+ static luabridge::LuaRef l_memory_get_banks(const memory_manager *m);
+ static luabridge::LuaRef l_memory_get_regions(const memory_manager *m);
+ struct lua_memory_region {
+ template<typename T> int l_region_read(lua_State *L);
+ template<typename T> int l_region_write(lua_State *L);
+ };
+
+ struct lua_emu_file {
+ lua_emu_file(const char *searchpath, UINT32 openflags) :
+ path(searchpath),
+ file(path.c_str(), openflags) {}
+
+ int l_emu_file_read(lua_State *L);
+ osd_file::error open(const char *name) {return file.open(name);}
+ osd_file::error open_next() {return file.open_next();}
+ int seek(INT64 offset, int whence) {return file.seek(offset, whence);}
+ UINT64 size() {return file.size();}
+ const char *filename() {return file.filename();}
+ const char *fullpath() {return file.fullpath();}
+
+ std::string path;
+ emu_file file;
+ };
+
+ struct lua_item {
+ lua_item(int index);
+ void *l_item_base;
+ unsigned int l_item_size;
+ unsigned int l_item_count;
+ int l_item_read(lua_State *L);
+ int l_item_read_block(lua_State *L);
+ int l_item_write(lua_State *L);
+ };
+ void run_internal(const char *env, int ref);
+
+ void resume(void *L, INT32 param);
+ void start();
+ static int luaopen_ioport(lua_State *L);
+ void close();
+
+ static void *checkparam(lua_State *L, int idx, const char *tname);
+ static void *getparam(lua_State *L, int idx, const char *tname);
+ static void push(lua_State *L, void *p, const char *tname);
+
+ int report(int status);
+ int docall(int narg, int nres);
+ int incomplete(int status) ;
+};
+
+#endif /* __LUA_ENGINE_H__ */
diff --git a/src/frontend/mame/mame.cpp b/src/frontend/mame/mame.cpp
new file mode 100644
index 00000000000..2be1ea0f615
--- /dev/null
+++ b/src/frontend/mame/mame.cpp
@@ -0,0 +1,393 @@
+// license:BSD-3-Clause
+// copyright-holders:Nicola Salmoria, Aaron Giles
+/***************************************************************************
+
+ mame.c
+
+ Controls execution of the core MAME system.
+****************************************************************************
+
+ Since there has been confusion in the past over the order of
+ initialization and other such things, here it is, all spelled out
+ as of January, 2008:
+
+ main()
+ - does platform-specific init
+ - calls mame_execute() [mame.c]
+
+ mame_execute() [mame.c]
+ - calls mame_validitychecks() [validity.c] to perform validity checks on all compiled drivers
+ - begins resource tracking (level 1)
+ - calls create_machine [mame.c] to initialize the running_machine structure
+ - calls init_machine() [mame.c]
+
+ init_machine() [mame.c]
+ - calls fileio_init() [fileio.c] to initialize file I/O info
+ - calls config_init() [config.c] to initialize configuration system
+ - calls input_init() [input.c] to initialize the input system
+ - calls output_init() [output.c] to initialize the output system
+ - calls state_init() [state.c] to initialize save state system
+ - calls state_save_allow_registration() [state.c] to allow registrations
+ - calls palette_init() [palette.c] to initialize palette system
+ - calls render_init() [render.c] to initialize the rendering system
+ - calls ui_init() [ui.c] to initialize the user interface
+ - calls generic_machine_init() [machine/generic.c] to initialize generic machine structures
+ - calls generic_video_init() [video/generic.c] to initialize generic video structures
+ - calls generic_sound_init() [audio/generic.c] to initialize generic sound structures
+ - calls timer_init() [timer.c] to reset the timer system
+ - calls osd_init() [osdepend.h] to do platform-specific initialization
+ - calls input_port_init() [inptport.c] to set up the input ports
+ - calls rom_init() [romload.c] to load the game's ROMs
+ - calls memory_init() [memory.c] to process the game's memory maps
+ - calls watchdog_init() [watchdog.c] to initialize the watchdog system
+ - calls the driver's DRIVER_INIT callback
+ - calls device_list_start() [devintrf.c] to start any devices
+ - calls video_init() [video.c] to start the video system
+ - calls tilemap_init() [tilemap.c] to start the tilemap system
+ - calls crosshair_init() [crsshair.c] to configure the crosshairs
+ - calls sound_init() [sound.c] to start the audio system
+ - calls debugger_init() [debugger.c] to set up the debugger
+ - calls the driver's MACHINE_START, SOUND_START, and VIDEO_START callbacks
+ - calls cheat_init() [cheat.c] to initialize the cheat system
+ - calls image_init() [image.c] to initialize the image system
+
+ - calls config_load_settings() [config.c] to load the configuration file
+ - calls nvram_load [machine/generic.c] to load NVRAM
+ - calls ui_display_startup_screens() [ui.c] to display the startup screens
+ - begins resource tracking (level 2)
+ - calls soft_reset() [mame.c] to reset all systems
+
+ -------------------( at this point, we're up and running )----------------------
+
+ - calls scheduler->timeslice() [schedule.c] over and over until we exit
+ - ends resource tracking (level 2), freeing all auto_mallocs and timers
+ - calls the nvram_save() [machine/generic.c] to save NVRAM
+ - calls config_save_settings() [config.c] to save the game's configuration
+ - calls all registered exit routines [mame.c]
+ - ends resource tracking (level 1), freeing all auto_mallocs and timers
+
+ - exits the program
+
+***************************************************************************/
+
+#include "emu.h"
+#include "mame.h"
+#include "emuopts.h"
+#include "mameopts.h"
+#include "osdepend.h"
+#include "validity.h"
+#include "clifront.h"
+#include "luaengine.h"
+#include <time.h>
+#include "ui/selgame.h"
+#include "ui/simpleselgame.h"
+#include "cheat.h"
+#include "ui/datfile.h"
+#include "ui/inifile.h"
+
+//**************************************************************************
+// MACHINE MANAGER
+//**************************************************************************
+
+mame_machine_manager* mame_machine_manager::m_manager = nullptr;
+
+mame_machine_manager* mame_machine_manager::instance(emu_options &options,osd_interface &osd)
+{
+ if(!m_manager)
+ {
+ m_manager = global_alloc(mame_machine_manager(options,osd));
+ }
+ return m_manager;
+}
+
+mame_machine_manager* mame_machine_manager::instance()
+{
+ return m_manager;
+}
+
+//-------------------------------------------------
+// mame_machine_manager - constructor
+//-------------------------------------------------
+
+mame_machine_manager::mame_machine_manager(emu_options &options,osd_interface &osd)
+ : machine_manager(options, osd),
+ m_plugins(std::make_unique<plugin_options>()),
+ m_lua(global_alloc(lua_engine)),
+ m_new_driver_pending(nullptr)
+{
+}
+
+
+//-------------------------------------------------
+// ~mame_machine_manager - destructor
+//-------------------------------------------------
+
+mame_machine_manager::~mame_machine_manager()
+{
+ global_free(m_lua);
+ m_manager = nullptr;
+}
+
+
+/***************************************************************************
+ GLOBAL VARIABLES
+***************************************************************************/
+
+//-------------------------------------------------
+// mame_schedule_new_driver - schedule a new game to
+// be loaded
+//-------------------------------------------------
+
+void mame_machine_manager::schedule_new_driver(const game_driver &driver)
+{
+ m_new_driver_pending = &driver;
+}
+
+
+/***************************************************************************
+ CORE IMPLEMENTATION
+***************************************************************************/
+void mame_machine_manager::update_machine()
+{
+ m_lua->set_machine(m_machine);
+ m_lua->attach_notifiers();
+}
+
+
+std::vector<std::string> split(const std::string &text, char sep)
+{
+ std::vector<std::string> tokens;
+ std::size_t start = 0, end = 0;
+ while ((end = text.find(sep, start)) != std::string::npos) {
+ std::string temp = text.substr(start, end - start);
+ if (temp != "") tokens.push_back(temp);
+ start = end + 1;
+ }
+ std::string temp = text.substr(start);
+ if (temp != "") tokens.push_back(temp);
+ return tokens;
+}
+
+void mame_machine_manager::start_luaengine()
+{
+ if (options().plugins())
+ {
+ path_iterator iter(options().plugins_path());
+ std::string pluginpath;
+ while (iter.next(pluginpath))
+ {
+ m_plugins->parse_json(pluginpath);
+ }
+ std::vector<std::string> include = split(options().plugin(),',');
+ std::vector<std::string> exclude = split(options().no_plugin(),',');
+ {
+ // parse the file
+ std::string error;
+ // attempt to open the output file
+ emu_file file(options().ini_path(), OPEN_FLAG_READ);
+ if (file.open("plugin.ini") == osd_file::error::NONE)
+ {
+ bool result = m_plugins->parse_ini_file((util::core_file&)file, OPTION_PRIORITY_MAME_INI, OPTION_PRIORITY_DRIVER_INI, error);
+ if (!result)
+ osd_printf_error("**Error loading plugin.ini**");
+ }
+ }
+ for (auto &curentry : *m_plugins)
+ {
+ if (!curentry.is_header())
+ {
+ if (std::find(include.begin(), include.end(), curentry.name()) != include.end())
+ {
+ std::string error_string;
+ m_plugins->set_value(curentry.name(), "1", OPTION_PRIORITY_CMDLINE, error_string);
+ }
+ if (std::find(exclude.begin(), exclude.end(), curentry.name()) != exclude.end())
+ {
+ std::string error_string;
+ m_plugins->set_value(curentry.name(), "0", OPTION_PRIORITY_CMDLINE, error_string);
+ }
+ }
+ }
+ }
+ m_lua->initialize();
+
+ {
+ emu_file file(options().plugins_path(), OPEN_FLAG_READ);
+ osd_file::error filerr = file.open("boot.lua");
+ if (filerr == osd_file::error::NONE)
+ {
+ m_lua->load_script(file.fullpath());
+ }
+ }
+}
+
+/*-------------------------------------------------
+ execute - run the core emulation
+-------------------------------------------------*/
+
+int mame_machine_manager::execute()
+{
+ bool started_empty = false;
+
+ bool firstgame = true;
+ bool firstrun = true;
+
+ // loop across multiple hard resets
+ bool exit_pending = false;
+ int error = EMU_ERR_NONE;
+
+ if (m_options.console()) {
+ m_lua->start_console();
+ }
+ while (error == EMU_ERR_NONE && !exit_pending)
+ {
+ m_new_driver_pending = nullptr;
+
+ // if no driver, use the internal empty driver
+ const game_driver *system = m_options.system();
+ if (system == nullptr)
+ {
+ system = &GAME_NAME(___empty);
+ if (firstgame)
+ started_empty = true;
+ }
+
+ firstgame = false;
+
+ // parse any INI files as the first thing
+ if (m_options.read_config())
+ {
+ m_options.revert(OPTION_PRIORITY_INI);
+ std::string errors;
+ mame_options::parse_standard_inis(m_options,errors);
+ }
+
+ // otherwise, perform validity checks before anything else
+ if (system != nullptr)
+ {
+ validity_checker valid(m_options);
+ valid.set_verbose(false);
+ valid.check_shared_source(*system);
+ }
+
+ // create the machine configuration
+ machine_config config(*system, m_options);
+
+ // create the machine structure and driver
+ running_machine machine(config, *this);
+
+ set_machine(&machine);
+
+ // run the machine
+ error = machine.run(firstrun);
+ firstrun = false;
+
+ // check the state of the machine
+ if (m_new_driver_pending)
+ {
+ // set up new system name and adjust device options accordingly
+ mame_options::set_system_name(m_options,m_new_driver_pending->name);
+ firstrun = true;
+ }
+ else
+ {
+ if (machine.exit_pending()) mame_options::set_system_name(m_options,"");
+ }
+
+ if (machine.exit_pending() && (!started_empty || (system == &GAME_NAME(___empty))))
+ exit_pending = true;
+
+ // machine will go away when we exit scope
+ set_machine(nullptr);
+ }
+ // return an error
+ return error;
+}
+
+TIMER_CALLBACK_MEMBER(mame_machine_manager::autoboot_callback)
+{
+ if (strlen(options().autoboot_script())!=0) {
+ mame_machine_manager::instance()->lua()->load_script(options().autoboot_script());
+ }
+ else if (strlen(options().autoboot_command())!=0) {
+ std::string cmd = std::string(options().autoboot_command());
+ strreplace(cmd, "'", "\\'");
+ std::string val = std::string("emu.keypost('").append(cmd).append("')");
+ mame_machine_manager::instance()->lua()->load_string(val.c_str());
+ }
+}
+
+void mame_machine_manager::reset()
+{
+ // setup autoboot if needed
+ m_autoboot_timer->adjust(attotime(options().autoboot_delay(),0),0);
+}
+
+ui_manager* mame_machine_manager::create_ui(running_machine& machine)
+{
+ m_ui = std::make_unique<mame_ui_manager>(machine);
+ m_ui->init();
+
+ machine.add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(mame_machine_manager::reset), this));
+
+ // start the inifile manager
+ m_inifile = std::make_unique<inifile_manager>(machine);
+
+ m_ui->set_startup_text("Initializing...", true);
+ // set up the cheat engine
+ m_cheat = std::make_unique<cheat_manager>(machine);
+
+ // allocate autoboot timer
+ m_autoboot_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(mame_machine_manager::autoboot_callback), this));
+
+ // start datfile manager
+ m_datfile = std::make_unique<datfile_manager>(machine);
+
+ // start favorite manager
+ m_favorite = std::make_unique<favorite_manager>(machine);
+
+ return m_ui.get();
+}
+
+void mame_machine_manager::ui_initialize(running_machine& machine,bool firstrun)
+{
+ m_ui->initialize(machine);
+
+ // display the startup screens
+ m_ui->display_startup_screens(firstrun);
+}
+
+const char * emulator_info::get_bare_build_version() { return bare_build_version; }
+const char * emulator_info::get_build_version() { return build_version; }
+
+void emulator_info::display_ui_chooser(running_machine& machine)
+{
+ // force the UI to show the game select screen
+ if (strcmp(machine.options().ui(), "simple") == 0) {
+ ui_simple_menu_select_game::force_game_select(machine, &machine.render().ui_container());
+ }
+ else {
+ ui_menu_select_game::force_game_select(machine, &machine.render().ui_container());
+ }
+}
+
+int emulator_info::start_frontend(emu_options &options, osd_interface &osd, int argc, char *argv[])
+{
+ cli_frontend frontend(options, osd);
+ return frontend.execute(argc, argv);
+}
+
+void emulator_info::draw_user_interface(running_machine& machine)
+{
+ mame_machine_manager::instance()->ui().update_and_render(&machine.render().ui_container());
+}
+
+void emulator_info::periodic_check()
+{
+ mame_machine_manager::instance()->lua()->periodic_check();
+}
+
+bool emulator_info::frame_hook()
+{
+ return mame_machine_manager::instance()->lua()->frame_hook();
+} \ No newline at end of file
diff --git a/src/frontend/mame/mame.h b/src/frontend/mame/mame.h
new file mode 100644
index 00000000000..33ce991e685
--- /dev/null
+++ b/src/frontend/mame/mame.h
@@ -0,0 +1,92 @@
+// license:BSD-3-Clause
+// copyright-holders:Nicola Salmoria, Aaron Giles
+/***************************************************************************
+
+ mame.h
+
+ Controls execution of the core MAME system.
+***************************************************************************/
+
+#pragma once
+
+#ifndef __EMU_H__
+#error Dont include this file directly; include emu.h instead.
+#endif
+
+#ifndef __MAME_H__
+#define __MAME_H__
+
+#include "emu.h"
+#include <time.h>
+#include "pluginopts.h"
+#include "ui/ui.h"
+
+class osd_interface;
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+class lua_engine;
+class cheat_manager;
+class datfile_manager;
+class inifile_manager;
+class favorite_manager;
+class mame_ui_manager;
+
+// ======================> machine_manager
+
+class mame_machine_manager : machine_manager
+{
+ DISABLE_COPYING(mame_machine_manager);
+private:
+ // construction/destruction
+ mame_machine_manager(emu_options &options, osd_interface &osd);
+public:
+ static mame_machine_manager *instance(emu_options &options, osd_interface &osd);
+ static mame_machine_manager *instance();
+ ~mame_machine_manager();
+
+ plugin_options &plugins() const { return *m_plugins; }
+ lua_engine *lua() { return m_lua; }
+
+ virtual void update_machine() override;
+
+ void reset();
+ TIMER_CALLBACK_MEMBER(autoboot_callback);
+
+ virtual ui_manager* create_ui(running_machine& machine) override;
+ virtual void ui_initialize(running_machine& machine,bool firstrun) override;
+
+ /* execute as configured by the OPTION_SYSTEMNAME option on the specified options */
+ int execute();
+ void start_luaengine();
+ void schedule_new_driver(const game_driver &driver);
+ mame_ui_manager& ui() const { assert(m_ui != nullptr); return *m_ui; }
+ cheat_manager &cheat() const { assert(m_cheat != nullptr); return *m_cheat; }
+ datfile_manager &datfile() const { assert(m_datfile != nullptr); return *m_datfile; }
+ inifile_manager &inifile() const { assert(m_inifile != nullptr); return *m_inifile; }
+ favorite_manager &favorite() const { assert(m_favorite != nullptr); return *m_favorite; }
+private:
+ std::unique_ptr<plugin_options> m_plugins; // pointer to plugin options
+ lua_engine * m_lua;
+
+ const game_driver * m_new_driver_pending; // pointer to the next pending driver
+
+ static mame_machine_manager* m_manager;
+ emu_timer *m_autoboot_timer; // autoboot timer
+ std::unique_ptr<mame_ui_manager> m_ui; // internal data from ui.cpp
+ std::unique_ptr<cheat_manager> m_cheat; // internal data from cheat.cpp
+ std::unique_ptr<datfile_manager> m_datfile; // internal data from datfile.c
+ std::unique_ptr<inifile_manager> m_inifile; // internal data from inifile.c for INIs
+ std::unique_ptr<favorite_manager> m_favorite; // internal data from inifile.c for favorites
+
+};
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+extern const char build_version[];
+extern const char bare_build_version[];
+
+#endif /* __MAME_H__ */
diff --git a/src/frontend/mame/mameopts.cpp b/src/frontend/mame/mameopts.cpp
new file mode 100644
index 00000000000..a0754f4cfd5
--- /dev/null
+++ b/src/frontend/mame/mameopts.cpp
@@ -0,0 +1,426 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+/***************************************************************************
+
+ mameopts.c
+
+ Options file and command line management.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "mameopts.h"
+#include "drivenum.h"
+#include "softlist.h"
+
+#include <ctype.h>
+
+int mame_options::m_slot_options = 0;
+int mame_options::m_device_options = 0;
+
+//-------------------------------------------------
+// add_slot_options - add all of the slot
+// options for the configured system
+//-------------------------------------------------
+
+bool mame_options::add_slot_options(emu_options &options, const software_part *swpart)
+{
+ // look up the system configured by name; if no match, do nothing
+ const game_driver *cursystem = options.system();
+ if (cursystem == nullptr)
+ return false;
+
+ // create the configuration
+ machine_config config(*cursystem, options);
+
+ // iterate through all slot devices
+ int starting_count = options.options_count();
+ for (const device_slot_interface &slot : slot_interface_iterator(config.root_device()))
+ {
+ // skip fixed slots
+ if (slot.fixed())
+ continue;
+
+ // retrieve info about the device instance
+ const char *name = slot.device().tag() + 1;
+ if (!options.exists(name))
+ {
+ // first device? add the header as to be pretty
+ if (m_slot_options++ == 0)
+ options.add_entry(nullptr, "SLOT DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE);
+
+ // add the option
+ options.add_entry(name, nullptr, OPTION_STRING | OPTION_FLAG_DEVICE, slot.default_option(), true);
+ }
+
+ // allow software lists to supply their own defaults
+ if (swpart != nullptr)
+ {
+ std::string featurename = std::string(name).append("_default");
+ const char *value = swpart->feature(featurename.c_str());
+ if (value != nullptr && (*value == '\0' || slot.option(value) != nullptr))
+ {
+ // set priority above INIs but below actual command line
+ std::string error;
+ options.set_value(name, value, OPTION_PRIORITY_SUBCMD, error);
+ }
+ }
+ }
+ return (options.options_count() != starting_count);
+}
+
+
+//-------------------------------------------------
+// update_slot_options - update slot values
+// depending of image mounted
+//-------------------------------------------------
+
+void mame_options::update_slot_options(emu_options &options, const software_part *swpart)
+{
+ // look up the system configured by name; if no match, do nothing
+ const game_driver *cursystem = options.system();
+ if (cursystem == nullptr)
+ return;
+ machine_config config(*cursystem, options);
+
+ // iterate through all slot devices
+ for (device_slot_interface &slot : slot_interface_iterator(config.root_device()))
+ {
+ // retrieve info about the device instance
+ const char *name = slot.device().tag() + 1;
+ if (options.exists(name) && !slot.option_list().empty())
+ {
+ std::string defvalue = slot.get_default_card_software();
+ if (defvalue.empty())
+ {
+ // keep any non-default setting
+ if (options.priority(name) > OPTION_PRIORITY_DEFAULT)
+ continue;
+
+ // reinstate the actual default value as configured
+ if (slot.default_option() != nullptr)
+ defvalue.assign(slot.default_option());
+ }
+
+ // set the value and hide the option if not selectable
+ options.set_default_value(name, defvalue.c_str());
+ const device_slot_option *option = slot.option(defvalue.c_str());
+ options.set_flag(name, ~OPTION_FLAG_INTERNAL, (option != nullptr && !option->selectable()) ? OPTION_FLAG_INTERNAL : 0);
+ }
+ }
+ while (add_slot_options(options,swpart)) {}
+ add_device_options(options);
+}
+
+
+//-------------------------------------------------
+// add_device_options - add all of the device
+// options for the configured system
+//-------------------------------------------------
+
+void mame_options::add_device_options(emu_options &options)
+{
+ // look up the system configured by name; if no match, do nothing
+ const game_driver *cursystem = options.system();
+ if (cursystem == nullptr)
+ return;
+ machine_config config(*cursystem, options);
+
+ // iterate through all image devices
+ for (const device_image_interface &image : image_interface_iterator(config.root_device()))
+ {
+ if (!image.user_loadable())
+ continue;
+
+ // retrieve info about the device instance
+ std::ostringstream option_name;
+ util::stream_format(option_name, "%s;%s", image.instance_name(), image.brief_instance_name());
+ if (strcmp(image.device_typename(image.image_type()), image.instance_name()) == 0)
+ util::stream_format(option_name, ";%s1;%s1", image.instance_name(), image.brief_instance_name());
+
+ // add the option
+ if (!options.exists(image.instance_name()))
+ {
+ // first device? add the header as to be pretty
+ if (m_device_options++ == 0)
+ options.add_entry(nullptr, "IMAGE DEVICES", OPTION_HEADER | OPTION_FLAG_DEVICE);
+
+ // add the option
+ options.add_entry(option_name.str().c_str(), nullptr, OPTION_STRING | OPTION_FLAG_DEVICE, nullptr, true);
+ }
+ }
+}
+
+
+//-------------------------------------------------
+// remove_device_options - remove device options
+//-------------------------------------------------
+
+void mame_options::remove_device_options(emu_options &options)
+{
+ // iterate through options and remove interesting ones
+ core_options::entry *nextentry;
+ for (auto *curentry = options.first(); curentry != nullptr; curentry = nextentry)
+ {
+ // pre-fetch the next entry in case we delete this one
+ nextentry = curentry->next();
+
+ // if this is a device option, nuke it
+ if ((curentry->flags() & OPTION_FLAG_DEVICE) != 0)
+ options.remove_entry(*curentry);
+ }
+
+ // take also care of ramsize options
+ options.set_default_value(OPTION_RAMSIZE, "");
+
+ // reset counters
+ m_slot_options = 0;
+ m_device_options = 0;
+}
+
+
+//-------------------------------------------------
+// parse_slot_devices - parse the command line
+// and update slot and image devices
+//-------------------------------------------------
+
+bool mame_options::parse_slot_devices(emu_options &options, int argc, char *argv[], std::string &error_string, const char *name, const char *value, const software_part *swpart)
+{
+ // an initial parse to capture the initial set of values
+ bool result;
+
+ options.parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
+
+ // keep adding slot options until we stop seeing new stuff
+ while (add_slot_options(options,swpart))
+ options.parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
+
+ // add device options and reparse
+ add_device_options(options);
+ if (name != nullptr && options.exists(name))
+ options.set_value(name, value, OPTION_PRIORITY_SUBCMD, error_string);
+ options.parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
+
+ int num;
+ do {
+ num = options.options_count();
+ update_slot_options(options,swpart);
+ result = options.parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
+ } while (num != options.options_count());
+
+ options.update_cached_options();
+
+ return result;
+}
+
+
+//-------------------------------------------------
+// parse_command_line - parse the command line
+// and update the devices
+//-------------------------------------------------
+
+bool mame_options::parse_command_line(emu_options &options, int argc, char *argv[], std::string &error_string)
+{
+ // parse as normal
+ options.parse_command_line(argc, argv, OPTION_PRIORITY_CMDLINE, error_string);
+ bool result = parse_slot_devices(options,argc, argv, error_string);
+ options.update_cached_options();
+ return result;
+}
+
+
+//-------------------------------------------------
+// parse_standard_inis - parse the standard set
+// of INI files
+//-------------------------------------------------
+
+void mame_options::parse_standard_inis(emu_options &options, std::string &error_string, const game_driver *driver)
+{
+ // start with an empty string
+ error_string.clear();
+
+ // parse the INI file defined by the platform (e.g., "mame.ini")
+ // we do this twice so that the first file can change the INI path
+ parse_one_ini(options,emulator_info::get_configname(), OPTION_PRIORITY_MAME_INI);
+ parse_one_ini(options,emulator_info::get_configname(), OPTION_PRIORITY_MAME_INI, &error_string);
+
+ // debug mode: parse "debug.ini" as well
+ if (options.debug())
+ parse_one_ini(options,"debug", OPTION_PRIORITY_DEBUG_INI, &error_string);
+
+ // if we have a valid system driver, parse system-specific INI files
+ const game_driver *cursystem = (driver == nullptr) ? options.system() : driver;
+ if (cursystem == nullptr)
+ return;
+
+ // parse "vertical.ini" or "horizont.ini"
+ if (cursystem->flags & ORIENTATION_SWAP_XY)
+ parse_one_ini(options,"vertical", OPTION_PRIORITY_ORIENTATION_INI, &error_string);
+ else
+ parse_one_ini(options,"horizont", OPTION_PRIORITY_ORIENTATION_INI, &error_string);
+
+ if (cursystem->flags & MACHINE_TYPE_ARCADE)
+ parse_one_ini(options,"arcade", OPTION_PRIORITY_SYSTYPE_INI, &error_string);
+ else if (cursystem->flags & MACHINE_TYPE_CONSOLE)
+ parse_one_ini(options,"console", OPTION_PRIORITY_SYSTYPE_INI, &error_string);
+ else if (cursystem->flags & MACHINE_TYPE_COMPUTER)
+ parse_one_ini(options,"computer", OPTION_PRIORITY_SYSTYPE_INI, &error_string);
+ else if (cursystem->flags & MACHINE_TYPE_OTHER)
+ parse_one_ini(options,"othersys", OPTION_PRIORITY_SYSTYPE_INI, &error_string);
+
+ machine_config config(*cursystem, options);
+ for (const screen_device &device : screen_device_iterator(config.root_device()))
+ {
+ // parse "raster.ini" for raster games
+ if (device.screen_type() == SCREEN_TYPE_RASTER)
+ {
+ parse_one_ini(options,"raster", OPTION_PRIORITY_SCREEN_INI, &error_string);
+ break;
+ }
+ // parse "vector.ini" for vector games
+ if (device.screen_type() == SCREEN_TYPE_VECTOR)
+ {
+ parse_one_ini(options,"vector", OPTION_PRIORITY_SCREEN_INI, &error_string);
+ break;
+ }
+ // parse "lcd.ini" for lcd games
+ if (device.screen_type() == SCREEN_TYPE_LCD)
+ {
+ parse_one_ini(options,"lcd", OPTION_PRIORITY_SCREEN_INI, &error_string);
+ break;
+ }
+ }
+
+ // next parse "source/<sourcefile>.ini"; if that doesn't exist, try <sourcefile>.ini
+ std::string sourcename = core_filename_extract_base(cursystem->source_file, true).insert(0, "source" PATH_SEPARATOR);
+ if (!parse_one_ini(options,sourcename.c_str(), OPTION_PRIORITY_SOURCE_INI, &error_string))
+ {
+ sourcename = core_filename_extract_base(cursystem->source_file, true);
+ parse_one_ini(options,sourcename.c_str(), OPTION_PRIORITY_SOURCE_INI, &error_string);
+ }
+
+ // then parse the grandparent, parent, and system-specific INIs
+ int parent = driver_list::clone(*cursystem);
+ int gparent = (parent != -1) ? driver_list::clone(parent) : -1;
+ if (gparent != -1)
+ parse_one_ini(options,driver_list::driver(gparent).name, OPTION_PRIORITY_GPARENT_INI, &error_string);
+ if (parent != -1)
+ parse_one_ini(options,driver_list::driver(parent).name, OPTION_PRIORITY_PARENT_INI, &error_string);
+ parse_one_ini(options,cursystem->name, OPTION_PRIORITY_DRIVER_INI, &error_string);
+
+ // Re-evaluate slot options after loading ini files
+ update_slot_options(options);
+
+ options.update_cached_options();
+}
+
+//-------------------------------------------------
+// set_system_name - set a new system name
+//-------------------------------------------------
+
+void mame_options::set_system_name(emu_options &options, const char *name)
+{
+ // remember the original system name
+ std::string old_system_name(options.system_name());
+ bool new_system = old_system_name.compare(name) != 0;
+
+ // if the system name changed, fix up the device options
+ if (new_system)
+ {
+ // first set the new name
+ std::string error;
+ options.set_value(OPTION_SYSTEMNAME, name, OPTION_PRIORITY_CMDLINE, error);
+ assert(error.empty());
+
+ // remove any existing device options
+ remove_device_options(options);
+ }
+ else
+ {
+ // revert device options set for the old software
+ options.revert(OPTION_PRIORITY_SUBCMD, OPTION_PRIORITY_SUBCMD);
+ }
+
+ // get the new system
+ const game_driver *cursystem = options.system();
+ if (cursystem == nullptr)
+ return;
+
+ if (*options.software_name() != 0)
+ {
+ std::string sw_load(options.software_name());
+ std::string sw_list, sw_name, sw_part, sw_instance, error_string;
+ int left = sw_load.find_first_of(':');
+ int middle = sw_load.find_first_of(':', left + 1);
+ int right = sw_load.find_last_of(':');
+
+ sw_list = sw_load.substr(0, left - 1);
+ sw_name = sw_load.substr(left + 1, middle - left - 1);
+ sw_part = sw_load.substr(middle + 1, right - middle - 1);
+ sw_instance = sw_load.substr(right + 1);
+ sw_load.assign(sw_load.substr(0, right));
+
+ // look up the software part
+ machine_config config(*cursystem, options);
+ software_list_device *swlist = software_list_device::find_by_name(config, sw_list.c_str());
+ software_info *swinfo = swlist != nullptr ? swlist->find(sw_name.c_str()) : nullptr;
+ software_part *swpart = swinfo != nullptr ? swinfo->find_part(sw_part.c_str()) : nullptr;
+
+ // then add the options
+ if (new_system)
+ {
+ while (add_slot_options(options,swpart)) {}
+ add_device_options(options);
+ }
+
+ options.set_value(OPTION_SOFTWARENAME, sw_name.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
+ if (options.exists(sw_instance.c_str()))
+ options.set_value(sw_instance.c_str(), sw_load.c_str(), OPTION_PRIORITY_SUBCMD, error_string);
+
+ int num;
+ do {
+ num = options.options_count();
+ update_slot_options(options,swpart);
+ } while (num != options.options_count());
+ }
+ else if (new_system)
+ {
+ // add the options afresh
+ while (add_slot_options(options)) {}
+ add_device_options(options);
+ int num;
+ do {
+ num = options.options_count();
+ update_slot_options(options);
+ } while (num != options.options_count());
+ }
+}
+
+//-------------------------------------------------
+// parse_one_ini - parse a single INI file
+//-------------------------------------------------
+
+bool mame_options::parse_one_ini(emu_options &options, const char *basename, int priority, std::string *error_string)
+{
+ // don't parse if it has been disabled
+ if (!options.read_config())
+ return false;
+
+ // open the file; if we fail, that's ok
+ emu_file file(options.ini_path(), OPEN_FLAG_READ);
+ osd_file::error filerr = file.open(basename, ".ini");
+ if (filerr != osd_file::error::NONE)
+ return false;
+
+ // parse the file
+ osd_printf_verbose("Parsing %s.ini\n", basename);
+ std::string error;
+ bool result = options.parse_ini_file((util::core_file&)file, priority, OPTION_PRIORITY_DRIVER_INI, error);
+
+ // append errors if requested
+ if (!error.empty() && error_string)
+ error_string->append(string_format("While parsing %s:\n%s\n", file.fullpath(), error));
+
+ return result;
+}
+
diff --git a/src/frontend/mame/mameopts.h b/src/frontend/mame/mameopts.h
new file mode 100644
index 00000000000..50b1ae5b776
--- /dev/null
+++ b/src/frontend/mame/mameopts.h
@@ -0,0 +1,78 @@
+// license:BSD-3-Clause
+// copyright-holders:Aaron Giles
+/***************************************************************************
+
+ mameopts.h
+
+ Options file and command line management.
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __MAMEOPTS_H__
+#define __MAMEOPTS_H__
+
+#include "emuopts.h"
+
+//**************************************************************************
+// CONSTANTS
+//**************************************************************************
+#undef OPTION_PRIORITY_CMDLINE
+
+// option priorities
+enum
+{
+ // command-line options are HIGH priority
+ OPTION_PRIORITY_SUBCMD = OPTION_PRIORITY_HIGH,
+ OPTION_PRIORITY_CMDLINE,
+
+ // INI-based options are NORMAL priority, in increasing order:
+ OPTION_PRIORITY_MAME_INI = OPTION_PRIORITY_NORMAL + 1,
+ OPTION_PRIORITY_DEBUG_INI,
+ OPTION_PRIORITY_ORIENTATION_INI,
+ OPTION_PRIORITY_SYSTYPE_INI,
+ OPTION_PRIORITY_SCREEN_INI,
+ OPTION_PRIORITY_SOURCE_INI,
+ OPTION_PRIORITY_GPARENT_INI,
+ OPTION_PRIORITY_PARENT_INI,
+ OPTION_PRIORITY_DRIVER_INI,
+ OPTION_PRIORITY_INI,
+};
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// forward references
+struct game_driver;
+class software_part;
+
+class mame_options
+{
+ static const UINT32 OPTION_FLAG_DEVICE = 0x80000000;
+
+public:
+ // parsing wrappers
+ static bool parse_command_line(emu_options &options, int argc, char *argv[], std::string &error_string);
+ static void parse_standard_inis(emu_options &options, std::string &error_string, const game_driver *driver = nullptr);
+ static bool parse_slot_devices(emu_options &options, int argc, char *argv[], std::string &error_string, const char *name = nullptr, const char *value = nullptr, const software_part *swpart = nullptr);
+ // FIXME: Couriersud: This should be in image_device_exit
+ static void remove_device_options(emu_options &options);
+
+ static void set_system_name(emu_options &options, const char *name);
+ static bool add_slot_options(emu_options &options, const software_part *swpart = nullptr);
+private:
+ // device-specific option handling
+ static void add_device_options(emu_options &options);
+ static void update_slot_options(emu_options &options, const software_part *swpart = nullptr);
+
+ // INI parsing helper
+ static bool parse_one_ini(emu_options &options, const char *basename, int priority, std::string *error_string = nullptr);
+
+ static int m_slot_options;
+ static int m_device_options;
+
+};
+
+#endif /* __MAMEOPTS_H__ */
diff --git a/src/frontend/mame/pluginopts.cpp b/src/frontend/mame/pluginopts.cpp
new file mode 100644
index 00000000000..90b4b138cab
--- /dev/null
+++ b/src/frontend/mame/pluginopts.cpp
@@ -0,0 +1,97 @@
+// license:BSD-3-Clause
+// copyright-holders:Miodrag Milanovic
+/***************************************************************************
+
+ pluginopts.cpp
+
+ Plugin options manager.
+
+***************************************************************************/
+#include <fstream>
+#include "emu.h"
+#include "pluginopts.h"
+
+#include <rapidjson/document.h>
+#include <rapidjson/error/en.h>
+#include <rapidjson/istreamwrapper.h>
+#include <fstream>
+
+//**************************************************************************
+// PLUGIN OPTIONS
+//**************************************************************************
+
+const options_entry plugin_options::s_option_entries[] =
+{
+ { nullptr, nullptr, OPTION_HEADER, "PLUGINS OPTIONS" },
+ { nullptr }
+};
+
+//-------------------------------------------------
+// plugin_options - constructor
+//-------------------------------------------------
+
+plugin_options::plugin_options()
+: core_options()
+{
+ add_entries(plugin_options::s_option_entries);
+}
+
+
+void plugin_options::parse_json(std::string path)
+{
+ // first try to open as a directory
+ osd_directory *directory = osd_opendir(path.c_str());
+ if (directory != nullptr)
+ {
+ // iterate over all files in the directory
+ for (const osd_directory_entry *entry = osd_readdir(directory); entry != nullptr; entry = osd_readdir(directory))
+ {
+ if (entry->type == ENTTYPE_FILE)
+ {
+ std::string name = entry->name;
+ if (name == "plugin.json")
+ {
+ std::string curfile = std::string(path).append(PATH_SEPARATOR).append(entry->name);
+ std::ifstream ifs(curfile);
+ rapidjson::IStreamWrapper isw(ifs);
+ rapidjson::Document document;
+ document.ParseStream<0>(isw);
+
+ if (document.HasParseError()) {
+ std::string error(GetParseError_En(document.GetParseError()));
+ osd_printf_error("Unable to parse plugin definition file %s. Errors returned:\n", curfile.c_str());
+ osd_printf_error("%s\n", error.c_str());
+ return;
+ }
+
+ if (document["plugin"].IsObject())
+ {
+ std::string name = document["plugin"]["name"].GetString();
+ std::string description = document["plugin"]["description"].GetString();
+ std::string type = document["plugin"]["type"].GetString();
+ bool start = false;
+ if (document["plugin"].HasMember("start") && (std::string(document["plugin"]["start"].GetString()) == "true"))
+ start = true;
+
+ if (type=="plugin")
+ {
+ add_entry(core_strdup(name.c_str()),core_strdup(description.c_str()), OPTION_BOOLEAN, start ? "1" : "0");
+ }
+ }
+
+ }
+ }
+ else if (entry->type == ENTTYPE_DIR)
+ {
+ std::string name = entry->name;
+ if (!(name == "." || name == ".."))
+ {
+ parse_json(path + PATH_SEPARATOR + name);
+ }
+ }
+ }
+
+ // close the directory and be done
+ osd_closedir(directory);
+ }
+}
diff --git a/src/frontend/mame/pluginopts.h b/src/frontend/mame/pluginopts.h
new file mode 100644
index 00000000000..91aa68c2208
--- /dev/null
+++ b/src/frontend/mame/pluginopts.h
@@ -0,0 +1,29 @@
+// license:BSD-3-Clause
+// copyright-holders:Miodrag Milanovic
+/***************************************************************************
+
+ pluginopts.cpp
+
+ Plugin options manager.
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __PLUGIN_OPTS_H__
+#define __PLUGIN_OPTS_H__
+
+#include "options.h"
+
+class plugin_options : public core_options
+{
+public:
+ // construction/destruction
+ plugin_options();
+
+ void parse_json(std::string path);
+private:
+ static const options_entry s_option_entries[];
+};
+
+#endif /* __PLUGIN_OPTS_H__ */
diff --git a/src/frontend/mame/ui/auditmenu.cpp b/src/frontend/mame/ui/auditmenu.cpp
new file mode 100644
index 00000000000..3c1ddace6cf
--- /dev/null
+++ b/src/frontend/mame/ui/auditmenu.cpp
@@ -0,0 +1,204 @@
+// license:BSD-3-Clause
+// copyright-holders:Maurizio Petrarota
+/*********************************************************************
+
+ ui/auditmenu.cpp
+
+ Internal UI user interface.
+
+*********************************************************************/
+
+#include "emu.h"
+#include "ui/ui.h"
+#include "ui/menu.h"
+#include "audit.h"
+#include "ui/auditmenu.h"
+
+extern const char UI_VERSION_TAG[];
+
+//-------------------------------------------------
+// sort
+//-------------------------------------------------
+
+inline int cs_stricmp(const char *s1, const char *s2)
+{
+ for (;;)
+ {
+ int c1 = tolower((UINT8)*s1++);
+ int c2 = tolower((UINT8)*s2++);
+ if (c1 == 0 || c1 != c2)
+ return c1 - c2;
+ }
+}
+
+bool sorted_game_list(const game_driver *x, const game_driver *y)
+{
+ bool clonex = strcmp(x->parent, "0");
+ bool cloney = strcmp(y->parent, "0");
+
+ if (!clonex && !cloney)
+ return (cs_stricmp(x->description, y->description) < 0);
+
+ int cx = -1, cy = -1;
+ if (clonex)
+ {
+ cx = driver_list::find(x->parent);
+ if (cx == -1 || (driver_list::driver(cx).flags & MACHINE_IS_BIOS_ROOT) != 0)
+ clonex = false;
+ }
+
+ if (cloney)
+ {
+ cy = driver_list::find(y->parent);
+ if (cy == -1 || (driver_list::driver(cy).flags & MACHINE_IS_BIOS_ROOT) != 0)
+ cloney = false;
+ }
+
+ if (!clonex && !cloney)
+ return (cs_stricmp(x->description, y->description) < 0);
+ else if (clonex && cloney)
+ {
+ if (!cs_stricmp(x->parent, y->parent))
+ return (cs_stricmp(x->description, y->description) < 0);
+ else
+ return (cs_stricmp(driver_list::driver(cx).description, driver_list::driver(cy).description) < 0);
+ }
+ else if (!clonex && cloney)
+ {
+ if (!cs_stricmp(x->name, y->parent))
+ return true;
+ else
+ return (cs_stricmp(x->description, driver_list::driver(cy).description) < 0);
+ }
+ else
+ {
+ if (!cs_stricmp(x->parent, y->name))
+ return false;
+ else
+ return (cs_stricmp(driver_list::driver(cx).description, y->description) < 0);
+ }
+}
+
+//-------------------------------------------------
+// ctor / dtor
+//-------------------------------------------------
+
+ui_menu_audit::ui_menu_audit(running_machine &machine, render_container *container, vptr_game &availablesorted, vptr_game &unavailablesorted, int _audit_mode)
+ : ui_menu(machine, container)
+ , m_availablesorted(availablesorted)
+ , m_unavailablesorted(unavailablesorted)
+ , m_audit_mode(_audit_mode)
+ , m_first(true)
+{
+ if (m_audit_mode == 2)
+ {
+ m_availablesorted.clear();
+ m_unavailablesorted.clear();
+ }
+}
+
+ui_menu_audit::~ui_menu_audit()
+{
+}
+
+//-------------------------------------------------
+// handle
+//-------------------------------------------------
+
+void ui_menu_audit::handle()
+{
+ process(UI_MENU_PROCESS_CUSTOM_ONLY);
+
+ if (m_first)
+ {
+ mame_machine_manager::instance()->ui().draw_text_box(container, _("Audit in progress..."), JUSTIFY_CENTER, 0.5f, 0.5f, UI_GREEN_COLOR);
+ m_first = false;
+ return;
+ }
+
+ if (m_audit_mode == 1)
+ {
+ vptr_game::iterator iter = m_unavailablesorted.begin();
+ while (iter != m_unavailablesorted.end())
+ {
+ driver_enumerator enumerator(machine().options(), (*iter)->name);
+ enumerator.next();
+ media_auditor auditor(enumerator);
+ media_auditor::summary summary = auditor.audit_media(AUDIT_VALIDATE_FAST);
+
+ // if everything looks good, include the driver
+ if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED)
+ {
+ m_availablesorted.push_back((*iter));
+ iter = m_unavailablesorted.erase(iter);
+ }
+ else
+ ++iter;
+ }
+ }
+ else
+ {
+ driver_enumerator enumerator(machine().options());
+ media_auditor auditor(enumerator);
+ while (enumerator.next())
+ {
+ media_auditor::summary summary = auditor.audit_media(AUDIT_VALIDATE_FAST);
+
+ // if everything looks good, include the driver
+ if (summary == media_auditor::CORRECT || summary == media_auditor::BEST_AVAILABLE || summary == media_auditor::NONE_NEEDED)
+ m_availablesorted.push_back(&enumerator.driver());
+ else
+ m_unavailablesorted.push_back(&enumerator.driver());
+ }
+ }
+
+ // sort
+ std::stable_sort(m_availablesorted.begin(), m_availablesorted.end(), sorted_game_list);
+ std::stable_sort(m_unavailablesorted.begin(), m_unavailablesorted.end(), sorted_game_list);
+ save_available_machines();
+ ui_menu::menu_stack->parent->reset(UI_MENU_RESET_SELECT_FIRST);
+ ui_menu::stack_pop(machine());
+}
+
+//-------------------------------------------------
+// populate
+//-------------------------------------------------
+
+void ui_menu_audit::populate()
+{
+ item_append("Dummy", nullptr, 0, (void *)(FPTR)1);
+}
+
+//-------------------------------------------------
+// save drivers infos to file
+//-------------------------------------------------
+
+void ui_menu_audit::save_available_machines()
+{
+ // attempt to open the output file
+ emu_file file(mame_machine_manager::instance()->ui().options().ui_path(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ if (file.open(emulator_info::get_configname(), "_avail.ini") == osd_file::error::NONE)
+ {
+ // generate header
+ std::ostringstream buffer;
+ buffer << "#\n" << UI_VERSION_TAG << emulator_info::get_bare_build_version() << "\n#\n\n";
+ util::stream_format(buffer, "%d\n", m_availablesorted.size());
+ util::stream_format(buffer, "%d\n", m_unavailablesorted.size());
+
+ // generate available list
+ for (size_t x = 0; x < m_availablesorted.size(); ++x)
+ {
+ int find = driver_list::find(m_availablesorted[x]->name);
+ util::stream_format(buffer, "%d\n", find);
+ }
+
+ // generate unavailable list
+ for (size_t x = 0; x < m_unavailablesorted.size(); ++x)
+ {
+ int find = driver_list::find(m_unavailablesorted[x]->name);
+ util::stream_format(buffer, "%d\n", find);
+ }
+ file.puts(buffer.str().c_str());
+ file.close();
+ }
+}
diff --git a/src/frontend/mame/ui/auditmenu.h b/src/frontend/mame/ui/auditmenu.h
new file mode 100644
index 00000000000..b63bbb6507b
--- /dev/null
+++ b/src/frontend/mame/ui/auditmenu.h
@@ -0,0 +1,41 @@
+// license:BSD-3-Clause
+// copyright-holders:Maurizio Petrarota
+/***************************************************************************
+
+ ui/auditmenu.h
+
+ Internal UI user interface.
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __UI_AUDIT_H__
+#define __UI_AUDIT_H__
+
+//-------------------------------------------------
+// class audit menu
+//-------------------------------------------------
+using vptr_game = std::vector<const game_driver *>;
+
+class ui_menu_audit : public ui_menu
+{
+public:
+ ui_menu_audit(running_machine &machine, render_container *container, vptr_game &availablesorted, vptr_game &unavailablesorted, int audit_mode);
+ virtual ~ui_menu_audit();
+ virtual void populate() override;
+ virtual void handle() override;
+
+private:
+ vptr_game &m_availablesorted;
+ vptr_game &m_unavailablesorted;
+
+ int m_audit_mode;
+ void save_available_machines();
+ bool m_first;
+};
+
+inline int cs_stricmp(const char *s1, const char *s2);
+bool sorted_game_list(const game_driver *x, const game_driver *y);
+
+#endif /* __UI_AUDIT_H__ */
diff --git a/src/frontend/mame/ui/barcode.cpp b/src/frontend/mame/ui/barcode.cpp
new file mode 100644
index 00000000000..10dec5bde11
--- /dev/null
+++ b/src/frontend/mame/ui/barcode.cpp
@@ -0,0 +1,154 @@
+// license:BSD-3-Clause
+// copyright-holders:Fabio Priuli
+/***************************************************************************
+
+ ui/barcode.cpp
+
+ "Barcode Reader" control
+
+***************************************************************************/
+
+#include "emu.h"
+#include "ui/ui.h"
+#include "ui/menu.h"
+#include "ui/barcode.h"
+
+// itemrefs for key menu items
+#define ITEMREF_NEW_BARCODE ((void *) 0x0001)
+#define ITEMREF_ENTER_BARCODE ((void *) 0x0002)
+#define ITEMREF_SELECT_READER ((void *) 0x0003)
+
+
+/**************************************************
+
+ BARCODE READER MENU
+
+ **************************************************/
+
+
+//-------------------------------------------------
+// ctor
+//-------------------------------------------------
+
+ui_menu_barcode_reader::ui_menu_barcode_reader(running_machine &machine, render_container *container, barcode_reader_device *device)
+ : ui_menu_device_control<barcode_reader_device>(machine, container, device)
+{
+}
+
+
+//-------------------------------------------------
+// dtor
+//-------------------------------------------------
+
+ui_menu_barcode_reader::~ui_menu_barcode_reader()
+{
+}
+
+//-------------------------------------------------
+// populate - populates the barcode input menu
+//-------------------------------------------------
+
+void ui_menu_barcode_reader::populate()
+{
+ if (current_device())
+ {
+ std::string buffer;
+ const char *new_barcode;
+
+ // selected device
+ item_append(current_display_name().c_str(), "", current_display_flags(), ITEMREF_SELECT_READER);
+
+ // append the "New Barcode" item
+ if (get_selection() == ITEMREF_NEW_BARCODE)
+ {
+ buffer.append(m_barcode_buffer);
+ new_barcode = buffer.c_str();
+ }
+ else
+ {
+ new_barcode = m_barcode_buffer;
+ }
+
+ item_append(_("New Barcode:"), new_barcode, 0, ITEMREF_NEW_BARCODE);
+
+ // finish up the menu
+ item_append(ui_menu_item_type::SEPARATOR);
+ item_append(_("Enter Code"), nullptr, 0, ITEMREF_ENTER_BARCODE);
+
+ customtop = mame_machine_manager::instance()->ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
+ }
+}
+
+
+//-------------------------------------------------
+// handle - manages inputs in the barcode input menu
+//-------------------------------------------------
+
+void ui_menu_barcode_reader::handle()
+{
+ // rebuild the menu (so to update the selected device, if the user has pressed L or R)
+ reset(UI_MENU_RESET_REMEMBER_POSITION);
+ populate();
+
+ // process the menu
+ const ui_menu_event *event = process(UI_MENU_PROCESS_LR_REPEAT);
+
+ // process the event
+ if (event != nullptr)
+ {
+ // handle selections
+ switch (event->iptkey)
+ {
+ case IPT_UI_LEFT:
+ if (event->itemref == ITEMREF_SELECT_READER)
+ previous();
+ break;
+
+ case IPT_UI_RIGHT:
+ if (event->itemref == ITEMREF_SELECT_READER)
+ next();
+ break;
+
+ case IPT_UI_SELECT:
+ if (event->itemref == ITEMREF_ENTER_BARCODE)
+ {
+ std::string tmp_file(m_barcode_buffer);
+ //printf("code %s\n", m_barcode_buffer);
+ if (!current_device()->is_valid(tmp_file.length()))
+ mame_machine_manager::instance()->ui().popup_time(5, "%s", _("Barcode length invalid!"));
+ else
+ {
+ current_device()->write_code(tmp_file.c_str(), tmp_file.length());
+ // if sending was successful, reset char buffer
+ if (m_barcode_buffer[0] != '\0')
+ memset(m_barcode_buffer, '\0', ARRAY_LENGTH(m_barcode_buffer));
+ reset(UI_MENU_RESET_REMEMBER_POSITION);
+ }
+ }
+ break;
+
+ case IPT_SPECIAL:
+ if (get_selection() == ITEMREF_NEW_BARCODE)
+ {
+ int buflen = strlen(m_barcode_buffer);
+
+ // if it's a backspace and we can handle it, do so
+ if ((event->unichar == 8 || event->unichar == 0x7f) && buflen > 0)
+ *(char *)utf8_previous_char(&m_barcode_buffer[buflen]) = 0;
+ else if (event->unichar >= '0' && event->unichar <= '9')
+ {
+ buflen += utf8_from_uchar(&m_barcode_buffer[buflen], ARRAY_LENGTH(m_barcode_buffer) - buflen, event->unichar);
+ m_barcode_buffer[buflen] = 0;
+ }
+ reset(UI_MENU_RESET_REMEMBER_POSITION);
+ }
+ break;
+
+ case IPT_UI_CANCEL:
+ // reset the char buffer also in this case
+ if (m_barcode_buffer[0] != '\0')
+ memset(m_barcode_buffer, '\0', ARRAY_LENGTH(m_barcode_buffer));
+ break;
+ }
+ }
+}
diff --git a/src/frontend/mame/ui/barcode.h b/src/frontend/mame/ui/barcode.h
new file mode 100644
index 00000000000..5a3dbff634e
--- /dev/null
+++ b/src/frontend/mame/ui/barcode.h
@@ -0,0 +1,31 @@
+// license:BSD-3-Clause
+// copyright-holders:Fabio Priuli
+/***************************************************************************
+
+ ui/barcode.h
+
+ "Barcode Reader" control
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __UI_BARCODE_H__
+#define __UI_BARCODE_H__
+
+#include "machine/bcreader.h"
+#include "ui/devctrl.h"
+
+class ui_menu_barcode_reader : public ui_menu_device_control<barcode_reader_device> {
+public:
+ ui_menu_barcode_reader(running_machine &machine, render_container *container, barcode_reader_device *device);
+ virtual ~ui_menu_barcode_reader();
+ virtual void populate() override;
+ virtual void handle() override;
+
+private:
+ char m_barcode_buffer[20];
+};
+
+
+#endif // __UI_BARCODE_H__
diff --git a/src/frontend/mame/ui/cheatopt.cpp b/src/frontend/mame/ui/cheatopt.cpp
new file mode 100644
index 00000000000..8d84c06d759
--- /dev/null
+++ b/src/frontend/mame/ui/cheatopt.cpp
@@ -0,0 +1,320 @@
+// license:BSD-3-Clause
+// copyright-holders:Nicola Salmoria, Aaron Giles, Nathan Woods
+/*********************************************************************
+
+ ui/cheatopt.cpp
+
+ Internal menu for the cheat interface.
+
+*********************************************************************/
+
+#include "emu.h"
+#include "cheat.h"
+
+#include "ui/ui.h"
+#include "ui/menu.h"
+#include "ui/cheatopt.h"
+
+/*-------------------------------------------------
+ menu_cheat - handle the cheat menu
+-------------------------------------------------*/
+
+void ui_menu_cheat::handle()
+{
+ /* process the menu */
+ const ui_menu_event *menu_event = process(UI_MENU_PROCESS_LR_REPEAT);
+
+
+ /* handle events */
+ if (menu_event != nullptr && menu_event->itemref != nullptr)
+ {
+ bool changed = false;
+
+ /* clear cheat comment on any movement or keypress */
+ machine().popmessage();
+
+ /* handle reset all + reset all cheats for reload all option */
+ if ((menu_event->itemref == ITEMREF_CHEATS_RESET_ALL || menu_event->itemref == ITEMREF_CHEATS_RELOAD_ALL) && menu_event->iptkey == IPT_UI_SELECT)
+ {
+ for (cheat_entry &curcheat : mame_machine_manager::instance()->cheat().entries())
+ if (curcheat.select_default_state())
+ changed = true;
+ }
+
+ /* handle individual cheats */
+ else if (menu_event->itemref >= ITEMREF_CHEATS_FIRST_ITEM)
+ {
+ cheat_entry *curcheat = reinterpret_cast<cheat_entry *>(menu_event->itemref);
+ const char *string;
+ switch (menu_event->iptkey)
+ {
+ /* if selected, activate a oneshot */
+ case IPT_UI_SELECT:
+ changed = curcheat->activate();
+ break;
+
+ /* if cleared, reset to default value */
+ case IPT_UI_CLEAR:
+ changed = curcheat->select_default_state();
+ break;
+
+ /* left decrements */
+ case IPT_UI_LEFT:
+ changed = curcheat->select_previous_state();
+ break;
+
+ /* right increments */
+ case IPT_UI_RIGHT:
+ changed = curcheat->select_next_state();
+ break;
+
+ /* bring up display comment if one exists */
+ case IPT_UI_DISPLAY_COMMENT:
+ case IPT_UI_UP:
+ case IPT_UI_DOWN:
+ string = curcheat->comment();
+ if (string != nullptr && string[0] != 0)
+ machine().popmessage(_("Cheat Comment:\n%s"), string);
+ break;
+ }
+ }
+
+ /* handle reload all */
+ if (menu_event->itemref == ITEMREF_CHEATS_RELOAD_ALL && menu_event->iptkey == IPT_UI_SELECT)
+ {
+ /* re-init cheat engine and thus reload cheats/cheats have already been turned off by here */
+ mame_machine_manager::instance()->cheat().reload();
+
+ /* display the reloaded cheats */
+ reset(UI_MENU_RESET_REMEMBER_REF);
+ machine().popmessage(_("All cheats reloaded"));
+ }
+
+ /* handle autofire menu */
+ if (menu_event->itemref == ITEMREF_CHEATS_AUTOFIRE_SETTINGS && menu_event->iptkey == IPT_UI_SELECT)
+ {
+ ui_menu::stack_push(global_alloc_clear<ui_menu_autofire>(machine(), container));
+ }
+
+ /* if things changed, update */
+ if (changed)
+ reset(UI_MENU_RESET_REMEMBER_REF);
+ }
+}
+
+
+/*-------------------------------------------------
+ menu_cheat_populate - populate the cheat menu
+-------------------------------------------------*/
+
+ui_menu_cheat::ui_menu_cheat(running_machine &machine, render_container *container) : ui_menu(machine, container)
+{
+}
+
+void ui_menu_cheat::populate()
+{
+ /* iterate over cheats */
+ std::string text;
+ std::string subtext;
+
+ // add the autofire menu
+ item_append(_("Autofire Settings"), nullptr, 0, (void *)ITEMREF_CHEATS_AUTOFIRE_SETTINGS);
+
+ /* add a separator */
+ item_append(ui_menu_item_type::SEPARATOR);
+
+ // add other cheats
+ if (!mame_machine_manager::instance()->cheat().entries().empty()) {
+ for (cheat_entry &curcheat : mame_machine_manager::instance()->cheat().entries())
+ {
+ UINT32 flags;
+ curcheat.menu_text(text, subtext, flags);
+ item_append(text.c_str(), subtext.c_str(), flags, &curcheat);
+ }
+
+ /* add a separator */
+ item_append(ui_menu_item_type::SEPARATOR);
+
+ /* add a reset all option */
+ item_append(_("Reset All"), nullptr, 0, (void *)ITEMREF_CHEATS_RESET_ALL);
+
+ /* add a reload all cheats option */
+ item_append(_("Reload All"), nullptr, 0, (void *)ITEMREF_CHEATS_RELOAD_ALL);
+ }
+}
+
+ui_menu_cheat::~ui_menu_cheat()
+{
+}
+
+
+
+
+
+/*-------------------------------------------------
+ menu_autofire - handle the autofire settings
+ menu
+-------------------------------------------------*/
+
+ui_menu_autofire::ui_menu_autofire(running_machine &machine, render_container *container) : ui_menu(machine, container)
+{
+ const screen_device *screen = machine.first_screen();
+
+ if (screen == nullptr)
+ {
+ refresh = 60.0;
+ }
+ else
+ {
+ refresh = ATTOSECONDS_TO_HZ(screen->refresh_attoseconds());
+ }
+}
+
+ui_menu_autofire::~ui_menu_autofire()
+{
+}
+
+void ui_menu_autofire::handle()
+{
+ ioport_field *field;
+ bool changed = false;
+
+ /* process the menu */
+ const ui_menu_event *menu_event = process(0);
+
+ /* handle events */
+ if (menu_event != nullptr && menu_event->itemref != nullptr)
+ {
+ // menu item is changed using left/right keys only
+ if (menu_event->iptkey == IPT_UI_LEFT || menu_event->iptkey == IPT_UI_RIGHT)
+ {
+ if (menu_event->itemref == ITEMREF_AUTOFIRE_STATUS)
+ {
+ // toggle autofire status
+ bool autofire_toggle = machine().ioport().get_autofire_toggle(); // (menu_event->iptkey == IPT_UI_LEFT);
+ machine().ioport().set_autofire_toggle(!autofire_toggle);
+ changed = true;
+ }
+ else if (menu_event->itemref == ITEMREF_AUTOFIRE_DELAY)
+ {
+ // change autofire frequency
+ int autofire_delay = machine().ioport().get_autofire_delay();
+ if (menu_event->iptkey == IPT_UI_LEFT)
+ {
+ autofire_delay--;
+ if (autofire_delay < 1)
+ autofire_delay = 1;
+ }
+ else
+ {
+ autofire_delay++;
+ if (autofire_delay > 30)
+ autofire_delay = 30;
+ }
+ machine().ioport().set_autofire_delay(autofire_delay);
+ changed = true;
+ }
+ else
+ {
+ // enable autofire on specific button
+ field = (ioport_field *)menu_event->itemref;
+ ioport_field::user_settings settings;
+ field->get_user_settings(settings);
+ settings.autofire = (menu_event->iptkey == IPT_UI_RIGHT);
+ field->set_user_settings(settings);
+ changed = true;
+ }
+ }
+ }
+
+ // if toggle settings changed, redraw menu to reflect new options
+ if (!changed)
+ {
+ changed = (last_toggle != machine().ioport().get_autofire_toggle());
+ }
+
+ /* if something changed, rebuild the menu */
+ if (changed)
+ {
+ reset(UI_MENU_RESET_REMEMBER_REF);
+ }
+}
+
+
+/*-------------------------------------------------
+ menu_autofire_populate - populate the autofire
+ menu
+-------------------------------------------------*/
+
+void ui_menu_autofire::populate()
+{
+ char temp_text[64];
+
+ /* add autofire toggle item */
+ bool autofire_toggle = machine().ioport().get_autofire_toggle();
+ item_append(_("Autofire Status"), (autofire_toggle ? _("Disabled") : _("Enabled")),
+ (autofire_toggle ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW), (void *)ITEMREF_AUTOFIRE_STATUS);
+
+ /* iterate over the input ports and add autofire toggle items */
+ int menu_items = 0;
+ for (ioport_port &port : machine().ioport().ports())
+ {
+ bool is_first_button = true;
+ for (ioport_field &field : port.fields())
+ {
+ if ((field.name()) && ((field.type() >= IPT_BUTTON1 && field.type() <= IPT_BUTTON16))) // IPT_BUTTON1 + 15)))
+ {
+ menu_items++;
+ ioport_field::user_settings settings;
+ field.get_user_settings(settings);
+
+ if (is_first_button)
+ {
+ /* add a separator for each player */
+ item_append(ui_menu_item_type::SEPARATOR);
+ is_first_button = false;
+ }
+ /* add an autofire item */
+ if (!autofire_toggle)
+ {
+ // item is enabled and can be switched to values on/off
+ item_append(field.name(), (settings.autofire ? _("On") : _("Off")),
+ (settings.autofire ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW), (void *)&field);
+ }
+ else
+ {
+ // item is disabled
+ item_append(field.name(), (settings.autofire ? _("On") : _("Off")),
+ MENU_FLAG_DISABLE | MENU_FLAG_INVERT, nullptr);
+ }
+ }
+ }
+ }
+
+ /* add text item if no buttons found */
+ if (menu_items==0)
+ {
+ item_append(ui_menu_item_type::SEPARATOR);
+ item_append(_("No buttons found on this machine!"), nullptr, MENU_FLAG_DISABLE, nullptr);
+ }
+
+ /* add a separator */
+ item_append(ui_menu_item_type::SEPARATOR);
+
+ /* add autofire delay item */
+ int value = machine().ioport().get_autofire_delay();
+ snprintf(temp_text, ARRAY_LENGTH(temp_text), "%d = %.2f Hz", value, (float)refresh/value);
+ if (!autofire_toggle)
+ {
+ item_append(_("Autofire Delay"), temp_text, MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW, (void *)ITEMREF_AUTOFIRE_DELAY);
+ }
+ else
+ {
+ item_append(_("Autofire Delay"), temp_text, MENU_FLAG_DISABLE | MENU_FLAG_INVERT, nullptr);
+ }
+
+ /* add a separator */
+ item_append(ui_menu_item_type::SEPARATOR);
+
+ last_toggle = autofire_toggle;
+}
diff --git a/src/frontend/mame/ui/cheatopt.h b/src/frontend/mame/ui/cheatopt.h
new file mode 100644
index 00000000000..a9321df7304
--- /dev/null
+++ b/src/frontend/mame/ui/cheatopt.h
@@ -0,0 +1,49 @@
+// license:BSD-3-Clause
+// copyright-holders:Nicola Salmoria, Aaron Giles, Nathan Woods
+/***************************************************************************
+
+ ui/cheatopt.h
+
+ Internal menu for the cheat interface.
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __UI_CHEATOPT_H__
+#define __UI_CHEATOPT_H__
+
+// itemrefs for key menu items
+#define ITEMREF_CHEATS_RESET_ALL ((void *) 0x0001)
+#define ITEMREF_CHEATS_RELOAD_ALL ((void *) 0x0002)
+#define ITEMREF_CHEATS_AUTOFIRE_SETTINGS ((void *) 0x0003)
+#define ITEMREF_CHEATS_FIRST_ITEM ((void *) 0x0004)
+
+class ui_menu_cheat : public ui_menu {
+public:
+ ui_menu_cheat(running_machine &machine, render_container *container);
+ virtual ~ui_menu_cheat();
+ virtual void populate() override;
+ virtual void handle() override;
+};
+
+
+// itemrefs for key menu items
+#define ITEMREF_AUTOFIRE_STATUS ((void *) 0x0001)
+#define ITEMREF_AUTOFIRE_DELAY ((void *) 0x0002)
+#define ITEMREF_AUTOFIRE_FIRST_BUTTON ((void *) 0x0003)
+
+class ui_menu_autofire : public ui_menu {
+public:
+ ui_menu_autofire(running_machine &machine, render_container *container);
+ virtual ~ui_menu_autofire();
+ virtual void populate() override;
+ virtual void handle() override;
+
+private:
+ float refresh;
+ bool last_toggle;
+};
+
+
+#endif /* __UI_CHEATOPT_H__ */
diff --git a/src/frontend/mame/ui/custmenu.cpp b/src/frontend/mame/ui/custmenu.cpp
new file mode 100644
index 00000000000..e1d6ed470ca
--- /dev/null
+++ b/src/frontend/mame/ui/custmenu.cpp
@@ -0,0 +1,583 @@
+// license:BSD-3-Clause
+// copyright-holders:Maurizio Petrarota
+/*********************************************************************
+
+ ui/custmenu.cpp
+
+ Internal UI user interface.
+
+*********************************************************************/
+
+#include "emu.h"
+#include "ui/ui.h"
+#include "ui/menu.h"
+#include "ui/custmenu.h"
+#include "ui/selector.h"
+#include "ui/inifile.h"
+#include "rendfont.h"
+
+/**************************************************
+ MENU CUSTOM FILTER
+**************************************************/
+//-------------------------------------------------
+// ctor / dtor
+//-------------------------------------------------
+ui_menu_custom_filter::ui_menu_custom_filter(running_machine &machine, render_container *container, bool _single_menu)
+ : ui_menu(machine, container)
+ , m_single_menu(_single_menu)
+ , m_added(false)
+{
+}
+
+ui_menu_custom_filter::~ui_menu_custom_filter()
+{
+ if (m_single_menu)
+ ui_menu::menu_stack->reset(UI_MENU_RESET_SELECT_FIRST);
+ save_custom_filters();
+}
+
+//-------------------------------------------------
+// handle
+//-------------------------------------------------
+void ui_menu_custom_filter::handle()
+{
+ bool changed = false;
+ m_added = false;
+
+ // process the menu
+ const ui_menu_event *m_event = process(UI_MENU_PROCESS_LR_REPEAT);
+ if (m_event != nullptr && m_event->itemref != nullptr)
+ {
+ switch ((FPTR)m_event->itemref)
+ {
+ case MAIN_FILTER:
+ if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
+ {
+ (m_event->iptkey == IPT_UI_RIGHT) ? custfltr::main++ : custfltr::main--;
+ changed = true;
+ }
+ break;
+
+ case ADD_FILTER:
+ if (m_event->iptkey == IPT_UI_SELECT)
+ {
+ custfltr::numother++;
+ custfltr::other[custfltr::numother] = FILTER_UNAVAILABLE + 1;
+ m_added = true;
+ }
+ break;
+
+ case REMOVE_FILTER:
+ if (m_event->iptkey == IPT_UI_SELECT)
+ {
+ custfltr::other[custfltr::numother] = FILTER_UNAVAILABLE + 1;
+ custfltr::numother--;
+ changed = true;
+ }
+ break;
+ }
+
+ if ((FPTR)m_event->itemref >= OTHER_FILTER && (FPTR)m_event->itemref < OTHER_FILTER + MAX_CUST_FILTER)
+ {
+ int pos = (int)((FPTR)m_event->itemref - OTHER_FILTER);
+ if (m_event->iptkey == IPT_UI_LEFT && custfltr::other[pos] > FILTER_UNAVAILABLE + 1)
+ {
+ custfltr::other[pos]--;
+ for ( ; custfltr::other[pos] > FILTER_UNAVAILABLE && (custfltr::other[pos] == FILTER_CATEGORY
+ || custfltr::other[pos] == FILTER_FAVORITE); custfltr::other[pos]--) ;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_RIGHT && custfltr::other[pos] < FILTER_LAST - 1)
+ {
+ custfltr::other[pos]++;
+ for ( ; custfltr::other[pos] < FILTER_LAST && (custfltr::other[pos] == FILTER_CATEGORY
+ || custfltr::other[pos] == FILTER_FAVORITE); custfltr::other[pos]++) ;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_SELECT)
+ {
+ size_t total = main_filters::length;
+ std::vector<std::string> s_sel(total);
+ for (size_t index = 0; index < total; ++index)
+ if (index <= FILTER_UNAVAILABLE || index == FILTER_CATEGORY || index == FILTER_FAVORITE || index == FILTER_CUSTOM)
+ s_sel[index] = "_skip_";
+ else
+ s_sel[index] = main_filters::text[index];
+
+ ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, custfltr::other[pos]));
+ }
+ }
+ else if ((FPTR)m_event->itemref >= YEAR_FILTER && (FPTR)m_event->itemref < YEAR_FILTER + MAX_CUST_FILTER)
+ {
+ int pos = (int)((FPTR)m_event->itemref - YEAR_FILTER);
+ if (m_event->iptkey == IPT_UI_LEFT && custfltr::year[pos] > 0)
+ {
+ custfltr::year[pos]--;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_RIGHT && custfltr::year[pos] < c_year::ui.size() - 1)
+ {
+ custfltr::year[pos]++;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_SELECT)
+ ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, c_year::ui, custfltr::year[pos]));
+ }
+ else if ((FPTR)m_event->itemref >= MNFCT_FILTER && (FPTR)m_event->itemref < MNFCT_FILTER + MAX_CUST_FILTER)
+ {
+ int pos = (int)((FPTR)m_event->itemref - MNFCT_FILTER);
+ if (m_event->iptkey == IPT_UI_LEFT && custfltr::mnfct[pos] > 0)
+ {
+ custfltr::mnfct[pos]--;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_RIGHT && custfltr::mnfct[pos] < c_mnfct::ui.size() - 1)
+ {
+ custfltr::mnfct[pos]++;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_SELECT)
+ ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, c_mnfct::ui, custfltr::mnfct[pos]));
+ }
+ }
+
+ if (changed)
+ reset(UI_MENU_RESET_REMEMBER_REF);
+ else if (m_added)
+ reset(UI_MENU_RESET_SELECT_FIRST);
+}
+
+//-------------------------------------------------
+// populate
+//-------------------------------------------------
+void ui_menu_custom_filter::populate()
+{
+ // add main filter
+ UINT32 arrow_flags = get_arrow_flags((int)FILTER_ALL, (int)FILTER_UNAVAILABLE, custfltr::main);
+ item_append(_("Main filter"), main_filters::text[custfltr::main], arrow_flags, (void *)(FPTR)MAIN_FILTER);
+
+ // add other filters
+ for (int x = 1; x <= custfltr::numother; x++)
+ {
+ item_append(ui_menu_item_type::SEPARATOR);
+
+ // add filter items
+ arrow_flags = get_arrow_flags((int)FILTER_UNAVAILABLE + 1, (int)FILTER_LAST - 1, custfltr::other[x]);
+ item_append(_("Other filter"), main_filters::text[custfltr::other[x]], arrow_flags, (void *)(FPTR)(OTHER_FILTER + x));
+
+ if (m_added)
+ selected = item.size() - 2;
+
+ // add manufacturer subitem
+ if (custfltr::other[x] == FILTER_MANUFACTURER && c_mnfct::ui.size() > 0)
+ {
+ arrow_flags = get_arrow_flags(0, c_mnfct::ui.size() - 1, custfltr::mnfct[x]);
+ std::string fbuff(_("^!Manufacturer"));
+ convert_command_glyph(fbuff);
+ item_append(fbuff.c_str(), c_mnfct::ui[custfltr::mnfct[x]].c_str(), arrow_flags, (void *)(FPTR)(MNFCT_FILTER + x));
+ }
+
+ // add year subitem
+ else if (custfltr::other[x] == FILTER_YEAR && c_year::ui.size() > 0)
+ {
+ arrow_flags = get_arrow_flags(0, c_year::ui.size() - 1, custfltr::year[x]);
+ std::string fbuff(_("^!Year"));
+ convert_command_glyph(fbuff);
+ item_append(fbuff.c_str(), c_year::ui[custfltr::year[x]].c_str(), arrow_flags, (void *)(FPTR)(YEAR_FILTER + x));
+ }
+ }
+
+ item_append(ui_menu_item_type::SEPARATOR);
+
+ if (custfltr::numother > 0)
+ item_append(_("Remove last filter"), nullptr, 0, (void *)(FPTR)REMOVE_FILTER);
+
+ if (custfltr::numother < MAX_CUST_FILTER - 2)
+ item_append(_("Add filter"), nullptr, 0, (void *)(FPTR)ADD_FILTER);
+
+ item_append(ui_menu_item_type::SEPARATOR);
+ customtop = mame_machine_manager::instance()->ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
+}
+
+//-------------------------------------------------
+// perform our special rendering
+//-------------------------------------------------
+void ui_menu_custom_filter::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+{
+ float width;
+ mame_ui_manager &mui = mame_machine_manager::instance()->ui();
+
+ // get the size of the text
+ mui.draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
+ float maxwidth = MAX(width, origx2 - origx1);
+
+ // compute our bounds
+ float x1 = 0.5f - 0.5f * maxwidth;
+ float x2 = x1 + maxwidth;
+ float y1 = origy1 - top;
+ float y2 = origy1 - UI_BOX_TB_BORDER;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ // draw the text within it
+ mui.draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
+}
+
+//-------------------------------------------------
+// save custom filters info to file
+//-------------------------------------------------
+
+void ui_menu_custom_filter::save_custom_filters()
+{
+ // attempt to open the output file
+ emu_file file(mame_machine_manager::instance()->ui().options().ui_path(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ if (file.open("custom_", emulator_info::get_configname(), "_filter.ini") == osd_file::error::NONE)
+ {
+ // generate custom filters info
+ std::ostringstream cinfo;
+ util::stream_format(cinfo, "Total filters = %d\n", (custfltr::numother + 1));
+ util::stream_format(cinfo, "Main filter = %s\n", main_filters::text[custfltr::main]);
+
+ for (int x = 1; x <= custfltr::numother; x++)
+ {
+ util::stream_format(cinfo, "Other filter = %s\n", main_filters::text[custfltr::other[x]]);
+ if (custfltr::other[x] == FILTER_MANUFACTURER)
+ util::stream_format(cinfo, " Manufacturer filter = %s\n", c_mnfct::ui[custfltr::mnfct[x]]);
+ else if (custfltr::other[x] == FILTER_YEAR)
+ util::stream_format(cinfo, " Year filter = %s\n", c_year::ui[custfltr::year[x]]);
+ }
+ file.puts(cinfo.str().c_str());
+ file.close();
+ }
+}
+
+/**************************************************
+ MENU CUSTOM SOFTWARE FILTER
+**************************************************/
+//-------------------------------------------------
+// ctor / dtor
+//-------------------------------------------------
+ui_menu_swcustom_filter::ui_menu_swcustom_filter(running_machine &machine, render_container *container, const game_driver *_driver, s_filter &_filter) :
+ ui_menu(machine, container)
+ , m_added(false)
+ , m_filter(_filter)
+ , m_driver(_driver)
+{
+}
+
+ui_menu_swcustom_filter::~ui_menu_swcustom_filter()
+{
+ ui_menu::menu_stack->reset(UI_MENU_RESET_SELECT_FIRST);
+ save_sw_custom_filters();
+}
+
+//-------------------------------------------------
+// handle
+//-------------------------------------------------
+void ui_menu_swcustom_filter::handle()
+{
+ bool changed = false;
+ m_added = false;
+
+ // process the menu
+ const ui_menu_event *m_event = process(UI_MENU_PROCESS_LR_REPEAT);
+ if (m_event != nullptr && m_event->itemref != nullptr)
+ {
+ switch ((FPTR)m_event->itemref)
+ {
+ case MAIN_FILTER:
+ if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
+ {
+ (m_event->iptkey == IPT_UI_RIGHT) ? sw_custfltr::main++ : sw_custfltr::main--;
+ changed = true;
+ }
+ break;
+
+ case ADD_FILTER:
+ if (m_event->iptkey == IPT_UI_SELECT)
+ {
+ sw_custfltr::numother++;
+ sw_custfltr::other[sw_custfltr::numother] = UI_SW_UNAVAILABLE + 1;
+ m_added = true;
+ }
+ break;
+
+ case REMOVE_FILTER:
+ if (m_event->iptkey == IPT_UI_SELECT)
+ {
+ sw_custfltr::other[sw_custfltr::numother] = UI_SW_UNAVAILABLE + 1;
+ sw_custfltr::numother--;
+ changed = true;
+ }
+ break;
+ }
+
+ if ((FPTR)m_event->itemref >= OTHER_FILTER && (FPTR)m_event->itemref < OTHER_FILTER + MAX_CUST_FILTER)
+ {
+ int pos = (int)((FPTR)m_event->itemref - OTHER_FILTER);
+ if (m_event->iptkey == IPT_UI_LEFT && sw_custfltr::other[pos] > UI_SW_UNAVAILABLE + 1)
+ {
+ sw_custfltr::other[pos]--;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_RIGHT && sw_custfltr::other[pos] < UI_SW_LAST - 1)
+ {
+ sw_custfltr::other[pos]++;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_SELECT)
+ {
+ size_t total = sw_filters::length;
+ std::vector<std::string> s_sel(total);
+ for (size_t index = 0; index < total; ++index)
+ if (index <= UI_SW_UNAVAILABLE|| index == UI_SW_CUSTOM)
+ s_sel[index] = "_skip_";
+ else
+ s_sel[index] = sw_filters::text[index];
+
+ ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, sw_custfltr::other[pos]));
+ }
+ }
+ else if ((FPTR)m_event->itemref >= YEAR_FILTER && (FPTR)m_event->itemref < YEAR_FILTER + MAX_CUST_FILTER)
+ {
+ int pos = (int)((FPTR)m_event->itemref - YEAR_FILTER);
+ if (m_event->iptkey == IPT_UI_LEFT && sw_custfltr::year[pos] > 0)
+ {
+ sw_custfltr::year[pos]--;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_RIGHT && sw_custfltr::year[pos] < m_filter.year.ui.size() - 1)
+ {
+ sw_custfltr::year[pos]++;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_SELECT)
+ ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, m_filter.year.ui, sw_custfltr::year[pos]));
+ }
+ else if ((FPTR)m_event->itemref >= TYPE_FILTER && (FPTR)m_event->itemref < TYPE_FILTER + MAX_CUST_FILTER)
+ {
+ int pos = (int)((FPTR)m_event->itemref - TYPE_FILTER);
+ if (m_event->iptkey == IPT_UI_LEFT && sw_custfltr::type[pos] > 0)
+ {
+ sw_custfltr::type[pos]--;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_RIGHT && sw_custfltr::type[pos] < m_filter.type.ui.size() - 1)
+ {
+ sw_custfltr::type[pos]++;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_SELECT)
+ ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, m_filter.type.ui, sw_custfltr::type[pos]));
+ }
+ else if ((FPTR)m_event->itemref >= MNFCT_FILTER && (FPTR)m_event->itemref < MNFCT_FILTER + MAX_CUST_FILTER)
+ {
+ int pos = (int)((FPTR)m_event->itemref - MNFCT_FILTER);
+ if (m_event->iptkey == IPT_UI_LEFT && sw_custfltr::mnfct[pos] > 0)
+ {
+ sw_custfltr::mnfct[pos]--;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_RIGHT && sw_custfltr::mnfct[pos] < m_filter.publisher.ui.size() - 1)
+ {
+ sw_custfltr::mnfct[pos]++;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_SELECT)
+ ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, m_filter.publisher.ui, sw_custfltr::mnfct[pos]));
+ }
+ else if ((FPTR)m_event->itemref >= REGION_FILTER && (FPTR)m_event->itemref < REGION_FILTER + MAX_CUST_FILTER)
+ {
+ int pos = (int)((FPTR)m_event->itemref - REGION_FILTER);
+ if (m_event->iptkey == IPT_UI_LEFT && sw_custfltr::region[pos] > 0)
+ {
+ sw_custfltr::region[pos]--;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_RIGHT && sw_custfltr::region[pos] < m_filter.region.ui.size() - 1)
+ {
+ sw_custfltr::region[pos]++;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_SELECT)
+ ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, m_filter.region.ui, sw_custfltr::region[pos]));
+ }
+ else if ((FPTR)m_event->itemref >= LIST_FILTER && (FPTR)m_event->itemref < LIST_FILTER + MAX_CUST_FILTER)
+ {
+ int pos = (int)((FPTR)m_event->itemref - LIST_FILTER);
+ if (m_event->iptkey == IPT_UI_LEFT && sw_custfltr::list[pos] > 0)
+ {
+ sw_custfltr::list[pos]--;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_RIGHT && sw_custfltr::list[pos] < m_filter.swlist.name.size() - 1)
+ {
+ sw_custfltr::list[pos]++;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_SELECT)
+ ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, m_filter.swlist.description, sw_custfltr::list[pos]));
+ }
+ }
+
+ if (changed)
+ reset(UI_MENU_RESET_REMEMBER_REF);
+ else if (m_added)
+ reset(UI_MENU_RESET_SELECT_FIRST);
+}
+
+//-------------------------------------------------
+// populate
+//-------------------------------------------------
+void ui_menu_swcustom_filter::populate()
+{
+ // add main filter
+ UINT32 arrow_flags = get_arrow_flags((int)UI_SW_ALL, (int)UI_SW_UNAVAILABLE, sw_custfltr::main);
+ item_append(_("Main filter"), sw_filters::text[sw_custfltr::main], arrow_flags, (void *)(FPTR)MAIN_FILTER);
+
+ // add other filters
+ for (int x = 1; x <= sw_custfltr::numother; x++)
+ {
+ item_append(ui_menu_item_type::SEPARATOR);
+
+ // add filter items
+ arrow_flags = get_arrow_flags((int)UI_SW_UNAVAILABLE + 1, (int)UI_SW_LAST - 1, sw_custfltr::other[x]);
+ item_append(_("Other filter"), sw_filters::text[sw_custfltr::other[x]], arrow_flags, (void *)(FPTR)(OTHER_FILTER + x));
+
+ if (m_added)
+ selected = item.size() - 2;
+
+ // add publisher subitem
+ if (sw_custfltr::other[x] == UI_SW_PUBLISHERS && m_filter.publisher.ui.size() > 0)
+ {
+ arrow_flags = get_arrow_flags(0, m_filter.publisher.ui.size() - 1, sw_custfltr::mnfct[x]);
+ std::string fbuff(_("^!Publisher"));
+ convert_command_glyph(fbuff);
+ item_append(fbuff.c_str(), m_filter.publisher.ui[sw_custfltr::mnfct[x]].c_str(), arrow_flags, (void *)(FPTR)(MNFCT_FILTER + x));
+ }
+
+ // add year subitem
+ else if (sw_custfltr::other[x] == UI_SW_YEARS && m_filter.year.ui.size() > 0)
+ {
+ arrow_flags = get_arrow_flags(0, m_filter.year.ui.size() - 1, sw_custfltr::year[x]);
+ std::string fbuff(_("^!Year"));
+ convert_command_glyph(fbuff);
+ item_append(fbuff.c_str(), m_filter.year.ui[sw_custfltr::year[x]].c_str(), arrow_flags, (void *)(FPTR)(YEAR_FILTER + x));
+ }
+
+ // add year subitem
+ else if (sw_custfltr::other[x] == UI_SW_LIST && m_filter.swlist.name.size() > 0)
+ {
+ arrow_flags = get_arrow_flags(0, m_filter.swlist.name.size() - 1, sw_custfltr::list[x]);
+ std::string fbuff(_("^!Software List"));
+ convert_command_glyph(fbuff);
+ item_append(fbuff.c_str(), m_filter.swlist.description[sw_custfltr::list[x]].c_str(), arrow_flags, (void *)(FPTR)(LIST_FILTER + x));
+ }
+
+ // add device type subitem
+ else if (sw_custfltr::other[x] == UI_SW_TYPE && m_filter.type.ui.size() > 0)
+ {
+ arrow_flags = get_arrow_flags(0, m_filter.type.ui.size() - 1, sw_custfltr::type[x]);
+ std::string fbuff(_("^!Device type"));
+ convert_command_glyph(fbuff);
+ item_append(fbuff.c_str(), m_filter.type.ui[sw_custfltr::type[x]].c_str(), arrow_flags, (void *)(FPTR)(TYPE_FILTER + x));
+ }
+
+ // add region subitem
+ else if (sw_custfltr::other[x] == UI_SW_REGION && m_filter.region.ui.size() > 0)
+ {
+ arrow_flags = get_arrow_flags(0, m_filter.region.ui.size() - 1, sw_custfltr::region[x]);
+ std::string fbuff(_("^!Region"));
+ convert_command_glyph(fbuff);
+ item_append(fbuff.c_str(), m_filter.region.ui[sw_custfltr::region[x]].c_str(), arrow_flags, (void *)(FPTR)(REGION_FILTER + x));
+ }
+ }
+
+ item_append(ui_menu_item_type::SEPARATOR);
+
+ if (sw_custfltr::numother > 0)
+ item_append(_("Remove last filter"), nullptr, 0, (void *)(FPTR)REMOVE_FILTER);
+
+ if (sw_custfltr::numother < MAX_CUST_FILTER - 2)
+ item_append(_("Add filter"), nullptr, 0, (void *)(FPTR)ADD_FILTER);
+
+ item_append(ui_menu_item_type::SEPARATOR);
+
+ customtop = mame_machine_manager::instance()->ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
+}
+
+//-------------------------------------------------
+// perform our special rendering
+//-------------------------------------------------
+void ui_menu_swcustom_filter::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+{
+ float width;
+ mame_ui_manager &mui = mame_machine_manager::instance()->ui();
+
+ // get the size of the text
+ mui.draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
+ float maxwidth = MAX(width, origx2 - origx1);
+
+ // compute our bounds
+ float x1 = 0.5f - 0.5f * maxwidth;
+ float x2 = x1 + maxwidth;
+ float y1 = origy1 - top;
+ float y2 = origy1 - UI_BOX_TB_BORDER;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ // draw the text within it
+ mui.draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
+}
+
+//-------------------------------------------------
+// save custom filters info to file
+//-------------------------------------------------
+
+void ui_menu_swcustom_filter::save_sw_custom_filters()
+{
+ // attempt to open the output file
+ emu_file file(mame_machine_manager::instance()->ui().options().ui_path(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ if (file.open("custom_", m_driver->name, "_filter.ini") == osd_file::error::NONE)
+ {
+ // generate custom filters info
+ std::ostringstream cinfo;
+ util::stream_format(cinfo, "Total filters = %d\n", (sw_custfltr::numother + 1));
+ util::stream_format(cinfo, "Main filter = %s\n", sw_filters::text[sw_custfltr::main]);
+
+ for (int x = 1; x <= sw_custfltr::numother; x++)
+ {
+ util::stream_format(cinfo, "Other filter = %s\n", sw_filters::text[sw_custfltr::other[x]]);
+ if (sw_custfltr::other[x] == UI_SW_PUBLISHERS)
+ util::stream_format(cinfo, " Manufacturer filter = %s\n", m_filter.publisher.ui[sw_custfltr::mnfct[x]]);
+ else if (sw_custfltr::other[x] == UI_SW_LIST)
+ util::stream_format(cinfo, " Software List filter = %s\n", m_filter.swlist.name[sw_custfltr::list[x]]);
+ else if (sw_custfltr::other[x] == UI_SW_YEARS)
+ util::stream_format(cinfo, " Year filter = %s\n", m_filter.year.ui[sw_custfltr::year[x]]);
+ else if (sw_custfltr::other[x] == UI_SW_TYPE)
+ util::stream_format(cinfo, " Type filter = %s\n", m_filter.type.ui[sw_custfltr::type[x]]);
+ else if (sw_custfltr::other[x] == UI_SW_REGION)
+ util::stream_format(cinfo, " Region filter = %s\n", m_filter.region.ui[sw_custfltr::region[x]]);
+ }
+ file.puts(cinfo.str().c_str());
+ file.close();
+ }
+}
diff --git a/src/frontend/mame/ui/custmenu.h b/src/frontend/mame/ui/custmenu.h
new file mode 100644
index 00000000000..338344dcddd
--- /dev/null
+++ b/src/frontend/mame/ui/custmenu.h
@@ -0,0 +1,131 @@
+// license:BSD-3-Clause
+// copyright-holders:Maurizio Petrarota
+/***************************************************************************
+
+ ui/custmenu.h
+
+ Internal UI user interface.
+
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __UI_CUSTMENU_H__
+#define __UI_CUSTMENU_H__
+
+#include "ui/utils.h"
+
+// Software region
+struct c_sw_region
+{
+ std::vector<std::string> ui;
+ UINT16 actual;
+ void set(std::string &str);
+ std::string getname(std::string &str);
+};
+
+// Software publishers
+struct c_sw_publisher
+{
+ std::vector<std::string> ui;
+ UINT16 actual;
+ void set(std::string &str);
+ std::string getname(std::string &str);
+};
+
+// Software device type
+struct c_sw_type
+{
+ std::vector<std::string> ui;
+ UINT16 actual;
+ void set(std::string &str);
+};
+
+// Software list
+struct c_sw_list
+{
+ std::vector<std::string> name;
+ std::vector<std::string> description;
+ UINT16 actual;
+};
+
+// Software years
+struct c_sw_year
+{
+ std::vector<std::string> ui;
+ UINT16 actual;
+ void set(std::string &str);
+};
+
+struct s_filter
+{
+ c_sw_region region;
+ c_sw_publisher publisher;
+ c_sw_year year;
+ c_sw_type type;
+ c_sw_list swlist;
+};
+
+//-------------------------------------------------
+// custom software filter menu class
+//-------------------------------------------------
+class ui_menu_swcustom_filter : public ui_menu
+{
+public:
+ ui_menu_swcustom_filter(running_machine &machine, render_container *container, const game_driver *_driver, s_filter &_filter);
+ virtual ~ui_menu_swcustom_filter();
+ virtual void populate() override;
+ virtual void handle() override;
+ virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
+
+private:
+ enum
+ {
+ MAIN_FILTER = 1,
+ ADD_FILTER,
+ REMOVE_FILTER,
+ MNFCT_FILTER,
+ YEAR_FILTER = MNFCT_FILTER + MAX_CUST_FILTER + 1,
+ REGION_FILTER = YEAR_FILTER + MAX_CUST_FILTER + 1,
+ TYPE_FILTER = REGION_FILTER + MAX_CUST_FILTER + 1,
+ LIST_FILTER = TYPE_FILTER + MAX_CUST_FILTER + 1,
+ OTHER_FILTER = LIST_FILTER + MAX_CUST_FILTER + 1
+ };
+
+ bool m_added;
+ s_filter &m_filter;
+ const game_driver *m_driver;
+
+ void save_sw_custom_filters();
+};
+
+//-------------------------------------------------
+// custom filter menu class
+//-------------------------------------------------
+class ui_menu_custom_filter : public ui_menu
+{
+public:
+ ui_menu_custom_filter(running_machine &machine, render_container *container, bool _single_menu = false);
+ virtual ~ui_menu_custom_filter();
+ virtual void populate() override;
+ virtual void handle() override;
+ virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
+
+private:
+ enum
+ {
+ MAIN_FILTER = 1,
+ ADD_FILTER,
+ REMOVE_FILTER,
+ MNFCT_FILTER,
+ YEAR_FILTER = MNFCT_FILTER + MAX_CUST_FILTER + 1,
+ SCREEN_FILTER = YEAR_FILTER + MAX_CUST_FILTER + 1,
+ OTHER_FILTER = SCREEN_FILTER + MAX_CUST_FILTER + 1
+ };
+
+ bool m_single_menu, m_added;
+ void save_custom_filters();
+};
+
+#endif /* __UI_CUSTMENU_H__ */
diff --git a/src/frontend/mame/ui/custui.cpp b/src/frontend/mame/ui/custui.cpp
new file mode 100644
index 00000000000..eb0e755d240
--- /dev/null
+++ b/src/frontend/mame/ui/custui.cpp
@@ -0,0 +1,1068 @@
+// license:BSD-3-Clause
+// copyright-holders:Maurizio Petrarota
+/*********************************************************************
+
+ ui/custui.cpp
+
+ Internal UI user interface.
+
+*********************************************************************/
+
+#include "emu.h"
+#include "emuopts.h"
+#include "osdepend.h"
+#include "ui/ui.h"
+#include "ui/menu.h"
+#include "ui/selector.h"
+#include "ui/utils.h"
+#include "ui/custui.h"
+
+const char *const ui_menu_custom_ui::hide_status[] = {
+ __("Show All"),
+ __("Hide Filters"),
+ __("Hide Info/Image"),
+ __("Hide Both") };
+
+//-------------------------------------------------
+// ctor
+//-------------------------------------------------
+
+ui_menu_custom_ui::ui_menu_custom_ui(running_machine &machine, render_container *container) : ui_menu(machine, container)
+{
+ // load languages
+ file_enumerator path(machine.options().language_path());
+ const char *lang = machine.options().language();
+ const osd_directory_entry *dirent;
+ int cnt = 0;
+ while ((dirent = path.next()) != nullptr)
+ if (dirent->type == ENTTYPE_DIR && strcmp(dirent->name, ".") != 0 && strcmp(dirent->name, "..") != 0)
+ {
+ auto name = std::string(dirent->name);
+ int i = strreplace(name, "_", " (");
+ if (i > 0) name = name.append(")");
+ m_lang.push_back(name);
+ if (strcmp(name.c_str(), lang) == 0)
+ m_currlang = cnt;
+ ++cnt;
+ }
+}
+
+//-------------------------------------------------
+// dtor
+//-------------------------------------------------
+
+ui_menu_custom_ui::~ui_menu_custom_ui()
+{
+ std::string error_string;
+ mame_machine_manager::instance()->ui().options().set_value(OPTION_HIDE_PANELS, ui_globals::panels_status, OPTION_PRIORITY_CMDLINE, error_string);
+ if (!m_lang.empty())
+ {
+ machine().options().set_value(OPTION_LANGUAGE, m_lang[m_currlang].c_str(), OPTION_PRIORITY_CMDLINE, error_string);
+ machine().options().mark_changed(OPTION_LANGUAGE);
+ load_translation(machine().options());
+ }
+ ui_globals::reset = true;
+}
+
+//-------------------------------------------------
+// handle
+//-------------------------------------------------
+
+void ui_menu_custom_ui::handle()
+{
+ bool changed = false;
+
+ // process the menu
+ const ui_menu_event *m_event = process(0);
+
+ if (m_event != nullptr && m_event->itemref != nullptr)
+ {
+ switch ((FPTR)m_event->itemref)
+ {
+ case FONT_MENU:
+ if (m_event->iptkey == IPT_UI_SELECT)
+ ui_menu::stack_push(global_alloc_clear<ui_menu_font_ui>(machine(), container));
+ break;
+ case COLORS_MENU:
+ if (m_event->iptkey == IPT_UI_SELECT)
+ ui_menu::stack_push(global_alloc_clear<ui_menu_colors_ui>(machine(), container));
+ break;
+ case HIDE_MENU:
+ {
+ if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
+ {
+ changed = true;
+ (m_event->iptkey == IPT_UI_RIGHT) ? ui_globals::panels_status++ : ui_globals::panels_status--;
+ }
+ else if (m_event->iptkey == IPT_UI_SELECT)
+ {
+ int total = ARRAY_LENGTH(hide_status);
+ std::vector<std::string> s_sel(total);
+ for (int index = 0; index < total; ++index)
+ s_sel[index] = _(hide_status[index]);
+
+ ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, ui_globals::panels_status));
+ }
+ break;
+ }
+ case LANGUAGE_MENU:
+ {
+ if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
+ {
+ changed = true;
+ (m_event->iptkey == IPT_UI_RIGHT) ? m_currlang++ : m_currlang--;
+ }
+ else if (m_event->iptkey == IPT_UI_SELECT)
+ {
+ int total = m_lang.size();
+ std::vector<std::string> s_sel(total);
+ for (int index = 0; index < total; ++index)
+ s_sel[index] = m_lang[index];
+
+ ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, m_currlang));
+ }
+ break;
+ }
+ }
+ }
+
+ if (changed)
+ reset(UI_MENU_RESET_REMEMBER_REF);
+}
+
+//-------------------------------------------------
+// populate
+//-------------------------------------------------
+
+void ui_menu_custom_ui::populate()
+{
+ UINT32 arrow_flags;
+ item_append(_("Fonts"), nullptr, 0, (void *)(FPTR)FONT_MENU);
+ item_append(_("Colors"), nullptr, 0, (void *)(FPTR)COLORS_MENU);
+
+ if (!m_lang.empty())
+ {
+ arrow_flags = get_arrow_flags(0, m_lang.size() - 1, m_currlang);
+ item_append(_("Language"), m_lang[m_currlang].c_str(), arrow_flags, (void *)(FPTR)LANGUAGE_MENU);
+ }
+
+ arrow_flags = get_arrow_flags(0, (int)HIDE_BOTH, ui_globals::panels_status);
+ item_append(_("Show side panels"), _(hide_status[ui_globals::panels_status]), arrow_flags, (void *)(FPTR)HIDE_MENU);
+
+ item_append(ui_menu_item_type::SEPARATOR);
+ customtop = mame_machine_manager::instance()->ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
+}
+
+//-------------------------------------------------
+// perform our special rendering
+//-------------------------------------------------
+
+void ui_menu_custom_ui::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+{
+ float width;
+ mame_ui_manager &mui = mame_machine_manager::instance()->ui();
+
+ mui.draw_text_full(container, _("Custom UI Settings"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ width += 2 * UI_BOX_LR_BORDER;
+ float maxwidth = MAX(origx2 - origx1, width);
+
+ // compute our bounds
+ float x1 = 0.5f - 0.5f * maxwidth;
+ float x2 = x1 + maxwidth;
+ float y1 = origy1 - top;
+ float y2 = origy1 - UI_BOX_TB_BORDER;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ // draw the text within it
+ mui.draw_text_full(container, _("Custom UI Settings"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
+}
+
+//-------------------------------------------------
+// ctor
+//-------------------------------------------------
+
+ui_menu_font_ui::ui_menu_font_ui(running_machine &machine, render_container *container) : ui_menu(machine, container)
+{
+ ui_options &moptions = mame_machine_manager::instance()->ui().options();
+ std::string name(machine.options().ui_font());
+ list();
+
+#ifdef UI_WINDOWS
+ m_bold = (strreplace(name, "[B]", "") + strreplace(name, "[b]", "") > 0);
+ m_italic = (strreplace(name, "[I]", "") + strreplace(name, "[i]", "") > 0);
+#endif
+ m_actual = 0;
+
+ for (size_t index = 0; index < m_fonts.size(); index++)
+ {
+ if (m_fonts[index].first == name)
+ {
+ m_actual = index;
+ break;
+ }
+ }
+
+ m_info_size = moptions.infos_size();
+ m_font_size = moptions.font_rows();
+
+ for (ui_options::entry &f_entry : moptions)
+ {
+ const char *name = f_entry.name();
+ if (name && strlen(name) && !strcmp(OPTION_INFOS_SIZE, f_entry.name()))
+ {
+ m_info_max = atof(f_entry.maximum());
+ m_info_min = atof(f_entry.minimum());
+ }
+ else if (name && strlen(name) && !strcmp(OPTION_FONT_ROWS, f_entry.name()))
+ {
+ m_font_max = atof(f_entry.maximum());
+ m_font_min = atof(f_entry.minimum());
+ }
+ }
+
+}
+
+//-------------------------------------------------
+// create fonts list
+//-------------------------------------------------
+
+void ui_menu_font_ui::list()
+{
+ machine().osd().get_font_families(machine().options().font_path(), m_fonts);
+
+ // add default string to the top of array
+ m_fonts.emplace(m_fonts.begin(), std::string("default"), std::string(_("default")));
+}
+
+//-------------------------------------------------
+// dtor
+//-------------------------------------------------
+
+ui_menu_font_ui::~ui_menu_font_ui()
+{
+ std::string error_string;
+ ui_options &moptions = mame_machine_manager::instance()->ui().options();
+
+ std::string name(m_fonts[m_actual].first);
+#ifdef UI_WINDOWS
+ if (name != "default")
+ {
+ if (m_italic)
+ name.insert(0, "[I]");
+ if (m_bold)
+ name.insert(0, "[B]");
+ }
+#endif
+ machine().options().set_value(OPTION_UI_FONT, name.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
+ machine().options().mark_changed(OPTION_UI_FONT);
+
+ moptions.set_value(OPTION_INFOS_SIZE, m_info_size, OPTION_PRIORITY_CMDLINE, error_string);
+ moptions.set_value(OPTION_FONT_ROWS, m_font_size, OPTION_PRIORITY_CMDLINE, error_string);
+}
+
+//-------------------------------------------------
+// handle
+//-------------------------------------------------
+
+void ui_menu_font_ui::handle()
+{
+ bool changed = false;
+
+ // process the menu
+ const ui_menu_event *m_event = process(UI_MENU_PROCESS_LR_REPEAT);
+
+ if (m_event != nullptr && m_event->itemref != nullptr)
+ switch ((FPTR)m_event->itemref)
+ {
+ case INFOS_SIZE:
+ if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
+ {
+ (m_event->iptkey == IPT_UI_RIGHT) ? m_info_size += 0.05f : m_info_size -= 0.05f;
+ changed = true;
+ }
+ break;
+
+ case FONT_SIZE:
+ if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
+ {
+ (m_event->iptkey == IPT_UI_RIGHT) ? m_font_size++ : m_font_size--;
+ changed = true;
+ }
+ break;
+
+
+ case MUI_FNT:
+ if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
+ {
+ (m_event->iptkey == IPT_UI_RIGHT) ? m_actual++ : m_actual--;
+ changed = true;
+ }
+ else if (m_event->iptkey == IPT_UI_SELECT)
+ {
+ std::vector<std::string> display_names;
+ display_names.reserve(m_fonts.size());
+ for (auto const &font : m_fonts) display_names.emplace_back(font.second);
+ ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, std::move(display_names), m_actual));
+ changed = true;
+ }
+ break;
+
+#ifdef UI_WINDOWS
+ case MUI_BOLD:
+ case MUI_ITALIC:
+ if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT || m_event->iptkey == IPT_UI_SELECT)
+ {
+ ((FPTR)m_event->itemref == MUI_BOLD) ? m_bold = !m_bold : m_italic = !m_italic;
+ changed = true;
+ }
+ break;
+#endif
+ }
+
+ if (changed)
+ reset(UI_MENU_RESET_REMEMBER_REF);
+}
+
+//-------------------------------------------------
+// populate
+//-------------------------------------------------
+
+void ui_menu_font_ui::populate()
+{
+ // set filter arrow
+ UINT32 arrow_flags;
+
+ // add fonts option
+ arrow_flags = get_arrow_flags(0, m_fonts.size() - 1, m_actual);
+ item_append(_("UI Font"), m_fonts[m_actual].second.c_str(), arrow_flags, (void *)(FPTR)MUI_FNT);
+
+#ifdef UI_WINDOWS
+ if (m_fonts[m_actual].first != "default")
+ {
+ item_append(_("Bold"), m_bold ? "On" : "Off", m_bold ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)MUI_BOLD);
+ item_append(_("Italic"), m_italic ? "On" : "Off", m_italic ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)(FPTR)MUI_ITALIC);
+ }
+#endif
+
+ arrow_flags = get_arrow_flags(m_font_min, m_font_max, m_font_size);
+ item_append(_("Lines"), string_format("%2d", m_font_size).c_str(), arrow_flags, (void *)(FPTR)FONT_SIZE);
+
+ item_append(ui_menu_item_type::SEPARATOR);
+
+ // add item
+ arrow_flags = get_arrow_flags(m_info_min, m_info_max, m_info_size);
+ item_append(_("Infos text size"), string_format("%3.2f", m_info_size).c_str(), arrow_flags, (void *)(FPTR)INFOS_SIZE);
+
+ item_append(ui_menu_item_type::SEPARATOR);
+
+ custombottom = customtop = mame_machine_manager::instance()->ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
+}
+
+//-------------------------------------------------
+// perform our special rendering
+//-------------------------------------------------
+
+void ui_menu_font_ui::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+{
+ float width;
+ mame_ui_manager &mui = mame_machine_manager::instance()->ui();
+
+ // top text
+ std::string topbuf(_("UI Fonts Settings"));
+
+ mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ width += 2 * UI_BOX_LR_BORDER;
+ float maxwidth = MAX(origx2 - origx1, width);
+
+ // compute our bounds
+ float x1 = 0.5f - 0.5f * maxwidth;
+ float x2 = x1 + maxwidth;
+ float y1 = origy1 - top;
+ float y2 = origy1 - UI_BOX_TB_BORDER;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ // draw the text within it
+ mui.draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
+
+ if ((FPTR)selectedref == INFOS_SIZE)
+ {
+ topbuf = _("Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
+
+ mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_NEVER,
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr, m_info_size);
+ width += 2 * UI_BOX_LR_BORDER;
+ maxwidth = MAX(origx2 - origx1, width);
+
+ // compute our bounds
+ x1 = 0.5f - 0.5f * maxwidth;
+ x2 = x1 + maxwidth;
+ y1 = origy2 + UI_BOX_TB_BORDER;
+ y2 = origy2 + bottom;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ // draw the text within it
+ mui.draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_LEFT, WRAP_NEVER,
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, m_info_size);
+ }
+}
+
+//-------------------------------------------------
+// ctor
+//-------------------------------------------------
+#define SET_COLOR_UI(var, opt) var[M##opt].color = opt; var[M##opt].option = OPTION_##opt
+
+ui_menu_colors_ui::ui_menu_colors_ui(running_machine &machine, render_container *container) : ui_menu(machine, container)
+{
+ SET_COLOR_UI(m_color_table, UI_BACKGROUND_COLOR);
+ SET_COLOR_UI(m_color_table, UI_BORDER_COLOR);
+ SET_COLOR_UI(m_color_table, UI_CLONE_COLOR);
+ SET_COLOR_UI(m_color_table, UI_DIPSW_COLOR);
+ SET_COLOR_UI(m_color_table, UI_GFXVIEWER_BG_COLOR);
+ SET_COLOR_UI(m_color_table, UI_MOUSEDOWN_BG_COLOR);
+ SET_COLOR_UI(m_color_table, UI_MOUSEDOWN_COLOR);
+ SET_COLOR_UI(m_color_table, UI_MOUSEOVER_BG_COLOR);
+ SET_COLOR_UI(m_color_table, UI_MOUSEOVER_COLOR);
+ SET_COLOR_UI(m_color_table, UI_SELECTED_BG_COLOR);
+ SET_COLOR_UI(m_color_table, UI_SELECTED_COLOR);
+ SET_COLOR_UI(m_color_table, UI_SLIDER_COLOR);
+ SET_COLOR_UI(m_color_table, UI_SUBITEM_COLOR);
+ SET_COLOR_UI(m_color_table, UI_TEXT_BG_COLOR);
+ SET_COLOR_UI(m_color_table, UI_TEXT_COLOR);
+ SET_COLOR_UI(m_color_table, UI_UNAVAILABLE_COLOR);
+}
+
+//-------------------------------------------------
+// dtor
+//-------------------------------------------------
+
+ui_menu_colors_ui::~ui_menu_colors_ui()
+{
+ std::string error_string, dec_color;
+ for (int index = 1; index < MUI_RESTORE; index++)
+ {
+ dec_color = string_format("%x", (UINT32)m_color_table[index].color);
+ mame_machine_manager::instance()->ui().options().set_value(m_color_table[index].option, dec_color.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
+ }
+}
+
+//-------------------------------------------------
+// handle
+//-------------------------------------------------
+
+void ui_menu_colors_ui::handle()
+{
+ bool changed = false;
+
+ // process the menu
+ const ui_menu_event *m_event = process(0);
+
+ if (m_event != nullptr && m_event->itemref != nullptr && m_event->iptkey == IPT_UI_SELECT)
+ {
+ if ((FPTR)m_event->itemref != MUI_RESTORE)
+ ui_menu::stack_push(global_alloc_clear<ui_menu_rgb_ui>(machine(), container, &m_color_table[(FPTR)m_event->itemref].color, item[selected].text));
+ else
+ {
+ changed = true;
+ restore_colors();
+ }
+ }
+
+ if (changed)
+ reset(UI_MENU_RESET_REMEMBER_REF);
+}
+
+//-------------------------------------------------
+// populate
+//-------------------------------------------------
+
+void ui_menu_colors_ui::populate()
+{
+ item_append(_("Normal text"), nullptr, 0, (void *)(FPTR)MUI_TEXT_COLOR);
+ item_append(_("Selected color"), nullptr, 0, (void *)(FPTR)MUI_SELECTED_COLOR);
+ item_append(_("Normal text background"), nullptr, 0, (void *)(FPTR)MUI_TEXT_BG_COLOR);
+ item_append(_("Selected background color"), nullptr, 0, (void *)(FPTR)MUI_SELECTED_BG_COLOR);
+ item_append(_("Subitem color"), nullptr, 0, (void *)(FPTR)MUI_SUBITEM_COLOR);
+ item_append(_("Clone"), nullptr, 0, (void *)(FPTR)MUI_CLONE_COLOR);
+ item_append(_("Border"), nullptr, 0, (void *)(FPTR)MUI_BORDER_COLOR);
+ item_append(_("Background"), nullptr, 0, (void *)(FPTR)MUI_BACKGROUND_COLOR);
+ item_append(_("Dipswitch"), nullptr, 0, (void *)(FPTR)MUI_DIPSW_COLOR);
+ item_append(_("Unavailable color"), nullptr, 0, (void *)(FPTR)MUI_UNAVAILABLE_COLOR);
+ item_append(_("Slider color"), nullptr, 0, (void *)(FPTR)MUI_SLIDER_COLOR);
+ item_append(_("Gfx viewer background"), nullptr, 0, (void *)(FPTR)MUI_GFXVIEWER_BG_COLOR);
+ item_append(_("Mouse over color"), nullptr, 0, (void *)(FPTR)MUI_MOUSEOVER_COLOR);
+ item_append(_("Mouse over background color"), nullptr, 0, (void *)(FPTR)MUI_MOUSEOVER_BG_COLOR);
+ item_append(_("Mouse down color"), nullptr, 0, (void *)(FPTR)MUI_MOUSEDOWN_COLOR);
+ item_append(_("Mouse down background color"), nullptr, 0, (void *)(FPTR)MUI_MOUSEDOWN_BG_COLOR);
+
+ item_append(ui_menu_item_type::SEPARATOR);
+ item_append(_("Restore originals colors"), nullptr, 0, (void *)(FPTR)MUI_RESTORE);
+
+ custombottom = customtop = mame_machine_manager::instance()->ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
+}
+
+//-------------------------------------------------
+// perform our special rendering
+//-------------------------------------------------
+
+void ui_menu_colors_ui::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+{
+ float width, maxwidth = origx2 - origx1;
+ mame_ui_manager &mui = mame_machine_manager::instance()->ui();
+ float line_height = mui.get_line_height();
+
+ // top text
+ std::string topbuf(_("UI Colors Settings"));
+
+ mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ width += 2 * UI_BOX_LR_BORDER;
+ maxwidth = MAX(maxwidth, width);
+
+ // compute our bounds
+ float x1 = 0.5f - 0.5f * maxwidth;
+ float x2 = x1 + maxwidth;
+ float y1 = origy1 - top;
+ float y2 = origy1 - UI_BOX_TB_BORDER;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ // draw the text within it
+ mui.draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
+
+ // bottom text
+ // get the text for 'UI Select'
+ std::string ui_select_text = machine().input().seq_name(machine().ioport().type_seq(IPT_UI_SELECT, 0, SEQ_TYPE_STANDARD));
+ topbuf = string_format(_("Double click or press %1$s to change the color value"), ui_select_text);
+
+ mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ width += 2 * UI_BOX_LR_BORDER;
+ maxwidth = MAX(maxwidth, width);
+
+ // compute our bounds
+ x1 = 0.5f - 0.5f * maxwidth;
+ x2 = x1 + maxwidth;
+ y1 = origy2 + UI_BOX_TB_BORDER;
+ y2 = origy2 + bottom;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_RED_COLOR);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ // draw the text within it
+ mui.draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
+
+ // compute maxwidth
+ topbuf = _("Menu Preview");
+
+ mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ maxwidth = width + 2.0f * UI_BOX_LR_BORDER;
+
+ std::string sampletxt[5];
+
+ sampletxt[0] = _("Normal");
+ sampletxt[1] = _("Subitem");
+ sampletxt[2] = _("Selected");
+ sampletxt[3] = _("Mouse Over");
+ sampletxt[4] = _("Clone");
+
+ for (auto & elem: sampletxt)
+ {
+ mui.draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ width += 2 * UI_BOX_LR_BORDER;
+ maxwidth = MAX(maxwidth, width);
+ }
+
+ // compute our bounds for header
+ x1 = origx2 + 2.0f * UI_BOX_LR_BORDER;
+ x2 = x1 + maxwidth;
+ y1 = origy1;
+ y2 = y1 + bottom - UI_BOX_TB_BORDER;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+ y2 -= UI_BOX_TB_BORDER;
+
+ // draw the text within it
+ mui.draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
+
+ // compute our bounds for menu preview
+ x1 -= UI_BOX_LR_BORDER;
+ x2 += UI_BOX_LR_BORDER;
+ y1 = y2 + 2.0f * UI_BOX_TB_BORDER;
+ y2 = y1 + 5.0f * line_height + 2.0f * UI_BOX_TB_BORDER;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, m_color_table[MUI_BACKGROUND_COLOR].color);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ // draw normal text
+ mui.draw_text_full(container, sampletxt[0].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NORMAL, m_color_table[MUI_TEXT_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr);
+ y1 += line_height;
+
+ // draw subitem text
+ mui.draw_text_full(container, sampletxt[1].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NORMAL, m_color_table[MUI_SUBITEM_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr);
+ y1 += line_height;
+
+ // draw selected text
+ highlight(container, x1, y1, x2, y1 + line_height, m_color_table[MUI_SELECTED_BG_COLOR].color);
+ mui.draw_text_full(container, sampletxt[2].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NORMAL, m_color_table[MUI_SELECTED_COLOR].color, m_color_table[MUI_SELECTED_BG_COLOR].color, nullptr, nullptr);
+ y1 += line_height;
+
+ // draw mouse over text
+ highlight(container, x1, y1, x2, y1 + line_height, m_color_table[MUI_MOUSEOVER_BG_COLOR].color);
+ mui.draw_text_full(container, sampletxt[3].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NORMAL, m_color_table[MUI_MOUSEOVER_COLOR].color, m_color_table[MUI_MOUSEOVER_BG_COLOR].color, nullptr, nullptr);
+ y1 += line_height;
+
+ // draw clone text
+ mui.draw_text_full(container, sampletxt[4].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NORMAL, m_color_table[MUI_CLONE_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr);
+
+}
+
+//-------------------------------------------------
+// restore original colors
+//-------------------------------------------------
+
+void ui_menu_colors_ui::restore_colors()
+{
+ ui_options options;
+ for (int index = 1; index < MUI_RESTORE; index++)
+ m_color_table[index].color = rgb_t((UINT32)strtoul(options.value(m_color_table[index].option), nullptr, 16));
+}
+
+//-------------------------------------------------
+// ctor
+//-------------------------------------------------
+
+ui_menu_rgb_ui::ui_menu_rgb_ui(running_machine &machine, render_container *container, rgb_t *_color, std::string _title) : ui_menu(machine, container)
+{
+ m_color = _color;
+ m_key_active = false;
+ m_lock_ref = 0;
+ m_title = _title;
+ m_search[0] = '\0';
+}
+
+//-------------------------------------------------
+// dtor
+//-------------------------------------------------
+
+ui_menu_rgb_ui::~ui_menu_rgb_ui()
+{
+}
+
+//-------------------------------------------------
+// handle
+//-------------------------------------------------
+
+void ui_menu_rgb_ui::handle()
+{
+ bool changed = false;
+
+ // process the menu
+ const ui_menu_event *m_event;
+
+ if (!m_key_active)
+ m_event = process(UI_MENU_PROCESS_LR_REPEAT);
+ else
+ m_event = process(UI_MENU_PROCESS_ONLYCHAR);
+
+ if (m_event != nullptr && m_event->itemref != nullptr)
+ {
+ switch ((FPTR)m_event->itemref)
+ {
+ case RGB_ALPHA:
+ if (m_event->iptkey == IPT_UI_LEFT && m_color->a() > 1)
+ {
+ m_color->set_a(m_color->a() - 1);
+ changed = true;
+ }
+
+ else if (m_event->iptkey == IPT_UI_RIGHT && m_color->a() < 255)
+ {
+ m_color->set_a(m_color->a() + 1);
+ changed = true;
+ }
+
+ else if (m_event->iptkey == IPT_UI_SELECT || m_event->iptkey == IPT_SPECIAL)
+ {
+ inkey_special(m_event);
+ changed = true;
+ }
+
+ break;
+
+ case RGB_RED:
+ if (m_event->iptkey == IPT_UI_LEFT && m_color->r() > 1)
+ {
+ m_color->set_r(m_color->r() - 1);
+ changed = true;
+ }
+
+ else if (m_event->iptkey == IPT_UI_RIGHT && m_color->r() < 255)
+ {
+ m_color->set_r(m_color->r() + 1);
+ changed = true;
+ }
+
+ else if (m_event->iptkey == IPT_UI_SELECT || m_event->iptkey == IPT_SPECIAL)
+ {
+ inkey_special(m_event);
+ changed = true;
+ }
+
+ break;
+
+ case RGB_GREEN:
+ if (m_event->iptkey == IPT_UI_LEFT && m_color->g() > 1)
+ {
+ m_color->set_g(m_color->g() - 1);
+ changed = true;
+ }
+
+ else if (m_event->iptkey == IPT_UI_RIGHT && m_color->g() < 255)
+ {
+ m_color->set_g(m_color->g() + 1);
+ changed = true;
+ }
+
+ else if (m_event->iptkey == IPT_UI_SELECT || m_event->iptkey == IPT_SPECIAL)
+ {
+ inkey_special(m_event);
+ changed = true;
+ }
+
+ break;
+
+ case RGB_BLUE:
+ if (m_event->iptkey == IPT_UI_LEFT && m_color->b() > 1)
+ {
+ m_color->set_b(m_color->b() - 1);
+ changed = true;
+ }
+
+ else if (m_event->iptkey == IPT_UI_RIGHT && m_color->b() < 255)
+ {
+ m_color->set_b(m_color->b() + 1);
+ changed = true;
+ }
+
+ else if (m_event->iptkey == IPT_UI_SELECT || m_event->iptkey == IPT_SPECIAL)
+ {
+ inkey_special(m_event);
+ changed = true;
+ }
+
+ break;
+
+ case PALETTE_CHOOSE:
+ if (m_event->iptkey == IPT_UI_SELECT)
+ ui_menu::stack_push(global_alloc_clear<ui_menu_palette_sel>(machine(), container, *m_color));
+ break;
+ }
+ }
+
+ if (changed)
+ reset(UI_MENU_RESET_REMEMBER_REF);
+}
+
+//-------------------------------------------------
+// populate
+//-------------------------------------------------
+
+void ui_menu_rgb_ui::populate()
+{
+ // set filter arrow
+ UINT32 arrow_flags = MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW;
+ std::string s_text = std::string(m_search).append("_");
+
+ if (m_lock_ref != RGB_ALPHA)
+ {
+ arrow_flags = get_arrow_flags(0, 255, m_color->a());
+ item_append(_("Alpha"), string_format("%3u", m_color->a()).c_str(), arrow_flags, (void *)(FPTR)RGB_ALPHA);
+ }
+ else
+ item_append(_("Alpha"), s_text.c_str(), 0, (void *)(FPTR)RGB_ALPHA);
+
+ if (m_lock_ref != RGB_RED)
+ {
+ arrow_flags = get_arrow_flags(0, 255, m_color->r());
+ item_append(_("Red"), string_format("%3u", m_color->r()).c_str(), arrow_flags, (void *)(FPTR)RGB_RED);
+ }
+ else
+ item_append(_("Red"), s_text.c_str(), 0, (void *)(FPTR)RGB_RED);
+
+ if (m_lock_ref != RGB_GREEN)
+ {
+ arrow_flags = get_arrow_flags(0, 255, m_color->g());
+ item_append(_("Green"), string_format("%3u", m_color->g()).c_str(), arrow_flags, (void *)(FPTR)RGB_GREEN);
+ }
+ else
+ item_append(_("Green"), s_text.c_str(), 0, (void *)(FPTR)RGB_GREEN);
+
+ if (m_lock_ref != RGB_BLUE)
+ {
+ arrow_flags = get_arrow_flags(0, 255, m_color->b());
+ item_append(_("Blue"), string_format("%3u", m_color->b()).c_str(), arrow_flags, (void *)(FPTR)RGB_BLUE);
+ }
+ else
+ item_append(_("Blue"), s_text.c_str(), 0, (void *)(FPTR)RGB_BLUE);
+
+ item_append(ui_menu_item_type::SEPARATOR);
+ item_append(_("Choose from palette"), nullptr, 0, (void *)(FPTR)PALETTE_CHOOSE);
+ item_append(ui_menu_item_type::SEPARATOR);
+
+ custombottom = customtop = mame_machine_manager::instance()->ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
+}
+
+//-------------------------------------------------
+// perform our special rendering
+//-------------------------------------------------
+
+void ui_menu_rgb_ui::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+{
+ float width, maxwidth = origx2 - origx1;
+ mame_ui_manager &mui = mame_machine_manager::instance()->ui();
+
+ // top text
+ std::string topbuf = std::string(m_title).append(_(" - ARGB Settings"));
+ mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ width += 2 * UI_BOX_LR_BORDER;
+ maxwidth = MAX(maxwidth, width);
+
+ // compute our bounds
+ float x1 = 0.5f - 0.5f * maxwidth;
+ float x2 = x1 + maxwidth;
+ float y1 = origy1 - top;
+ float y2 = origy1 - UI_BOX_TB_BORDER;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ // draw the text within it
+ mui.draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
+
+ std::string sampletxt(_("Color preview ="));
+ maxwidth = origx2 - origx1;
+ mui.draw_text_full(container, sampletxt.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ width += 2 * UI_BOX_LR_BORDER;
+ maxwidth = MAX(maxwidth, width);
+
+ // compute our bounds
+ x1 -= UI_BOX_LR_BORDER;
+ x2 = x1 + width;
+ y1 = origy2 + UI_BOX_TB_BORDER;
+ y2 = origy2 + bottom;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_RED_COLOR);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ // draw the normal text
+ mui.draw_text_full(container, sampletxt.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NORMAL, ARGB_WHITE, ARGB_BLACK, nullptr, nullptr);
+
+ float t_x2 = x1 - UI_BOX_LR_BORDER + maxwidth;
+ x1 = x2 + 2.0f * UI_BOX_LR_BORDER;
+ x2 = t_x2;
+ y1 -= UI_BOX_TB_BORDER;
+
+ mui.draw_outlined_box(container, x1, y1, x2, y2, *m_color);
+
+}
+
+//-------------------------------------------------
+// handle special key event
+//-------------------------------------------------
+
+void ui_menu_rgb_ui::inkey_special(const ui_menu_event *m_event)
+{
+ if (m_event->iptkey == IPT_UI_SELECT)
+ {
+ m_key_active = !m_key_active;
+ m_lock_ref = (FPTR)m_event->itemref;
+
+ if (!m_key_active)
+ {
+ int val = atoi(m_search);
+ val = m_color->clamp(val);
+
+ switch ((FPTR)m_event->itemref)
+ {
+ case RGB_ALPHA:
+ m_color->set_a(val);
+ break;
+
+ case RGB_RED:
+ m_color->set_r(val);
+ break;
+
+ case RGB_GREEN:
+ m_color->set_g(val);
+ break;
+
+ case RGB_BLUE:
+ m_color->set_b(val);
+ break;
+ }
+
+ m_search[0] = 0;
+ m_lock_ref = 0;
+ return;
+ }
+ }
+
+ if (!m_key_active)
+ {
+ m_search[0] = 0;
+ return;
+ }
+
+ int buflen = strlen(m_search);
+
+ // if it's a backspace and we can handle it, do so
+ if (((m_event->unichar == 8 || m_event->unichar == 0x7f) && buflen > 0))
+ *(char *)utf8_previous_char(&m_search[buflen]) = 0;
+ else if (buflen >= 3)
+ return;
+ // if it's any other key and we're not maxed out, update
+ else if ((m_event->unichar >= '0' && m_event->unichar <= '9'))
+ buflen += utf8_from_uchar(&m_search[buflen], ARRAY_LENGTH(m_search) - buflen, m_event->unichar);
+
+ m_search[buflen] = 0;
+}
+
+ui_menu_palette_sel::palcolor ui_menu_palette_sel::m_palette[] = {
+ { __("White"), "FFFFFFFF" },
+ { __("Silver"), "FFC0C0C0" },
+ { __("Gray"), "FF808080" },
+ { __("Black"), "FF000000" },
+ { __("Red"), "FFFF0000" },
+ { __("Orange"), "FFFFA500" },
+ { __("Yellow"), "FFFFFF00" },
+ { __("Green"), "FF00FF00" },
+ { __("Blue"), "FF0000FF" },
+ { __("Violet"), "FF8F00FF" }
+};
+
+//-------------------------------------------------
+// ctor
+//-------------------------------------------------
+
+ui_menu_palette_sel::ui_menu_palette_sel(running_machine &machine, render_container *container, rgb_t &_color)
+ : ui_menu(machine, container), m_original(_color)
+{
+}
+
+//-------------------------------------------------
+// dtor
+//-------------------------------------------------
+
+ui_menu_palette_sel::~ui_menu_palette_sel()
+{
+}
+
+//-------------------------------------------------
+// handle
+//-------------------------------------------------
+
+void ui_menu_palette_sel::handle()
+{
+ // process the menu
+ const ui_menu_event *m_event = process(MENU_FLAG_UI_PALETTE);
+ if (m_event != nullptr && m_event->itemref != nullptr)
+ {
+ if (m_event->iptkey == IPT_UI_SELECT)
+ {
+ m_original = rgb_t((UINT32)strtoul(item[selected].subtext, nullptr, 16));
+ ui_menu::menu_stack->parent->reset(UI_MENU_RESET_SELECT_FIRST);
+ ui_menu::stack_pop(machine());
+ }
+ }
+}
+
+//-------------------------------------------------
+// populate
+//-------------------------------------------------
+
+void ui_menu_palette_sel::populate()
+{
+ for (int x = 0; x < ARRAY_LENGTH(m_palette); ++x)
+ item_append(_(m_palette[x].name), m_palette[x].argb, MENU_FLAG_UI_PALETTE, (void *)(FPTR)(x + 1));
+
+ item_append(ui_menu_item_type::SEPARATOR);
+}
+
+//-------------------------------------------------
+// perform our special rendering
+//-------------------------------------------------
+
+void ui_menu_palette_sel::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+{
+}
diff --git a/src/frontend/mame/ui/custui.h b/src/frontend/mame/ui/custui.h
new file mode 100644
index 00000000000..0aeffca9c5b
--- /dev/null
+++ b/src/frontend/mame/ui/custui.h
@@ -0,0 +1,178 @@
+// license:BSD-3-Clause
+// copyright-holders:Maurizio Petrarota
+/***************************************************************************
+
+ ui/custui.h
+
+ Internal UI user interface.
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef MAME_EMU_UI_UI_CUSTUI_H
+#define MAME_EMU_UI_UI_CUSTUI_H
+
+//-------------------------------------------------
+// Custom UI menu
+//-------------------------------------------------
+
+class ui_menu_custom_ui : public ui_menu
+{
+public:
+ ui_menu_custom_ui(running_machine &machine, render_container *container);
+ virtual ~ui_menu_custom_ui();
+ virtual void populate() override;
+ virtual void handle() override;
+ virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
+
+private:
+ enum
+ {
+ LANGUAGE_MENU = 1,
+ FONT_MENU,
+ COLORS_MENU,
+ HIDE_MENU
+ };
+ static const char *const hide_status[];
+ std::vector<std::string> m_lang;
+ std::uint16_t m_currlang;
+};
+
+//-------------------------------------------------
+// Font UI menu
+//-------------------------------------------------
+
+class ui_menu_font_ui : public ui_menu
+{
+public:
+ ui_menu_font_ui(running_machine &machine, render_container *container);
+ virtual ~ui_menu_font_ui();
+ virtual void populate() override;
+ virtual void handle() override;
+ virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
+
+private:
+ enum
+ {
+ INFOS_SIZE = 1,
+ FONT_SIZE,
+ MUI_FNT,
+ MUI_BOLD,
+ MUI_ITALIC
+ };
+
+ void list();
+
+ std::uint16_t m_actual;
+ std::vector<std::pair<std::string, std::string> > m_fonts;
+#ifdef UI_WINDOWS
+ bool m_bold, m_italic;
+#endif
+
+ float m_info_min, m_info_max, m_info_size;
+ int m_font_min, m_font_max, m_font_size;
+};
+
+//-------------------------------------------------
+// Colors UI menu
+//-------------------------------------------------
+
+class ui_menu_colors_ui : public ui_menu
+{
+public:
+ ui_menu_colors_ui(running_machine &machine, render_container *container);
+ virtual ~ui_menu_colors_ui();
+ virtual void populate() override;
+ virtual void handle() override;
+ virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
+
+private:
+ enum
+ {
+ MUI_BACKGROUND_COLOR = 1,
+ MUI_BORDER_COLOR,
+ MUI_CLONE_COLOR,
+ MUI_DIPSW_COLOR,
+ MUI_GFXVIEWER_BG_COLOR,
+ MUI_MOUSEDOWN_BG_COLOR,
+ MUI_MOUSEDOWN_COLOR,
+ MUI_MOUSEOVER_BG_COLOR,
+ MUI_MOUSEOVER_COLOR,
+ MUI_SELECTED_BG_COLOR,
+ MUI_SELECTED_COLOR,
+ MUI_SLIDER_COLOR,
+ MUI_SUBITEM_COLOR,
+ MUI_TEXT_BG_COLOR,
+ MUI_TEXT_COLOR,
+ MUI_UNAVAILABLE_COLOR,
+ MUI_RESTORE
+ };
+
+ struct s_color_table
+ {
+ rgb_t color;
+ const char *option;
+ };
+
+ s_color_table m_color_table[MUI_RESTORE];
+ void restore_colors();
+};
+
+//-------------------------------------------------
+// ARGB UI menu
+//-------------------------------------------------
+
+class ui_menu_rgb_ui : public ui_menu
+{
+public:
+ ui_menu_rgb_ui(running_machine &machine, render_container *container, rgb_t *_color, std::string _title);
+ virtual ~ui_menu_rgb_ui();
+ virtual void populate() override;
+ virtual void handle() override;
+ virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
+
+private:
+ rgb_t *m_color;
+ char m_search[4];
+ bool m_key_active;
+ int m_lock_ref;
+ std::string m_title;
+
+ enum
+ {
+ RGB_ALPHA = 1,
+ RGB_RED,
+ RGB_GREEN,
+ RGB_BLUE,
+ PALETTE_CHOOSE
+ };
+
+ void inkey_special(const ui_menu_event *menu_event);
+};
+
+//-------------------------------------------------
+// Palette UI menu
+//-------------------------------------------------
+
+class ui_menu_palette_sel : public ui_menu
+{
+public:
+ ui_menu_palette_sel(running_machine &machine, render_container *container, rgb_t &_color);
+ virtual ~ui_menu_palette_sel();
+ virtual void populate() override;
+ virtual void handle() override;
+ virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
+
+private:
+ struct palcolor
+ {
+ const char *name;
+ const char *argb;
+ };
+
+ static palcolor m_palette[];
+ rgb_t &m_original;
+};
+
+#endif // MAME_EMU_UI_UI_CUSTUI_H
diff --git a/src/frontend/mame/ui/datfile.cpp b/src/frontend/mame/ui/datfile.cpp
new file mode 100644
index 00000000000..1e2ca1d6938
--- /dev/null
+++ b/src/frontend/mame/ui/datfile.cpp
@@ -0,0 +1,680 @@
+// license:BSD-3-Clause
+// copyright-holders:Maurizio Petrarota
+/***************************************************************************
+
+ ui/datfile.cpp
+
+ UI DATs manager.
+
+***************************************************************************/
+
+#include "emu.h"
+#include "drivenum.h"
+#include "ui/ui.h"
+#include "ui/datfile.h"
+#include "ui/utils.h"
+
+//-------------------------------------------------
+// TAGS
+//-------------------------------------------------
+static std::string DATAFILE_TAG("$");
+static std::string TAG_BIO("$bio");
+static std::string TAG_INFO("$info");
+static std::string TAG_MAME("$mame");
+static std::string TAG_COMMAND("$cmd");
+static std::string TAG_END("$end");
+static std::string TAG_DRIVER("$drv");
+static std::string TAG_STORY("$story");
+static std::string TAG_HISTORY_R("## REVISION:");
+static std::string TAG_MAMEINFO_R("# MAMEINFO.DAT");
+static std::string TAG_MESSINFO_R("# MESSINFO.DAT");
+static std::string TAG_SYSINFO_R("# This file was generated on");
+static std::string TAG_STORY_R("# version");
+static std::string TAG_COMMAND_SEPARATOR("-----------------------------------------------");
+static std::string TAG_GAMEINIT_R("# GAMEINIT.DAT");
+
+//-------------------------------------------------
+// Statics
+//-------------------------------------------------
+datfile_manager::dataindex datfile_manager::m_histidx;
+datfile_manager::dataindex datfile_manager::m_mameidx;
+datfile_manager::dataindex datfile_manager::m_messidx;
+datfile_manager::dataindex datfile_manager::m_cmdidx;
+datfile_manager::dataindex datfile_manager::m_sysidx;
+datfile_manager::dataindex datfile_manager::m_storyidx;
+datfile_manager::dataindex datfile_manager::m_ginitidx;
+datfile_manager::drvindex datfile_manager::m_drvidx;
+datfile_manager::drvindex datfile_manager::m_messdrvidx;
+datfile_manager::drvindex datfile_manager::m_menuidx;
+datfile_manager::swindex datfile_manager::m_swindex;
+std::string datfile_manager::m_history_rev;
+std::string datfile_manager::m_mame_rev;
+std::string datfile_manager::m_mess_rev;
+std::string datfile_manager::m_sysinfo_rev;
+std::string datfile_manager::m_story_rev;
+std::string datfile_manager::m_ginit_rev;
+bool datfile_manager::first_run = true;
+
+//-------------------------------------------------
+// ctor
+//-------------------------------------------------
+datfile_manager::datfile_manager(running_machine &machine) : m_machine(machine)
+{
+ if (mame_machine_manager::instance()->ui().options().enabled_dats() && first_run)
+ {
+ first_run = false;
+ if (parseopen("mameinfo.dat"))
+ {
+ init_mameinfo();
+ parseclose();
+ }
+
+ if (parseopen("command.dat"))
+ {
+ init_command();
+ parseclose();
+ }
+
+ if (parseopen("story.dat"))
+ {
+ init_storyinfo();
+ parseclose();
+ }
+
+ if (parseopen("messinfo.dat"))
+ {
+ init_messinfo();
+ parseclose();
+ }
+
+ if (parseopen("sysinfo.dat"))
+ {
+ init_sysinfo();
+ parseclose();
+ }
+
+ if (parseopen("history.dat"))
+ {
+ init_history();
+ parseclose();
+ }
+
+ if (parseopen("gameinit.dat"))
+ {
+ init_gameinit();
+ parseclose();
+ }
+ }
+}
+
+//-------------------------------------------------
+// initialize sysinfo.dat index
+//-------------------------------------------------
+void datfile_manager::init_sysinfo()
+{
+ int swcount = 0;
+ int count = index_datafile(m_sysidx, swcount);
+ osd_printf_verbose("Sysinfo.dat games found = %i\n", count);
+ osd_printf_verbose("Rev = %s\n", m_sysinfo_rev.c_str());
+}
+
+//-------------------------------------------------
+// initialize story.dat index
+//-------------------------------------------------
+void datfile_manager::init_storyinfo()
+{
+ int swcount = 0;
+ int count = index_datafile(m_storyidx, swcount);
+ osd_printf_verbose("Story.dat games found = %i\n", count);
+}
+
+//-------------------------------------------------
+// initialize history.dat index
+//-------------------------------------------------
+void datfile_manager::init_history()
+{
+ int swcount = 0;
+ int count = index_datafile(m_histidx, swcount);
+ osd_printf_verbose("History.dat systems found = %i\n", count);
+ osd_printf_verbose("History.dat software packages found = %i\n", swcount);
+ osd_printf_verbose("Rev = %s\n", m_history_rev.c_str());
+}
+
+//-------------------------------------------------
+// initialize gameinit.dat index
+//-------------------------------------------------
+void datfile_manager::init_gameinit()
+{
+ int swcount = 0;
+ drvindex tmp;
+ int count = index_mame_mess_info(m_ginitidx, tmp, swcount);
+ osd_printf_verbose("Gameinit.dat games found = %i\n", count);
+ osd_printf_verbose("Rev = %s\n", m_ginit_rev.c_str());
+}
+
+//-------------------------------------------------
+// initialize mameinfo.dat index
+//-------------------------------------------------
+void datfile_manager::init_mameinfo()
+{
+ int drvcount = 0;
+ int count = index_mame_mess_info(m_mameidx, m_drvidx, drvcount);
+ osd_printf_verbose("Mameinfo.dat games found = %i\n", count);
+ osd_printf_verbose("Mameinfo.dat drivers found = %d\n", drvcount);
+ osd_printf_verbose("Rev = %s\n", m_mame_rev.c_str());
+}
+
+//-------------------------------------------------
+// initialize messinfo.dat index
+//-------------------------------------------------
+void datfile_manager::init_messinfo()
+{
+ int drvcount = 0;
+ int count = index_mame_mess_info(m_messidx, m_messdrvidx, drvcount);
+ osd_printf_verbose("Messinfo.dat games found = %i\n", count);
+ osd_printf_verbose("Messinfo.dat drivers found = %d\n", drvcount);
+ osd_printf_verbose("Rev = %s\n", m_mess_rev.c_str());
+}
+
+//-------------------------------------------------
+// initialize command.dat index
+//-------------------------------------------------
+void datfile_manager::init_command()
+{
+ int swcount = 0;
+ int count = index_datafile(m_cmdidx, swcount);
+ osd_printf_verbose("Command.dat games found = %i\n", count);
+}
+
+bool datfile_manager::has_software(std::string &softlist, std::string &softname, std::string &parentname)
+{
+ // Find software in software list index
+ if (m_swindex.find(softlist) == m_swindex.end())
+ return false;
+
+ m_itemsiter = m_swindex[softlist].find(softname);
+ if (m_itemsiter == m_swindex[softlist].end() && !parentname.empty())
+ m_itemsiter = m_swindex[softlist].find(parentname);
+
+ if (m_itemsiter == m_swindex[softlist].end())
+ return false;
+
+ return true;
+}
+//-------------------------------------------------
+// load software info
+//-------------------------------------------------
+void datfile_manager::load_software_info(std::string &softlist, std::string &buffer, std::string &softname, std::string &parentname)
+{
+ // Load history text
+ if (!m_swindex.empty() && parseopen("history.dat"))
+ {
+ // Find software in software list index
+ if (!has_software(softlist, softname, parentname))
+ return;
+
+ long s_offset = (*m_itemsiter).second;
+ char rbuf[64 * 1024];
+ fseek(fp, s_offset, SEEK_SET);
+ std::string readbuf;
+ while (fgets(rbuf, 64 * 1024, fp) != nullptr)
+ {
+ readbuf = chartrimcarriage(rbuf);
+
+ // end entry when a end tag is encountered
+ if (readbuf == TAG_END)
+ break;
+
+ // add this string to the buffer
+ buffer.append(readbuf).append("\n");
+ }
+ parseclose();
+ }
+}
+
+//-------------------------------------------------
+// load_data_info
+//-------------------------------------------------
+void datfile_manager::load_data_info(const game_driver *drv, std::string &buffer, int type)
+{
+ dataindex index_idx;
+ drvindex driver_idx;
+ std::string tag;
+ std::string filename;
+
+ switch (type)
+ {
+ case UI_HISTORY_LOAD:
+ filename = "history.dat";
+ tag = TAG_BIO;
+ index_idx = m_histidx;
+ break;
+ case UI_MAMEINFO_LOAD:
+ filename = "mameinfo.dat";
+ tag = TAG_MAME;
+ index_idx = m_mameidx;
+ driver_idx = m_drvidx;
+ break;
+ case UI_SYSINFO_LOAD:
+ filename = "sysinfo.dat";
+ tag = TAG_BIO;
+ index_idx = m_sysidx;
+ break;
+ case UI_MESSINFO_LOAD:
+ filename = "messinfo.dat";
+ tag = TAG_MAME;
+ index_idx = m_messidx;
+ driver_idx = m_messdrvidx;
+ break;
+ case UI_STORY_LOAD:
+ filename = "story.dat";
+ tag = TAG_STORY;
+ index_idx = m_storyidx;
+ break;
+ case UI_GINIT_LOAD:
+ filename = "gameinit.dat";
+ tag = TAG_MAME;
+ index_idx = m_ginitidx;
+ break;
+ }
+
+ if (parseopen(filename.c_str()))
+ {
+ load_data_text(drv, buffer, index_idx, tag);
+
+ // load driver info
+ if (!driver_idx.empty())
+ load_driver_text(drv, buffer, driver_idx, TAG_DRIVER);
+
+ // cleanup mameinfo and sysinfo double line spacing
+ if ((tag == TAG_MAME && type != UI_GINIT_LOAD) || type == UI_SYSINFO_LOAD)
+ strreplace(buffer, "\n\n", "\n");
+
+ parseclose();
+ }
+}
+
+//-------------------------------------------------
+// load a game text into the buffer
+//-------------------------------------------------
+void datfile_manager::load_data_text(const game_driver *drv, std::string &buffer, dataindex &idx, std::string &tag)
+{
+ dataindex::iterator itemsiter = idx.find(drv);
+ if (itemsiter == idx.end())
+ {
+ int cloneof = driver_list::non_bios_clone(*drv);
+ if (cloneof == -1)
+ return;
+ else
+ {
+ const game_driver *c_drv = &driver_list::driver(cloneof);
+ itemsiter = idx.find(c_drv);
+ if (itemsiter == idx.end())
+ return;
+ }
+ }
+
+ long s_offset = (*itemsiter).second;
+ fseek(fp, s_offset, SEEK_SET);
+ char rbuf[64 * 1024];
+ std::string readbuf;
+ while (fgets(rbuf, 64 * 1024, fp) != nullptr)
+ {
+ readbuf = chartrimcarriage(rbuf);
+
+ // end entry when a end tag is encountered
+ if (readbuf == TAG_END)
+ break;
+
+ // continue if a specific tag is encountered
+ if (readbuf == tag)
+ continue;
+
+ // add this string to the buffer
+ buffer.append(readbuf).append("\n");
+ }
+}
+
+//-------------------------------------------------
+// load a driver name and offset into an
+// indexed array
+//-------------------------------------------------
+void datfile_manager::load_driver_text(const game_driver *drv, std::string &buffer, drvindex &idx, std::string &tag)
+{
+ std::string s(core_filename_extract_base(drv->source_file));
+ drvindex::const_iterator index = idx.find(s);
+
+ // if driver not found, return
+ if (index == idx.end())
+ return;
+
+ buffer.append("\n--- DRIVER INFO ---\n").append("Driver: ").append(s).append("\n\n");
+ long s_offset = (*index).second;
+ fseek(fp, s_offset, SEEK_SET);
+ char rbuf[64 * 1024];
+ std::string readbuf;
+ while (fgets(rbuf, 64 * 1024, fp) != nullptr)
+ {
+ readbuf = chartrimcarriage(rbuf);
+
+ // end entry when a end tag is encountered
+ if (readbuf == TAG_END)
+ break;
+
+ // continue if a specific tag is encountered
+ if (readbuf == tag)
+ continue;
+
+ // add this string to the buffer
+ buffer.append(readbuf).append("\n");
+ }
+}
+
+//-------------------------------------------------
+// load a game name and offset into an
+// indexed array (mameinfo)
+//-------------------------------------------------
+int datfile_manager::index_mame_mess_info(dataindex &index, drvindex &index_drv, int &drvcount)
+{
+ std::string name;
+ size_t foundtag;
+ size_t t_mame = TAG_MAMEINFO_R.size();
+ size_t t_mess = TAG_MESSINFO_R.size();
+ size_t t_ginit = TAG_GAMEINIT_R.size();
+ size_t t_info = TAG_INFO.size();
+
+ char rbuf[64 * 1024];
+ std::string readbuf, xid;
+ while (fgets(rbuf, 64 * 1024, fp) != nullptr)
+ {
+ readbuf = chartrimcarriage(rbuf);
+ if (m_mame_rev.empty() && readbuf.compare(0, t_mame, TAG_MAMEINFO_R) == 0)
+ {
+ size_t found = readbuf.find(" ", t_mame + 1);
+ m_mame_rev = readbuf.substr(t_mame + 1, found - t_mame);
+ }
+ else if (m_mess_rev.empty() && (foundtag = readbuf.find(TAG_MESSINFO_R)) != std::string::npos)
+ {
+ size_t found = readbuf.find(" ", foundtag + t_mess + 1);
+ m_mess_rev = readbuf.substr(foundtag + t_mess + 1, found - t_mess - foundtag);
+ }
+ else if (m_ginit_rev.empty() && readbuf.compare(0, t_ginit, TAG_GAMEINIT_R) == 0)
+ {
+ size_t found = readbuf.find(" ", t_ginit + 1);
+ m_ginit_rev = readbuf.substr(t_ginit + 1, found - t_ginit);
+ }
+ else if (readbuf.compare(0, t_info, TAG_INFO) == 0)
+ {
+ // TAG_INFO
+ fgets(rbuf, 64 * 1024, fp);
+ xid = chartrimcarriage(rbuf);
+ name = readbuf.substr(t_info + 1);
+ if (xid == TAG_MAME)
+ {
+ // validate driver
+ int game_index = driver_list::find(name.c_str());
+ if (game_index != -1)
+ index.emplace(&driver_list::driver(game_index), ftell(fp));
+ }
+ else if (xid == TAG_DRIVER)
+ {
+ index_drv.emplace(name, ftell(fp));
+ drvcount++;
+ }
+ }
+ }
+ return index.size();
+}
+
+//-------------------------------------------------
+// load a game name and offset into an
+// indexed array
+//-------------------------------------------------
+int datfile_manager::index_datafile(dataindex &index, int &swcount)
+{
+ std::string readbuf, name;
+ size_t t_hist = TAG_HISTORY_R.size();
+ size_t t_story = TAG_STORY_R.size();
+ size_t t_sysinfo = TAG_SYSINFO_R.size();
+ size_t t_info = TAG_INFO.size();
+ size_t t_bio = TAG_BIO.size();
+ char rbuf[64 * 1024];
+ while (fgets(rbuf, 64 * 1024, fp) != nullptr)
+ {
+ readbuf = chartrimcarriage(rbuf);
+
+ if (m_history_rev.empty() && readbuf.compare(0, t_hist, TAG_HISTORY_R) == 0)
+ {
+ size_t found = readbuf.find(" ", t_hist + 1);
+ m_history_rev = readbuf.substr(t_hist + 1, found - t_hist);
+ }
+ else if (m_sysinfo_rev.empty() && readbuf.compare(0, t_sysinfo, TAG_SYSINFO_R) == 0)
+ {
+ size_t found = readbuf.find(".", t_sysinfo + 1);
+ m_sysinfo_rev = readbuf.substr(t_sysinfo + 1, found - t_sysinfo);
+ }
+ else if (m_story_rev.empty() && readbuf.compare(0, t_story, TAG_STORY_R) == 0)
+ m_story_rev = readbuf.substr(t_story + 1);
+ else if (readbuf.compare(0, t_info, TAG_INFO) == 0)
+ {
+ int curpoint = t_info + 1;
+ int ends = readbuf.size();
+ while (curpoint < ends)
+ {
+ // search for comma
+ size_t found = readbuf.find(",", curpoint);
+
+ // found it
+ if (found != std::string::npos)
+ {
+ // copy data and validate driver
+ name = readbuf.substr(curpoint, found - curpoint);
+
+ // validate driver
+ int game_index = driver_list::find(name.c_str());
+ if (game_index != -1)
+ index.emplace(&driver_list::driver(game_index), ftell(fp));
+
+ // update current point
+ curpoint = ++found;
+ }
+ // if comma not found, copy data while until reach the end of string
+ else if (curpoint < ends)
+ {
+ name = readbuf.substr(curpoint);
+ int game_index = driver_list::find(name.c_str());
+ if (game_index != -1)
+ index.emplace(&driver_list::driver(game_index), ftell(fp));
+
+ // update current point
+ curpoint = ends;
+ }
+ }
+ }
+ // search for software info
+ else if (!readbuf.empty() && readbuf[0] == DATAFILE_TAG[0])
+ {
+ fgets(rbuf, 64 * 1024, fp);
+ std::string readbuf_2(chartrimcarriage(rbuf));
+
+ // TAG_BIO identifies software list
+ if (readbuf_2.compare(0, t_bio, TAG_BIO) == 0)
+ {
+ size_t eq_sign = readbuf.find("=");
+ std::string s_list(readbuf.substr(1, eq_sign - 1));
+ std::string s_roms(readbuf.substr(eq_sign + 1));
+ int ends = s_list.size();
+ int curpoint = 0;
+
+ while (curpoint < ends)
+ {
+ size_t found = s_list.find(",", curpoint);
+
+ // found it
+ if (found != std::string::npos)
+ {
+ name = s_list.substr(curpoint, found - curpoint);
+ curpoint = ++found;
+ }
+ else
+ {
+ name = s_list;
+ curpoint = ends;
+ }
+
+ // search for a software list in the index, if not found then allocates
+ std::string lname(name);
+ int cpoint = 0;
+ int cends = s_roms.size();
+
+ while (cpoint < cends)
+ {
+ // search for comma
+ size_t found = s_roms.find(",", cpoint);
+
+ // found it
+ if (found != std::string::npos)
+ {
+ // copy data
+ name = s_roms.substr(cpoint, found - cpoint);
+
+ // add a SoftwareItem
+ m_swindex[lname].emplace(name, ftell(fp));
+
+ // update current point
+ cpoint = ++found;
+ swcount++;
+ }
+ else
+ {
+ // if reach the end, bail out
+ if (s_roms[cpoint] == '\r' || s_roms[cpoint] == '\n')
+ break;
+
+ // copy data
+ name = s_roms.substr(cpoint);
+
+ // add a SoftwareItem
+ m_swindex[lname].emplace(name, ftell(fp));
+
+ // update current point
+ cpoint = cends;
+ swcount++;
+ }
+ }
+ }
+ }
+ }
+ }
+ return index.size();
+}
+
+//---------------------------------------------------------
+// parseopen - Open up file for reading
+//---------------------------------------------------------
+bool datfile_manager::parseopen(const char *filename)
+{
+ // MAME core file parsing functions fail in recognizing UNICODE chars in UTF-8 without BOM,
+ // so it's better and faster use standard C fileio functions.
+
+ emu_file file(mame_machine_manager::instance()->ui().options().history_path(), OPEN_FLAG_READ);
+ if (file.open(filename) != osd_file::error::NONE)
+ return false;
+
+ m_fullpath = file.fullpath();
+ file.close();
+ fp = fopen(m_fullpath.c_str(), "rb");
+
+ fgetc(fp);
+ fseek(fp, 0, SEEK_SET);
+ return true;
+}
+
+//-------------------------------------------------
+// create the menu index
+//-------------------------------------------------
+void datfile_manager::index_menuidx(const game_driver *drv, dataindex &idx, drvindex &index)
+{
+ dataindex::iterator itemsiter = idx.find(drv);
+ if (itemsiter == idx.end())
+ {
+ int cloneof = driver_list::non_bios_clone(*drv);
+ if (cloneof == -1)
+ return;
+ else
+ {
+ const game_driver *c_drv = &driver_list::driver(cloneof);
+ itemsiter = idx.find(c_drv);
+ if (itemsiter == idx.end())
+ return;
+ }
+ }
+
+ // seek to correct point in datafile
+ long s_offset = (*itemsiter).second;
+ fseek(fp, s_offset, SEEK_SET);
+ size_t tinfo = TAG_INFO.size();
+ char rbuf[64 * 1024];
+ std::string readbuf;
+ while (fgets(rbuf, 64 * 1024, fp) != nullptr)
+ {
+ readbuf = chartrimcarriage(rbuf);
+
+ if (!core_strnicmp(TAG_INFO.c_str(), readbuf.c_str(), tinfo))
+ break;
+
+ // TAG_COMMAND identifies the driver
+ if (readbuf == TAG_COMMAND)
+ {
+ fgets(rbuf, 64 * 1024, fp);
+ chartrimcarriage(rbuf);
+ index.emplace(rbuf, ftell(fp));
+ }
+ }
+}
+
+//-------------------------------------------------
+// load command text into the buffer
+//-------------------------------------------------
+void datfile_manager::load_command_info(std::string &buffer, std::string &sel)
+{
+ if (parseopen("command.dat"))
+ {
+ // open and seek to correct point in datafile
+ long offset = m_menuidx.at(sel);
+ fseek(fp, offset, SEEK_SET);
+ char rbuf[64 * 1024];
+ std::string readbuf;
+ while (fgets(rbuf, 64 * 1024, fp) != nullptr)
+ {
+ readbuf = chartrimcarriage(rbuf);
+
+ // skip separator lines
+ if (readbuf == TAG_COMMAND_SEPARATOR)
+ continue;
+
+ // end entry when a tag is encountered
+ if (readbuf == TAG_END)
+ break;
+
+ // add this string to the buffer
+ buffer.append(readbuf).append("\n");;
+ }
+ parseclose();
+ }
+}
+
+//-------------------------------------------------
+// load submenu item for command.dat
+//-------------------------------------------------
+void datfile_manager::command_sub_menu(const game_driver *drv, std::vector<std::string> &menuitems)
+{
+ if (parseopen("command.dat"))
+ {
+ m_menuidx.clear();
+ index_menuidx(drv, m_cmdidx, m_menuidx);
+ for (auto & elem : m_menuidx)
+ menuitems.push_back(elem.first);
+ parseclose();
+ }
+}
diff --git a/src/frontend/mame/ui/datfile.h b/src/frontend/mame/ui/datfile.h
new file mode 100644
index 00000000000..27bb8094704
--- /dev/null
+++ b/src/frontend/mame/ui/datfile.h
@@ -0,0 +1,96 @@
+// license:BSD-3-Clause
+// copyright-holders:Maurizio Petrarota
+/***************************************************************************
+
+ ui/datfile.h
+
+ UI DATs manager.
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __UI_DATFILE_H__
+#define __UI_DATFILE_H__
+
+//-------------------------------------------------
+// Datafile Manager
+//-------------------------------------------------
+class datfile_manager
+{
+public:
+ // construction/destruction
+ datfile_manager(running_machine &machine);
+
+ // getters
+ running_machine &machine() const { return m_machine; }
+
+ // actions
+ void load_data_info(const game_driver *drv, std::string &buffer, int type);
+ void load_command_info(std::string &buffer, std::string &sel);
+ void load_software_info(std::string &softlist, std::string &buffer, std::string &softname, std::string &parentname);
+ void command_sub_menu(const game_driver *drv, std::vector<std::string> &menuitems);
+ void reset_run() { first_run = true; }
+
+ std::string rev_history() const { return m_history_rev; }
+ std::string rev_mameinfo() const { return m_mame_rev; }
+ std::string rev_messinfo() const { return m_mess_rev; }
+ std::string rev_sysinfo() const { return m_sysinfo_rev; }
+ std::string rev_storyinfo() const { return m_story_rev; }
+ std::string rev_ginitinfo() const { return m_ginit_rev; }
+
+ bool has_history(const game_driver *driver) { return (m_histidx.find(driver) != m_histidx.end()); }
+ bool has_mameinfo(const game_driver *driver) { return (m_mameidx.find(driver) != m_mameidx.end()); }
+ bool has_messinfo(const game_driver *driver) { return (m_messidx.find(driver) != m_messidx.end()); }
+ bool has_command(const game_driver *driver) { return (m_cmdidx.find(driver) != m_cmdidx.end()); }
+ bool has_sysinfo(const game_driver *driver) { return (m_sysidx.find(driver) != m_sysidx.end()); }
+ bool has_story(const game_driver *driver) { return (m_storyidx.find(driver) != m_storyidx.end()); }
+ bool has_gameinit(const game_driver *driver) { return (m_ginitidx.find(driver) != m_ginitidx.end()); }
+ bool has_software(std::string &softlist, std::string &softname, std::string &parentname);
+
+ bool has_data(const game_driver *a = nullptr)
+ {
+ const game_driver *d = (a != nullptr) ? a : &machine().system();
+ return (has_history(d) || has_mameinfo(d) || has_messinfo(d) || has_command(d) || has_sysinfo(d) || has_story(d) || has_gameinit(d));
+ }
+private:
+ using drvindex = std::unordered_map<std::string, long>;
+ using dataindex = std::unordered_map<const game_driver *, long>;
+ using swindex = std::unordered_map<std::string, drvindex>;
+
+ // global index
+ static dataindex m_histidx, m_mameidx, m_messidx, m_cmdidx, m_sysidx, m_storyidx, m_ginitidx;
+ static drvindex m_drvidx, m_messdrvidx, m_menuidx;
+ static swindex m_swindex;
+
+ // internal helpers
+ void init_history();
+ void init_mameinfo();
+ void init_messinfo();
+ void init_command();
+ void init_sysinfo();
+ void init_storyinfo();
+ void init_gameinit();
+
+ // file open/close/seek
+ bool parseopen(const char *filename);
+ void parseclose() { if (fp != nullptr) fclose(fp); }
+
+ int index_mame_mess_info(dataindex &index, drvindex &index_drv, int &drvcount);
+ int index_datafile(dataindex &index, int &swcount);
+ void index_menuidx(const game_driver *drv, dataindex &idx, drvindex &index);
+ drvindex::iterator m_itemsiter;
+
+ void load_data_text(const game_driver *drv, std::string &buffer, dataindex &idx, std::string &tag);
+ void load_driver_text(const game_driver *drv, std::string &buffer, drvindex &idx, std::string &tag);
+
+ // internal state
+ running_machine &m_machine; // reference to our machine
+ std::string m_fullpath;
+ static std::string m_history_rev, m_mame_rev, m_mess_rev, m_sysinfo_rev, m_story_rev, m_ginit_rev;
+ FILE *fp = nullptr;
+ static bool first_run;
+};
+
+
+#endif /* __UI_DATFILE_H__ */
diff --git a/src/frontend/mame/ui/datmenu.cpp b/src/frontend/mame/ui/datmenu.cpp
new file mode 100644
index 00000000000..7e90e11178d
--- /dev/null
+++ b/src/frontend/mame/ui/datmenu.cpp
@@ -0,0 +1,296 @@
+// license:BSD-3-Clause
+// copyright-holders:Maurizio Petrarota
+/*********************************************************************
+
+ ui/datmenu.cpp
+
+ Internal UI user interface.
+
+*********************************************************************/
+
+#include "emu.h"
+#include "ui/ui.h"
+#include "ui/menu.h"
+#include "drivenum.h"
+#include "rendfont.h"
+#include "ui/datfile.h"
+#include "ui/datmenu.h"
+#include "ui/utils.h"
+#include "softlist.h"
+
+//-------------------------------------------------
+// ctor / dtor
+//-------------------------------------------------
+
+ui_menu_dats_view::ui_menu_dats_view(running_machine &machine, render_container *container, const game_driver *driver)
+ : ui_menu(machine, container)
+ , m_actual(0)
+ , m_driver((driver == nullptr) ? &machine.system() : driver)
+ , m_issoft(false)
+
+{
+ for (device_image_interface &image : image_interface_iterator(machine.root_device()))
+ {
+ if (image.filename())
+ {
+ m_list = strensure(image.software_list_name());
+ m_short = strensure(image.software_entry()->shortname());
+ m_long = strensure(image.software_entry()->longname());
+ m_parent = strensure(image.software_entry()->parentname());
+ }
+ }
+
+ init_items();
+}
+
+//-------------------------------------------------
+// ctor
+//-------------------------------------------------
+
+ui_menu_dats_view::ui_menu_dats_view(running_machine &machine, render_container *container, ui_software_info *swinfo, const game_driver *driver)
+ : ui_menu(machine, container)
+ , m_actual(0)
+ , m_driver((driver == nullptr) ? &machine.system() : driver)
+ , m_swinfo(swinfo)
+ , m_list(swinfo->listname)
+ , m_short(swinfo->shortname)
+ , m_long(swinfo->longname)
+ , m_parent(swinfo->parentname)
+ , m_issoft(true)
+
+{
+ if (mame_machine_manager::instance()->datfile().has_software(m_list, m_short, m_parent))
+ m_items_list.emplace_back(_("Software History"), UI_HISTORY_LOAD, mame_machine_manager::instance()->datfile().rev_history());
+ if (swinfo != nullptr && !swinfo->usage.empty())
+ m_items_list.emplace_back(_("Software Usage"), 0, "");
+}
+
+//-------------------------------------------------
+// dtor
+//-------------------------------------------------
+
+ui_menu_dats_view::~ui_menu_dats_view()
+{
+}
+
+//-------------------------------------------------
+// handle
+//-------------------------------------------------
+
+void ui_menu_dats_view::handle()
+{
+ const ui_menu_event *m_event = process(MENU_FLAG_UI_DATS);
+ if (m_event != nullptr)
+ {
+ if (m_event->iptkey == IPT_UI_LEFT && m_actual > 0)
+ {
+ m_actual--;
+ reset(UI_MENU_RESET_SELECT_FIRST);
+ }
+
+ if (m_event->iptkey == IPT_UI_RIGHT && m_actual < m_items_list.size() - 1)
+ {
+ m_actual++;
+ reset(UI_MENU_RESET_SELECT_FIRST);
+ }
+ }
+}
+
+//-------------------------------------------------
+// populate
+//-------------------------------------------------
+
+void ui_menu_dats_view::populate()
+{
+ bool paused = machine().paused();
+ if (!paused)
+ machine().pause();
+
+ (m_issoft == true) ? get_data_sw() : get_data();
+
+ item_append(MENU_SEPARATOR_ITEM, nullptr, (MENU_FLAG_UI_DATS | MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW), nullptr);
+ customtop = 2.0f * mame_machine_manager::instance()->ui().get_line_height() + 4.0f * UI_BOX_TB_BORDER;
+ custombottom = mame_machine_manager::instance()->ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
+
+ if (!paused)
+ machine().resume();
+}
+
+//-------------------------------------------------
+// perform our special rendering
+//-------------------------------------------------
+
+void ui_menu_dats_view::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+{
+ mame_ui_manager &mui = mame_machine_manager::instance()->ui();
+ float maxwidth = origx2 - origx1;
+ float width;
+ std::string driver = (m_issoft == true) ? m_swinfo->longname : m_driver->description;
+
+ mui.draw_text_full(container, driver.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ width += 2 * UI_BOX_LR_BORDER;
+ maxwidth = MAX(maxwidth, width);
+
+ // compute our bounds
+ float x1 = 0.5f - 0.5f * maxwidth;
+ float x2 = x1 + maxwidth;
+ float y1 = origy1 - top;
+ float y2 = origy1 - 2.0f * UI_BOX_TB_BORDER - mui.get_line_height();
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ mui.draw_text_full(container, driver.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
+
+ maxwidth = 0;
+ for (auto & elem : m_items_list)
+ {
+ mui.draw_text_full(container, elem.label.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
+ DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ maxwidth += width;
+ }
+
+ float space = (1.0f - maxwidth) / (m_items_list.size() * 2);
+
+ // compute our bounds
+ x1 -= UI_BOX_LR_BORDER;
+ x2 += UI_BOX_LR_BORDER;
+ y1 = y2 + UI_BOX_TB_BORDER;
+ y2 += mui.get_line_height() + 2.0f * UI_BOX_TB_BORDER;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR);
+
+ // take off the borders
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ // draw the text within it
+ int x = 0;
+ for (auto & elem : m_items_list)
+ {
+ x1 += space;
+ rgb_t fcolor = (m_actual == x) ? rgb_t(0xff, 0xff, 0xff, 0x00) : UI_TEXT_COLOR;
+ rgb_t bcolor = (m_actual == x) ? rgb_t(0xff, 0xff, 0xff, 0xff) : UI_TEXT_BG_COLOR;
+ mui.draw_text_full(container, elem.label.c_str(), x1, y1, 1.0f, JUSTIFY_LEFT, WRAP_NEVER, DRAW_NONE, fcolor, bcolor, &width, nullptr);
+
+ if (bcolor != UI_TEXT_BG_COLOR)
+ mui.draw_textured_box(container, x1 - (space / 2), y1, x1 + width + (space / 2), y2, bcolor, rgb_t(255, 43, 43, 43),
+ hilight_main_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
+
+ mui.draw_text_full(container, elem.label.c_str(), x1, y1, 1.0f, JUSTIFY_LEFT, WRAP_NEVER, DRAW_NORMAL, fcolor, bcolor, &width, nullptr);
+ x1 += width + space;
+ ++x;
+ }
+
+ // bottom
+ std::string revision;
+ revision.assign(_("Revision: ")).append(m_items_list[m_actual].revision);
+ mui.draw_text_full(container, revision.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
+ width += 2 * UI_BOX_LR_BORDER;
+ maxwidth = MAX(origx2 - origx1, width);
+
+ // compute our bounds
+ x1 = 0.5f - 0.5f * maxwidth;
+ x2 = x1 + maxwidth;
+ y1 = origy2 + UI_BOX_TB_BORDER;
+ y2 = origy2 + bottom;
+
+ // draw a box
+ mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
+
+ // take off the borders
+ x1 += UI_BOX_LR_BORDER;
+ x2 -= UI_BOX_LR_BORDER;
+ y1 += UI_BOX_TB_BORDER;
+
+ // draw the text within it
+ mui.draw_text_full(container, revision.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
+ DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
+}
+
+//-------------------------------------------------
+// load data from DATs
+//-------------------------------------------------
+
+void ui_menu_dats_view::get_data()
+{
+ std::vector<int> xstart;
+ std::vector<int> xend;
+ std::string buffer;
+ std::vector<std::string> m_item;
+ if (m_items_list[m_actual].option == UI_COMMAND_LOAD)
+ {
+ mame_machine_manager::instance()->datfile().command_sub_menu(m_driver, m_item);
+ if (!m_item.empty())
+ {
+ for (size_t x = 0; x < m_item.size(); ++x)
+ {
+ std::string t_buffer;
+ buffer.append(m_item[x]).append("\n");
+ mame_machine_manager::instance()->datfile().load_command_info(t_buffer, m_item[x]);
+ if (!t_buffer.empty())
+ buffer.append(t_buffer).append("\n");
+ }
+ convert_command_glyph(buffer);
+ }
+ }
+ else
+ mame_machine_manager::instance()->datfile().load_data_info(m_driver, buffer, m_items_list[m_actual].option);
+
+ int lines = mame_machine_manager::instance()->ui().wrap_text(container, buffer.c_str(), 0.0f, 0.0f, 1.0f - (4.0f * UI_BOX_LR_BORDER), xstart, xend);
+ for (int x = 0; x < lines; ++x)
+ {
+ std::string tempbuf(buffer.substr(xstart[x], xend[x] - xstart[x]));
+ item_append(tempbuf.c_str(), nullptr, (MENU_FLAG_UI_DATS | MENU_FLAG_DISABLE), (void *)(FPTR)(x + 1));
+ }
+}
+
+void ui_menu_dats_view::get_data_sw()
+{
+ std::vector<int> xstart;
+ std::vector<int> xend;
+ std::string buffer;
+ if (m_items_list[m_actual].option == 0)
+ buffer = m_swinfo->usage;
+ else
+ {
+ if (m_swinfo->startempty == 1)
+ mame_machine_manager::instance()->datfile().load_data_info(m_swinfo->driver, buffer, UI_HISTORY_LOAD);
+ else
+ mame_machine_manager::instance()->datfile().load_software_info(m_swinfo->listname, buffer, m_swinfo->shortname, m_swinfo->parentname);
+ }
+
+ int lines = mame_machine_manager::instance()->ui().wrap_text(container, buffer.c_str(), 0.0f, 0.0f, 1.0f - (4.0f * UI_BOX_LR_BORDER), xstart, xend);
+ for (int x = 0; x < lines; ++x)
+ {
+ std::string tempbuf(buffer.substr(xstart[x], xend[x] - xstart[x]));
+ item_append(tempbuf.c_str(), nullptr, (MENU_FLAG_UI_DATS | MENU_FLAG_DISABLE), (void *)(FPTR)(x + 1));
+ }
+}
+
+void ui_menu_dats_view::init_items()
+{
+ datfile_manager &datfile = mame_machine_manager::instance()->datfile();
+ if (datfile.has_history(m_driver))
+ m_items_list.emplace_back(_("History"), UI_HISTORY_LOAD, datfile.rev_history());
+ if (datfile.has_mameinfo(m_driver))
+ m_items_list.emplace_back(_("Mameinfo"), UI_MAMEINFO_LOAD, datfile.rev_mameinfo());
+ if (datfile.has_messinfo(m_driver))
+ m_items_list.emplace_back(_("Messinfo"), UI_MESSINFO_LOAD, datfile.rev_messinfo());
+ if (datfile.has_sysinfo(m_driver))
+ m_items_list.emplace_back(_("Sysinfo"), UI_SYSINFO_LOAD, datfile.rev_sysinfo());
+ if (datfile.has_story(m_driver))
+ m_items_list.emplace_back(_("Mamescore"), UI_STORY_LOAD, datfile.rev_storyinfo());
+ if (datfile.has_gameinit(m_driver))
+ m_items_list.emplace_back(_("Gameinit"), UI_GINIT_LOAD, datfile.rev_ginitinfo());
+ if (datfile.has_command(m_driver))
+ m_items_list.emplace_back(_("Command"), UI_COMMAND_LOAD, "");
+}
diff --git a/src/frontend/mame/ui/datmenu.h b/src/frontend/mame/ui/datmenu.h
new file mode 100644
index 00000000000..10de3894816
--- /dev/null
+++ b/src/frontend/mame/ui/datmenu.h
@@ -0,0 +1,52 @@
+// license:BSD-3-Clause
+// copyright-holders:Maurizio Petrarota
+/***************************************************************************
+
+ ui/datmenu.h
+
+ Internal UI user interface.
+
+
+***************************************************************************/
+
+#pragma once
+
+#ifndef __UI_DATMENU_H__
+#define __UI_DATMENU_H__
+
+struct ui_software_info;
+
+//-------------------------------------------------
+// class dats menu
+//-------------------------------------------------
+
+class ui_menu_dats_view : public ui_menu
+{
+public:
+ ui_menu_dats_view(running_machine &machine, render_container *container, ui_software_info *swinfo, const game_driver *driver = nullptr);
+ ui_menu_dats_view(running_machine &machine, render_container *container, const game_driver *driver = nullptr);
+ virtual ~ui_menu_dats_view();
+ virtual void populate() override;
+ virtual void handle() override;
+ virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
+
+private:
+ int m_actual;
+ const game_driver *m_driver;
+ ui_software_info *m_swinfo;
+ std::string m_list, m_short, m_long, m_parent;
+ void get_data();
+ void get_data_sw();
+ void init_items();
+ bool m_issoft;
+ struct list_items
+ {
+ list_items(std::string l, int i, std::string rev) { label = l; option = i; revision = rev; }
+ std::string label;
+ int option;
+ std::string revision;
+ };
+ std::vector<list_items> m_items_list;
+};
+
+#endif /* __UI_DATMENU_H__ */
diff --git a/src/frontend/mame/ui/defimg.h b/src/frontend/mame/ui/defimg.h
new file mode 100644
index 00000000000..bce018449d1
--- /dev/null
+++ b/src/frontend/mame/ui/defimg.h
@@ -0,0 +1,262 @@
+// license:BSD-3-Clause
+// copyright-holders:Maurizio Petrarota
+
+static const UINT32 no_avail_bmp[] =
+{
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x01231f20, 0x04231f20, 0x11231f20, 0x2e231f20, 0x62231f20, 0x8e231f20, 0xb4231f20, 0xd4231f20, 0xe5231f20, 0xf2231f20, 0xfd231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xfd231f20, 0xf2231f20, 0xe5231f20, 0xd4231f20, 0xb4231f20, 0x8e231f20, 0x62231f20, 0x2e231f20, 0x11231f20, 0x04231f20, 0x01231f20, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00231f20, 0x00000000, 0x00000000, 0x06231f20, 0x1c231f20, 0x49231f20, 0x8c231f20, 0xc4231f20, 0xf0231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xf0231f20, 0xc4231f20, 0x8c231f20, 0x49231f20, 0x1c231f20, 0x06231f20, 0x00000000, 0x00000000, 0x00231f20, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x04231f20, 0x32231f20, 0x7b231f20, 0xc2231f20, 0xf3231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xf3231f20, 0xc2231f20, 0x7b231f20, 0x32231f20, 0x04231f20, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x30231f20, 0x8e231f20, 0xd6231f20, 0xfd231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xfd231f20, 0xd6231f20, 0x8e231f20, 0x30231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x0e231f20, 0x73231f20, 0xd8231f20, 0xfb231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xfb231f20, 0xd8231f20, 0x73231f20, 0x0e231f20, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00231f20, 0x00000000, 0x29231f20, 0xb6231f20, 0xfb231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xfb231f20, 0xb6231f20, 0x29231f20, 0x00000000, 0x00231f20, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x03231f20, 0x4f231f20, 0xdd231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xdd231f20, 0x4f231f20, 0x03231f20, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x0a231f20, 0x72231f20, 0xf4231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xf4231f20, 0x72231f20, 0x0a231f20, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x10231f20, 0x84231f20, 0xf5231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1a1b, 0xff1e191a, 0xff1e1a1b, 0xff211c1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xf5231f20, 0x84231f20, 0x10231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x0a231f20, 0x84231f20, 0xf5231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff1c1718, 0xff1b1718, 0xff1b1718, 0xff1b1718, 0xff1d191a, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1e1a1b, 0xff1b1718, 0xff1b1718, 0xff1c1819, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff393637, 0xff7c7a7a, 0xff827f80, 0xff7d7b7c, 0xff494647, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xf5231f20, 0x84231f20, 0x0a231f20, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x03231f20, 0x74231f20, 0xf5231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff3b3839, 0xff585656, 0xff5a5757, 0xff5a5757, 0xff5b5858, 0xff4b4949, 0xff272325, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff464243, 0xff5a5858, 0xff5a5758, 0xff565253, 0xff312d2e, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1c1819, 0xff575355, 0xffececec, 0xfff7f7f7, 0xffededed, 0xff7a7878, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xf5231f20, 0x74231f20, 0x03231f20, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x51231f20, 0xf4231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1f1b1c, 0xff807d7e, 0xfff1f1f1, 0xfff6f6f6, 0xfff6f6f6, 0xfff9f9f9, 0xffe1e0e0, 0xff565354, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffa9a7a7, 0xfff6f6f6, 0xfff6f6f6, 0xffe6e6e6, 0xff575455, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xf4231f20, 0x51231f20, 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x2a231f20, 0xde231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff848283, 0xfff7f7f7, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffa6a4a5, 0xff2c2729, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffedecec, 0xff5a5758, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff595556, 0xfff6f6f6, 0xffffffff, 0xfff6f6f6, 0xff7e7c7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xde231f20, 0x2a231f20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00231f20, 0x00000000, 0x0e231f20, 0xb5231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfff0f0f0, 0xff585556, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1c1819, 0xff524f50, 0xffdbdbdb, 0xffe5e4e5, 0xffdcdbdb, 0xff737071, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xb5231f20, 0x0e231f20, 0x00000000, 0x00231f20, 0x00000000, 0x00000000,
+ 0x00000000, 0x00231f20, 0x00000000, 0x00000000, 0x73231f20, 0xfb231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffb4b3b4, 0xff282425, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff2e2b2c, 0xff4f4c4d, 0xff524f50, 0xff504d4e, 0xff363334, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xfb231f20, 0x73231f20, 0x00000000, 0x00000000, 0x00231f20, 0x00000000,
+ 0x00000000, 0x00231f20, 0x00000000, 0x30231f20, 0xd8231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfffdfdfd, 0xffededed, 0xfffdfdfd, 0xffffffff, 0xfff9fafa, 0xff646162, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1a1b, 0xff1e1a1b, 0xff1e1a1b, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xd8231f20, 0x30231f20, 0x00000000, 0x00231f20, 0x00000000,
+ 0x00231f20, 0x00000000, 0x05231f20, 0x8e231f20, 0xfa231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xffadacac, 0xffdbdbdb, 0xffffffff, 0xffffffff, 0xffc8c7c7, 0xff2b2628, 0xff201c1d, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff1c1718, 0xff1a1617, 0xff1b1718, 0xff1b1718, 0xff1a1617, 0xff1d191a, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff201c1d, 0xff201c1d, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff201c1d, 0xff201c1d, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff1d191a, 0xff1a1617, 0xff1b1718, 0xff1a1617, 0xff1b1718, 0xff1f1b1c, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff1c1819, 0xff1a1517, 0xff1b1718, 0xff1a1517, 0xff1c1719, 0xff201c1d, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff1c1819, 0xff191516, 0xff1a1617, 0xff1a1617, 0xff191516, 0xff1b1718, 0xff1f1b1c, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff1c1819, 0xff1a1617, 0xff1b1718, 0xff1a1617, 0xff1a1617, 0xff1f1b1c, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff201c1d, 0xff201c1d, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff1d191a, 0xff1a1516, 0xff1a1617, 0xff1b1718, 0xff191516, 0xff1b1718, 0xff201c1d, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xfa231f20, 0x8e231f20, 0x05231f20, 0x00000000, 0x00231f20,
+ 0x00000000, 0x00000000, 0x32231f20, 0xd8231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff7f7f7, 0xff858384, 0xff949393, 0xfffdfefd, 0xffffffff, 0xfffdfdfd, 0xff767475, 0xff1c1718, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff252122, 0xff413e3f, 0xff6e6c6c, 0xff8f8d8d, 0xff9c9b9b, 0xff9b9999, 0xff898787, 0xff646061, 0xff383435, 0xff221e1f, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff292526, 0xff393637, 0xff3b3839, 0xff3a3738, 0xff2c292a, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231e1f, 0xff2f2b2c, 0xff3a3738, 0xff3b3839, 0xff393536, 0xff282425, 0xff221e1f, 0xff201c1d, 0xff302d2e, 0xff5f5c5d, 0xff8a8788, 0xff9b9a9a, 0xff989797, 0xff7c7a7a, 0xff454243, 0xff231f20, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xff373334, 0xff666465, 0xff8e8c8c, 0xff9b999a, 0xff918f8f, 0xff716f6f, 0xff3b3839, 0xff221e1f, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff231f20, 0xff302c2d, 0xff4e4a4b, 0xff706e6f, 0xff8b898a, 0xff999797, 0xff999797, 0xff8e8c8d, 0xff767374, 0xff494646, 0xff2b2728, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff201c1d, 0xff332f30, 0xff636061, 0xff8d8b8b, 0xff9c9a9b, 0xff989697, 0xff807f7f, 0xff524f4f, 0xff2a2627, 0xff211d1e, 0xff221e1f, 0xff2e2a2b, 0xff3b3738, 0xff3b3839, 0xff383536, 0xff292526, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff231f20, 0xff393636, 0xff646162, 0xff878485, 0xff989697, 0xff9d9b9b, 0xff908e8e, 0xff716e6e, 0xff423f3f, 0xff252122, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xd8231f20, 0x32231f20, 0x00000000, 0x00000000,
+ 0x00000000, 0x06231f20, 0x7c231f20, 0xfc231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7b797a, 0xff4a4647, 0xffdedede, 0xffffffff, 0xffffffff, 0xffd1d0d1, 0xff363233, 0xff1f1b1c, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff252122, 0xff504e4f, 0xffaaa9a9, 0xffececed, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffe1e0e1, 0xff949293, 0xff403c3d, 0xff221e1f, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1c1718, 0xff555253, 0xffe9e9e9, 0xfff4f4f4, 0xffebebeb, 0xff787676, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff8b898a, 0xffeff0f0, 0xfff3f3f3, 0xffdddddd, 0xff4c4a4a, 0xff242021, 0xff716f6f, 0xffd4d2d3, 0xfffefefe, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfff0f0f0, 0xff9c9b9c, 0xff393536, 0xff201c1d, 0xff231f20, 0xff211d1e, 0xff322f30, 0xff848282, 0xffe0dede, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffe3e3e3, 0xff838182, 0xff2f2b2c, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff2b2728, 0xff605d5e, 0xffa2a1a1, 0xffd8d7d7, 0xfff7f7f7, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfff6f5f5, 0xffc4c3c3, 0xff6c696a, 0xff2d292a, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff2f2b2c, 0xff7c797a, 0xffd9d8d8, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfff8f7f7, 0xffbdbcbc, 0xff5a5757, 0xff1f1a1b, 0xff817e7f, 0xfff2f1f1, 0xfff3f2f2, 0xffdedede, 0xff524e4f, 0xff1d191a, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff242021, 0xff474344, 0xff9a9899, 0xffe3e2e2, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffeeedee, 0xffaaa9a9, 0xff4e4b4b, 0xff231f20, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xfc231f20, 0x7c231f20, 0x06231f20, 0x00000000,
+ 0x00000000, 0x1c231f20, 0xc3231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7e7c7d, 0xff1d181a, 0xff9a9898, 0xfffbfbfb, 0xffffffff, 0xfff9f9f9, 0xff848182, 0xff1f1b1c, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff272324, 0xff7d7a7b, 0xffe9e9e9, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffcfcfc, 0xfffdfcfc, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffd4d3d4, 0xff605d5e, 0xff211d1e, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff595656, 0xfff7f7f7, 0xffffffff, 0xfff7f7f7, 0xff7e7c7d, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff939191, 0xfffbfbfb, 0xffffffff, 0xffeae9e9, 0xff5d5a5b, 0xff8c8a8a, 0xfff8f7f7, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffbab9b9, 0xff3b3738, 0xff1b1718, 0xff3c3939, 0xffb3b2b2, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffffefe, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffdfdfd, 0xff959293, 0xff2b2728, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff484445, 0xffe6e6e6, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffdfefe, 0xfffafafa, 0xfffcfbfb, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfff8f8f8, 0xff9d9b9b, 0xff343031, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff383435, 0xffa7a6a6, 0xfffefdfd, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffdfdfd, 0xfff8f8f8, 0xfffcfcfc, 0xffffffff, 0xffffffff, 0xffe7e7e7, 0xff696767, 0xff8b8989, 0xfffcfcfc, 0xffffffff, 0xffeaeaea, 0xff555253, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff262222, 0xff727071, 0xffdedede, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffcfcfc, 0xfffbfbfb, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffe5e4e4, 0xff757273, 0xff252122, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xc3231f20, 0x1c231f20, 0x00000000,
+ 0x01231f20, 0x49231f20, 0xf4231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff807d7e, 0xff161213, 0xff474444, 0xffdfdedf, 0xffffffff, 0xffffffff, 0xffd1d0d0, 0xff413d3e, 0xff201c1d, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff211d1e, 0xff828080, 0xfff4f3f3, 0xffffffff, 0xffffffff, 0xfffcfcfc, 0xffcecdcd, 0xff9c9a9a, 0xff868585, 0xff8a8787, 0xffa6a4a4, 0xffdddcdc, 0xffffffff, 0xffffffff, 0xffffffff, 0xffe0dfe0, 0xff5f5c5d, 0xff1f1b1b, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xffececec, 0xffadabac, 0xfff2f2f2, 0xffffffff, 0xffd3d2d2, 0xffa6a4a5, 0xff908e8f, 0xff929191, 0xffb4b3b3, 0xffeeeeee, 0xffffffff, 0xffffffff, 0xfffdfdfd, 0xff959394, 0xff363333, 0xffb0afb0, 0xffffffff, 0xfffafafa, 0xffc9c8c9, 0xffa09e9f, 0xff8f8c8d, 0xff969494, 0xffbdbcbc, 0xfff6f5f6, 0xffffffff, 0xffffffff, 0xfff7f7f7, 0xff686667, 0xff201c1d, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff4b4949, 0xffefeeef, 0xffffffff, 0xffdddddd, 0xffbab9ba, 0xff9e9c9d, 0xff8b898a, 0xff848182, 0xff868484, 0xff999797, 0xffbebdbe, 0xfff0f0ef, 0xffffffff, 0xffffffff, 0xffffffff, 0xff949293, 0xff262223, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff2e2a2b, 0xff9f9d9e, 0xfffdfdfd, 0xffffffff, 0xffffffff, 0xfff1f1f1, 0xffb7b5b6, 0xff8d8b8c, 0xff7f7c7d, 0xff878586, 0xffaaa8a9, 0xffe2e1e2, 0xffffffff, 0xffdbdbdb, 0xffbcbbbb, 0xfffcfcfc, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff221e1f, 0xff807e7e, 0xfff0f0f0, 0xffffffff, 0xffffffff, 0xfff7f7f7, 0xffcac9c9, 0xff9e9c9c, 0xff888686, 0xff858282, 0xff959393, 0xffc0bfbf, 0xfff5f5f5, 0xffffffff, 0xffffffff, 0xffecebeb, 0xff726f70, 0xff211d1e, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xf4231f20, 0x49231f20, 0x01231f20,
+ 0x04231f20, 0x8c231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff807d7e, 0xff1b1718, 0xff1e191a, 0xff8f8d8e, 0xffffffff, 0xffffffff, 0xfff9f9f9, 0xff888687, 0xff242021, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1d1a1b, 0xff5c5959, 0xffe6e5e5, 0xffffffff, 0xffffffff, 0xfff6f5f6, 0xff979495, 0xff3f3c3c, 0xff272424, 0xff221f20, 0xff221e1f, 0xff2b2728, 0xff4d494a, 0xffb6b5b5, 0xffffffff, 0xffffffff, 0xffffffff, 0xffc9c8c8, 0xff3f3b3c, 0xff201c1d, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xfffcfcfc, 0xfff9f9f9, 0xfff4f4f4, 0xff918e8f, 0xff413e3f, 0xff2b2728, 0xff242021, 0xff242021, 0xff2d2a2a, 0xff6c6a6a, 0xffeae9e9, 0xffffffff, 0xffffffff, 0xffdcdcdc, 0xffb1afb0, 0xfff7f7f7, 0xffececec, 0xff7b797a, 0xff393536, 0xff292526, 0xff231f20, 0xff262223, 0xff343031, 0xff7f7d7d, 0xfff4f4f4, 0xffffffff, 0xffffffff, 0xffc1c0c0, 0xff292526, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff454243, 0xffb1afb0, 0xff7e7b7c, 0xff494647, 0xff332f30, 0xff292526, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff272224, 0xff343031, 0xff656263, 0xffd1d0d0, 0xffffffff, 0xffffffff, 0xfff2f2f2, 0xff545152, 0xff1e1a1b, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff6c6a6b, 0xfff1f1f1, 0xffffffff, 0xffffffff, 0xffe4e3e4, 0xff6b6869, 0xff302c2d, 0xff241f20, 0xff221e1f, 0xff221e1f, 0xff2c2829, 0xff565253, 0xffc2c2c2, 0xffffffff, 0xfff8f8f8, 0xffffffff, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1d191b, 0xff666264, 0xffe9e8e9, 0xffffffff, 0xffffffff, 0xffe3e3e3, 0xff7b7879, 0xff3b3738, 0xff282425, 0xff221e1f, 0xff221e1f, 0xff252122, 0xff353132, 0xff777575, 0xffe9e9e9, 0xffffffff, 0xffffffff, 0xffd5d4d4, 0xff4a4647, 0xff201c1d, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0x8c231f20, 0x04231f20,
+ 0x11231f20, 0xc4231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7f7d7e, 0xff1c1819, 0xff1f1b1c, 0xff383535, 0xffdcdbdb, 0xffffffff, 0xffffffff, 0xffd3d3d3, 0xff434041, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff2c2829, 0xffb0afaf, 0xfffefefe, 0xffffffff, 0xfffcfcfc, 0xff9e9d9d, 0xff282525, 0xff211d1e, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff383435, 0xffc7c7c7, 0xffffffff, 0xffffffff, 0xfff8f8f8, 0xff848383, 0xff242021, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xffffffff, 0xfffaf9f9, 0xff918f8f, 0xff2a2627, 0xff221e1f, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1a1b, 0xff8a8889, 0xffffffff, 0xffffffff, 0xfffdfdfd, 0xfffdfdfd, 0xfff6f7f7, 0xff6b6969, 0xff211d1e, 0xff221d1e, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff2a2727, 0xffa3a1a1, 0xffffffff, 0xffffffff, 0xfff6f6f6, 0xff4d4a4b, 0xff1f1b1c, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff282425, 0xff302c2d, 0xff242021, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231e1f, 0xff221e1f, 0xff221e1f, 0xff524f4f, 0xffdddddd, 0xffffffff, 0xffffffff, 0xffa5a4a4, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff312d2e, 0xffbfbebe, 0xffffffff, 0xffffffff, 0xfff5f4f5, 0xff625f60, 0xff1f1b1c, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff211d1e, 0xff4b4849, 0xffd5d4d4, 0xffffffff, 0xffffffff, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff363333, 0xffc1c1c1, 0xffffffff, 0xffffffff, 0xffededed, 0xff666464, 0xff211d1e, 0xff221e1f, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff1f1b1c, 0xff706e6e, 0xfff9f9f9, 0xffffffff, 0xfffdfdfd, 0xff908e8f, 0xff272223, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xc4231f20, 0x11231f20,
+ 0x2e231f20, 0xf0231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7f7d7e, 0xff1c1819, 0xff231f20, 0xff1c1819, 0xff7d7b7b, 0xffffffff, 0xffffffff, 0xffffffff, 0xff8a8788, 0xff252122, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff535051, 0xffe2e1e1, 0xffffffff, 0xffffffff, 0xffd9d9d9, 0xff393636, 0xff1e1a1b, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff5b5859, 0xfff5f5f5, 0xffffffff, 0xffffffff, 0xffc4c3c3, 0xff383435, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xffffffff, 0xffcbcacb, 0xff3b3839, 0xff201c1d, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1f1b1c, 0xff3f3b3c, 0xffeeedee, 0xffffffff, 0xffffffff, 0xffffffff, 0xffa6a5a5, 0xff242021, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221f1f, 0xff615e5e, 0xfff2f2f2, 0xffffffff, 0xffffffff, 0xff797677, 0xff1b1617, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff262223, 0xff939191, 0xffffffff, 0xffffffff, 0xffdedede, 0xff2f2b2c, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff575354, 0xfff5f5f5, 0xffffffff, 0xffffffff, 0xffa1a09f, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201d1e, 0xff817f81, 0xfff5f5f5, 0xffffffff, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211c1e, 0xff6c696a, 0xffefefef, 0xffffffff, 0xffffffff, 0xff989797, 0xff1d191a, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff211d1e, 0xffb1b0b0, 0xffffffff, 0xffffffff, 0xffcccbcb, 0xff3b3738, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xf0231f20, 0x2e231f20,
+ 0x62231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7f7d7e, 0xff1c1819, 0xff231f20, 0xff211d1e, 0xff2f2c2d, 0xffcdcdcd, 0xffffffff, 0xffffffff, 0xffdddddd, 0xff423f40, 0xff211d1e, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff7d7b7b, 0xfff9f9f9, 0xffffffff, 0xffffffff, 0xff8f8e8e, 0xff1a1617, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffbdbcbd, 0xffffffff, 0xffffffff, 0xffeaeaea, 0xff565353, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xfff9f9f9, 0xff918f90, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff282425, 0xffcdcccc, 0xffffffff, 0xffffffff, 0xfff7f7f7, 0xff5d5b5b, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff474444, 0xffdad9d9, 0xffffffff, 0xffffffff, 0xff999898, 0xff1b1618, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff211d1e, 0xff211d1e, 0xff211d1e, 0xff211d1e, 0xff211d1e, 0xff211d1e, 0xff211d1e, 0xff1f1b1c, 0xff696768, 0xfff0f0ef, 0xffffffff, 0xfff5f5f5, 0xff4c494a, 0xff1d191a, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff8a8989, 0xffffffff, 0xffffffff, 0xfff7f7f7, 0xff565354, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1e1a1b, 0xff454242, 0xffdedede, 0xffffffff, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff2a2627, 0xffa19fa0, 0xffffffff, 0xffffffff, 0xffeeeded, 0xff444040, 0xff1d191a, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1c1819, 0xff626060, 0xffffffff, 0xffffffff, 0xffeeeeee, 0xff575354, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0x62231f20,
+ 0x8e231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7f7d7e, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff1f1b1c, 0xff6e6b6b, 0xfffbfbfb, 0xffffffff, 0xffffffff, 0xff959394, 0xff211d1e, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff2a2627, 0xffa09f9f, 0xffffffff, 0xffffffff, 0xfff8f8f8, 0xff535051, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1a1617, 0xff7e7b7c, 0xffffffff, 0xffffffff, 0xfffefefe, 0xff737172, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xfff2f2f1, 0xff686666, 0xff1c1719, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff231f20, 0xffb7b5b5, 0xffffffff, 0xffffffff, 0xffdbdbdb, 0xff423f3f, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff3b3738, 0xffcecdcd, 0xffffffff, 0xffffffff, 0xffa7a6a6, 0xff1e1a1b, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff1f1b1c, 0xff2c2729, 0xff3b3839, 0xff4c4849, 0xff575455, 0xff5c595a, 0xff5f5c5d, 0xff5f5c5d, 0xff5f5c5d, 0xff5d5a5b, 0xff8b898a, 0xffefefef, 0xffffffff, 0xfffbfbfb, 0xff646162, 0xff1b1617, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xffb2b1b2, 0xffffffff, 0xffffffff, 0xffd5d4d4, 0xff373435, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff272324, 0xffbebdbd, 0xfffefefe, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff383435, 0xffc7c7c7, 0xffffffff, 0xffffffff, 0xffc3c2c2, 0xff201c1d, 0xff1d191a, 0xff1f1b1c, 0xff1e1b1c, 0xff1f1b1c, 0xff1f1b1c, 0xff1f1b1c, 0xff1f1b1c, 0xff1f1b1c, 0xff1f1b1c, 0xff1c1819, 0xff3a3738, 0xffeeeeee, 0xffffffff, 0xffffffff, 0xff706e6e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0x8e231f20,
+ 0xb4231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7f7d7e, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff312e2e, 0xffbcbbbb, 0xffffffff, 0xffffffff, 0xffebebeb, 0xff4a4748, 0xff1e1a1b, 0xff221e1f, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff302d2e, 0xffb9b8b9, 0xffffffff, 0xffffffff, 0xffe6e6e6, 0xff343031, 0xff201c1d, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1e1a1b, 0xff565254, 0xfffbfbfb, 0xffffffff, 0xffffffff, 0xff8f8c8d, 0xff252122, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xffededed, 0xff575454, 0xff1b1718, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201d1e, 0xffafadae, 0xffffffff, 0xffffffff, 0xffcac9ca, 0xff373334, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff383535, 0xffc9c8c8, 0xffffffff, 0xffffffff, 0xffafadae, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1a1b, 0xff393536, 0xff777475, 0xffacaaaa, 0xffcccacb, 0xffdddddc, 0xffe5e5e5, 0xffe9e9e9, 0xffebebeb, 0xffebebeb, 0xffebebeb, 0xffebeaeb, 0xfff0f0f0, 0xfffdfdfd, 0xffffffff, 0xffffffff, 0xff706d6e, 0xff191516, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff2c292a, 0xffcccbcc, 0xffffffff, 0xffffffff, 0xffbab9b9, 0xff2b2829, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xffa2a0a0, 0xfffcfcfc, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff484445, 0xffdcdcdc, 0xffffffff, 0xffffffff, 0xffc8c7c8, 0xff716f6f, 0xff747172, 0xff747273, 0xff747273, 0xff757273, 0xff757273, 0xff757273, 0xff767373, 0xff757374, 0xff767374, 0xff757273, 0xff828081, 0xffeeedee, 0xffffffff, 0xffffffff, 0xff858283, 0xff242021, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xb4231f20,
+ 0xd4231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7f7d7e, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff686566, 0xfff1f1f1, 0xffffffff, 0xffffffff, 0xffabaaaa, 0xff211c1d, 0xff211d1e, 0xff221e1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff343031, 0xffc6c5c5, 0xffffffff, 0xffffffff, 0xffd4d4d4, 0xff2a2627, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1f1b1c, 0xff413e3f, 0xfff6f6f5, 0xffffffff, 0xffffffff, 0xff9f9e9e, 0xff272223, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xffe9e9e9, 0xff524e4f, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xffadabac, 0xffffffff, 0xffffffff, 0xffc4c3c4, 0xff322f30, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff373435, 0xffc8c7c7, 0xffffffff, 0xffffffff, 0xffb0aeaf, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff5d5a5b, 0xffc8c7c8, 0xfff3f3f3, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff777475, 0xff181415, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff322e2f, 0xffdbdada, 0xffffffff, 0xffffffff, 0xffaeacac, 0xff282425, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1d191a, 0xff908e8f, 0xfffbfbfb, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff545151, 0xffe9e9e9, 0xffffffff, 0xffffffff, 0xfff9f9f9, 0xfff1f1f1, 0xfff2f1f2, 0xfff2f1f2, 0xfff2f1f2, 0xfff2f2f2, 0xfff2f2f2, 0xfff2f2f2, 0xfff2f2f2, 0xfff2f2f2, 0xfff2f2f2, 0xfff2f2f2, 0xfff3f3f3, 0xfffdfdfd, 0xffffffff, 0xffffffff, 0xff8d8c8c, 0xff242021, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xd4231f20,
+ 0xe5231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7f7d7e, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff322e2f, 0xffb6b5b5, 0xffffffff, 0xffffffff, 0xfff3f3f3, 0xff5a5858, 0xff1a1617, 0xff221f1f, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff373434, 0xffcac9c9, 0xffffffff, 0xffffffff, 0xffcbcacb, 0xff282425, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff3b3738, 0xfff2f1f2, 0xffffffff, 0xffffffff, 0xffa5a4a4, 0xff262223, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xffe9e9e9, 0xff514d4f, 0xff1d1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xffadacad, 0xffffffff, 0xffffffff, 0xffc4c3c3, 0xff322e30, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff373435, 0xffc8c7c7, 0xffffffff, 0xffffffff, 0xffb0aeaf, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff565454, 0xffe2e1e1, 0xffffffff, 0xffffffff, 0xffffffff, 0xfff3f3f3, 0xffd1d0d0, 0xffb3b1b1, 0xffa19f9f, 0xff989696, 0xff939191, 0xff929091, 0xff918f90, 0xffafaeaf, 0xfff4f4f4, 0xffffffff, 0xffffffff, 0xff777475, 0xff181415, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff322f30, 0xffdfdede, 0xffffffff, 0xffffffff, 0xffa9a7a8, 0xff282425, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1c1819, 0xff8b8989, 0xfffbfbfb, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff595758, 0xfff0efef, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff929091, 0xff242021, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xe5231f20,
+ 0xf2231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7f7d7e, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1f1b1c, 0xff676566, 0xffececec, 0xffffffff, 0xffffffff, 0xffb9b8b8, 0xff262223, 0xff201c1c, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff353233, 0xffc7c6c7, 0xffffffff, 0xffffffff, 0xffd2d1d1, 0xff2a2627, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff3f3b3c, 0xfff5f5f5, 0xffffffff, 0xffffffff, 0xffa2a0a1, 0xff262223, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xffe9e9e9, 0xff514d4f, 0xff1d1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xffadacad, 0xffffffff, 0xffffffff, 0xffc4c3c3, 0xff322e30, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff373435, 0xffc8c7c7, 0xffffffff, 0xffffffff, 0xffb0aeaf, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff2e2a2b, 0xffc2c1c1, 0xffffffff, 0xffffffff, 0xfff5f4f4, 0xff9b9a9a, 0xff464344, 0xff2a2627, 0xff221e1f, 0xff1d191a, 0xff1c1819, 0xff1c1819, 0xff1c1819, 0xff1a1516, 0xff5c595a, 0xffe9e8e9, 0xffffffff, 0xffffffff, 0xff777475, 0xff181415, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff302c2d, 0xffd7d7d7, 0xffffffff, 0xffffffff, 0xffb1b0b0, 0xff292526, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e191a, 0xff959393, 0xfffcfcfc, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff585556, 0xffeeedee, 0xffffffff, 0xffffffff, 0xffc1c0c0, 0xff848282, 0xff898788, 0xff898788, 0xff898788, 0xff898788, 0xff898788, 0xff898788, 0xff898788, 0xff898788, 0xff898788, 0xff898788, 0xff898788, 0xff898788, 0xff898788, 0xff8b898a, 0xff565253, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xf2231f20,
+ 0xfd231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7f7d7e, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff2c2829, 0xffb6b5b5, 0xfffefefe, 0xffffffff, 0xfff1f1f1, 0xff666364, 0xff1c1819, 0xffafadad, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff312e2f, 0xffbdbcbd, 0xffffffff, 0xffffffff, 0xffe1e0e1, 0xff302c2d, 0xff201c1d, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1e1a1b, 0xff4f4b4c, 0xfffaf9f9, 0xffffffff, 0xffffffff, 0xff949292, 0xff262223, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xffe9e9e9, 0xff514d4f, 0xff1d1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xffadacad, 0xffffffff, 0xffffffff, 0xffc4c3c3, 0xff322e30, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff373435, 0xffc8c7c7, 0xffffffff, 0xffffffff, 0xffb0aeaf, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff1e1a1b, 0xff5d5a5b, 0xfffffefe, 0xffffffff, 0xfffefefe, 0xff8c898a, 0xff201c1d, 0xff1d191a, 0xff211d1e, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff6a6768, 0xffefefef, 0xffffffff, 0xffffffff, 0xff777475, 0xff181415, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff2a2627, 0xffc6c5c5, 0xffffffff, 0xffffffff, 0xffc1c0c0, 0xff2e2a2b, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff201c1d, 0xffa9a8a8, 0xfffdfdfd, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff4f4c4d, 0xffe4e4e4, 0xffffffff, 0xffffffff, 0xff999797, 0xff100c0d, 0xff181415, 0xff181415, 0xff181415, 0xff181415, 0xff181415, 0xff181415, 0xff181415, 0xff181415, 0xff181415, 0xff181415, 0xff181415, 0xff181415, 0xff181415, 0xff171314, 0xff1e1a1b, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xfd231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7f7d7e, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1c1819, 0xff5f5d5d, 0xffeeeeee, 0xffffffff, 0xfffefefe, 0xffb9b7b8, 0xff302d2e, 0xffacabab, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff2c2829, 0xffa8a6a6, 0xffffffff, 0xffffffff, 0xfff4f4f4, 0xff494647, 0xff1d191a, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff726f70, 0xffffffff, 0xffffffff, 0xffffffff, 0xff7a7878, 0xff241f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xffe9e9e9, 0xff514d4f, 0xff1d1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xffadacad, 0xffffffff, 0xffffffff, 0xffc4c3c3, 0xff322e30, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff373435, 0xffc8c7c7, 0xffffffff, 0xffffffff, 0xffb0aeaf, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff908e8e, 0xffffffff, 0xffffffff, 0xffdcdbdb, 0xff434041, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff7f7c7d, 0xfff9f9f9, 0xffffffff, 0xffffffff, 0xff777475, 0xff181415, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xffa8a6a7, 0xffffffff, 0xffffffff, 0xffe0dfdf, 0xff3f3b3c, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff2d2a2b, 0xffc8c8c8, 0xfffefefe, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff3f3c3d, 0xffd3d2d2, 0xffffffff, 0xffffffff, 0xffc7c5c6, 0xff262223, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7f7d7e, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff242021, 0xffaeacad, 0xffffffff, 0xffffffff, 0xffeeeeee, 0xff6c6a6a, 0xffadabab, 0xfffdfdfd, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff242121, 0xff868484, 0xfffcfcfc, 0xffffffff, 0xffffffff, 0xff7e7b7c, 0xff191516, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1a1b, 0xffacaaab, 0xffffffff, 0xffffffff, 0xfff0f0f0, 0xff5d595a, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xffe9e9e9, 0xff514d4f, 0xff1d1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xffadacad, 0xffffffff, 0xffffffff, 0xffc4c3c3, 0xff322e30, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff373435, 0xffc8c7c7, 0xffffffff, 0xffffffff, 0xffb0aeaf, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff1e1a1b, 0xffa7a5a6, 0xffffffff, 0xffffffff, 0xffc6c5c5, 0xff343132, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff2b2829, 0xffa9a8a8, 0xffffffff, 0xffffffff, 0xffffffff, 0xff777475, 0xff181415, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff7b7878, 0xffffffff, 0xffffffff, 0xfffefefe, 0xff696667, 0xff1e1a1b, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1d191a, 0xff555153, 0xffe6e5e5, 0xffffffff, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff2f2b2c, 0xffb2b1b1, 0xffffffff, 0xffffffff, 0xfff1f1f1, 0xff4a4748, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7f7d7e, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1d191a, 0xff4e4a4b, 0xffefeeee, 0xffffffff, 0xffffffff, 0xffbcbbbb, 0xffc1c0c1, 0xfffcfcfc, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff5d5a5b, 0xffe9e8e9, 0xffffffff, 0xffffffff, 0xffc7c6c6, 0xff2b2627, 0xff1f1b1c, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1c1819, 0xff464243, 0xffebebeb, 0xffffffff, 0xffffffff, 0xffcfcece, 0xff3e3a3b, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xffe9e9e9, 0xff514d4f, 0xff1d1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xffadacad, 0xffffffff, 0xffffffff, 0xffc4c3c3, 0xff322e30, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff373435, 0xffc8c7c7, 0xffffffff, 0xffffffff, 0xffb0aeaf, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff1e1a1b, 0xffa8a6a6, 0xffffffff, 0xffffffff, 0xffcbcaca, 0xff383435, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff4e4b4b, 0xffe3e2e2, 0xffffffff, 0xffffffff, 0xffffffff, 0xff777475, 0xff181415, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff484546, 0xffe8e8e8, 0xffffffff, 0xffffffff, 0xffc3c2c2, 0xff292627, 0xff201c1d, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff262223, 0xff9e9c9c, 0xfffbfbfb, 0xffffffff, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff7f7c7d, 0xfff8f7f8, 0xffffffff, 0xffffffff, 0xffa3a1a1, 0xff1e1a1c, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7f7d7e, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1f1b1c, 0xff9c9a9a, 0xffffffff, 0xffffffff, 0xfff5f5f5, 0xfff0f0f0, 0xfffefefe, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff343031, 0xffbfbebe, 0xffffffff, 0xffffffff, 0xfff8f8f8, 0xff807e7f, 0xff1d191a, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff262223, 0xffafadae, 0xffffffff, 0xffffffff, 0xfffdfdfd, 0xff949293, 0xff272324, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xffe9e9e9, 0xff514d4f, 0xff1d1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xffadacad, 0xffffffff, 0xffffffff, 0xffc4c3c3, 0xff322e30, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff373435, 0xffc8c7c7, 0xffffffff, 0xffffffff, 0xffb0aeaf, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff949192, 0xffffffff, 0xffffffff, 0xffecebec, 0xff565354, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff2c2829, 0xffb1afaf, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xff777475, 0xff181415, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff2a2627, 0xffa6a4a5, 0xffffffff, 0xffffffff, 0xffffffff, 0xff939192, 0xff201c1d, 0xff1f1b1c, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff211d1e, 0xff6c6a6a, 0xffebebeb, 0xffffffff, 0xffffffff, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff444041, 0xffd5d4d4, 0xffffffff, 0xffffffff, 0xfff0f0f0, 0xff716e6f, 0xff1d191a, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff221e1f, 0xff2d292a, 0xff252122, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7f7d7e, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff403d3e, 0xffe4e4e4, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1e1a1b, 0xff706d6e, 0xfff0eff0, 0xffffffff, 0xffffffff, 0xffe9e9e9, 0xff706e6f, 0xff282425, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff302c2d, 0xff969494, 0xfffafaf9, 0xffffffff, 0xffffffff, 0xffdad9d9, 0xff4d494a, 0xff201c1d, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xffe9e9e9, 0xff514d4f, 0xff1d1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xffadacad, 0xffffffff, 0xffffffff, 0xffc4c3c3, 0xff322e30, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff373435, 0xffc8c7c7, 0xffffffff, 0xffffffff, 0xffb0aeaf, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff1d191a, 0xff615f5f, 0xfffdfcfc, 0xffffffff, 0xffffffff, 0xffbbb9b9, 0xff3a3738, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff373334, 0xffa5a3a3, 0xffffffff, 0xfffefefe, 0xfffefefe, 0xffffffff, 0xffffffff, 0xff777475, 0xff181415, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff534f50, 0xffe0dfe0, 0xffffffff, 0xffffffff, 0xfffbfbfb, 0xffa2a0a1, 0xff433f40, 0xff2a2627, 0xff252122, 0xff282425, 0xff3a3738, 0xff807d7e, 0xffeaeaea, 0xfffefefe, 0xffeeeded, 0xfffefefe, 0xffffffff, 0xffe9e8e8, 0xff555252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff201b1c, 0xff7e7b7c, 0xfff3f3f3, 0xffffffff, 0xffffffff, 0xffe9e9e9, 0xff7c7a7a, 0xff302c2d, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff231f20, 0xff242021, 0xff2e2a2b, 0xff4f4c4d, 0xff9f9e9f, 0xff9c9a9b, 0xff2f2b2c, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231e1f, 0xff1e1b1c, 0xff848282, 0xfff6f6f6, 0xffffffff, 0xfff8f8f8, 0xff7f7d7e, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff8b898a, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffececec, 0xff595658, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff272425, 0xffa3a1a1, 0xfffafafa, 0xffffffff, 0xffffffff, 0xfff3f2f3, 0xffaaa9a9, 0xff6c6a6a, 0xff585556, 0xff5b5859, 0xff797677, 0xffc2c1c1, 0xfffdfdfd, 0xffffffff, 0xffffffff, 0xffefeeee, 0xff7b7979, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585556, 0xfff5f5f5, 0xffffffff, 0xfff5f5f5, 0xff7d7b7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff929090, 0xfffafafa, 0xffffffff, 0xffe9e9e9, 0xff514d4f, 0xff1d1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xffadacad, 0xffffffff, 0xffffffff, 0xffc4c3c3, 0xff322e30, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff373435, 0xffc8c7c7, 0xffffffff, 0xffffffff, 0xffb0aeaf, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff2e2a2b, 0xffc4c3c3, 0xffffffff, 0xffffffff, 0xffffffff, 0xffcccccc, 0xff7b7878, 0xff575354, 0xff524e4f, 0xff5c595a, 0xff848282, 0xffd2d1d1, 0xffffffff, 0xfff5f5f5, 0xffcbcbcb, 0xffeeeeee, 0xffffffff, 0xffffffff, 0xff777475, 0xff181415, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff242021, 0xff7c797a, 0xffedeced, 0xffffffff, 0xffffffff, 0xffffffff, 0xffe9e8e8, 0xffbebdbe, 0xffaeadae, 0xffb8b7b7, 0xffdddcdc, 0xffffffff, 0xffffffff, 0xffbfbebf, 0xffa5a3a4, 0xfffbfbfb, 0xffffffff, 0xffe9e8e8, 0xff545252, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff282325, 0xff9e9d9d, 0xfff7f7f7, 0xffffffff, 0xffffffff, 0xfffcfcfc, 0xffc6c5c5, 0xff888687, 0xff636161, 0xff585556, 0xff575455, 0xff5e5b5c, 0xff726f70, 0xff959293, 0xffc3c2c2, 0xfff4f3f3, 0xffffffff, 0xffb5b4b4, 0xff2f2b2c, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff858383, 0xfff8f7f7, 0xffffffff, 0xfff9f9f9, 0xff807d7e, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff3f3c3c, 0xffd5d4d4, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffededed, 0xff5a5758, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1f1b1c, 0xff332f30, 0xffa4a3a3, 0xfff6f6f6, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffdfdfd, 0xfff0f1f1, 0xfff3f3f3, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffeae9e9, 0xff858383, 0xff252222, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585656, 0xfff6f6f6, 0xffffffff, 0xfff6f6f6, 0xff7e7c7c, 0xff201d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff939191, 0xfffbfbfb, 0xffffffff, 0xffeaeaea, 0xff524e4f, 0xff1d1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xffaeacad, 0xffffffff, 0xffffffff, 0xffc5c4c4, 0xff322e30, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff383435, 0xffc9c8c9, 0xffffffff, 0xffffffff, 0xffb1afb0, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff585556, 0xffdedddd, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfff0f0f0, 0xffe9e9e9, 0xfff4f4f4, 0xffffffff, 0xffffffff, 0xfffafafa, 0xffa4a3a3, 0xff706d6e, 0xffe6e6e6, 0xffffffff, 0xffffffff, 0xff787576, 0xff181415, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff272324, 0xff7e7b7d, 0xffdfdede, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffdfdfd, 0xffc2c1c1, 0xff494747, 0xff8a8788, 0xfffbfbfb, 0xffffffff, 0xffe7e6e6, 0xff514e4f, 0xff1d191a, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1f1b1c, 0xff2c2829, 0xff918f8f, 0xffe9e9e9, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffafafa, 0xfff0f0f0, 0xffefefef, 0xfff7f7f7, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffadabac, 0xff2e2a2b, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff828181, 0xfff5f5f5, 0xfffcfcfc, 0xfff7f7f7, 0xff7e7b7c, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff252122, 0xff817f7f, 0xfff8f8f8, 0xfffdfefe, 0xfffcfcfc, 0xfffcfdfc, 0xffebeaeb, 0xff595656, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201b1d, 0xff2e2a2b, 0xff787575, 0xffcccbcc, 0xfffbfafb, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfff4f4f3, 0xffbab9b9, 0xff625e5f, 0xff252122, 0xff201c1d, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1b1718, 0xff585555, 0xfff2f2f2, 0xfffefdfd, 0xfff3f4f4, 0xff7c7a7a, 0xff211c1d, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff1f1b1c, 0xff908e8f, 0xfff9f8f8, 0xfffcfcfc, 0xffe7e6e6, 0xff504d4e, 0xff1d1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211c1d, 0xffacaaaa, 0xffffffff, 0xffffffff, 0xffc3c2c2, 0xff322e2f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff383435, 0xffc7c5c6, 0xffffffff, 0xffffffff, 0xffafadad, 0xff201c1d, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff232020, 0xff5b5959, 0xffc0bfbf, 0xfffafafa, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffdddcdd, 0xff888686, 0xff302c2d, 0xff5a5657, 0xffe7e7e7, 0xfffefefe, 0xfffffffe, 0xff767475, 0xff191415, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff242021, 0xff535051, 0xff9d9b9b, 0xffd2d1d2, 0xffeeeeee, 0xfff9fafa, 0xfff7f7f7, 0xffe7e7e7, 0xffc4c3c4, 0xff858384, 0xff3d3a3b, 0xff1b1819, 0xff989797, 0xfffcfcfc, 0xffffffff, 0xffe1e0e1, 0xff4a4647, 0xff1e1a1b, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff272324, 0xff5e5b5c, 0xffafadae, 0xffeaeaea, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfff5f5f5, 0xffd1d1d1, 0xff9f9d9e, 0xff565454, 0xff262223, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff3b3738, 0xff575455, 0xff585556, 0xff575556, 0xff393637, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff312d2e, 0xff545152, 0xff595657, 0xff585556, 0xff585556, 0xff545152, 0xff302c2d, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff242021, 0xff3a3637, 0xff656263, 0xff949292, 0xffb1b0b0, 0xffbdbcbc, 0xffbcbaba, 0xffacabab, 0xff898787, 0xff595656, 0xff322e2f, 0xff221e1f, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff302c2d, 0xff565353, 0xff595556, 0xff565454, 0xff393536, 0xff221f1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff3e3a3b, 0xff585556, 0xff585556, 0xff535051, 0xff2e2b2b, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff454142, 0xff5a5859, 0xff5a5758, 0xff4a4748, 0xff272324, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff282425, 0xff4b4748, 0xff595657, 0xff5a5758, 0xff454243, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff231f20, 0xff363233, 0xff666464, 0xff9a9798, 0xffb4b3b4, 0xffbdbcbc, 0xffb7b6b6, 0xffa09e9e, 0xff737172, 0xff434041, 0xff262223, 0xff211d1e, 0xff312d2e, 0xff535051, 0xff595656, 0xff595556, 0xff383435, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff211d1e, 0xff292526, 0xff3b3738, 0xff4e4b4c, 0xff565454, 0xff555253, 0xff4a4647, 0xff353132, 0xff252122, 0xff1f1b1c, 0xff231e1f, 0xffb5b4b4, 0xfffefefe, 0xffffffff, 0xffd5d4d4, 0xff3a3738, 0xff1f1b1c, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xff2e2a2b, 0xff4d4a4a, 0xff787676, 0xff9e9c9d, 0xffb5b4b4, 0xffbdbcbd, 0xffbababa, 0xffb1b0b1, 0xff9c9a9b, 0xff7d7b7b, 0xff575455, 0xff3b3838, 0xff292526, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff211d1e, 0xff211d1e, 0xff221f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff211d1e, 0xff211d1e, 0xff211d1e, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff211d1e, 0xff252122, 0xff292526, 0xff272425, 0xff231f20, 0xff211d1e, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff211d1e, 0xff211d1e, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211e1f, 0xff211d1e, 0xff221e1f, 0xff221f1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff211d1e, 0xff211d1e, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff211d1e, 0xff211d1e, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221f1f, 0xff221d1f, 0xff221e1f, 0xff252122, 0xff282425, 0xff262223, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff211d1e, 0xff211d1e, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff1f1b1c, 0xff3c393a, 0xffd5d5d5, 0xffffffff, 0xfffefefe, 0xffbebdbe, 0xff272324, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff211d1e, 0xff211d1e, 0xff262223, 0xff292526, 0xff272425, 0xff242021, 0xff211d1e, 0xff211d1e, 0xff211d1e, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff201c1d, 0xff7b7879, 0xfff4f3f3, 0xffffffff, 0xfffbfbfb, 0xff8e8b8c, 0xff1d191a, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff322e2f, 0xff312d2e, 0xff211d1e, 0xff1f1b1c, 0xff201c1d, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff211d1e, 0xff1f1b1c, 0xff221e1f, 0xff555253, 0xffd6d5d5, 0xffffffff, 0xffffffff, 0xffeaeaea, 0xff4c484a, 0xff1c1819, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff727070, 0xffafadae, 0xff777475, 0xff494647, 0xff302c2d, 0xff231f20, 0xff221e1f, 0xff211e1f, 0xff2a2627, 0xff434040, 0xff7b7879, 0xffd5d4d4, 0xffffffff, 0xffffffff, 0xffffffff, 0xff9b9999, 0xff201d1e, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff838181, 0xfffafafa, 0xfff4f3f4, 0xffdbd9da, 0xffc0bfbf, 0xffacabab, 0xffa3a2a2, 0xffa8a6a6, 0xffb8b6b7, 0xffd5d4d4, 0xfff4f4f4, 0xffffffff, 0xffffffff, 0xffffffff, 0xffbcbbbc, 0xff353133, 0xff201b1c, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff828080, 0xfffcfcfc, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffefefe, 0xfffcfcfc, 0xfffdfdfd, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffdfefe, 0xffacaaab, 0xff3c3839, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff434041, 0xff939191, 0xffcdcccd, 0xffedecec, 0xfff7f7f7, 0xfffefefe, 0xffffffff, 0xffffffff, 0xffffffff, 0xfff9f9f9, 0xffebebeb, 0xffbcbbbc, 0xff696666, 0xff2a2627, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff1f1b1c, 0xff1d191a, 0xff272324, 0xff3d3a3b, 0xff5a5758, 0xff6e6c6c, 0xff797677, 0xff7b797a, 0xff737172, 0xff605d5e, 0xff3f3b3b, 0xff231f20, 0xff1d191a, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff1e1a1b, 0xff1b1718, 0xff191516, 0xff181415, 0xff181415, 0xff181415, 0xff1b1718, 0xff1f1a1c, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff211d1e, 0xff2d292a, 0xff5e5c5d, 0xff696566, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696666, 0xff696566, 0xff696666, 0xff514e4f, 0xff221e1f, 0xff221e1f, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff221e1f, 0xff201c1d, 0xff787576, 0xffe8e7e7, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f3f3, 0xfff4f4f4, 0xffd1d1d1, 0xff464344, 0xff1e1a1b, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff201c1d, 0xff4b4849, 0xffd6d6d6, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffcfcfc, 0xffa2a1a1, 0xff292526, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff2e2a2b, 0xffaaa8a9, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xfffefdfd, 0xfff7f6f7, 0xfff5f5f5, 0xfff5f5f5, 0xfff5f5f5, 0xfff5f5f5, 0xfff5f5f5, 0xfff5f5f5, 0xfff5f5f5, 0xfff5f5f5, 0xfff5f5f5, 0xfff5f5f5, 0xfff5f5f5, 0xfff5f5f5, 0xfff5f5f5, 0xfff5f5f5, 0xfff5f5f5, 0xfff5f5f5, 0xfffafafa, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffeaeaea, 0xff656263, 0xff211d1e, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20,
+ 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff231f20, 0xff242021, 0xff737071, 0xfff7f7f7, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffe4e3e4, 0xff686566, 0xff423e3f, 0xff464243, 0xff464243, 0xff464243, 0xff464243, 0xff464243, 0xff464243, 0xff464243, 0xff464243, 0xff464243, 0xff464243, 0xff464243, 0xff464243, 0xff464243, 0xff454142, 0xff464344, 0xffa19f9f, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffc0bfbf, 0xff383435