Mupen64Plus - N64 Emulator for the Pi


202 posts   Page 1 of 9   1, 2, 3, 4, 5 ... 9
by PhonicUK » Mon May 28, 2012 1:12 pm
I've been working on porting the version of Mupen64Plus originally made for the Pandora to the Pi.

I've got it to compile and run (the GTK based ui works absolutely fine), and I can emulate a game with no video output, and using the interpreter instead of the dynarec.

Right now I'm trying to sort out the gles2n64 plugin, which has some ARMv7 assembler in that I'm rewriting as C to get it going and will then have to re-optimize later. The dynarec also has some minor issues stemming from being predominantly built around the Cortex chip.

You can download the original sources from:

git://gitorious.org/mupen64plus-arm/mupen64plus-arm.git
http://code.google.com/p/gles2n64/source/checkout

You'll also need to grab a copy of the gl2extimg.h header file.

Based on how it performs on the N900, I'm reasonably confident we can get Mario64 playable on it with some work.
Posts: 8
Joined: Sat May 26, 2012 12:18 am
by PhonicUK » Mon May 28, 2012 2:09 pm
Update:

Hexxeh and I have been pouring over it. He's managed to get the plugin compiled and we've got the dynarec to behave instead of using the interpreter. Now we're just struggling to get the gles2n64 plugin to work properly.
Posts: 8
Joined: Sat May 26, 2012 12:18 am
by Xero Xenith » Tue May 29, 2012 7:23 pm
Wow, sounds great! IIRC there was one working reasonably well on the Sony PSP (333MHz MIPS R4000) so I'm looking forward to trying this out once graphics are working :)
Posts: 3
Joined: Sun May 27, 2012 11:22 pm
by PhonicUK » Tue May 29, 2012 9:12 pm
The PSP has the slight advantage of being based on the same architecture as the N64 so its easier to emulate. Hexxeh managed to get the GPU plugin to compile and added a few pi-specific buts but we're getting no output.
Posts: 8
Joined: Sat May 26, 2012 12:18 am
by benhofb » Wed May 30, 2012 3:28 am
Xero Xenith wrote:Wow, sounds great! IIRC there was one working reasonably well on the Sony PSP (333MHz MIPS R4000) so I'm looking forward to trying this out once graphics are working :)


Yeah, but even this port was pretty basic. I have run Super Mario 64 on my 3000 and the sound is still rather choppy. I think once the plugins and all that jazz are implemented, the RPi will be a fantastic little emulator for N64. Maybe someone would get the idea to put one in a N64 cartridge...
User avatar
Posts: 15
Joined: Tue May 01, 2012 3:29 am
Location: A City on the Periphery of Orlando.
by abishur » Wed May 30, 2012 11:52 pm
Exciting, be sure to update this thread as things progress! Hopefully someone will be able to work out getting sound from the FCEUX emulator soon and we can have an NES and N64 emulator going :-)
Dear forum: Play nice ;-)
User avatar
Forum Moderator
Forum Moderator
Posts: 4298
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
by ikesmasher » Thu May 31, 2012 2:37 am
Great work dude! i hope to see this become a reality very soon!
Posts: 25
Joined: Tue May 29, 2012 2:50 am
by matthewbpt » Wed Jun 20, 2012 2:26 pm
Any updates on the status of this project? I finally received my pi and would love to help you guys get this working.
Posts: 1
Joined: Wed Jun 20, 2012 2:13 pm
by Endercraft4 » Mon Jun 25, 2012 1:13 am
This is awesome! :o I hope you have an n64 game at least some what playable by the time I get my PI.
By the way, did anyone else here order their PI from element14
Posts: 5
Joined: Mon Jun 25, 2012 1:08 am
by Izzeho » Fri Jun 29, 2012 9:48 am
Hmm very interesting. I'd be thoroughly intrigued to know what performance will be like under armv6, I'd find it hard to believe it could be anything but bad =/ Can the much better GPU (as opposed to the SGX530) perhaps offset that?
Posts: 2
Joined: Fri Jun 29, 2012 9:33 am
by Endercraft4 » Sun Jul 01, 2012 9:36 pm
If You do not post an update we will think you are lairs :D
Just joking....ish
Posts: 5
Joined: Mon Jun 25, 2012 1:08 am
by portets » Sat Jul 21, 2012 4:11 am
Any update yet?

@abishur has anyone got fceux to work yet? I got it compiled and working with sound, but it's slow. It runs at full speed without sound and all lowest settings. Crawls at fullscreen though.
Posts: 185
Joined: Sat Oct 29, 2011 6:24 am
by abishur » Sun Jul 22, 2012 3:03 am
portets wrote:Any update yet?

@abishur has anyone got fceux to work yet? I got it compiled and working with sound, but it's slow. It runs at full speed without sound and all lowest settings. Crawls at fullscreen though.


