[mythtv] patches

DanM dan at milkcarton.com
Sat Feb 22 11:15:13 EST 2003


Skipped content of type multipart/alternative-------------- next part --------------
--- mamehandler.cpp	2003-02-22 10:34:06.000000000 +0000
+++ mamehandler.cpp.new	2003-02-22 10:47:52.000000000 +0000
@@ -408,6 +408,7 @@
         QString exec;
         check_xmame_exe();
         makecmd_line(romdata->Romname(), &exec, static_cast<MameRomInfo*>(romdata));
+        //cout << exec << endl;
         command = popen(exec, "w");
         /* Send a newline to *command in case xmame wants the user to "press any key" */
         fprintf(command, "\n");
@@ -482,7 +483,7 @@
                 exec+= " -version 2>/dev/null";
                 command = popen(exec, "r");
 
-                /* Chech xmame display target */
+                /* Check xmame display target */
                 while (fgets(line, 254, command) && !xmame_version_ok) {
                         tmp = line + 1;
                         while ((*tmp && (*tmp++ != '('))
@@ -753,21 +754,35 @@
                  << "default.";
             *exec+= "/roms";
         }
+
+        /* define the integer version of xmame_minor so we only have to evaluate it once */
+        tmp = general_prefs.xmame_minor;
+        int xmame_minor = atoi(tmp);
+
         if (!general_prefs.cheat_file.isEmpty())
         {
+          /* The cheatfile argument name changed in 0.62. */
+          if (xmame_minor >= 62) {
+            *exec+= " -cheat_file ";
+          } else {
            *exec+= " -cheatfile ";
+          }
            *exec+= general_prefs.cheat_file;
         }
         if (!general_prefs.game_history_file.isEmpty())
         {
+          /* The historyfile argument name changed in 0.62. */
+          if (xmame_minor >= 62) {
+            *exec+= " -history_file ";
+          } else {
            *exec+= " -historyfile ";
+          }
            *exec+= general_prefs.game_history_file;
         }
         if (!screenshotdir.isEmpty())
         {
-          tmp = general_prefs.xmame_minor;
           /* The screenshot dir argument name changed in 0.62. */
-          if (atoi(tmp) >= 62) {
+          if (xmame_minor >= 62) {
             *exec+= " -snapshot_directory ";
           } else {
             *exec+= " -screenshotdir ";
@@ -776,8 +791,10 @@
         }
         if (!general_prefs.highscore_dir.isEmpty())
         {
-          *exec+= " -spooldir ";
-          *exec+= general_prefs.highscore_dir;
+          if (xmame_minor < 62) {
+            *exec+= " -spooldir ";
+            *exec+= general_prefs.highscore_dir;
+          }
         }
         *exec+= game_settings.fullscreen ? fullscreen : windowed;
         *exec+= game_settings.scanlines ? " -scanlines" : " -noscanlines";


More information about the mythtv-dev mailing list