Kodi Community Forum

Full Version: [RELEASE] Rom Collection Browser - Browse and launch emulator game ROMs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2015-02-09, 07:54)malte Wrote: [ -> ]
desumoyo Wrote:a simple (I guess?) workaround would be to have Kodi to copy the file somewhere in a temp folder on the SD, and try to launch that file instead.
This is already implemented. I want to include it into next release. You can already add it manually: link

Can anyone confirm this works with the latest test version of RCB on latest kodi 14.1?

I'm not familiar with the process here, but willing to give it a try..
thanks malte for reply, at the present time it would be beyond my capabilities as my knowledge of python is probably way to low. I sort of understand what's needed but unsure how to implement

here's what mine looks like in black glass nova with multiple instances , this is the kinda thing that I was hoping to achieve

Image
(2014-11-16, 00:22)sklick Wrote: [ -> ]I have prepared a patch for those who want to use rom collections stored on networked drives on systems that do not support files on networked drives ("smb://...", etc...) natively - such as Android. With this patch a new option "Make Local Copy" is added to "Edit Rom Collection" -> "Launch Games". When checked the rom will be copied from the location it was imported from into a temporary local storage, where emulators and the compressed file handling routines (for *.zip and *.7zip) can pick it up. The copying is accomplished by XBMC's internal file copy system, so every file on whatever networked storage XBMC can pick up can also be copied. Once a local copy has been made, the launched emulator should have no problem reading the file.

Here's the story behind this patch:
I have a Fire TV, so Android, unrooted and unrootable. Import from a network share worked. Launching a game did not. Checking the logs, it showed that for uncompressed files the emulators were fed with the network location of the file, such as "smb://SHARENAME/roms/game.nes". Android emulators such as RetroArch cannot access these files. They can only read local copies. Using zipped ROMs should work since RCB uncompresses these to a local location before launching the emu. Sadly RCB's uncompress routines also do not like networked files. To fix this I put in the "Make local copy" option before the ROM is launched or uncompressed. That's what this patch adds to the current repo version (2.0.17) of RCB.

Code:
Index: resources/language/English/strings.xml
===================================================================
--- resources/language/English/strings.xml    (revision 1825)
+++ resources/language/English/strings.xml    (working copy)
@@ -255,6 +255,7 @@
    <string id="52036">Autoplay Video (Info Window)</string>
    <string id="52037">Use RetroPlayer</string>
    <string id="52038">Gameclient</string>
+    <string id="52039">Make Local Copy</string>
    
    <string id="52034">Save Config</string>
    <string id="52035">Cancel</string>
Index: resources/lib/config.py
===================================================================
--- resources/lib/config.py    (revision 1825)
+++ resources/lib/config.py    (working copy)
@@ -235,6 +235,7 @@
    maxFolderDepth = 99
    useFoldernameAsGamename = False
    doNotExtractZipFiles = False
+    makeLocalCopy = False
    diskPrefix = '_Disk.*'
    xboxCreateShortcut = False
    xboxCreateShortcutAddRomfile = False
@@ -493,6 +494,11 @@
            doNotExtractZipFiles = self.readTextElement(romCollectionRow, 'doNotExtractZipFiles')             
            if(doNotExtractZipFiles != ''):
                romCollection.doNotExtractZipFiles = doNotExtractZipFiles.upper() == 'TRUE'        
+            
+            makeLocalCopy = self.readTextElement(romCollectionRow, 'makeLocalCopy')             
+            if(makeLocalCopy != ''):
+                romCollection.makeLocalCopy = makeLocalCopy.upper() == 'TRUE'        
+            
                
            romCollection.diskPrefix = self.readTextElement(romCollectionRow, 'diskPrefix')
                
@@ -742,4 +748,4 @@
        else:
            return ''
    