Not to my knowledge, which distro are you using and are you doing it from the console or within X?
Dear forum: Play nice ;-)
User avatar
Forum Moderator
Forum Moderator
Posts: 4298
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
by yoonsikp » Fri Aug 03, 2012 9:12 pm
What has happened on this project? I'm extremely interested.
Posts: 23
Joined: Wed Aug 31, 2011 3:07 pm
by ndrs » Fri Aug 03, 2012 9:17 pm
yoonsikp wrote:What has happened on this project? I'm extremely interested.


Same here. I've tried to make a build of mupen64plus but armv6 was not compatible.

So this would be a great work.

PCSX runs absolutely fine, so mupen64plus will run as well with some work. (I know i'ts totally different, it's just a tought).
Posts: 31
Joined: Wed Jul 04, 2012 10:22 pm
by marqs » Fri Aug 03, 2012 10:00 pm
Yeah, it'd be great if we'll get this one working soon.

BTW, N64's pads can be easily connected to RPi's GPIOs, since they need only 3 wires and use 3.3V :) . I've made a driver based on kernel's gamecon (originally for parallel port) to support N64 pads. with Raspberry's GPIOs. The 50mA limit should be enough for 4 pads, but I have to do some more testing. I'll put the code out in a few days. It'd be also quite easy to add support for other retro pads (nes,snes,etc.) there, assuming they would work at 3.3V.
Posts: 126
Joined: Sat Jun 09, 2012 11:34 am
by danboid » Sat Aug 04, 2012 3:10 pm
The git repo linked in the first post doesn't work for me an I've tried it at various times over the last few weeks so I suspect it no longer exists.

Code: Select all
git clone git://gitorious.org/mupen64plus-arm/mupen64plus-arm.git
Cloning into 'mupen64plus-arm'...
fatal: The remote end hung up unexpectedly


Hopefully PhonicUK is still working on it and can provide a link to a working repo or source tarball that I can try to build on my Pandaboard?
Posts: 15
Joined: Sat Jul 28, 2012 1:07 pm
by Pioni-Sensei » Sat Aug 04, 2012 11:45 pm
How is the progress on this project going?
I've got two pi's. intending to use one as a media/emu machine on my TV and the other one to power my 3D printer.
So far the first one has xbmc (smoothly) and the second one has most of the drivers.
Biggest thing I'm wanting is a N64 emu.
Please keep us posted Phonic! :D
Posts: 9
Joined: Fri Jun 22, 2012 10:25 am
by yoonsikp » Sun Aug 05, 2012 4:07 am
We could always use the android version of mupen since we know android will soon be released for the pi.
Posts: 23
Joined: Wed Aug 31, 2011 3:07 pm
by Norefall » Wed Oct 31, 2012 2:24 pm
Like everyone else here, I also want to know the status of this project. Is it dead?
Posts: 43
Joined: Sun Nov 06, 2011 12:19 pm
by taoofdre » Sat Dec 29, 2012 6:43 pm
Bump, curious as well! One of the best emulators I've had a pleasure of using (on Android).
Posts: 2
Joined: Fri Dec 28, 2012 7:12 pm
by HonkeyKong » Mon Jan 28, 2013 7:30 pm
I've been working on getting this emulator built and running, but I keep running into this roadblock during the linking stage:

Code: Select all
g++ main/main.o main/romcache.o main/util.o main/cheat.o main/config.o main/adler32.o main/md5.o main/plugin.o main/rom.o main/savestates.o main/zip/ioapi.o main/zip/unzip.o main/bzip2/bzlib.o main/bzip2/crctable.o main/bzip2/decompress.o main/bzip2/compress.o main/bzip2/randtable.o main/bzip2/huffman.o main/bzip2/blocksort.o main/lzma/buffer.o main/lzma/io.o main/lzma/main.o main/7zip/7zAlloc.o main/7zip/7zBuffer.o main/7zip/7zCrc.o main/7zip/7zDecode.o main/7zip/7zExtract.o main/7zip/7zHeader.o main/7zip/7zIn.o main/7zip/7zItem.o main/7zip/7zMain.o main/7zip/LzmaDecode.o main/7zip/BranchX86.o main/7zip/BranchX86_2.o memory/dma.o memory/flashram.o memory/memory.o memory/pif.o memory/tlb.o r4300/r4300.o r4300/bc.o r4300/compare_core.o r4300/cop0.o r4300/cop1.o r4300/cop1_d.o r4300/cop1_l.o r4300/cop1_s.o r4300/cop1_w.o r4300/exception.o r4300/interupt.o r4300/profile.o r4300/pure_interp.o r4300/recomp.o r4300/special.o r4300/regimm.o r4300/tlb.o r4300/empty_dynarec.o r4300/new_dynarec/new_dynarec.o r4300/new_dynarec/linkage_arm.o opengl/OGLFT.o opengl/osd.o opengl/screenshot.o main/translate.o -Wl,-export-dynamic -lz -lm -lpng -lfreetype -ldl -L/usr/lib/arm-linux-gnueabihf -lSDL -L/usr/X11R6/lib -lGL -lGLU -o mupen64plus
/usr/bin/ld: error: mupen64plus uses VFP register arguments, r4300/new_dynarec/linkage_arm.o does not
/usr/bin/ld: failed to merge target specific data of file r4300/new_dynarec/linkage_arm.o
collect2: ld returned 1 exit status
make: *** [mupen64plus] Error 1


