User avatar
eix
Posts: 84
Joined: Sat Sep 15, 2012 8:09 am

Snes9x with native OpenGL rendering: grab it while it's hot!

Fri Jan 11, 2013 12:44 am

I have been hacking the official snes9x to run on our beloved Raspberry with native OpenGL, upscaled through DispmanX.

This is a pre-alpha version, there's still lots of work to do.
I will of course properly release the sources, just give me some time please :)

Framerate looks good, my next focus will be on the sound emulation part.
Cheers :P

Grab it while it's hot! Download from: https://docs.google.com/file/d/0B_mVbKY ... RDNzg/edit

NOTE: you will need GLES2, which is by default installed on your Raspbian

Previous related topic: http://www.raspberrypi.org/phpBB3/viewt ... 78&t=25640

welshy
Posts: 1667
Joined: Mon Oct 29, 2012 2:07 pm

Re: Snes9x with native OpenGL rendering: grab it while it's

Fri Jan 11, 2013 8:57 am

eix
I have tried the Program, except for the screen aspect ratio now being 16:9 instead of 4:3 the Framerate is pretty much identical to snes9x-sdl v1.53 (Even from Console)? You note the OpenGLES Drivers, do they have to be switched/activated? (i.e. an addition to the command line on initialising?). Because I can’t seem to quit the Program (Q or Esc key in snes9x-sdl) to read the Terminal to see what the Program is doing! I’m Not knocking the, no doubt, considerable effort involved, just trying to give some feedback!
"The list of things I have heard now contains everything!"

User avatar
eix
Posts: 84
Joined: Sat Sep 15, 2012 8:09 am

Re: Snes9x with native OpenGL rendering: grab it while it's

Fri Jan 11, 2013 6:44 pm

