ric_rpi
Posts: 206
Joined: Thu Jul 11, 2013 2:33 pm
Location: Bedford, UK

Re: Mupen64Plus - N64 Emulator for the Pi

Thu Oct 17, 2013 7:51 pm

Thank you,

I've done the keyboard mapping now for the console mode but need to replicate for X windows. I do not know how to get the scan codes from X to do the same mapping though. Given the pi struggles to run mupen64plus in desktop mode, I'm not too concerned with fixing it now. Users can change the values in the cfg if they want it now.

I also decided not to go down the ncurses route so mouse input will have to wait too.

I'll be heading back to the Interrupt routines to find some more cycles ...

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

Re: Mupen64Plus - N64 Emulator for the Pi

Fri Oct 18, 2013 8:52 am

ric_rpi
I received a private msg from arimal RE: The Legend of Zelda: Majora’s Mask which was suffering from a similar issue as Goldeneye 64 (i.e. only getting a black screen when trying to open the inventory/menu) on testing found a 'fix' of sorts

Set
ScreenUpdateSettings=1
This causes 'flickering' which can be eliminated by
Set
SkipFrame = False
Unfortunately due to the emulator now displaying EVER frame its slower

Goldeneye 64
Setting Screen Update to 1 & Skipframe to False allows game to be rendered FULLY (again this is slower), as in Mask now ALL Attract/Menu/Option Screen become visible. However, just setting ScreenUpdateSettings=1, they are NOT visible
"The list of things I have heard now contains everything!"

ric_rpi
Posts: 206
Joined: Thu Jul 11, 2013 2:33 pm
Location: Bedford, UK

Re: Mupen64Plus - N64 Emulator for the Pi

Fri Oct 18, 2013 10:12 am

ok, atleast we now understand that issue but a shame we can't skip every other frame.

I have a preliminary design for the multi-threaded core that looks quite reasonable now. Hopefully I'll have something coded up by end of next week. Whether it will work is another matter but I can strip quite a bit of code out of the interrupt implementation.

gyeben
Posts: 150
Joined: Tue Jun 19, 2012 6:38 pm
Location: Hungary, Eger

Re: Mupen64Plus - N64 Emulator for the Pi

Sat Oct 19, 2013 1:08 pm

ric_rpi:
keyboard input in the console still doesn't work properly.

Image

I pressed the following keys: ENTER, left, right, up, down, ESC. Only ENTER and ESC were recognized. The arrow keys are identified as "SDL key -1 -1".

ric_rpi
Posts: 206
Joined: Thu Jul 11, 2013 2:33 pm
Location: Bedford, UK

Re: Mupen64Plus - N64 Emulator for the Pi

Sat Oct 19, 2013 7:48 pm

gyeben

Thank you for testing the code, I guess I'll need to add the escaped keys from a keyboard separately. Are you using a standard US 101 keyboard?

ric_rpi
Posts: 206
Joined: Thu Jul 11, 2013 2:33 pm
Location: Bedford, UK

Re: Mupen64Plus - N64 Emulator for the Pi

Sun Oct 20, 2013 8:45 am

I have added escaped keys to the ric_dev branch now. It has a few minor changes and better protection from ROMS breaking emulator.

If the arrow keys now work and no one has any objections, then I would like to push it to the master branch.

ric_rpi
Posts: 206
Joined: Thu Jul 11, 2013 2:33 pm
Location: Bedford, UK

Re: Mupen64Plus - N64 Emulator for the Pi

Tue Oct 22, 2013 3:55 pm

Well the Multi-threading isn't going too well due to the global variables and lack of understanding of the SPECIAL_INTs.

I have found some more optimizations but also found I broke the keyboard on ric_dev, fix waiting to commit once I've removed a recurring graphics issue.

Something worth a try is setting DEFAULT_MODE to a frequency supported by your TV. A low value e.g. 22050 makes a big difference to performance.

ric_rpi
Posts: 206
Joined: Thu Jul 11, 2013 2:33 pm
Location: Bedford, UK

Re: Mupen64Plus - N64 Emulator for the Pi

Thu Oct 24, 2013 9:46 am

ric_rpi wrote:Well the Multi-threading isn't going too well due to the global variables and lack of understanding of the SPECIAL_INTs.

I have found some more optimizations but also found I broke the keyboard on ric_dev, fix waiting to commit once I've removed a recurring graphics issue.

Something worth a try is setting DEFAULT_MODE to a frequency supported by your TV. A low value e.g. 22050 makes a big difference to performance.
ric_dev now fixed and from what I have tested, keyboard arrows partially working.

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

Re: Mupen64Plus - N64 Emulator for the Pi

Fri Oct 25, 2013 4:29 pm

arimal wrote:It's a 256Mb model b, firmware and all is up to date as of this morning. I have a small 100Mb swap file in use. I have it compiling now with a 64/192 split and it seems to have passed the the point where it was crashing.
Actually, I had to use a 32/224 split to overcome the "critical point". I assume that other running services (e.g., SAMBA) already occupy too much memory for the 64/192 split in my case.
fun stuff for technics enthusiasts: www.petrockblock.com

