snes9x-1.39-rpi -- full speed SNES emulation with sound


176 posts   Page 2 of 8   1, 2, 3, 4, 5 ... 8
by welshy » Tue Dec 18, 2012 9:01 am
Raspiberry
I assume you are referring to the "Binary" Package? You can, of course use wget and type the site address (In a Terminal), however, the EASIEST way is to just click on the "Get it Here" within paleriders Text! Either download on another device and transfer using a Memory Stick OR from "X" on the RPi, then use the File System to manipulate the file to where you want it situated (Right Click your mouse to Extract/Uncompress the File)! or use the Link Below -

https://www.dropbox.com/s/n61comjs37c71 ... 19.tar.bz2

Hope That Helps!
Posts: 1346
Joined: Mon Oct 29, 2012 2:07 pm
by Raspiberry » Wed Dec 19, 2012 3:26 am
welshy wrote:Raspiberry
I assume you are referring to the "Binary" Package? You can, of course use wget and type the site address (In a Terminal), however, the EASIEST way is to just click on the "Get it Here" within paleriders Text! Either download on another device and transfer using a Memory Stick OR from "X" on the RPi, then use the File System to manipulate the file to where you want it situated (Right Click your mouse to Extract/Uncompress the File)! or use the Link Below -

https://www.dropbox.com/s/n61comjs37c71 ... 19.tar.bz2

Hope That Helps!

Alright, thanks for that.
But, I do have another question: how do I set fullscreen? Upon my first run of the RPi (when I first got it) it ran NEARLY fullscreen. I didn't try touching it to fill the screen.
For the emulator, will it use these settings, or will it force the lower resolution in the readme.txt?
If so, I'd like to know how to actually setup the configuration file for resolution, within "/etc." Going into the specified file will display many resolutions. The last one at the bottom of the text SEEMS the most accurate, but I can't be sure. So, how do I change that?
Thanks.
If only my school used the Raspberry Pi...
User avatar
Posts: 20
Joined: Sun Dec 16, 2012 9:56 pm
by m4chine » Wed Dec 19, 2012 9:25 pm
wow love the monitor lol not seen one of those for years back in the day i used to do a little mod to them and retro fit a scart socket on the back i also used to do the same to the amstrad cpc coulur monitors they where great to play your snes on nice to see people still have them :)
Posts: 1
Joined: Wed Dec 19, 2012 9:18 pm
by Raspiberry » Sat Dec 22, 2012 12:50 am
Had a problem: when I did sudo ./aoss (tried oss asweel to be sure) -sy supermarioworld.smc in console (tried root as well, not in X window system), it said aoss (or oss when I tried that) was not a recognised command.

This was after sudo apt-get install alsa-oss.
If only my school used the Raspberry Pi...
User avatar
Posts: 20
Joined: Sun Dec 16, 2012 9:56 pm
by welshy » Sat Dec 22, 2012 10:16 am
Raspiberry
I you are having problems with this version of SNES9X-SDLv1.39, try MY "Guide"
SNES9X-SDL-v1.53 - A "Beginners Guide" to Compiling/Using - viewtopic.php?f=78&t=24318

It DOESNT render as many FPS (Frames Per Second) as v.139, but is easier to set up (No need for OSS), has more accurate/ improved sound AND will emulate ANY GAME (Including StarFox/StarWing, i.e. SuperFX games). This should get you started in SNES Emulation until eix completes his project! See Here - viewtopic.php?f=78&t=25640

Hope That Helps!
Posts: 1346
Joined: Mon Oct 29, 2012 2:07 pm
by Raspiberry » Sat Dec 22, 2012 3:16 pm
welshy wrote:Raspiberry
I you are having problems with this version of SNES9X-SDLv1.39, try MY "Guide"
SNES9X-SDL-v1.53 - A "Beginners Guide" to Compiling/Using - viewtopic.php?f=78&t=24318

It DOESNT render as many FPS (Frames Per Second) as v.139, but is easier to set up (No need for OSS), has more accurate/ improved sound AND will emulate ANY GAME (Including StarFox/StarWing, i.e. SuperFX games). This should get you started in SNES Emulation until eix completes his project! See Here - viewtopic.php?f=78&t=25640

Hope That Helps!

Actually, I got this version working. The config file's command line is supposed to be: "sudo aoss ./snes9x -sy -dfr smw.smc"

Version 1.53 (for me) ran at 10 or 20 frames per second, on non overclocked.
If only my school used the Raspberry Pi...
User avatar
Posts: 20
Joined: Sun Dec 16, 2012 9:56 pm
by tejonbiker » Thu Jan 10, 2013 6:52 am
I can't get 60 FPS with Sunset Riders, in the other hand, I can't get sound work, I followed the instructions but when I exec the command "sudo ./aoss ... " the console says "Cannot found command aoss", What I missing?