-            
\ No newline at end of file
+            
Index: resources/lib/configxmlwriter.py
===================================================================
--- resources/lib/configxmlwriter.py    (revision 1825)
+++ resources/lib/configxmlwriter.py    (working copy)
@@ -74,6 +74,7 @@
            SubElement(romCollectionXml, 'useFoldernameAsGamename').text = str(romCollection.useFoldernameAsGamename)
            SubElement(romCollectionXml, 'maxFolderDepth').text = str(romCollection.maxFolderDepth)
            SubElement(romCollectionXml, 'doNotExtractZipFiles').text = str(romCollection.doNotExtractZipFiles)
+            SubElement(romCollectionXml, 'makeLocalCopy').text = str(romCollection.makeLocalCopy)
            SubElement(romCollectionXml, 'diskPrefix').text = str(romCollection.diskPrefix)
            
            if (os.environ.get( "OS", "xbox" ) == "xbox"):
@@ -370,4 +371,4 @@
        except Exception, (exc):
            print("Error: Cannot write config.xml: " +str(exc))
            return False, util.localize(32008) +": " +str(exc)
-        
\ No newline at end of file
+        
Index: resources/lib/dialogeditromcollection.py
===================================================================
--- resources/lib/dialogeditromcollection.py    (revision 1825)
+++ resources/lib/dialogeditromcollection.py    (working copy)
@@ -60,8 +60,8 @@
CONTROL_BUTTON_SAVESTATEPARAMS = 5480
CONTROL_BUTTON_PRECMD = 5510
CONTROL_BUTTON_POSTCMD = 5520
+CONTROL_BUTTON_MAKELOCALCOPY = 5560

-
class EditRomCollectionDialog(dialogbase.DialogBaseEdit):
        
    selectedControlId = 0
@@ -429,6 +429,9 @@
        control = self.getControlById(CONTROL_BUTTON_DONTEXTRACTZIP)
        control.setSelected(self.selectedRomCollection.doNotExtractZipFiles)
        
+        control = self.getControlById(CONTROL_BUTTON_MAKELOCALCOPY)
+        control.setSelected(self.selectedRomCollection.makeLocalCopy)
+            
        control = self.getControlById(CONTROL_BUTTON_PRECMD)
        util.setLabel(self.selectedRomCollection.preCmd, control)        
        
@@ -510,7 +513,10 @@
        self.selectedRomCollection.usePopen = bool(control.isSelected())
        control = self.getControlById(CONTROL_BUTTON_DONTEXTRACTZIP)
        self.selectedRomCollection.doNotExtractZipFiles = bool(control.isSelected())
+        control = self.getControlById(CONTROL_BUTTON_MAKELOCALCOPY)
+        self.selectedRomCollection.makeLocalCopy = bool(control.isSelected())
        
+        
        Logutil.log('updateSelectedRomCollection: precmd = ' +self.selectedRomCollection.preCmd, util.LOG_LEVEL_INFO)
    
    
@@ -735,4 +741,4 @@
        if(site != None):
            sites.append(site)
            
-        return sites
\ No newline at end of file
+        return sites
Index: resources/lib/launcher.py
===================================================================
--- resources/lib/launcher.py    (revision 1825)
+++ resources/lib/launcher.py    (working copy)
@@ -177,6 +177,19 @@
    for fileNameRow in filenameRows:
        rom = fileNameRow[0]
        Logutil.log('rom: ' +str(rom), util.LOG_LEVEL_INFO)
+        
+        if romCollection.makeLocalCopy:
+            localDir = os.path.join(util.getTempDir(), romCollection.name)
+            if os.path.exists(localDir):
+                Logutil.log("Trying to delete local rom files", util.LOG_LEVEL_INFO)    
+                files = os.listdir(localDir)
+                for file in files:
+                    os.remove(os.path.join(localDir, file))
+            localRom = os.path.join(localDir, os.path.basename(str(rom)))
+            Logutil.log('Creating local copy: ' + str(localRom), util.LOG_LEVEL_INFO)
+            if xbmcvfs.copy(rom, localRom):
+                Logutil.log('Local copy created', util.LOG_LEVEL_INFO)
+            rom = localRom

        # If it's a .7z file
        # Don't extract zip files in case of savestate handling and when called From skin
