PDA

View Full Version : Mupen64 0.5 source code



Hacktarux
August 26th, 2005, 23:34
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
August 28th, 2005, 06:16
thank you! the plugin source integration is a wonderful time saver. all of your hard work is greatly appreciated. thanks again, hacktarux.

GameboyHippo
August 29th, 2005, 07:24
PWNTASTIC!!! I want to add a feature to the .5 code. How do I submit code changes?

ciruZ
August 29th, 2005, 16:35
Small patch for the Makefile to be able to clean properly, even if not everything is already built yet:

--- 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:

--- 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 >.

Hacktarux
August 29th, 2005, 16:47
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
August 29th, 2005, 16:52
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
August 29th, 2005, 22:25
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.

Hacktarux
August 29th, 2005, 22:57
Sorry for that, to fix the nogui version just add those two lines in main/main.c :



#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/ ?

smcd
August 29th, 2005, 23:08
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
August 30th, 2005, 18:11
Yeah, it's more or less a bug. HTML is enabled (what shouldn't be, I guess, since XSS would be possible). Just write &amp;lt; and &amp;gt; instead.

beniro
September 8th, 2005, 16:16
I worked to build this on Arch Linux. The PKGBUILD is at the link below...but why I'm really posting this is that there's a patch there that may help some people resolve some issues. The patch isn't written by me.

http://bbs.archlinux.org/viewtopic.php?t=15016&start=15

Hacktarux
September 8th, 2005, 19:25
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
January 8th, 2006, 07:31
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



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
January 9th, 2006, 02:14
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



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?

Hacktarux
January 9th, 2006, 18:46
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
January 12th, 2006, 09:31
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:

tpower01
November 28th, 2006, 03:51
Okay...so I'm new to these forums, and linux, and emulators. How do I get help?

GarulfoLinux
December 10th, 2006, 19:50
Impossible compilation under Ubuntu Edgy :( .

braddabug
December 24th, 2006, 20:19
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
February 7th, 2007, 17:42
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?

Viper187666
April 16th, 2007, 00:40
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?

You forgot about the expansion pack, which adds another 4MB for certain games. That's 8MB total, divide by 4 to store in a long array.


Anyone able to mod the Windows source for breakpoints on read/write/execute? I don't need a full blown debugger or anything, just breakpoints.

Sri Narayan
April 16th, 2007, 21:15
Just want to add a patch for freebsd. compile it with gmake not make!!

GarulfoLinux
April 24th, 2007, 23:47
Just want to add a patch for freebsd. compile it with gmake not make!!

Thank you very much for the patch ! :)

CyZyco
June 7th, 2007, 01:06
You forgot about the expansion pack, which adds another 4MB for certain games. That's 8MB total, divide by 4 to store in a long array.


Anyone able to mod the Windows source for breakpoints on read/write/execute? I don't need a full blown debugger or anything, just breakpoints.

Ok.... I'm learning yet :). I got your code and change almost all to learn and rebuild in using OO. My idea is port it to java or python.

CyZyco
November 14th, 2007, 19:54
Can anybody explain me what means the SPECIAL_INT Interrupt?
The interrupt systems seems a simulator event list but I don' t understood.
I change the code to not use malloc to each new interrupt, I believe that increases 1 FPS :).

DarkJezter
January 2nd, 2008, 08:52
Hey all,

In my struggle to get mupen64 up and running with mythgame, I encountered an odd bug where mupen64_nogui refuses to load the plugins specified in either the config file, or from the command line args. Suffice it to say, if I'm running the emulator from mythtv, manually selecting the plugins with interactive mode is hardly an option.

The patch for it is really simple, edit ./mupen64_src-0.5/main/main.c line 232 from:

char plugins[100][100], s[20];

to:

char plugins[101][100], s[20];


Here's the patch file:


--- main.c.old 2008-01-02 00:56:16.000000000 -0700
+++ main.c 2008-01-02 00:32:27.000000000 -0700
@@ -229,7 +229,7 @@
int main (int argc, char *argv[])
{
char c;
- char plugins[100][100], s[20];
+ char plugins[101][100], s[20];
char romfile[PATH_MAX];
int old_i, i, i1, i2, i3, i4;
int p, p_fullscreen = 0, p_emumode = 0, p_gfx = 0, p_audio = 0, p_input = 0, p_rsp = 0, p_help = 0, p_error = 0;


P.S. Is this project at all active anymore? Bugs like this lead me to believe this project could do well with a live repository like CVS or SVN, and perhaps a new release including the patches already brought forward by other members of this forum.

Ciao

Richard42
January 2nd, 2008, 13:47
P.S. Is this project at all active anymore? Bugs like this lead me to believe this project could do well with a live repository like CVS or SVN, and perhaps a new release including the patches already brought forward by other members of this forum.

Hacktarux hasn't released anything since 2005 so a few months ago I made a branch called mupen64-amd64 and started working on it. I've fixed the bug that you found and several others in the _nogui build. I have an SVN repository set up for this at:

svn://fascination.homelinux.net:7684/mupen64plus/trunk/

The svn login is 'mupen64', and the password is 'Dyson5632-kart'. This account has read-only access to the project. For any developers interested in joining us on this project, drop me a PM and I can set you up with an account with read/write access.

Additionally, I have made 2 source and binary releases of this project, posted here on this forum. It's called mupen64-amd64 because I ported it to build and run natively on 64-bit machines, but it still runs on 32-bit machines as well.

Edit: reflect new project name so people don't keep getting the old versions

Viper187666
September 5th, 2008, 14:39
I'm still looking for the 0.5.1 source from 2005. Why does 0.5.0 seem to be the last thing posted here?

Also, does anyone know how to get read/write breakpoints to work properly? I tried adding a function call to the SB/SH/SW functions in the pure interpreter file, which sends the interp_addr and address variables to check the address being written and output the current PC. Problem is, the inter_addr it outputs is like 10 instructions off.

Amaroq
January 22nd, 2009, 12:22
Configure won't work for some reason.


./configure
Found a working C compiler (gcc).
Checking SDL...
./config.temp: 3: Syntax error: "(" unexpected
*** Couldn't find a working SDL library!


I'm trying to compile 0.5 (from the link at the beginning of this thread) on Ubuntu 8.10, amd64.

EDIT: Never mind, just found about mupen plus. xD

Kreationz
February 19th, 2011, 03:44
Is there a place to find older versions of the source?

MasterPhW
February 19th, 2011, 04:47
Is there a place to find older versions of the source?
There is no links for it, but I tried some combinations of former versions and this one was the only one still working.
http://mupen64.emulation64.com/files/0.4/mupen64_src-0.4.tar.bz2
Sorry!