JBaker1225
Posts: 48
Joined: Wed Apr 17, 2013 10:27 pm

Re: PiSNES released - Super Nintendo emulator

Sat May 04, 2013 7:50 pm

pudding wrote:
JBaker1225 wrote:However, I redirected EmulationStation to launch my ROMs in SNES9X. And when I do, everything works perfectly, except the controls have reverted back to the default settings, without my custom mapping.
Any idea why this is
I'll put a fix in for this. And I'll add an option to stretch the video.
Awesome, thanks. I tried pulling the build down from the new Retro Pie setup script, and it's the same problem with regards to controls. It's launching from /RetroPie/emulators/pisnes/snes9x and the snes9x.cfg is in the same directory, but it still won't recognize it.
But when I launch from the terminal via

Code: Select all

 /RetroPie/emulators/pisnes/snes9x /home/pi/RetroPie/roms/snes/game.smc 
The controls I set are recognized and work perfectly. So it seems like an odd bug (at least to someone like me who understands absolute zero about programming and Linux :lol: )

Anyway, glad to hear you're working on it and really appreciate everything you've done. Looking forward to an update in the next few days.

kalehrl
Posts: 350
Joined: Tue Jul 24, 2012 10:49 am

Re: PiSNES released - Super Nintendo emulator

Sun May 05, 2013 7:10 am

Is it possible to launch your snes9x.gui and pass command line arguments to it?
I've been using palerider's snes9x with -r 4 -h 85 to gain a bit of speed by reducing audio sample rate (-r 4) and setting cpu cycles to 85 (-h 85) instead of the default 100.


pudding
Posts: 95
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: PiSNES released - Super Nintendo emulator

Wed May 08, 2013 9:34 am

Released a new version:
* Added more configuration to the snes9x.cfg for graphics and sound.
* Added options for aspect ratio, stretching and video border.
* Pass command line options from frontend to runtime snes9x.
* Fix config file not being read when calling snes9x binary outside of CWD.
Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

JBaker1225
Posts: 48
Joined: Wed Apr 17, 2013 10:27 pm

Re: PiSNES released - Super Nintendo emulator

Wed May 08, 2013 2:55 pm

pudding wrote:Released a new version:
* Added more configuration to the snes9x.cfg for graphics and sound.
* Added options for aspect ratio, stretching and video border.
* Pass command line options from frontend to runtime snes9x.
* Fix config file not being read when calling snes9x binary outside of CWD.
Awesome. Can't wait to get home from work and try it out.

JBaker1225
Posts: 48
Joined: Wed Apr 17, 2013 10:27 pm

Re: PiSNES released - Super Nintendo emulator

Wed May 08, 2013 6:58 pm

pudding wrote:Released a new version:
* Added more configuration to the snes9x.cfg for graphics and sound.
* Added options for aspect ratio, stretching and video border.
* Pass command line options from frontend to runtime snes9x.
* Fix config file not being read when calling snes9x binary outside of CWD.
Checked it out on lunch, and the controls work perfectly now, as well as changing the aspect ratio to fit the screen.

I did notice the Super Mario All-Stars doesn't seem to work for some reason though. The game starts fine, and you can do the game select screen perfectly. But once you choose a game, it goes to this weird glitchy screen, and once you finally get the emulator closed, it locks up the RPi. Checked the ROM and it works fine on my Mac. Seems an odd glitch because Super Mario All-Stars isn't a particularly demanding game like Star Fox or Yoshi's Island.

bassmeets
Posts: 3
Joined: Wed May 08, 2013 7:10 pm

Re: PiSNES released - Super Nintendo emulator

Wed May 08, 2013 7:14 pm

Hi, first of all, thanks for the emulator, working flawlessly except for one little problem I have.
When using a PS3 Controller with sixad I get the message "Error detected invalid joystick/keyboard".
I noticed in unix/graphics.ccp that the "offending" line is:

Code: Select all

if (SDL_JoystickNumAxes(joy[i]) > 6)
                {
                    SDL_JoystickClose(joy[i]);
                    joy[i]=0;
                    printf("Error detected invalid joystick/keyboard\n");
                    break;
                }
I guess this is because the SixAxis has more then 6 axes?
Is there any way around this or am I doing something wrong?

Thanks in advance!

ti84
Posts: 70
Joined: Wed Feb 06, 2013 9:09 pm

Re: PiSNES released - Super Nintendo emulator

Thu May 09, 2013 2:19 am

Jbaker1225

Does your Mario all stars work with any other emulators on the raspberry pi

User avatar
Aloshi
Posts: 359
Joined: Sat Jun 23, 2012 6:42 pm
Contact: Website

Re: PiSNES released - Super Nintendo emulator