Does anyone know of a way to fix this? I've found this problem when building a lot of software, but no way around it.
User avatar
Posts: 27
Joined: Fri Jan 11, 2013 3:25 pm
Location: Kansas, USA
by Bramude » Mon Jan 28, 2013 8:38 pm
I'll definitely be looking out for this. Do you know by about when it'll be finished?
Posts: 12
Joined: Fri Jan 25, 2013 7:57 pm
Location: Brooklyn, New York
by marqs » Mon Jan 28, 2013 11:43 pm
HonkeyKong wrote:I've been working on getting this emulator built and running, but I keep running into this roadblock during the linking stage:

Code: Select all
g++ main/main.o main/romcache.o main/util.o main/cheat.o main/config.o main/adler32.o main/md5.o main/plugin.o main/rom.o main/savestates.o main/zip/ioapi.o main/zip/unzip.o main/bzip2/bzlib.o main/bzip2/crctable.o main/bzip2/decompress.o main/bzip2/compress.o main/bzip2/randtable.o main/bzip2/huffman.o main/bzip2/blocksort.o main/lzma/buffer.o main/lzma/io.o main/lzma/main.o main/7zip/7zAlloc.o main/7zip/7zBuffer.o main/7zip/7zCrc.o main/7zip/7zDecode.o main/7zip/7zExtract.o main/7zip/7zHeader.o main/7zip/7zIn.o main/7zip/7zItem.o main/7zip/7zMain.o main/7zip/LzmaDecode.o main/7zip/BranchX86.o main/7zip/BranchX86_2.o memory/dma.o memory/flashram.o memory/memory.o memory/pif.o memory/tlb.o r4300/r4300.o r4300/bc.o r4300/compare_core.o r4300/cop0.o r4300/cop1.o r4300/cop1_d.o r4300/cop1_l.o r4300/cop1_s.o r4300/cop1_w.o r4300/exception.o r4300/interupt.o r4300/profile.o r4300/pure_interp.o r4300/recomp.o r4300/special.o r4300/regimm.o r4300/tlb.o r4300/empty_dynarec.o r4300/new_dynarec/new_dynarec.o r4300/new_dynarec/linkage_arm.o opengl/OGLFT.o opengl/osd.o opengl/screenshot.o main/translate.o -Wl,-export-dynamic -lz -lm -lpng -lfreetype -ldl -L/usr/lib/arm-linux-gnueabihf -lSDL -L/usr/X11R6/lib -lGL -lGLU -o mupen64plus
/usr/bin/ld: error: mupen64plus uses VFP register arguments, r4300/new_dynarec/linkage_arm.o does not
/usr/bin/ld: failed to merge target specific data of file r4300/new_dynarec/linkage_arm.o
collect2: ld returned 1 exit status
make: *** [mupen64plus] Error 1


Does anyone know of a way to fix this? I've found this problem when building a lot of software, but no way around it.

Which version (maemo / original) did you use? I managed to compile the 1.99.5 bundle for Pi some time ago with a couple of Makefile modifications. However, to make it usable, one would have to create a new gles plugin or wrap gles2n64 to mupen64plus plugin architecture.

I got it running with dummy video and sdl audio plugins (without any sound - perhaps some issue with OSS?), but haven't had much time to look at it properly.
Posts: 126
Joined: Sat Jun 09, 2012 11:34 am
by HonkeyKong » Tue Jan 29, 2013 12:56 am
marqs wrote:Which version (maemo / original) did you use? I managed to compile the 1.99.5 bundle for Pi some time ago with a couple of Makefile modifications. However, to make it usable, one would have to create a new gles plugin or wrap gles2n64 to mupen64plus plugin architecture.

I got it running with dummy video and sdl audio plugins (without any sound - perhaps some issue with OSS?), but haven't had much time to look at it properly.


I'm using the maemo version. I couldn't find any other ones. If you could point me toward the original version, I would like to play around with getting it running. I was planning on trying to rewrite the ARMv7 ASM in GLES2N64 to work with ARMv6.
User avatar
Posts: 27
Joined: Fri Jan 11, 2013 3:25 pm
Location: Kansas, USA