EmulationStation - an emulator front-end


178 posts   Page 1 of 8   1, 2, 3, 4, 5 ... 8
by Aloshi » Sat Aug 04, 2012 10:06 pm
EmulationStation is a front-end designed for browsing lists of ROMs from multiple systems with a joystick/gamepad, without need for a keyboard or the X windowing system. It was intended for use with RetroArch, but should work for any emulator.

The GitHub project page is here, along with instructions: https://github.com/Aloshi/EmulationStation

A cool guy who goes by the name of petrockblog has made an installation script that automatically downloads and installs RetroArch, its cores, and EmulationStation: https://github.com/petrockblog/RetroPie-Setup
Last edited by Aloshi on Sat Aug 04, 2012 10:08 pm, edited 1 time in total.
User avatar
Posts: 353
Joined: Sat Jun 23, 2012 6:42 pm
by Aloshi » Sat Aug 04, 2012 10:08 pm
I figured I've piggybacked off the RetroArch topic long enough and should just make my own thread. :)
I've also just made a commit which adds alphabetical sorting and a menu to safely shutdown the system without need for a keyboard, among other things. I'll post here as I make changes.
User avatar
Posts: 353
Joined: Sat Jun 23, 2012 6:42 pm
by Pendor » Sat Aug 04, 2012 10:28 pm
I modified yesterday the scraper as I told you. The script now does everything automatically once its called (no parameters needed) by reading ES systems config file. I also added the required ID as PLATFORMID in es_systems.cfg:

Code: Select all
NAME=Gameboy Color
PATH=/ROMS/GBC/
EXTENSION=.gbc
COMMAND=retroarch -L /path/to/core /path/to/file
PLATFORMID=41


If you add that extra parameter to the source, just name it whatever you want, the script can be easily edited. I'm not home now but when I come back, I'll clean the code a lil bit and post it here.
Posts: 48
Joined: Tue Jul 24, 2012 3:21 am
by Aloshi » Sun Aug 05, 2012 4:17 am
You should be able to add any variables you want to the es_systems.cfg file. It'll complain, but should continue parsing fine.
User avatar
Posts: 353
Joined: Sat Jun 23, 2012 6:42 pm
by Pendor » Sun Aug 05, 2012 4:17 pm
Aloshi wrote:You should be able to add any variables you want to the es_systems.cfg file. It'll complain, but should continue parsing fine.


Yeah, I figured that much after looking at your code. If anything, it'll just say "unknown variable name".
Posts: 48
Joined: Tue Jul 24, 2012 3:21 am
by Pendor » Tue Aug 07, 2012 9:08 pm
I forgot to mention the current script saves gamelists per platform. I take it ES doesnt support individual gamelists yet, right? (I have not looked at your most recent code, sorry)
Posts: 48
Joined: Tue Jul 24, 2012 3:21 am
by Aloshi » Tue Aug 07, 2012 9:51 pm
At the moment, no. If I do separate it by system (at the moment one gamelist works for every system), I would like to keep it in one file but in different gamelist tags with the system defined as an attribute, to keep from having to define another variable for each system. Example:

Code: Select all
<gameList system = "Nintendo Entertainment System">
...
</gameList>

<gameList system = "Super Nintendo Entertainment System">
...
</gameList>