Thu May 09, 2013 2:24 am

bassmeets wrote: I guess this is because the SixAxis has more then 6 axes?
Is there any way around this or am I doing something wrong?
You might be able to set the PS3 controller driver to not enable the motion stuff (which should make it have less than 6 axes). I have no idea how to do this, but I think it's possible.

JBaker1225
Posts: 48
Joined: Wed Apr 17, 2013 10:27 pm

Re: PiSNES released - Super Nintendo emulator

Thu May 09, 2013 4:29 am

ti84 wrote:Jbaker1225

Does your Mario all stars work with any other emulators on the raspberry pi
It worked with RetroArch with the pocketsnes core, but the controls inexplicably switched to the second player controller after you selected a game. So I guess both emus have a weird glitch once you choose your game, but this one is worse. :lol:

bassmeets
Posts: 3
Joined: Wed May 08, 2013 7:10 pm

Re: PiSNES released - Super Nintendo emulator

Fri May 10, 2013 11:30 am

Aloshi wrote:
bassmeets wrote: I guess this is because the SixAxis has more then 6 axes?
Is there any way around this or am I doing something wrong?
You might be able to set the PS3 controller driver to not enable the motion stuff (which should make it have less than 6 axes). I have no idea how to do this, but I think it's possible.
Tried disabling the axes in /var/lib/sixad/profiles/default. It seems that sixad isn't looking for these profiles though (not sure why). Also tried enabling LEGACY=1 in /etc/default/sixad, this didn't work either.

While I'm by no means an expert coder, the following seems to work (your experience may differ) for the PS3 Dual Shock 3 controller:

Ended up slightly editing graphics.ccp and unix.ccp, commenting out the following in graphics.ccp:

Code: Select all

           Check for valid joystick, some keyboards
            aren't SDL compatible
            if(joy[i])
            {
               if (SDL_JoystickNumAxes(joy[i]) > 6)
                {
                    SDL_JoystickClose(joy[i]);
                    joy[i]=0;
                    printf("Error detected invalid joystick/keyboard\n");
                   break;
                }
            }
                      if(i==1) break;         //Only need two joysticks
And adding code for keypad support in unix.ccp / keys.h and keyconstants.h:

Added the following in keyconstants.h:

Code: Select all

// Joypad
#define JB_UP 4
#define JB_DOWN 6
#define JB_RIGHT 5
#define JB_LEFT 7
Added the following in keys.h:

Code: Select all

#define RPI_JOY_UP      4
#define RPI_JOY_DOWN    6
#define RPI_JOY_RIGHT   5
#define RPI_JOY_LEFT    7
Added the following in unix.ccp after "//Configure joysticks from config file or defaults":

Code: Select all

        sfc_joy[JB_UP] = get_integer_conf("Joystick", "JB_UP", RPI_JOY_UP);
        sfc_joy[JB_DOWN] = get_integer_conf("Joystick", "JB_DOWN", RPI_JOY_DOWN);
        sfc_joy[JB_LEFT] = get_integer_conf("Joystick", "JB_LEFT", RPI_JOY_LEFT);
        sfc_joy[JB_RIGHT] = get_integer_conf("Joystick", "JB_RIGHT", RPI_JOY_RIGHT);
And replacing the follow in unix.ccp:

Code: Select all

        if (keyssnes[sfc_key[UP_1]] == SDL_PRESSED || joy_axes[which1][JA_UD] == UP)              val |= SNES_UP_MASK;
        if (keyssnes[sfc_key[DOWN_1]] == SDL_PRESSED || joy_axes[which1][JA_UD] == DOWN])        val |= SNES_DOWN_MASK;
        if (keyssnes[sfc_key[LEFT_1]] == SDL_PRESSED || joy_axes[which1][JA_LR] == LEFT])        val |= SNES_LEFT_MASK;
        if (keyssnes[sfc_key[RIGHT_1]] == SDL_PRESSED || joy_axes[which1][JA_LR] == RIGHT])     val |= SNES_RIGHT_MASK;
With:

Code: Select all

        if (keyssnes[sfc_key[UP_1]] == SDL_PRESSED || joy_axes[which1][JA_UD] == UP || joy_buttons[which1][JB_UP])              val |= SNES_UP_MASK;
        if (keyssnes[sfc_key[DOWN_1]] == SDL_PRESSED || joy_axes[which1][JA_UD] == DOWN || joy_buttons[which1][JB_DOWN])        val |= SNES_DOWN_MASK;
        if (keyssnes[sfc_key[LEFT_1]] == SDL_PRESSED || joy_axes[which1][JA_LR] == LEFT || joy_buttons[which1][JB_LEFT])        val |= SNES_LEFT_MASK;
        if (keyssnes[sfc_key[RIGHT_1]] == SDL_PRESSED || joy_axes[which1][JA_LR] == RIGHT || joy_buttons[which1][JB_RIGHT])     val |= SNES_RIGHT_MASK;