@@ -289,11 +302,12 @@
    #Note: Trying to delete temporary files (from zip or 7z extraction) from last run
    #Do this before launching a new game. Otherwise game could be deleted before launch
    try:
-        Logutil.log("Trying to delete temporary rom files", util.LOG_LEVEL_INFO)    
-        tempDir = util.getTempDir()
-        files = os.listdir(tempDir)
-        for file in files:
-            os.remove(os.path.join(tempDir, file))
+        tempDir = os.path.join(util.getTempDir(), 'extracted')
+        if os.path.exists(tempDir):
+            Logutil.log("Trying to delete temporary rom files", util.LOG_LEVEL_INFO)    
+            files = os.listdir(tempDir)
+            for file in files:
+                os.remove(os.path.join(tempDir, file))
    except Exception, (exc):
        Logutil.log("Error deleting files after launch emu: " +str(exc), util.LOG_LEVEL_ERROR)
        gui.writeMsg(util.localize(32036) +": " +str(exc))
@@ -334,7 +348,7 @@
            Logutil.log('Error handling compressed file', util.LOG_LEVEL_WARNING)
            return []
        for archive in archives:                    
-            newPath = os.path.join(util.getTempDir(), archive[0])
+            newPath = os.path.join(util.getTempDir(), 'extracted', archive[0])
            fp = open(newPath, 'wb')
            fp.write(archive[1])
            fp.close()
@@ -768,4 +782,4 @@
    archive = zipfile.ZipFile(fp)
    archivesDecompressed = [(name, archive.read(name)) for name in archiveList]
    fp.close()
-    return archivesDecompressed
\ No newline at end of file
+    return archivesDecompressed
Index: resources/skins/Default/720p/script-RCB-editromcollection.xml
===================================================================
--- resources/skins/Default/720p/script-RCB-editromcollection.xml    (revision 1825)
+++ resources/skins/Default/720p/script-RCB-editromcollection.xml    (working copy)
@@ -1942,6 +1942,24 @@
                    <onleft>7000</onleft>
                    <onright>6000</onright>
                    <onup>5520</onup>
+                    <ondown>5560</ondown>
+                </control>
+                
+                <!-- Make local copy -->
+                <control type="radiobutton" id="5560">
+                    <posx>0</posx>
+                    <posy>300</posy>
+                    <width>660</width>
+                    <height>30</height>
+                    <font>font13</font>
+                    <label>$ADDON[script.games.rom.collection.browser 52039]</label>
+                    <textcolor>88FFFFFF</textcolor>
+                    <focusedcolor>FFFFFFFF</focusedcolor>
+                    <texturefocus>rcb-MenuItemFO.png</texturefocus>
+                    <texturenofocus>rcb-MenuItemNF.png</texturenofocus>
+                    <onleft>7000</onleft>
+                    <onright>6000</onright>
+                    <onup>5450</onup>
                    <ondown>5540</ondown>
                </control>
                
@@ -1948,7 +1966,7 @@
                <!-- Use RetroPlayer -->
                <control type="radiobutton" id="5540">
                    <posx>0</posx>
-                    <posy>300</posy>
+                    <posy>330</posy>
                    <width>660</width>
                    <height>30</height>
                    <font>font13</font>
@@ -1965,7 +1983,7 @@
                <!-- Game Client -->
                <control type="image">
                    <posx>0</posx>
-                    <posy>330</posy>
+                    <posy>360</posy>
                    <width>270</width>
                    <height>30</height>
                    <texture>rcb-MenuItemFO.png</texture>
@@ -1973,7 +1991,7 @@
                </control>                
                <control type="label">
                    <posx>7</posx>
-                    <posy>330</posy>
+                    <posy>360</posy>
                    <width>200</width>
                    <height>30</height>
                    <font>font13</font>