I haven't worked on EmulationStation in a few days though, I've been busy packing/getting ready for college. I'd like to at least add resizing of images and some very simple theming support before I leave in about a week.
User avatar
Posts: 353
Joined: Sat Jun 23, 2012 6:42 pm
by XarothBrook » Tue Aug 07, 2012 10:00 pm
Having one big XML for all systems is a bit chaotic, and is prone to human errors (people trying to add the same system twice because they failed to see the system in the list due to it's size)..

also, from what I noticed, you still do file system walking with the xml files in use.. I would suggest an option to turn this off... that way you can limit the system to only fully documented games.

I've been working on GameDB a while the past days, not made many commits as I'm in the process of re-doing some things.. decided to use the already-available admin interface for the framework it uses, rather than building my own logic... figured I'd not need to re-invent the wheel.
Posts: 8
Joined: Thu Jul 26, 2012 10:37 pm
by Pendor » Tue Aug 07, 2012 10:16 pm
XarothBrook wrote:Having one big XML for all systems is a bit chaotic, and is prone to human errors (people trying to add the same system twice because they failed to see the system in the list due to it's size)..


This.

Right now, my scraper checks for recognized games on each system folder (using ES config file) and saves the gamelist.xml on them: Basically:

Code: Select all

NAME=NES
PATH=~/ROMS/NES/
EXTENSION=.nes
COMMAND=retroarch -L /emulibs/nes.so %ROM% -c ~/retroarch.cfg
PLATFORMID=7

NAME=SNES
PATH=~/ROMS/SNES/
EXTENSION=.sfc
COMMAND=retroarch -L /emulibs/snes.so %ROM% -c ~/retroarch.cfg
PLATFORMID=6

NAME=GBC
PATH=~/ROMS/GBC/
EXTENSION=.gbc
COMMAND=retroarch -L /emulibs/libgambatte.so %ROM% -c ~/retroarch.cfg
PLATFORMID=41

Output:
~/ROMS/NES/gamelist.xml
~/ROMS/SNES/gamelist.xml
~/ROMS/GBC/gamelist.xml
etc


It would just be a matter of checking if the file exists and parsing it if so.
Posts: 48
Joined: Tue Jul 24, 2012 3:21 am
by Aloshi » Wed Aug 08, 2012 1:27 am
Alright, just committed these changes. The XML file is now loaded from the system's search directory. I also added a "--gamelist-only" switch that will skip searching and only add games from gamelist.xml. As part of this, a gamelist.xml file can now specify a game that was not previously found by the automatic search and it will be created properly. I also realized that there were some issues with sorting different-case games (uppercase coming before any lowercase), so I fixed that too.
User avatar
Posts: 353
Joined: Sat Jun 23, 2012 6:42 pm
by Pendor » Wed Aug 08, 2012 3:39 am
Aloshi wrote:Alright, just committed these changes. The XML file is now loaded from the system's search directory. I also added a "--gamelist-only" switch that will skip searching and only add games from gamelist.xml. As part of this, a gamelist.xml file can now specify a game that was not previously found by the automatic search and it will be created properly. I also realized that there were some issues with sorting different-case games (uppercase coming before any lowercase), so I fixed that too.


Great!

I'm back home now, I'll fix a few things tomorrow and set up a repo on github with the script.
Posts: 48
Joined: Tue Jul 24, 2012 3:21 am
by Pendor » Thu Aug 09, 2012 12:06 am
Here's the scraper.

It's the first time I write something in Python (I should've started a long time ago *sigh*) so I apologize in advance if the code is not great.

I used the already available libs to avoid installing stuff, so maybe there are faster libraries out there (but I doubt there's gonna be any real difference)

I'm gonna add some more tweaks later and try some actual image resizing on runtime to reduce load, cause most boxarts are too big resolution-wise.

Seems to be working fine so far but if you find something strange, let me know.
Posts: 48
Joined: Tue Jul 24, 2012 3:21 am
by Aloshi » Thu Aug 09, 2012 12:46 am
Awesome! Just tried it, seemed to work fine with my limited set of games (and realized Super Castlevania 4 is not the same as Super Castlevania IV :P). I'm going to try to get some basic image resizing in soon. I'm thinking I'll just resize the width to fill the left side of the screen and leave the height to whatever the aspect ratio is. That way if you switch between a lower-resolution display and a higher one, it can still use the higher resolution box art.
User avatar
Posts: 353
Joined: Sat Jun 23, 2012 6:42 pm
by Pendor » Thu Aug 09, 2012 1:20 am
Aloshi wrote:I'm going to try to get some basic image resizing in soon. I'm thinking I'll just resize the width to fill the left side of the screen and leave the height to whatever the aspect ratio is. That way if you switch between a lower-resolution display and a higher one, it can still use the higher resolution box art.


Last (and only) time I tried, images were so big it slowed the whole thing down. That's why I considered reducing their filesize instead of just letting ES resize the way the boxart is displayed. Don't get me wrong, I still think resizing in ES is needed but those images are huge sometimes. If done properly, it certainly won't hurt to make them smaller.

Then again, I only tried that once. It was about 5 or 6 platform and nearly 10 boxarts per system. Maybe it's the way they're loaded, I dunno. I'll experiment a lil bit in a few minutes.
Posts: 48
Joined: Tue Jul 24, 2012 3:21 am
by Aloshi » Thu Aug 09, 2012 1:45 am
Ah yeah, I just started tinkering and I'm seeing the same thing. I don't think SDL_image provides any options in how files are loaded, so I think some pre-ES resizing will be needed.
User avatar
Posts: 353
Joined: Sat Jun 23, 2012 6:42 pm
by Pendor » Thu Aug 09, 2012 2:53 am
OK, resizing them to half now. I can definitely see an improvement but it's still a bit sluggish. I'll try with different (smaller) sizes. Maybe I should just resize images above certain resolution.

Edit: Hmmm, a quarter from its original size doesn't make much of a difference compared to half.

Also, a small bug I forgot to mention: Images are not loaded when switching systems. I'll try to be more clear: When changing systems, ES automatically selects the first game available. While it does load everything else (name, description, filesize), it seems to omit the image. It loads just fine if I reselect that file using the keyboard/controller.
Posts: 48
Joined: Tue Jul 24, 2012 3:21 am
by Aloshi » Thu Aug 09, 2012 1:41 pm
Well, I guess I'll try threaded image loading.

And yeah, I've noticed that bug too, I'll fix it soon.
User avatar
Posts: 353
Joined: Sat Jun 23, 2012 6:42 pm
by mats » Thu Aug 09, 2012 2:15 pm
Hi,

i recognized a litte bug regarding the extension. Can you make it case INsensitive or is it possible to add both extensions e.g. .nes and .NES?
Posts: 12
Joined: Thu Aug 02, 2012 8:21 am
by Jasperklaren » Thu Aug 09, 2012 3:20 pm
Hi guys,

I'm having trouble with audio using the SNES emulator.

I've tried it with Zelda and Mario, when the game starts the sound is fine but after a few seconds it just cuts off and stops working, but the game itself runs perfectly.

Im using HDMI for audio and have not changed the configuration file or anything. Help would be appreciated :)
Posts: 2
Joined: Thu Aug 09, 2012 3:17 pm
by Pendor » Thu Aug 09, 2012 3:49 pm
Jasperklaren wrote:Hi guys,

I'm having trouble with audio using the SNES emulator.

I've tried it with Zelda and Mario, when the game starts the sound is fine but after a few seconds it just cuts off and stops working, but the game itself runs perfectly.

Im using HDMI for audio and have not changed the configuration file or anything. Help would be appreciated :)