I was hoping that the buttons could be assigned in snes9x.cfg using

Code: Select all

JB_UP=4
JB_DOWN=6
JB_RIGHT=5
JB_LEFT=7
The joypad works, however the keyassignments are coded in and can't be altered using snes9x.cfg. Does anyone have any idea why.
P.S. I also know this code might look a bit silly to some, I have no experience with coding (only scripting ;) ) so...

pudding
Posts: 95
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: PiSNES released - Super Nintendo emulator

Fri May 10, 2013 12:57 pm

bassmeets wrote: When using a PS3 Controller with sixad I get the message "Error detected invalid joystick/keyboard".
Can you run http://pisnes.googlecode.com/files/sdljoystick on your Pi with the joystick plugged in. It will say how many axis there are.
Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

bassmeets
Posts: 3
Joined: Wed May 08, 2013 7:10 pm

Re: PiSNES released - Super Nintendo emulator

Fri May 10, 2013 1:19 pm

pudding wrote:
bassmeets wrote: When using a PS3 Controller with sixad I get the message "Error detected invalid joystick/keyboard".
Can you run http://pisnes.googlecode.com/files/sdljoystick on your Pi with the joystick plugged in. It will say how many axis there are.
As far as I can tell it shows 26 axis (axi, axes?). Which as far as I know, could be correct. I tried changing the max number of axes to 20 in unix.ccp and it still threw out the error. Fixed the problem in an above post though.

pudding
Posts: 95
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: PiSNES released - Super Nintendo emulator

Fri May 10, 2013 2:08 pm

bassmeets wrote:As far as I can tell it shows 26 axis (axi, axes?). Which as far as I know, could be correct.
Sadly that sounds like an SDL incompatible joystick. (SDL is used by PiSNES for input).
Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

pudding
Posts: 95
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: PiSNES released - Super Nintendo emulator

Sat May 25, 2013 10:22 am