@@ -1986,7 +2004,7 @@
                </control>
                <control type="label">
                    <posx>7</posx>
-                    <posy>330</posy>
+                    <posy>360</posy>
                    <width>200</width>
                    <height>30</height>
                    <font>font13</font>
@@ -2000,7 +2018,7 @@
                <control type="button" id="5550">
                    <description>Game client</description>
                    <posx>240</posx>
-                    <posy>330</posy>
+                    <posy>360</posy>
                    <width>410</width>
                    <height>30</height>
                    <visible>true</visible>
@@ -2077,4 +2095,4 @@
            <onright>7000</onright>
        </control>        
    </controls>
-</window>
\ No newline at end of file
+</window>

To apply this patch you need two programs. A subversion client (svn) to checkout the latest RCB source code and a patch program that can handle Unix diff and patch files. Both things are available for every current OS; TortoiseSVN for Windows comes to mind, nearly every Linux distro got an subversion package in their repositories; the Window's compatible patch program might be more difficult, Linux got this already on board in even the most basic installs. Here's what needs to be done:

1. Get the latest RCB source via SVN from code.google.com:
Code:
svn checkout http://romcollectionbrowser.googlecode.com/svn/trunk/ romcollectionbrowser-read-only
You will get a new directory romcollectionbrowser-read-only.

2. Apply the patch by placing it in that same directory, and apply the patch to the source:
Code:
patch -p0 -i name-of-the-patch-file.diff

3. Zip up the romcollectionbrowser-read-only direcotry and choose System->Add-Ons->Install from zip file in XBMC and select the zip file. On my Fire TV I had to push the zip onto the device via adb first, but how you get the zip onto your XBMC device depends on your device.

4. When editing a ROM collection you should see a new option "Make local copy" at the bottom. If not, the patch was not applied or the install went wrong or something else entirely. In that case just keep trying and watch out for errors along the way. Google is your friend.


Has anyone tried and got this to work? I tried to follow the instructions and using different flavours of Tortoise (windows) I was able to create the patch file and what looked like correctly patching the directory, but when I reinstalled the addon I didn't see any sign of the "Make Local Copy" option under 'Edit Rom Collection'

I'm desperate to get this working as all of my roms are stored on a NAS.

Any help is appreciated!
(2015-02-09, 07:54)malte Wrote: [ -> ]
Maleficium Wrote:After some tests with Kodi and the latest release of RCB I decided to went back to Gotham and 2.0.17.
Anyone know how could I get 2.0.17 ? The link seems broken.
What did not work in 2.0.18? Usually 2.0.18 should also work with Gotham. But you are right, since I switched to provide the files via repository there are no previous versions available online. You could still grab them from your local XBMC packages folder. I will also think about how to provide older versions on my project page.

It was solved by now, I went back to Frodo (not Gotham as I said) and I installed 2.0.17 from the available add-ons list from XBMC itself.
The link provided in this forum to 2.0.17 its the "broken one".

My major problem with Kodi (and Gotham) its the time RCB needs to start. I have a big database (almost 50k games, 69 systems) and it takes almost 1 minute just to start while in Frodo it starts in 2 seconds. Add a new game its another long wait, even with filters to just 1 system.
Not sure if the problem its with Kodi, with my config.xml (I modified some things) or with my DB itself, I'm using the same in the last couple years.

Well, I can live with that for now, Frodo to RCB Kodi for other things.

Btw, there's any way to start RCB automatically every time I start XBMC ?
(2015-01-18, 19:41)joebloggs12 Wrote: [ -> ]
(2015-01-17, 14:12)weirdinin Wrote: [ -> ]Hi. I have a minor problem here. How do I change the game art like fanart, frontbox after I have imported game?
I have tried to delete and change images from fanart folder and then delete the game from context menu and imported again. However, the fanart doesn't change.
just replace the images, it should correct itself as soon as the cache clears