Takenover83
Posts: 166
Joined: Mon Sep 02, 2013 5:39 am

Re: Mupen64Plus - N64 Emulator for the Pi

Tue Oct 29, 2013 2:39 am

Anyone had any luck mapping a exit/quit button? I tried editing the section below with no success. I use /dev/input/j0 and button 16 is the home button on my ps3 controller. So far I have been exiting with the keyboard via ctrl+c.

/home/pi/.config/mupen64plus/mupen64plus.cfg

Code: Select all

[CoreEvents]
# Joystick event string for stopping the emulator
Joy Mapping Stop = "j0b16"

ric_rpi
Posts: 206
Joined: Thu Jul 11, 2013 2:33 pm
Location: Bedford, UK

Re: Mupen64Plus - N64 Emulator for the Pi

Fri Nov 01, 2013 3:30 pm

Its been over a week so I should give everyone an update.

First off I have pushed ric_dev into the master branch so the default code now has keyboard input and some optimizations. Ctrl+C will not work due to changing the keyboard mode but ESC key should exit the emulation. The arrow keys are not working correctly and need investigating.

The core events from joystick input rely on 'SDL_EventFilter' so, from looking at the code, I am assuming this may not be working yet on the pi, especially as the keyboard and mouse don't work either.

I have put my latest multi-threaded version into ric_dev. I haven't tested it locally so it may not work but it doesn't crash and I can get screen shots remotely. Currently only the graphics processing is in its own thread and the emulation runs a little slower as I have not had any luck with modify the interrupt queue with

Code: Select all

add_interupt_event(VI_INT, 0);
from a 'non-main' thread. The emulator dead-locks on a mutex just after it starts running if I try.

I still do not know if the emulator has to generate and process VI_INTs at certain points in its execution for it to run correctly. If it does then using multi-threading on graphics in the way I have been trying will not work.

ric_rpi
Posts: 206
Joined: Thu Jul 11, 2013 2:33 pm
Location: Bedford, UK

Re: Mupen64Plus - N64 Emulator for the Pi

Mon Nov 04, 2013 9:16 pm

I have fixed a bug in the audio sampling that should give a small performance boost on HDMI when DEFAULT_MODE=10000 in the mupen64plus.cfg. If you are using the Audio jack then this should make a bigger difference to performance

omg-a-bear
Posts: 1
Joined: Wed Oct 30, 2013 10:57 am

Re: Mupen64Plus - N64 Emulator for the Pi

Tue Nov 05, 2013 12:42 pm

Just wanted to give a big thumbs up! This looks promising, and the emulation runs quite nice for me - albeit laggy at times.

I admire the time and effort put in to this, first of all ric_rpi for development, but also [mainly] welshy for the testing! Keep up the good work, guys!

Just out of curiosity; how big of a difference is it working on the RPi versus an Android emulator such as Mupen64+AE (https://github.com/paulscode/mupen64plus-ae)?

ric_rpi
Posts: 206
Joined: Thu Jul 11, 2013 2:33 pm
Location: Bedford, UK

Re: Mupen64Plus - N64 Emulator for the Pi

Tue Nov 05, 2013 3:17 pm

omg-a-bear wrote:Just wanted to give a big thumbs up! This looks promising, and the emulation runs quite nice for me - albeit laggy at times.

I admire the time and effort first of all ric_rpi putting into the development, but also [mainly] welshy for the testing! Keep up the good work, guys!

Just as a side note; how big of a difference is it working on the RPi versus an Android emulator such as Mupen64+AE (https://github.com/paulscode/mupen64plus-ae)?
I don't know, I think someone else tried to get the android version working on the pi but I believe the android version uses SDL to initialize the graphics. Currently SDL on the pi is not hardware accelerated.

I pinched their GLES2 video plugins and implemented quite a few other optimizations in the core to get it working as well as it is. There is still quite a bit missing from the rpi version though. I am focusing on trying to increase its speed before fixing other functionality though.

tin0
Posts: 6
Joined: Mon Jul 29, 2013 7:17 am

Re: Mupen64Plus - N64 Emulator for the Pi

Tue Nov 26, 2013 11:51 am

Hey there, i've played around with mupenplus for the pi a few months ago, but i got a black screen every time (sound and stuff was loading)

Just for learning purposes, did you had the same effect and how did you solved it?

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

Re: Mupen64Plus - N64 Emulator for the Pi

Tue Nov 26, 2013 12:42 pm

tin0
Try the latest dev release, the code is constantly changing due to development, it could be you downloaded the source at a point it wasn't stable/working correctly.
"The list of things I have heard now contains everything!"

tin0
Posts: 6
Joined: Mon Jul 29, 2013 7:17 am

Re: Mupen64Plus - N64 Emulator for the Pi

Tue Nov 26, 2013 1:33 pm

Thanks for the reply, but i think i couldn't express my question.

i have hacked around a little bit before the actual project appeared. I had the problem that the screen was black everytime and i couldn't find the reason (i've tried the gles2 plugin from the android port). so my question is if the developer of this new fork had the same issue and know what caused it. Just for demystifying it for myself :)

