{"id":30,"date":"2008-02-01T22:25:21","date_gmt":"2008-02-02T03:25:21","guid":{"rendered":"http:\/\/localhost:8888\/wordpress\/index.php\/mamewah-tools\/"},"modified":"2012-08-08T15:32:27","modified_gmt":"2012-08-08T20:32:27","slug":"mamewah-tools","status":"publish","type":"page","link":"https:\/\/www.rickandviv.net\/index.php\/the-frinkiac-7\/mamewah-tools\/","title":{"rendered":"MAMEWah Tools"},"content":{"rendered":"<p>I use <a href=\"http:\/\/mamewah.mameworld.info\/\">MAMEWah<\/a> as my front-end on my arcade cabinet.  It is very customizable and very powerful.<\/p>\n<p>Sometime around release 1.62 it gained the ability to have game-specific settings.  With this ability, it is possible to mix games from more than one emulator into a single game list.<\/p>\n<p>Putting arbitrary games into a list isn&#8217;t supported via any MAMEWah functionality, per se.  But we can make changes to the game lists behind MAMEWah&#8217;s back and it will dutifully display the changed lists.<\/p>\n<p>I&#8217;ve written three little Perl scripts that I use to manipulate the .lst files that MAMEWah generates in the \\mamewah\\files directory.  I&#8217;m providing them here for those who want to do this kind of thing.<\/p>\n<p><big><a href=\"https:\/\/www.rickandviv.net\/wp-content\/uploads\/2008\/02\/mamewah-tools-01.zip\" title=\"MAMEWah tools version 0.1 zip file.\">Here&#8217;s a download link.<\/a><\/big><\/p>\n<p>Feel free to try these scripts out and send me feedback.  But PLEASE BACKUP YOUR .LST LISTFILES BEFORE USING THESE SCRIPTS!!!  I can&#8217;t guarantee that they will work for all users and all releases of MAMEWah.<\/p>\n<h2>filter-mamewah-list.pl<\/h2>\n<p>This tool takes a MAMEWah .lst file and filters it against a list of roms given in a separate file.  This tool was written to allow the quick recreation of a specific list of games.  If you have a list of roms, this tool will filter an emulator-#.lst file such that it only contains the games in that list.<\/p>\n<p><p>The -unique option will work through a list of games and remove duplicate game names.  It works by stripping the game names at the first left parenthesis &#8220;(&#8221; and using some heuristics to choose among the different like-named game names.<\/p>\n<p>The -duphints option is a helper to the -unique option.  It allows you to tell the script which rom to choose for a given gamename.  The rom and gamenames are provided by a text file that has lines of the form &#8220;Game name=romname&#8221;, one per line.  This is useful when you&#8217;ve played a particular clone of a game and always want the script to choose that particular clone in the future (to preserve your high score, for instance).<\/p>\n<p>Here&#8217;s the help text printed by the -h command line argument:<\/p>\n<pre>\r\nfilter-mamewah-list.pl [options] {-ftr &lt;filter file&gt; | -unique} -src &lt;MAMEWah source list&gt;\r\n\r\nTakes a MAMEWah list and pulls out only items that match those in the filter\r\nlist.\r\n\r\nOptions:\r\n   -unique\r\n      Remove duplicate entries in the game list by comparing game names.\r\n\r\n   -rewrite\r\n      Rename the output list to that of the MAMEWah source list upon finish.\r\n\r\n   -duphints &lt;hints file&gt;\r\n      A file of \"hints\" that tell the script which specific rom to choose\r\n      when it has to choose between alternatives.\r\n<\/pre>\n<h2>make-mamewah-filter.pl<\/h2>\n<p>This tool takes a MAMEWah .lst file and pulls out only the rom names.  It&#8217;s useful for creating a rom list that the previous tool can use.<\/p>\n<p>Here&#8217;s its help text:<\/p>\n<pre>\r\nmake-mamewah-filter.pl -ftr &lt;filter file&gt; -src &lt;MAMEWah source list&gt; [-h]\r\n\r\nTakes a MAMEWah list and creates a filter list including all roms that are\r\npresent.\r\n<\/pre>\n<h2>merge-mamewah-lists.pl<\/h2>\n<p>This is the most powerful of the tools.  It will take two MAMEWah .lst files and create a third that is the combination of the two.<\/p>\n<p>By default it will simply merge the two lists, favoring the information in the first list when a rom exists on both.  This would only be useful when the roms on both game lists are run by the same emulator.<\/p>\n<p>The -inis flag instructs the script to create game-specific .ini files for every game on list2 that isn&#8217;t on list1.  This is helpful when merging lists of games from two different emulators.  You must provide it a template file from which the script will generate the .ini files.  The form of the template file should be the following:<\/p>\n<pre>\r\n### [ini_unique_gamename].ini (mamewah v1.62) ###\r\n\r\n### Execution Settings ###\r\npre_emulator_app_commandlines\r\nemulator_commandline d:\\emulation\\pacmame-0.58\\pacmame.exe [ini_gamename]{autodosbox}\r\npost_emulator_app_commandlines\r\n<\/pre>\n<p>I&#8217;ve put in place two special MAMEWah-like tags.  The [ini_gamename] tag will get replaced when the .ini file is created by the name of the rom corresponding to the game.  The [ini_unique_gamename] tag will get replaced by the uniqified name (specified by the -uniqifier option).<\/p>\n<p>The -uniqifier option provides for a different way of dealing with romnames that are present on both lists.  You can give it a string to add to the front of the romname that will act to make it unique.  Obviously, the new unique name will not correspond to a real romname, so this option is best used in conjunction with the -inis option so that a .ini file will be created.  The .ini file can have the real romname on its commandline via the [ini_gamename] tag.<\/p>\n<p>Here&#8217;s the help text:<\/p>\n<pre>\r\nmerge-mamewah-lists.pl [options] &lt;MAMEWah list1&gt; &lt;MAMEWah list2&gt; &lt;output list&gt;\r\n\r\nMerges two MAMEWah lists into a third.\r\n\r\nOptions:\r\n   -uniqifier &lt;string&gt;\r\n      Change the name of any game that is on both lists by adding <string> to\r\n      the front.  When creating game-specific .ini files, the uniqified name\r\n      will be used for the .ini filename.\r\n\r\n   -inis &lt;ini file template filename&gt;\r\n      Create a set of game-specific .ini files for the games on list2 using\r\n      the file specified as a template.\r\n\r\n      The string [ini_gamename] will be replaced with the rom name anywhere\r\n      it exists in the template.\r\n\r\n      The string [ini_unique_gamename] will be replaced with the rom name as\r\n      uniqified anywhere it exists in the template.\r\n<\/pre>\n<p>Here are a couple of examples of use:<\/p>\n<p><h3>Example 1: merging MisfitMAME and PacMAME lists<\/h3>\n<p>I run both MisfitMAME and PacMAME on my cab in addition to MAME itself.  As of the versions that I have (0.62 and 0.58 respectively) there are 304 PacMAME games and 433 MisfitMAME games.  But they have 199 games in common, for a total of 538 different games between them.<\/p>\n<p>I wanted to just combine these two emulators into one &#8220;Alternate Arcade Games&#8221; list.  The issues are the following:<\/p>\n<ul>\n<li>I want MisfitMAME to be the &#8220;main&#8221; emulator.  The PacMAME games will be the exceptions to the MisfitMAME list rule.  They will be run via game-specific .ini files.<\/li>\n<li>When a rom shows up on both lists, it is actually the same game.  So the script will just take the one on the Misfit list.<\/li>\n<\/ul>\n<p>The following use of the tool will accomplish what I want:<\/p>\n<pre>\r\nmerge-mamewah-lists.pl -inis pacini-template.txt misfit-0.lst pacmame-0.lst out.lst\r\n<\/pre>\n<p>pacini-template.txt is the example given above.  The out.lst file contains all games from both list files, and a .ini file was created for every game that needs to be run via PacMAME.<\/p>\n<h3>Example 2: merging MAME and Daphne lists<\/h3>\n<p>Merging MAME and Daphne is a pretty natural idea.  Getting all &#8220;Arcade Games&#8221; into one list is probably something most people think of.<\/p>\n<p>The issues are the following:<\/p>\n<ul>\n<li>Obviously, MAME will be the &#8220;main&#8221; emulator and Daphne games will be run via game-specific .ini files.<\/li>\n<li>When a romname shows up on both lists, the games are actually different.  So both games need to show up in the list.  A uniqifier will be necessary.<\/li>\n<\/ul>\n<p>The following use of the tool will accomplish what I want:<\/p>\n<pre>\r\nmerge-mamewah-lists.pl -inis daphneini-template.txt -uniqifier daphne_ mame-0.lst daphne-0.lst out.lst\r\n<\/pre>\n<p>Here&#8217;s the daphneini-template.txt file:<\/p>\n<pre>\r\n### [ini_unique_gamename].ini (mamewah v1.62) ###\r\n\r\n### Execution Settings ###\r\npre_emulator_app_commandlines\r\nemulator_commandline d:\\emulation\\Daphne\\daphne.exe [ini_gamename] vldp -framefile \"d:\\emulation\\daphne\\framefile\\[ini_gamename].txt\" -fullscreen -nohwaccel{nodosbox}{nosafelaunch}\r\npost_emulator_app_commandlines\r\n<\/pre>\n<p>The [ini_gamename] tags will get replaced with the real romname that Daphne wants to see, while the .ini filename will have the uniqifier daphne_ prepended to it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I use MAMEWah as my front-end on my arcade cabinet. It is very customizable and very powerful. Sometime around release 1.62 it gained the ability to have game-specific settings. With this ability, it is possible to mix games from more than one emulator into a single game list. Putting arbitrary games into a list isn&#8217;t [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":4,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-30","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.rickandviv.net\/index.php\/wp-json\/wp\/v2\/pages\/30","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rickandviv.net\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.rickandviv.net\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.rickandviv.net\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rickandviv.net\/index.php\/wp-json\/wp\/v2\/comments?post=30"}],"version-history":[{"count":5,"href":"https:\/\/www.rickandviv.net\/index.php\/wp-json\/wp\/v2\/pages\/30\/revisions"}],"predecessor-version":[{"id":1332,"href":"https:\/\/www.rickandviv.net\/index.php\/wp-json\/wp\/v2\/pages\/30\/revisions\/1332"}],"up":[{"embeddable":true,"href":"https:\/\/www.rickandviv.net\/index.php\/wp-json\/wp\/v2\/pages\/4"}],"wp:attachment":[{"href":"https:\/\/www.rickandviv.net\/index.php\/wp-json\/wp\/v2\/media?parent=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}