I have more issues in regards of changing metadata of rcm. If I edit Steam.nfo e.g change <plot>blaa blaa </plot> to something else and re-add or rescrape the game, the plot of the game in rcm doesn't change. How come rcm always uses metadata for plot from internet, not from local file?

debugging log here: http://pastebin.com/Sgpy3mH7
I first rescraped the game using all scrapers (local and internet). No change in plot. Then tried to scrape only using local data. No change in the plot.

Steam.nfo http://pastebin.com/KipERc2w
(2015-02-09, 14:33)joebloggs12 Wrote: [ -> ]thanks malte for reply, at the present time it would be beyond my capabilities as my knowledge of python is probably way to low. I sort of understand what's needed but unsure how to implement

here's what mine looks like in black glass nova with multiple instances , this is the kinda thing that I was hoping to achieve

Image

Nice it would be so cool if it could be implemented !
(2015-02-09, 18:51)Maleficium Wrote: [ -> ]
(2015-02-09, 07:54)malte Wrote: [ -> ]
Maleficium Wrote:After some tests with Kodi and the latest release of RCB I decided to went back to Gotham and 2.0.17.
Anyone know how could I get 2.0.17 ? The link seems broken.
What did not work in 2.0.18? Usually 2.0.18 should also work with Gotham. But you are right, since I switched to provide the files via repository there are no previous versions available online. You could still grab them from your local XBMC packages folder. I will also think about how to provide older versions on my project page.

It was solved by now, I went back to Frodo (not Gotham as I said) and I installed 2.0.17 from the available add-ons list from XBMC itself.
The link provided in this forum to 2.0.17 its the "broken one".

My major problem with Kodi (and Gotham) its the time RCB needs to start. I have a big database (almost 50k games, 69 systems) and it takes almost 1 minute just to start while in Frodo it starts in 2 seconds. Add a new game its another long wait, even with filters to just 1 system.
Not sure if the problem its with Kodi, with my config.xml (I modified some things) or with my DB itself, I'm using the same in the last couple years.

Well, I can live with that for now, Frodo to RCB Kodi for other things.

Btw, there's any way to start RCB automatically every time I start XBMC ?


low download database is my main problem. i will give a try with frodo
thanks for the tips
I had this working, for the most part, yesterday with a handful of NES games. When I tried to add PSX it didn't work right so I deleted rom collections and tried again. It was then that everything went wrong, nothing worked. So I uninstalled RCB turned off the computer came back today and tried again. Same thing, it doesn't work. When I import games nothing happens the library is empty. All I see is the information/sorting tabs i.e. colsole, genre, year, publisher etc on a black screen.

System:
Win Vista (32-bit)
AMD Athlon 64 x2 Dual Core 3.00GHz
4GB Ram
Kodi 14.0 Helix
RCB 2.0.17

Checking the log I received three Errors:

Error while reading gameclient addons via json. Assume that we are not in RetroPlayer branch.

ERROR: Control 500 in window 13000 has been asked to focus, but it can't

ERROR: Control 52 in window 13000 has been asked to focus, but it can't

Can post whole log if needed.

Any help is appreciated.
Hey guys,

Looking for a little help with sound setup in RCB.

I'm running Openelec 5, and I do have sound working when retroarch is started via Advanced Launcher.

If I run the same game (presumably same command executed) in RCB, it doesn't have sound.

I've tried the suspend sound feature without any luck.

Ideas?
(2015-02-10, 00:16)Ylee_one Wrote: [ -> ]I had this working, for the most part, yesterday with a handful of NES games. When I tried to add PSX it didn't work right so I deleted rom collections and tried again. It was then that everything went wrong, nothing worked. So I uninstalled RCB turned off the computer came back today and tried again. Same thing, it doesn't work. When I import games nothing happens the library is empty. All I see is the information/sorting tabs i.e. colsole, genre, year, publisher etc on a black screen.

