Browse Source

Emulator skip ROM_SO checks if no needs for rom so

cuu 5 years ago
parent
commit
83a7547a0a
2 changed files with 36 additions and 31 deletions
  1. 17 14
      sys.py/UI/Emulator/fav_list_page.py
  2. 19 17
      sys.py/UI/Emulator/rom_list_page.py

+ 17 - 14
sys.py/UI/Emulator/fav_list_page.py

@@ -318,25 +318,28 @@ class FavListPage(Page):
                 
             print("Run ",path)
             
-            # check ROM_SO exists
-            if FileExists(self._Emulator["ROM_SO"]):
-                escaped_path = CmdClean( path)
+            if self._Emulator["FILETYPE"] == "dir":
+                escaped_path = CmdClean(path)
+            else:
+                escaped_path = CmdClean(path)
                 
-                custom_config = ""
-                if self._Emulator["RETRO_CONFIG"] != "" and len(self._Emulator["RETRO_CONFIG"]) > 5:
-                    custom_config = " -c " + self._Emulator["RETRO_CONFIG"]
-                        
-                cmdpath = " ".join( (self._Emulator["LAUNCHER"],self._Emulator["ROM_SO"], custom_config, escaped_path))
+            custom_config = ""
+            if self._Emulator["RETRO_CONFIG"] != "" and len(self._Emulator["RETRO_CONFIG"]) > 5:
+                custom_config = " -c " + self._Emulator["RETRO_CONFIG"]
                 
+            cmdpath = " ".join( (self._Emulator["LAUNCHER"],self._Emulator["ROM_SO"], custom_config, escaped_path))
+                
+            if self._Emulator["ROM_SO"] =="": #empty means No needs for rom so
                 pygame.event.post( pygame.event.Event(RUNEVT, message=cmdpath))
-                return
             else:
-                
-                self._Screen.PushPage(self._RomSoConfirmDownloadPage)
-                self._Screen.Draw()
-                self._Screen.SwapAndShow()
+                if FileExists(self._Emulator["ROM_SO"]):
+                    pygame.event.post( pygame.event.Event(RUNEVT, message=cmdpath))
+                else:
+                    self._Screen.PushPage(self._RomSoConfirmDownloadPage)
+                    self._Screen.Draw()
+                    self._Screen.SwapAndShow()
+                    return            
 
-            return
     
         self._Screen.Draw()
         self._Screen.SwapAndShow()

+ 19 - 17
sys.py/UI/Emulator/rom_list_page.py

@@ -357,27 +357,29 @@ class RomListPage(Page):
                 path = cur_li._Path
             
             print("Run  ",path)
-
-            # check ROM_SO exists
-            if FileExists(self._Emulator["ROM_SO"]):
-                if self._Emulator["FILETYPE"] == "dir":
-                    escaped_path = CmdClean(path)
-                else:
-                    escaped_path = CmdClean(path)
+            
+            if self._Emulator["FILETYPE"] == "dir":
+                escaped_path = CmdClean(path)
+            else:
+                escaped_path = CmdClean(path)
+                
+            custom_config = ""
+            if self._Emulator["RETRO_CONFIG"] != "" and len(self._Emulator["RETRO_CONFIG"]) > 5:
+                custom_config = " -c " + self._Emulator["RETRO_CONFIG"]
                 
-                custom_config = ""
-                if self._Emulator["RETRO_CONFIG"] != "" and len(self._Emulator["RETRO_CONFIG"]) > 5:
-                    custom_config = " -c " + self._Emulator["RETRO_CONFIG"]
+            cmdpath = " ".join( (self._Emulator["LAUNCHER"],self._Emulator["ROM_SO"], custom_config, escaped_path))
                 
-                cmdpath = " ".join( (self._Emulator["LAUNCHER"],self._Emulator["ROM_SO"], custom_config, escaped_path))
+            if self._Emulator["ROM_SO"] =="": #empty means No needs for rom so
                 pygame.event.post( pygame.event.Event(RUNEVT, message=cmdpath))
-                return
             else:
-                
-                self._Screen.PushPage(self._RomSoConfirmDownloadPage)
-                self._Screen.Draw()
-                self._Screen.SwapAndShow()
-    
+                if FileExists(self._Emulator["ROM_SO"]):
+                    pygame.event.post( pygame.event.Event(RUNEVT, message=cmdpath))
+                else:
+                    self._Screen.PushPage(self._RomSoConfirmDownloadPage)
+                    self._Screen.Draw()
+                    self._Screen.SwapAndShow()
+                    return
+            
         self._Screen.Draw()
         self._Screen.SwapAndShow()