ric_rpi
Posts: 206
Joined: Thu Jul 11, 2013 2:33 pm
Location: Bedford, UK

Re: Mupen64Plus - N64 Emulator for the Pi

Tue Nov 26, 2013 3:28 pm

I started by experimenting with the hello_triangle example to draw on the screen from within mupen64plus. Once this was rendering, I then allowed the gfx (gles2rice) plugin to render too. I then had a problem where the image had a translucent effect. This was from not setting the alpha for dispmanx but once this was set it worked very well. - more detail and code in mupen64plus-core/src/api/rpiGLES.c

Afraid I didn't have any black screens though ...

tin0
Posts: 6
Joined: Mon Jul 29, 2013 7:17 am

Re: Mupen64Plus - N64 Emulator for the Pi

Tue Nov 26, 2013 9:20 pm

Thank you very much for the reply and the link :)

Sabes
Posts: 1
Joined: Thu Nov 28, 2013 6:34 pm

Re: Mupen64Plus - N64 Emulator for the Pi

Thu Nov 28, 2013 6:51 pm

Takenover83 wrote:Anyone had any luck mapping a exit/quit button? I tried editing the section below with no success. I use /dev/input/j0 and button 16 is the home button on my ps3 controller. So far I have been exiting with the keyboard via ctrl+c.

/home/pi/.config/mupen64plus/mupen64plus.cfg

Code: Select all

[CoreEvents]
# Joystick event string for stopping the emulator
Joy Mapping Stop = "j0b16"
I have a solution for the Joy Mapping Stop not working. I am using an xbox 360 controller. You can have one of the buttons act as an esc key by configuring the xboxdrv. This is done by including --ui-buttonmap buttonofchoice=KEY_ESC. Here is an example of what I did.

sudo xboxdrv --trigger-as-button --id 0 --led 2 --ui-buttonmap guide=KEY_ESC --deadzone 4000 --silent & sleep 1

--ui-buttonmap buttonofchoice=KEY_ESC can also be added to an existing configuration via:

sudo nano /etc/rc.local

arimal
Posts: 38
Joined: Sun Jun 17, 2012 3:03 pm

Re: Mupen64Plus - N64 Emulator for the Pi

Fri Nov 29, 2013 11:30 pm

For people not using an xbox controller xboxdrv can still serve the function of giving your joystick an ESC key in a roundabout way. First you map a button on your joystick to a virtual xbox pad and then map that button to a key. Seems counterintuitive but is actually a lot less trouble than joy2key. Though your event device file is likely different and BTN_BASE6 is R3 on my ps2 pad and is the same key I use to close retroarch, so change this config as necessary.

save this to an empty file named whatever pleases you.

Code: Select all

[xboxdrv]
#We just want an escape key on R3
evdev = /dev/input/by-id/usb-0810_Twin_USB_Joystick-event-joystick
evdev-debug = false
evdev-grab = false
[evdev-keymap]
BTN_BASE6 = BACK
[ui-buttonmap]
BACK = KEY_ESC
Then you can start the emulator like so.

Code: Select all

sudo xboxdrv --config /home/pi/your config file here --silent ./mupen64plus $ROM

baeckerman83
Posts: 6
Joined: Fri Nov 29, 2013 7:42 am

Re: Mupen64Plus - N64 Emulator for the Pi

Thu Dec 05, 2013 7:16 pm

Has anyone get Mario Kart 64 started in the splittscreen mode? Every time I try it stop loading at the intro video for the splitscreen. I use retropie with the mupen64plus emulator. Single games are working in mario kart 64.

franky
Posts: 1
Joined: Fri Mar 28, 2014 10:30 pm

Re: Mupen64Plus - N64 Emulator for the Pi

Sat Mar 29, 2014 11:32 am

Mupen 64 plus - Controller don’t work

I tried to edit the mupen64plus.cfg, but whatever option i choose, the keyboard dont work.
When I start mupen64 the command line says:

missing or incompatile config section Input-sdl-1 .clearing
....
....
....
....
inuput: 1 controller found , 1 plugged in and usable in the emulator

??????? first missing and then controller found??????
The emulator starts but no usable keyboard

ric_rpi
Posts: 206
Joined: Thu Jul 11, 2013 2:33 pm
Location: Bedford, UK

Re: Mupen64Plus - N64 Emulator for the Pi

Wed Apr 02, 2014 4:02 pm

franky

There is an issue (#24) with controller configurations when editing the mupen64plus.cfg file.

The current work around is to edit the InputAutoCfg.ini file in the test folder.

olso4539
Posts: 30
Joined: Mon Feb 03, 2014 9:02 pm

Re: Mupen64Plus - N64 Emulator for the Pi

Wed Jun 04, 2014 3:27 am

Is it normal that the gles2n64 video plugin makes the screen flicker (estimate varying from 5 to 20 hz) for all games? It seems like it flickers least under heavy load. I have been using the rice plugin but it won't open Mega Man 64.

I'm using the Mupen64plus branch with the recently posted build instructions. Games that I've tried include Super Mario 64 and Mega Man 64.

It seems to almost stop flickering entirely under high load...maybe that's a clue?
-Jon

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 6 guests