Thanks
Posts: 20
Joined: Tue Aug 28, 2012 1:36 am
by steev » Thu Jan 10, 2013 7:02 am
tejonbiker wrote:I can't get 60 FPS with Sunset Riders, in the other hand, I can't get sound work, I followed the instructions but when I exec the command "sudo ./aoss ... " the console says "Cannot found command aoss", What I missing?

Thanks


If you're on Raspbian, install the alsa-oss package with:
Code: Select all
sudo apt-get install alsa-oss


Then you should have the aoss command.
Posts: 57
Joined: Fri Jan 27, 2012 5:08 pm
by adufray » Thu Jan 10, 2013 2:25 pm
steev wrote:
tejonbiker wrote:I can't get 60 FPS with Sunset Riders, in the other hand, I can't get sound work, I followed the instructions but when I exec the command "sudo ./aoss ... " the console says "Cannot found command aoss", What I missing?

Thanks


If you're on Raspbian, install the alsa-oss package with:
Code: Select all
sudo apt-get install alsa-oss


Then you should have the aoss command.


After installing the alsa-oss package he'll definitely have the aoss command, but it likely won't be in his current working directory. There was a typo (already pointed out by Raspiberry) in the original command where the "./" is in front of "aoss" instead of "snes9x". That should fix the sound part.

I ran into a problem trying to get the dpad on my Xbox360 controller to work. I'm not sure if it applies to a Microsoft branded controller yet, I was using a lousy Gamestop knockoff. However, the dpad was being detected as a joyaxes in jstest, but was actually a joyhat. (I was not familiar with the term "joyhat" previously, but apparently it's another type of gamepad input -- axes, buttons, and hats.)