You're right welshy, it's not playable (it's more like a demo) and the aspect ratio is wrong, I will fix this.

Also not a big improvement in the sound emulation (that causes slowness), thus I am working on merging some optimizations there.

Will keep this thread posted!

Cheers :ugeek:

nornagon
Posts: 1
Joined: Sun Jan 13, 2013 4:49 am

Re: Snes9x with native OpenGL rendering: grab it while it's

Sun Jan 13, 2013 4:59 am

I am highly interested in this project. Keep it up!

(PS, how are you doing profiling on the Pi? I tried using callgrind, but it took forever even just to start the emulator I was trying to profile...)

User avatar
dasmau89
Posts: 13
Joined: Wed Jan 02, 2013 3:19 pm

Re: Snes9x with native OpenGL rendering: grab it while it's

Sat Jan 19, 2013 12:25 pm

Hi,
I have difficulties getting this to run (I'm running the ArchLinux version, not raspbian)
1. I dowloaded the binary and did a chmod +x
2. I tried to run it:
$ ./snes9x-ogl
./snes9x-ogl: error while loading shared libraries: libGLESv2.so: cannot open shared object file: No such file or directory
This was odd, so I checked /etc/ld.so.conf with included /etc/ld.so.conf.d/*.conf and in /etc/ld.so.conf.d/raspberrypi-firmware.conf there was /opt/vc/lib/
3. $ ls /opt/vc/lib/ | grep GLES
libGLESv1_CM.so
libGLESv2.so
libGLESv2_static.a
4. $ sudo ldconfig -v | grep GLES
libGLESv2.so -> libGLESv2.so
5. $ ldd ./snes9x-ogl | grep "not found"
libGLESv2.so => not found
libbcm_host.so => not found

possible solutions:
- I think I could 'fix' this by copiing/symlinking the lib into /usr/lib, but this is not what I want. Does anybody now how to make this work the 'right way' ?
- can you statically link the binary?
thou shalt not kill -9

User avatar
eix
Posts: 84
Joined: Sat Sep 15, 2012 8:09 am

Re: Snes9x with native OpenGL rendering: grab it while it's

Sun Jan 20, 2013 11:12 am

nornagon wrote:I am highly interested in this project. Keep it up!

(PS, how are you doing profiling on the Pi? I tried using callgrind, but it took forever even just to start the emulator I was trying to profile...)
I tried that way, it's a dead end. I will use a virtual machine, like QEMU, but I didn't yet go into this

User avatar
eix
Posts: 84
Joined: Sat Sep 15, 2012 8:09 am

Re: Snes9x with native OpenGL rendering: grab it while it's

Sun Jan 20, 2013 11:14 am

dasmau89 wrote:Hi,
I have difficulties getting this to run (I'm running the ArchLinux version, not raspbian)
1. I dowloaded the binary and did a chmod +x
2. I tried to run it:
$ ./snes9x-ogl
./snes9x-ogl: error while loading shared libraries: libGLESv2.so: cannot open shared object file: No such file or directory
This was odd, so I checked /etc/ld.so.conf with included /etc/ld.so.conf.d/*.conf and in /etc/ld.so.conf.d/raspberrypi-firmware.conf there was /opt/vc/lib/
3. $ ls /opt/vc/lib/ | grep GLES
libGLESv1_CM.so
libGLESv2.so
libGLESv2_static.a
4. $ sudo ldconfig -v | grep GLES
libGLESv2.so -> libGLESv2.so
5. $ ldd ./snes9x-ogl | grep "not found"
libGLESv2.so => not found
libbcm_host.so => not found

possible solutions:
- I think I could 'fix' this by copiing/symlinking the lib into /usr/lib, but this is not what I want. Does anybody now how to make this work the 'right way' ?
- can you statically link the binary?
Hi dasmau89, sorry for the state of this binary..it was just a showroom-like demo :)
I will shortly (maybe even today) complete the code cleanup and release it as-is, thus you can compile it yourself

Otherwise, I am sure that if you have the same version of binaries as of Raspbian you can use some LD_LIBRARY_PATH hack (search on google) to make it run - although not sure it's worth the effort

User avatar
eix
Posts: 84
Joined: Sat Sep 15, 2012 8:09 am

Re: Snes9x with native OpenGL rendering: grab it while it's

Sun Jan 20, 2013 5:05 pm

As promised, please feel free to grab the sources from here:

https://github.com/neagix/snes9x-rpi

This is a fork of current (as of December 2012) snes9x git repository, with the following changes:
  • support of OpenGL ES direct rendering (added by neagix)
  • SDL input and audio code from snes9x-sdl (merged from https://github.com/domaemon/snes9x-sdl)
  • SPC700 ARM-optimized core from a snes9x-0.40 fork (by notaz)
Please note that this is just experimental and audio does not work. I am not going to mantain this because I am now working on a different snes9x port (same goal features: working sound and native sound support)

User avatar
dasmau89
Posts: 13
Joined: Wed Jan 02, 2013 3:19 pm

Re: Snes9x with native OpenGL rendering: grab it while it's

Sun Jan 20, 2013 9:54 pm

eix wrote: Hi dasmau89, sorry for the state of this binary..it was just a showroom-like demo :)
I will shortly (maybe even today) complete the code cleanup and release it as-is, thus you can compile it yourself

Otherwise, I am sure that if you have the same version of binaries as of Raspbian you can use some LD_LIBRARY_PATH hack (search on google) to make it run - although not sure it's worth the effort
Thanks for the reply, I will check the repo out, even if it doesn't do much :)

I have a suggestion for further development on this:
ditch audio for now and concentrate on making fullspeed OpenGL rendering (without frameskip) a reality (starting with less 'intensive' games like Super Mario World and building the way up to games like Donkey Kong Country 8-) ) (and framebuffer -> X11)
This is a route that many emulators are taking, since audio emulation takes a lot of processing power and (to my knowledge) the snd_bcm2835 alsa driver is not in a good shape too...
thou shalt not kill -9

User avatar
eix
Posts: 84
Joined: Sat Sep 15, 2012 8:09 am

Re: Snes9x with native OpenGL rendering: grab it while it's

Sun Jan 20, 2013 10:26 pm

Guys, I have another release - once again not playable but useful as a demo:

https://docs.google.com/file/d/0B_mVbKY ... F6cTA/edit

This one comes with sound also, although it's horrible. I would call this release "the horrible-sound release", to (hopefully) make the difference with future versions :)

This is a re-port of Snes9x4DP and it still needs some work and polishing; for example I have started adding some optimizations that were not enabled (probably by mistake)

Return to “Gaming”