System:
Win Vista (32-bit)
AMD Athlon 64 x2 Dual Core 3.00GHz
4GB Ram
Kodi 14.0 Helix
RCB 2.0.17

Checking the log I received three Errors:

Error while reading gameclient addons via json. Assume that we are not in RetroPlayer branch.

ERROR: Control 500 in window 13000 has been asked to focus, but it can't

ERROR: Control 52 in window 13000 has been asked to focus, but it can't

Can post whole log if needed.

Any help is appreciated.

Same here.

Must be a problem within RCB. Everything was working completely fine yesterday.
Hey all, signed up here just for help with RCB.. I love this program/add-on.. seriously i have looked at dozens of front ends in an attempt to solve the issue, and nothing out there came close to having the search options this has are exactly what you need to sort though a large game library..

This takes me to my problem, I took the time to import and sort out a library of ~2400 games, and it was working fantastic, for a single evening.... the next day it was only showing a tiny fraction of the games listed, I have; deleted all the rom collections and reimported - same result, except this time it skipped the working phase, uninstalled and removed all add on scripts and folders re-installed re imported games - this kinda works, but not all the info is propagating, and when closed it hangs xbmc program add ons., It was at this point that I went looking at other front ends, and well the results are above. so i returned to a backup of the original folder/data, and removed again then re imported, it, as always now, shows importing of all the info, but only displays some of the B files (no its not always B) that its just reported as imported.Oh and i tried a parallel clean install of 14.1 and while more testing is needed the first import reported it was imported info, and nfo's were created in the folder, but everything is blank.. sigh

please excuse my rambling, It feels like im so close...

win7sp164
ASUS P6T
intel i7 920
6GB ram
ATI5870
Gotham with rapier skin - should note that its in portable mode
are you sure your filter is set to all
yup, good call otherwise tho, that menu is not so obvious. Those are another great feature.
(2015-02-09, 17:02)kayone Wrote: [ -> ]Has anyone tried and got this to work? I tried to follow the instructions and using different flavours of Tortoise (windows) I was able to create the patch file and what looked like correctly patching the directory, but when I reinstalled the addon I didn't see any sign of the "Make Local Copy" option under 'Edit Rom Collection'

I'm desperate to get this working as all of my roms are stored on a NAS.

Any help is appreciated!

Tried it with RCB 2.0.17 and it works. You don't really need Tortoise, you can just open the files and search for the lines to replace them. How exactly did you reinstall the addon? Patched the files, created the zip, uninstalled RCB and installed the zip?

Btw, even though I'm happy with this method because I can now play my NAS-stored ROMs, due to the limited space of the Fire TV, I can't really have a high number of PS One games (700 MB ISO). Therefore, would it be possible to automatically delete the temp files when you close the emulator so that you free up the space?
(2015-02-11, 17:38)my_heroine Wrote: [ -> ]
(2015-02-09, 17:02)kayone Wrote: [ -> ]Has anyone tried and got this to work? I tried to follow the instructions and using different flavours of Tortoise (windows) I was able to create the patch file and what looked like correctly patching the directory, but when I reinstalled the addon I didn't see any sign of the "Make Local Copy" option under 'Edit Rom Collection'

I'm desperate to get this working as all of my roms are stored on a NAS.

Any help is appreciated!

Tried it with RCB 2.0.17 and it works. You don't really need Tortoise, you can just open the files and search for the lines to replace them. How exactly did you reinstall the addon? Patched the files, created the zip, uninstalled RCB and installed the zip?

Btw, even though I'm happy with this method because I can now play my NAS-stored ROMs, due to the limited space of the Fire TV, I can't really have a high number of PS One games (700 MB ISO). Therefore, would it be possible to automatically delete the temp files when you close the emulator so that you free up the space?

I'm using the new test version of RCB (2.1.0) which cured a few problems for Eminence skin

& I patched the files, created the zip and installed over the top.


EDIT- @my_heroine I tried and managed to mess up several times using the method you suggested and gave up! any chance you can upload the .zip which has been amended?