What's new

Mupen64 0.5 source code

Hacktarux

Emulator Developer
Moderator
Here, you can download the source code of mupen64 0.4 and all the plugins included in its binary package. Many plugins source code have been integrated directly into mupen64's source code. It should be easier for users who want to compile everything.

The core source code:
http://mupen64.emulation64.com/files/0.5/mupen64_src-0.5.tar.bz2

Gfx plugins:
rice's video plugin 6.1.0 (binary only until rice wants to release source code):
http://mupen64.emulation64.com/files/0.5/RiceVideoBinaries-6.1.0.tar.bz2
Glide64 0.7 SP8:
http://mupen64.emulation64.com/files/0.5/glide64-0.7.SP8.tar.bz2
TR64 0.7.8 (with GTK2 support):
http://mupen64.emulation64.com/files/0.5/tr64_ogl_gtk2-0.7.8.tar.bz2
 

aminalshmu

linux gaming enthusiast
thank you! the plugin source integration is a wonderful time saver. all of your hard work is greatly appreciated. thanks again, hacktarux.
 

ciruZ

New member
Small patch for the Makefile to be able to clean properly, even if not everything is already built yet:
Code:
--- Makefile.old        2005-08-29 17:31:11.000000000 +0200
+++ Makefile    2005-08-29 17:30:53.000000000 +0200
@@ -405,7 +405,7 @@
        
 clean:
        find . -name '*.o' -print0 | xargs -0r rm -f
-       rm mupen64 mupen64_nogui mupen64_dbg plugins/mupen64_input.so blight_input/arial.ttf.c blight_input/ttftoh plugins/blight_input.so plugins/mupen64_hle_rsp_azimer.so plugins/dummyaudio.so plugins/mupen64_audio.so plugins/jttl_audio.so plugins/mupen64_soft_gfx.so plugins/glN64.so
+       rm -f mupen64 mupen64_nogui mupen64_dbg plugins/mupen64_input.so blight_input/arial.ttf.c blight_input/ttftoh plugins/blight_input.so plugins/mupen64_hle_rsp_azimer.so plugins/dummyaudio.so plugins/mupen64_audio.so plugins/jttl_audio.so plugins/mupen64_soft_gfx.so plugins/glN64.so
 
 clean_o:
        find . -name '*.o' -print0 | xargs -0r rm -f

// Edit:
Just another patch, this time for main/main.c. This way it's able to compile it without errors:
Code:
--- main/main.c.old     2005-08-29 17:38:55.000000000 +0200
+++ main/main.c 2005-08-29 17:39:15.000000000 +0200
@@ -37,6 +37,7 @@
 
 #include <stdlib.h>
 #include <unistd.h>
+#include <dirent.h>
 
 #include "main.h"
 #include "guifuncs.h"

// Edit 2:
HTML was enabled and therefore there were no < and >.
 
Last edited:
OP
Hacktarux

Hacktarux

Emulator Developer
Moderator
GameboyHippo said:
PWNTASTIC!!! I want to add a feature to the .5 code. How do I submit code changes?

Just submit a patch like ciruz did or attach it to your post if it's bigger :)
 

ciruZ

New member
Another interesting fact: Tried to build it for multiuser, the binary only gives a "Resource temporary unaviable" then. Don't know why and I have no interest to investigate further into this because I don't needed (just wanted to test it).
 

GameboyHippo

New member
When I try to build it for multiuser, it compiles. But when I run it, it segfaults. Also it does not build the guiless version when compiling for multiuser.
 
OP
Hacktarux

Hacktarux

Emulator Developer
Moderator
Sorry for that, to fix the nogui version just add those two lines in main/main.c :

Code:
#include <dirent.h>
#include <sys/stat.h>

Concerning the segfault... of course you have done a "make install" as root after compilation, you have checked that you have some plugins in PREFIX/share/mupen64/plugins/ ?
 
Last edited:

smcd

Active member
Can't see the needed #include files
emutalk likes to eat things between '<' and '>' maybe if you put it in [ code ] and [ / code ] tags it'll show? Or otherwise you can just use "file.h"
 

ciruZ

New member
Yeah, it's more or less a bug. HTML is enabled (what shouldn't be, I guess, since XSS would be possible). Just write &lt; and &gt; instead.
 
OP
Hacktarux

Hacktarux

Emulator Developer
Moderator
yup, mupen64 will crash if it's configured for one user and you do a "make install"...

i didn't remember that the mupen64 sound plugin was using a config file and forgot to handle the multiuser case.... i'll have to change that
 

loserMcloser

New member
Hacktarux said:
Concerning the segfault... of course you have done a "make install" as root after compilation, you have checked that you have some plugins in PREFIX/share/mupen64/plugins/ ?

Sorry to nitpick, but it should only take a few extra lines to output "No plugins found" and exit cleanly instead of segfaulting...?

Also, note that line 297 of main.c

Code:
if(strcmp(entry->d_name + strlen(entry->d_name) - 3, ".so"))

implicitly assumes that strlen(entry->d_name) is at least 3 -- you're going to be out of bounds if it's only 1 or 2.
 

smcd

Active member
loserMcloser said:
Sorry to nitpick, but it should only take a few extra lines to output "No plugins found" and exit cleanly instead of segfaulting...?

Also, note that line 297 of main.c

Code:
if(strcmp(entry->d_name + strlen(entry->d_name) - 3, ".so"))

implicitly assumes that strlen(entry->d_name) is at least 3 -- you're going to be out of bounds if it's only 1 or 2.

You could use strrchr perhaps to find the first occurence of the '.' from the end of the C-string to compare against?
 
OP
Hacktarux

Hacktarux

Emulator Developer
Moderator
don't worry sethmcdoogle, it's easy to fix, it's just that i've never looked at that and didn't see there was a potential problem there....

anyway, i'll fix it next time i'll work on mupen64
 

kulminaator

New member
cvs or subversion for the source ?

Is there any chance that mupen's source will move to CVS or SVN ?

Patching the original source from the forum definitely is fun
but quite time consuming. Also the subversion/cvs would allow
to make checkouts from historic revisions which arent always
even packaged as a source release.

btw. great job with the emulator, runs just fine under linux
and there almost no bugs with the rice video plugin.

:mupen64: :mupen64: :mupen64:
 

braddabug

New member
I got it to compile on Debian. I was getting an error inside SDL_ttf.c. It looks like that's an old version of the SDL_ttf files. I tried to replace them with a newer version, but the SDL site is down today. Intead I just replaced line 281 (or somewhere in there. it's just above the line that says "stream->read = RWread") with this:

stream->memory = NULL;

I got it to build and now it's running Ocarina of Time about as well as I could ask an emulator to.

BTW, I second the Subversion repo idea.
 

CyZyco

New member
rdram

Hi,

I was studding your code and I have anuy doubts.

In n64info, rdram's range is

0x0000 0000 to 0x001F FFFF RDRAM range 0
0x0020 0000 to 0x003F FFFF RDRAM range 1

so, its has 0x400000 bytes.

In memory.c is
unsigned long rdram[0x800000/4];

has it been superdimensioned?
 

Top