[RELEASE] "Arcade Browser" (Emulator ROMS browser) Script for Linux

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Redsandro Offline
Skilled Python Coder
Posts: 133
Joined: Jul 2008
Reputation: 0
Location: Netherlands
Thumbs Up  [RELEASE] "Arcade Browser" (Emulator ROMS browser) Script for Linux
Post: #1
When I discovered XBMC Media Center (quite some time ago) I wanted to get my console emulators running using my TV, remote control, and two ~$15 controllers from eBay.

There are some other launcher scripts for emulators out there, but I couldn't get any of them to work, and most of them are only for the Xbox anyway. So I decided to write one for Linux myself as a personal project. But ever since I got the basic functionality working, I couldn't find the time anymore to add the features I wanted - like a list of favorites, etc.. So instead of waiting to releasing it fully featured, which would take forever, I thought I'd release it here and now. I spent quite some time on it, (as I didn't know any Python before), so maybe it's good for some people. Feel free to use it in any way you like, keep develop it, change it however you live, etc. If you add something cool, please let me know. Maybe any cool derivatives can be combined in a new cooler Arcade Browser combined collaborate project.

Current Features:
  • Manually edit emulators.ini to point to your command line emulators and rom paths and the script does the rest.
  • Files are indexed in xml. You can re-index them if you want.
  • XBMC is closed and restarted (autorun.py) because not everyone's computer can afford to run everything at the same time.
  • Windows emulators through wine no problem.

[Image: emus_t.jpg] [Image: roms_t.jpg]


DOWNLOAD HERE: Arcade Browser 0.2b2.zip

Known issues:
Except for lack of features, starting a ROM while the list is being loaded can be annoying if the list contains many many items (thousands). But who needs thousands of ROMs anyway.

Thanks Nuka1195 for pointing out my mistake!

http://www.rednet.nl/vision/articles/222
(This post was last modified: 2009-04-30 08:01 by Gamester17.)
find quote
vtinoc Offline
Junior Member
Posts: 23
Joined: Mar 2009
Reputation: 0
Post: #2
I got to say this is the best emulator browser nice and cool gui and all, runs on xbmc live but that's it does not run the emulators finds the exts and I have the emulators in the folders of the roms like
/home/xbme/emulators/roms/snes/zsnes
But won't load.

Would be nice to run on xbmc live since it is based on linux, you know out of the box.

And props on the make.
find quote
Redsandro Offline
Skilled Python Coder
Posts: 133
Joined: Jul 2008
Reputation: 0
Location: Netherlands
Post: #3
Thanks!