I added this code (it's sort of lazy, sorry) to unix/unix.cpp in the S9xProcessEvents function between "case SDL_JOYBUTTONUP:" and "case SDL_JOYAXISMOTION:" blocks:

Code: Select all
                   case SDL_JOYHATMOTION:
                       //fprintf (stderr, "Snes9X: joyhat motion on hat %d value is %d.\n", event.jhat.hat, event.jhat.value);
                       switch(event.jhat.value) {
                               case SDL_HAT_CENTERED:
                                       joy_axes[JA_LR] = CENTER;
                                       joy_axes[JA_UD] = CENTER;
                                       break;
                               case SDL_HAT_UP:
                                       joy_axes[JA_LR] = CENTER;
                                       joy_axes[JA_UD] = UP;
                                       break;
                               case SDL_HAT_DOWN:
                                       joy_axes[JA_LR] = CENTER;
                                       joy_axes[JA_UD] = DOWN;
                                       break;
                               case SDL_HAT_LEFT:
                                       joy_axes[JA_LR] = LEFT;
                                       joy_axes[JA_UD] = CENTER;
                                       break;
                               case SDL_HAT_RIGHT:
                                       joy_axes[JA_LR] = RIGHT;
                                       joy_axes[JA_UD] = CENTER;
                                       break;
                               case SDL_HAT_RIGHTUP:
                                       joy_axes[JA_LR] = RIGHT;
                                       joy_axes[JA_UD] = UP;
                                       break;
                               case SDL_HAT_LEFTUP:
                                       joy_axes[JA_LR] = LEFT;
                                       joy_axes[JA_UD] = UP;
                                       break;
                               case SDL_HAT_RIGHTDOWN:
                                       joy_axes[JA_LR] = RIGHT;
                                       joy_axes[JA_UD] = DOWN;
                                       break;
                               case SDL_HAT_LEFTDOWN:
                                       joy_axes[JA_LR] = LEFT;
                                       joy_axes[JA_UD] = DOWN;
                                       break;
                       }


I also added support for exiting a game via the controller. If you have JB_QUIT defined, you can add this in unix/unix.cpp to the S9xReadJoypad function, after this line:

Code: Select all
        if (keyssnes[sfc_key[RIGHT_1]] == SDL_PRESSED || joy_axes[JA_LR] == RIGHT)      val |= SNES_RIGHT_MASK;


add:

Code: Select all
        if (joy_buttons[JB_QUIT]) S9xExit();


I was also testing with a USB SNES controller I bought on Amazon, which did not have an extra button for me to map to exit. To still allow for quitting, I added a key combination to trigger the exit:

Code: Select all
        if (joy_buttons[JB_START] && joy_buttons[JB_SELECT] && joy_buttons[JB_L] && joy_buttons[JB_R]) S9xExit();


This code triggers when START, SELECT, LEFT SHOULDER, and RIGHT SHOULDER are all pressed simultaneously. I couldn't figure out a good way to add support for multiple buttons in unix/joydef.h, so this will have to do in the meantime.
Posts: 2
Joined: Wed Jan 09, 2013 1:40 pm
by xslouis » Thu Jan 17, 2013 11:01 pm
So how do I start the actual program? Because typing run just does nothing with sudo, but without it says I need permissions. I Need help! :?
Posts: 2
Joined: Thu Jan 17, 2013 10:57 pm
by Chep » Fri Jan 18, 2013 9:40 pm
Hi

I made a patch to use 2 joysticks.
I also uses a configuration file to bind joysticks buttons.
It is not perfect (config file is not very readable for human) but it works: my girlfriend just killed me in Street Fighter II.
If you're interested, tell me how I can give you the files.
Chep
User avatar
Posts: 46
Joined: Fri Jan 18, 2013 9:32 pm
by Belthasar » Fri Jan 18, 2013 11:40 pm
@adufray - Thank you so much. I was having the same problem with my USB PS3 controller.

@xslouis this is how I run it. sudo aoss ./snes9x path_to_rom
and to stop it I am pressing ctrl+z
Posts: 2
Joined: Wed Sep 12, 2012 12:34 pm
by xslouis » Sat Jan 19, 2013 2:23 am
by Belthasar » Fri Jan 18, 2013 5:40 pm
@xslouis this is how I run it. sudo aoss ./snes9x path_to_rom
and to stop it I am pressing ctrl+z


Thank you! That worked! Now, I want to add a controller (e.g. wii classic controller via bluetooth).
I saw it is possible if I get the mappings, but how would I recompile the program?

(P.S. I'm relatively new to coding and this type of stuff, so sorry if I that is a stupid question)
Posts: 2
Joined: Thu Jan 17, 2013 10:57 pm
by adufray » Mon Jan 21, 2013 2:59 pm
Chep wrote:Hi

I made a patch to use 2 joysticks.
I also uses a configuration file to bind joysticks buttons.
It is not perfect (config file is not very readable for human) but it works: my girlfriend just killed me in Street Fighter II.
If you're interested, tell me how I can give you the files.
I'm very interested in 2 player support! Can you use a site like GitHub or even PasteBin to share the changes?
Posts: 2
Joined: Wed Jan 09, 2013 1:40 pm
by eix » Tue Jan 22, 2013 10:51 am
Today I discovered that my port of snes9x is also based on 1.39, possibly me and palerider initially took the same route on this, I have however added different features (native OpenGL ES support instead of SDL rendering on X11).

These days I am busy with fixes to the controls (not yet working), but I will also take care of checking differences with palerider's version for improvements.

At that point I will also look into proper joystick support, so please publish useful changes for discussion/merge! :)
User avatar
Posts: 82
Joined: Sat Sep 15, 2012 8:09 am
by tejonbiker » Tue Feb 05, 2013 7:23 pm
After a while and playing several games (and installing several things), the binary only says segmentation fault, when I execute with "sudo aoss ...." command the prompt don't show nothing and the program exit, Any one have an idea of what's happening?

After installing RetroPie and two sudo apt-get upgrade this happen, and emulestation says the same menssage.
Posts: 20
Joined: Tue Aug 28, 2012 1:36 am
by tejonbiker » Fri Feb 08, 2013 2:16 am
Sorry for the discomfort, I had splitted the memory for compiling purposes and I had forgotten to return to 128/128.
Posts: 20
Joined: Tue Aug 28, 2012 1:36 am
by Benjiman » Sat Feb 09, 2013 11:22 am
Chep wrote:Hi

I made a patch to use 2 joysticks.
I also uses a configuration file to bind joysticks buttons.
It is not perfect (config file is not very readable for human) but it works: my girlfriend just killed me in Street Fighter II.
If you're interested, tell me how I can give you the files.

Hi,
I am very interessted in your Patch (or any over that enables multijoystick-support for this Emulator).

The easiest way to post it here would be Pastebin. Just paste your Code in there, click on Submit and share the given Link in this Forum.

It would be fantastic then I can use this Emulator to play all the SNES-Coop-Games with my Friends.
Thank you in anticipation
Posts: 5
Joined: Sat Feb 09, 2013 11:12 am
by DustinCox » Sun Feb 10, 2013 2:25 pm
does anyone know if it supports one of these? if so, how would you make it work?

http://www.thinkgeek.com/product/f08d/?srp=4#tabs
Posts: 1
Joined: Sun Feb 10, 2013 2:23 pm
by mariuth » Sun Feb 10, 2013 9:13 pm
Got my ps3 controller hooked-up, but i cant seem to get the axis settings right.. :?
Can anybody provide any information on how do adjust the "Axes" and "Axis positions", eventually upload their joydef.h?
Posts: 1
Joined: Sun Feb 10, 2013 8:36 pm
by kalehrl » Sun Feb 17, 2013 9:36 am
Savestates should also work, try keyboard number keys 0-9 to load. Hold shift and an number key to save.

I'm trying to save state on Donkey Kong Country ROM but it doesn't work.
When I press Shift+1, only some parts of the background are removed.
The state isn't saved.
When I try to load it by pressing 1, nothing happens.
I tried CTRL+1, F1 combinations but nothing seems to work.
Posts: 342
Joined: Tue Jul 24, 2012 10:49 am
by Chep » Mon Feb 18, 2013 9:26 am
Benjiman wrote:Hi,
I am very interessted in your Patch (or any over that enables multijoystick-support for this Emulator).

The easiest way to post it here would be Pastebin. Just paste your Code in there, click on Submit and share the given Link in this Forum.

It would be fantastic then I can use this Emulator to play all the SNES-Coop-Games with my Friends.
Thank you in anticipation

Hi,
This is the code to enable 2 players. It's not perfect but it works. I give you
both tarball and patch file.

A file called joysticks.buttons is to create in the same directory as snes9X
executable but it can be easily changed with the define in joydef.h:
#define JOYSTICK_BUTTONS_FILENAME "joysticks.buttons"

Structure of the file can be improved but I had not much time to do this
and I wanted it to work NOW. Format is:

Name of the 1st gamepad
A button
B button
X button
Y button
L button
R button
START button
SELECT button
ACCEL button
QUIT button
Name of the 2nd gamepad
A button
B button
X button
Y button
L button
R button
START button
SELECT button
ACCEL button
QUIT button

I put my file in tarball.

I think you can add more joysticks with the define in snes9x.h but I don't know
if snes can manage more than 2 controllers.
#define NB_MAX_CONTROLLERS 2

The name of the gamepads can be found with dmesg. I put a printf on joystick
detection but it doesn't seems to work, there is no output as soon as SDL is
initialized and I don't know why. Maybe we could add an output file to write
in. The name of the gamepad must be exactly the same as SDL detection that's why
a working printf should be useful.

When I will have some time, I'll create a simple configuration tool which write the config file for us.
Chep
User avatar
Posts: 46
Joined: Fri Jan 18, 2013 9:32 pm
by badman12345 » Mon Feb 18, 2013 1:10 pm
Excellent Chep!

The only downfall I see is that it identifies controllers by name rather then by /dev/input/jsX... I would imagine this might give you a hard time if you have 2 identical controllers.

Still, this is excellent! Thank you so much!

Also, it looks like your unix.cpp file naming got mangled, and I'd be careful as it appears to expose your hostname and logon name...
Posts: 33
Joined: Thu Feb 14, 2013 3:00 am
by Chep » Mon Feb 18, 2013 1:28 pm
badman12345 wrote:Excellent Chep!

The only downfall I see is that it identifies controllers by name rather then by /dev/input/jsX... I would imagine this might give you a hard time if you have 2 identical controllers.

Still, this is excellent! Thank you so much!

Also, it looks like your unix.cpp file naming got mangled, and I'd be careful as it appears to expose your hostname and logon name...

Thanks, I removed the bad file. I'm glad there was not my password :-p

It is a quick and dirty patch, but you are right. I don't know if it is possible to use /dev/input/jsX with SDL because SDL should be platform independent. I'll have a look if I can.
Chep
User avatar
Posts: 46
Joined: Fri Jan 18, 2013 9:32 pm
by badman12345 » Mon Feb 18, 2013 1:29 pm
Yes you're right, SDL should def be platform independent. This is excellent work!

I just found this thought:
http://www.libsdl.org/docs/html/guideinput.html
SDL has a function to get the name of the joysticks as assigned by the operations system and that function is SDL_JoystickName. The joystick is specified by an index where 0 is the first joystick and the last joystick is the number returned by SDL_NumJoysticks - 1.


I wish I could help more than that, alas I have no functional programming knowledge beyond quick and dirty python scripting :-(.

I do, however, know that Pygame (Python's SDL implementation) supports joysticks by number in a similar manner:
pygame.joystick.get_count
number of joysticks on the system
pygame.joystick.get_count(): return count
...
pygame.joystick.Joystick
create a new Joystick object
pygame.joystick.Joystick(id): return Joystick
Create a new joystick to access a physical device. The id argument must be a value from 0 to pygame.joystick.get_count()-1.


So in pygame, you could do something like
Code: Select all
Numcontrollers = pygame.joystick.get_count()
if Numcontrollers == 1:
    Controller1 = pygame.joystick.Joystick(0)
    Controller2 = None
elif Numcontrollers > 1:
    Controller1 = pygame.joystick.Joystick(0)
    Controller2 = pygame.joystick.Joystick(1)
else:
    Controller1 = None
    Controller2 = None


Or something like that... I'm not sure what the true C/C++/SDL version of that code would be, but if pygame supports it, then vanilla SDL most likely does too.

Sorry I can't be more helpful than that :-(
Posts: 33
Joined: Thu Feb 14, 2013 3:00 am