This topic is for Aloshi's frontend. You should ask that on the retroarch thread or to the developer of the core/emulator.

If you're indeed using retroarch, the application uses ALSA which is kinda new on the Rpi yet so problems like that are expected.
Posts: 48
Joined: Tue Jul 24, 2012 3:21 am
by Aloshi » Thu Aug 09, 2012 3:59 pm
mats wrote:Hi,

i recognized a litte bug regarding the extension. Can you make it case INsensitive or is it possible to add both extensions e.g. .nes and .NES?


At the moment it's working as intended, but I'd like to add support for multiple extensions in the future. Until then, there's probably a handy bash script somewhere to automatically rename your extensions to lowercase. Sorry.

Jasperklaren wrote:I'm having trouble with audio using the SNES emulator.
...


You might be better off posting in the RetroArch thread here: http://raspberrypi.org/phpBB3/viewtopic.php?f=35&t=6750
For what it's worth, I haven't gotten sound working right yet either.
User avatar
Posts: 353
Joined: Sat Jun 23, 2012 6:42 pm
by Pendor » Thu Aug 09, 2012 5:26 pm
I just made a commit fixing a few things and added max image width as a parameter (If the boxart's width is above that value, it'll be resized to fit that value (mantaining aspect ratio)).

I think it's pretty straightforward, but I updated the readme anyway.
Posts: 48
Joined: Tue Jul 24, 2012 3:21 am
by Aloshi » Thu Aug 09, 2012 10:19 pm
I've just committed a change that adds two things: automatic resizing of images if their width is above 35% of the screen, and multithreaded image loading. It's still not quite perfect (descriptions still don't display right), but getting there. I think I can get a pretty decent speed boost if I cache text, especially at higher resolutions, so I'm going to try and add that for the next update.

Also, you now need libsdl-gfx1.2-dev to build.
User avatar
Posts: 353
Joined: Sat Jun 23, 2012 6:42 pm
by Pendor » Thu Aug 09, 2012 10:23 pm
Aloshi wrote:I've just committed a change that adds two things: automatic resizing of images if their width is above 35% of the screen, and multithreaded image loading. It's still not quite perfect (descriptions still don't display right), but getting there. I think I can get a pretty decent speed boost if I cache text, especially at higher resolutions, so I'm going to try and add that for the next update.

Also, you now need libsdl-gfx1.2-dev to build.


Cool, I'll check it later.
Posts: 48
Joined: Tue Jul 24, 2012 3:21 am
by Pendor » Fri Aug 10, 2012 1:29 am
Hmm, your last commit seems to be slowing both the frontend and the emulation. Might be the new way images are loaded, I dunno.

I reverted the whole thing to the previous version and it's working fine again.
Posts: 48
Joined: Tue Jul 24, 2012 3:21 am