I don't know what XMBC Live is, but I've got zsnes working (and all the emulators in the ini, it's in the package the way I use it on my computer), but if you really cannot figure it out, search for debug.txt in the python script and make sure it writes it, so you can read the used execution command for the emulator. Type that in a terminal and you can see what the error message is.
find quote
vtinoc Offline
Junior Member
Posts: 23
Joined: Mar 2009
Reputation: 0
Post: #4
I will do that, and if you don't mind can you show me how your
Folders are listed.

Thank you.

Edit
Ok debug writes for nes (noescape)
And zsnes(DO escape)
(This post was last modified: 2009-04-18 20:15 by vtinoc.)
find quote
Redsandro Offline
Skilled Python Coder
Posts: 133
Joined: Jul 2008
Reputation: 0
Location: Netherlands
Post: #5
I mean the file in your script folder called debug.txt, what does it say?

My emulators can be anywhere, just make sure there's a link or binary in your /bin or /usr/bin so you can execute it from command prompt. You need to be able to type the name of the emulator at the command prompt so it starts.

Here's my rompaths:
/var/media/roms/neogeo/
/var/media/roms/nes/
/var/media/roms/snes/
/var/media/roms/mastersystem/
/var/media/roms/megadrive/
/var/media/roms/n64/
find quote
empty Offline
Senior Member
Posts: 147
Joined: Jan 2007
Reputation: 0
Location: Germany
Post: #6
Is a Windows Version planed?
find quote
Redsandro Offline
Skilled Python Coder
Posts: 133
Joined: Jul 2008
Reputation: 0
Location: Netherlands
Post: #7
No, I don't have the time. But feel free to try and port it!
find quote
Striss Offline
Junior Member
Posts: 1
Joined: Apr 2009
Reputation: 0
Post: #8
Hi, the launcher seems to be working fine for me until I close one of the emulators. XBMC does not return, and I'm left with this error in the terminal:

Traceback (most recent call last):
File "/usr/share/xbmc/FEH.py", line 3, in <module>
import datetime
ImportError: No module named datetime


I'm running Ubuntu Jaunty with the prebuilt xbmc jaunty binaries from apt. I've installed all kinds of python-datetime packages as well, but still nothing.

Any idea what might be the problem?
find quote
Redsandro Offline
Skilled Python Coder
Posts: 133
Joined: Jul 2008
Reputation: 0
Location: Netherlands
Post: #9
Hey, sorry for the late reply, I was on a trip.

But it sounds totally Arcade Browser UNrelated. I don't use datetime and I don't know what FEH.py is.

I have built and tested AB on 7.04 t/m 8.10 and not Jaunty, so maybe there's something new that interferes. I would guess there's a problem with handling autoexec.py. FEH.py, whatever it is, clearly executes when XBMC tries to rerun and fails on importing datetime. So it might be as simple as getting the datetime module for python to work, which is probably not related to AB OR XBMC. Try google on the ImportError. Please let us know if you got it working!
find quote
topfs2 Offline
Team-Kodi Developer
Posts: 4,084
Joined: Dec 2007
Reputation: 12
Post: #10
Yeah definatly arcade unrelated. FEH.py is a safety tool we have wich we run prior to starting XBMC which will check if XBMC is capable to run on the system and gives an error message if it won't work, i.e if you don't have Hardware support for OpenGL.

Anyways, I have moved the datetime module to SDL output as it's the onlyone that needs it, so now the failuretesting script should fail safely if you don't have the module Rolleyes

r19822.

If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
find quote
Redsandro Offline
Skilled Python Coder
Posts: 133
Joined: Jul 2008
Reputation: 0
Location: Netherlands
Post: #11
Well.. great, thanks! Big Grin

But I've never had this before using default (x)ubuntu and default XBMC binaries from the repos. So someone probably made a change along the way.

Striss, fix datetime module or update to XBMC svn I guess. Smile
find quote
Redsandro Offline
Skilled Python Coder
Posts: 133
Joined: Jul 2008
Reputation: 0
Location: Netherlands
Post: #12
Problem.
I've been using my script for a long time all the way up to the releases of XBMC that came with Ubuntu 9.04, but now with the recent version from the 9.10 repo, my script doesn't work anymore.

Anyone any idea what changed so that the code is wrong? I haven't got the slightest idea what to change to make this working again.

-edit-

I've attached the current main script for convenience. The whole package is in the first post.
Attached File(s)
.txt  default.py.txt (Size: 17.97 KB / Downloads: 18)
(This post was last modified: 2009-11-18 15:35 by Redsandro.)
find quote
icekiller Offline
Senior Member
Posts: 132
Joined: May 2008
Reputation: 0
Post: #13
I fixed it ...
wasn't too hard but I can't seem to upload files
so:
def bootRom(self):
# Prepare command
emu = self.emulators[self.selEmu]
rom = self.lstMain.getSelectedItem().getLabel()
cmd = emu['app']
if (emu['noescape'] == True):
self.note("noescape")

cmd = cmd.replace('%ROMPATH%', emu['romdir'])
cmd = cmd.replace('%ROM%', rom)
else:
self.note("DO escape")
cmd = cmd.replace('%ROMPATH%','%ROMPATH%'+'/')
cmd = cmd.replace('%ROMPATH%', re.escape(emu['romdir']))
cmd = cmd.replace('%ROM%', re.escape(rom))
cmd = re.escape(HOMEDIR)+'applaunch.sh '+cmd


the problem seems to be the 'dir' for patch misses a / at the end.
also i had to comment this out:
# Write new autoexec.py
#fh = open(autoexec,'w') # truncate to 0
#fh.write("import xbmc\n")
#fh.write("xbmc.executescript('"+HOMEDIR+"default.py')\n")
#fh.close()
only has to be done once anyway.. enjoy

Also thanks to endymion for suggestions to try other stuff but i ended up fixing it in the script.
(This post was last modified: 2009-11-18 18:07 by icekiller.)
find quote
Redsandro Offline
Skilled Python Coder
Posts: 133
Joined: Jul 2008
Reputation: 0
Location: Netherlands
Post: #14
icekiller Wrote:the problem seems to be the 'dir' for patch misses a / at the end.
also i had to comment this out:
# Write new autoexec.py
#fh = open(autoexec,'w') # truncate to 0
#fh.write("import xbmc\n")
#fh.write("xbmc.executescript('"+HOMEDIR+"default.py')\n")
#fh.close()

No it doesn't, it will break all emulators listed in emulators.ini unless you've customised it wrong:

emulators.ini:
Quote:# Arcade Browser emulator config file
#
# Manually edit this one, do not use square brackets for things other than necesary.
# Use trailing slash for rom path!
#
# Format:

Quote:only has to be done once anyway..
No it has to be done every time, because this makes Arcade Browser restart when you quit a ROM.

But I will check out if your commenting suggestion fixes the script that at the moment just fails to load. I will post back when I tested it. (Not the right machine now)
(This post was last modified: 2009-11-18 18:18 by Redsandro.)
find quote
Redsandro Offline
Skilled Python Coder
Posts: 133
Joined: Jul 2008
Reputation: 0
Location: Netherlands
Post: #15
I just realized, your second change in the script is also unnecessary.

default.py line 14 and 15:
Quote:# This script needs writepermission on /usr/share/xbmc/scripts,
# So [user] either be in the group or have others write permissions!

I think there is a good change the update reset the permissions for my folders, so I'm going to check that out when I am at that computer.
find quote
Post Reply