New version just released. The graphics backend was rewritten (based on Andrey's excellent GLES2 backend) to allow non anti-aliased drawing and other post-processing effects like scanlines.
Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

raygan
Posts: 14
Joined: Wed Oct 17, 2012 1:02 pm

Re: PiSNES released - Super Nintendo emulator

Sat May 25, 2013 3:59 pm

Nice update! Looking forward to testing it this evening.

JBaker1225
Posts: 48
Joined: Wed Apr 17, 2013 10:27 pm

Re: PiSNES released - Super Nintendo emulator

Sat May 25, 2013 11:02 pm

Awesome.
Any idea whether this fixes the problems with some of the games (i.e. Mario All Stars)?

Andrey
Posts: 78
Joined: Sat Sep 01, 2012 9:52 am

Re: PiSNES released - Super Nintendo emulator

Sat May 25, 2013 11:58 pm

pudding wrote:New version just released. The graphics backend was rewritten (based on Andrey's excellent GLES2 backend) to allow non anti-aliased drawing and other post-processing effects like scanlines.
I'm working on snes9x4d port too :lol:

Vanfanel
Posts: 433
Joined: Sat Aug 18, 2012 5:58 pm

Re: PiSNES released - Super Nintendo emulator

Sun May 26, 2013 12:31 am

@Andrey, Pudding: Any hopes for a recent Snes9X version to be fullspeed on the Pi? Old versions < 1.5x have horrible audio emulation, with broken samples and rythms (pipes in Mario World, every music out of tempo in Super Adventure Island, etc). Blargg's SPC700 was incorporated later and corrected those audio issues, making it sound like an SNES.

Andrey
Posts: 78
Joined: Sat Sep 01, 2012 9:52 am

Re: PiSNES released - Super Nintendo emulator

Sun May 26, 2013 9:57 pm

@Vanfanel

May be, but first i need to finish current work :)

iain1970
Posts: 18
Joined: Mon Jul 02, 2012 9:10 am

Re: PiSNES released - Super Nintendo emulator

Mon May 27, 2013 5:23 pm

Hi,

Back to basics for me I'm afraid. I've downloaded the latest version of Raspbian and then downloaded PiSnes through the Pi Store. I'm stuck on "page one" as it were. My set up is a Pi A 256mb running through HDMI set to High on the overclock menu.

First problem, for me at least, is that I can only run PiSnes through my library in the Pi Store. Is there a way I can run it from the desktop or instead of typing "startx"?

Second problem is that although I have loaded the .smc roms in the ROM directory, all I get is a blank screen for any that I select. What have I done wrong?

pudding
Posts: 95
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: PiSNES released - Super Nintendo emulator

Mon May 27, 2013 6:10 pm

You've put your roms in /usr/local/bin/indiecity/InstalledApps/pisnes/Full/roms/ I assume?

To run PiSNES outside of Pi Store, in either X-Windows (startx) or the Console simply run /usr/local/bin/indiecity/InstalledApps/pisnes/Full/snes9x.gui. You could create an alias for this in your .profile:
alias pisnes='/usr/local/bin/indiecity/InstalledApps/pisnes/Full/snes9x.gui'

Then simply run 'pisnes' at the command line.

To manually run individual games instead of using the game selector GUI:
cd /usr/local/bin/indiecity/InstalledApps/pisnes/Full/
./snes9x roms/{game rom filename}

If you're getting a blank screen when running it try turning off your overclocking for now.
Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

iain1970
Posts: 18
Joined: Mon Jul 02, 2012 9:10 am

Re: PiSNES released - Super Nintendo emulator

Tue May 28, 2013 10:44 am

Yes, I dropped the .smc files into the ROMS folder. The roms are listed on the GUI menu and can be selected.

Oddly, the overclocking was done following the install of PiMame earlier on yesterday, but I shall make the attempt to turn it off before trying anything else.

petrockblog
Posts: 270
Joined: Wed Jul 04, 2012 6:12 am
Location: Germany
Contact: Website

Re: PiSNES released - Super Nintendo emulator

Wed May 29, 2013 5:43 pm

When I download the sources and start compilation with

Code: Select all

make
I get the following error:

Code: Select all

gcc -I/usr/include -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux  -o snes9x cpuops.o cpuexec.o   cpu.o tile.o gfx.o clip.o memmap.o ppu.o dma.o unix/unix.o spc700.o soundux.o apu.o unix/graphics.o dsp1.o snes9x.o snapshot.o data.o globals.o unix/gles2.o  loadzip.o unzip/unzip.o unzip/explode.o unzip/unreduce.o unzip/unshrink.o  -L/usr/lib/arm-linux-gnueabihf -L/opt/vc/lib -lGLESv2 -lEGL -lglib-2.0 -lSDL -lstdc++ -lz -lpthread 
unix/graphics.o: In function `S9xInitDisplay':
graphics.cpp:(.text+0x94): undefined reference to `bcm_host_init'
graphics.cpp:(.text+0x1c8): undefined reference to `graphics_get_display_size'
graphics.cpp:(.text+0x1ec): undefined reference to `vc_dispmanx_rect_set'
graphics.cpp:(.text+0x214): undefined reference to `vc_dispmanx_rect_set'
graphics.cpp:(.text+0x21c): undefined reference to `vc_dispmanx_display_open'
graphics.cpp:(.text+0x22c): undefined reference to `vc_dispmanx_update_start'
graphics.cpp:(.text+0x254): undefined reference to `vc_dispmanx_element_add'
graphics.cpp:(.text+0x274): undefined reference to `vc_dispmanx_rect_set'
graphics.cpp:(.text+0x290): undefined reference to `vc_dispmanx_rect_set'
graphics.cpp:(.text+0x2a4): undefined reference to `vc_dispmanx_resource_create'
graphics.cpp:(.text+0x2d8): undefined reference to `vc_dispmanx_element_add'
graphics.cpp:(.text+0x2fc): undefined reference to `vc_dispmanx_update_submit_sync'
unix/graphics.o: In function `S9xDeinitDisplay':
graphics.cpp:(.text+0x5c8): undefined reference to `vc_dispmanx_update_start'
graphics.cpp:(.text+0x5d8): undefined reference to `vc_dispmanx_element_remove'
graphics.cpp:(.text+0x5e4): undefined reference to `vc_dispmanx_element_remove'
graphics.cpp:(.text+0x5ec): undefined reference to `vc_dispmanx_update_submit_sync'
graphics.cpp:(.text+0x5f4): undefined reference to `vc_dispmanx_resource_delete'
graphics.cpp:(.text+0x5fc): undefined reference to `vc_dispmanx_display_close'
graphics.cpp:(.text+0x600): undefined reference to `bcm_host_deinit'
collect2: ld returned 1 exit status
make: *** [snes9x] Error 1
It seems as if there is a library missing that is needed for linking. Do you have an idea, what needs to be modified in the Makefile?
fun stuff for technics enthusiasts: www.petrockblock.com

kalehrl
Posts: 350
Joined: Tue Jul 24, 2012 10:49 am

Re: PiSNES released - Super Nintendo emulator

Wed May 29, 2013 5:56 pm

Try adding

Code: Select all

-lbcm_host

Return to “Gaming”