What's new

Progress on amd64 branch

Richard42

Emulator Developer
I've committed a few changes/fixes to the SVN repository. I fixed the printout of the plugins selected, and did some work on the plugin selection code. I changed the name of the #define in the config.h file and added some comments and removed a few small bugs from the code in main.c and gtk_main.c. I would still like to refactor it some more to be more user friendly.

I learned how the config/makefile setup for mupen64 actually works in Linux; I don't think it's documented anywhere and it was very confusing for me. I didn't really catch all of the details until I had gone through the code closely. When you run the configure program, it asks you if you want to "configure mupen64 to run in a user directory". If you answer 'yes' to this, then the emulator will be built so that it will look for a mupen64.conf file and 'plugins' folder in the same folder as the executable. However, if you answer 'no' to this question, it will build the emulator differently. In this case you have to run 'make install' and it will put all of the binaries and config files in a place like '/usr/local/mupen64'. And when the emulator runs, it will search for the config files in a hidden folder '.mupen64' off of your home directory. If it doesn't find the config files in your home, it will copy them from the /usr/local/... folder and make symbolic links to the libraries, then run out of your home directory. I'm sure this will be useful to somebody. :)

I also found the texture bug in the 64-bit build of the glN64 plugin. There is some sort of texture caching mechanism in Textures.cpp; I assume that it's to save the overhead of color conversion and opengl memory allocation; probably textures are reused very often. There's a loop which searches the list of cached textures to see if one matches the texture which is currently being loaded by the RDP code. For some reason the CRC check in the test statement was commented out, so the routine returned the first texture which matched the parameters for resolution, format, etc. That's why it looked like "PPPPP" - all of the letters had the same size and since the letter P was first, and thus at the top of the stack, it was always returned. Now the games look great! I played through a few races and mario 64 levels tonight.
 

Surkow

Member
Maybe be a weird question, but are there fixes that could be backported to the 32 bits version? It seems like you guys are also cleaning up the code besides just porting it to amd64.
 
OP
R

Richard42

Emulator Developer
Maybe be a weird question, but are there fixes that could be backported to the 32 bits version? It seems like you guys are also cleaning up the code besides just porting it to amd64.

That's actually a very valid question. I'm going to totally re-work the plugin loading code in main.c because right now it's hosed. Last night I found and fixed a bug which made it impossible to correctly load the gfx plugin if you configure the project to run in a user directory. Anyone else notice that this has never worked? After the bug fix it's actually possible to run from your build directory without copying the plugins to /home/user/.mupen64/plugins or /usr/local/... That's a nice fix to have.

Regarding maintenance of the 32-bit build, I see 2 ways that we can handle this. If someone wishes to maintain an official 32-bit build and merge my fixes into his repository, we can work together that way. I have commit email notification set up on my SVN server. I can add anyone who wishes to this service, and they will automatically receive diffs for every change committed to my SVN.

Alternatively, you could always do 32-bit builds directly from my repository. I'm pretty sure that all of the changes I made to support amd64 do not break compatibility with 32-bit systems. The only caveat here is that I don't want to be responsible for regression testing against 32-bit systems, because the only machine I have that's not 64-bits is an old P3 laptop that I rarely use. If someone would like to volunteer for testing and validation to make sure that I don't break the build for 32-bit systems, I'm sure a lot of folks here would appreciate it.
 

Danny

Programmer | Moderator
If someone wishes to maintain an official 32-bit build and merge my fixes into his repository, we can work together that way. I have commit email notification set up on my SVN server. I can add anyone who wishes to this service, and they will automatically receive diffs for every change committed to my SVN.

I would be more than wiling.
 

Surkow

Member
...

Alternatively, you could always do 32-bit builds directly from my repository. I'm pretty sure that all of the changes I made to support amd64 do not break compatibility with 32-bit systems. The only caveat here is that I don't want to be responsible for regression testing against 32-bit systems, because the only machine I have that's not 64-bits is an old P3 laptop that I rarely use. If someone would like to volunteer for testing and validation to make sure that I don't break the build for 32-bit systems, I'm sure a lot of folks here would appreciate it.

You can also install a 32bits operating system on a 64bit proc (what I normally do). So even without 32bits processor I'm sure I could help out with testing. Just don't expect me to be able to help with programming. :p
 

nmn

Mupen64Plus Dev.
My original intention was to have it be portable to both 32-bit and 64-bit intel processors. Infact, my original port DID compile to 32-bit properly. If we port the recompiler, perhaps we should have a seperate folder for the 64-bit version so that we can make it only be used when its compiled in 64-bit. Infact, I was kinda hoping once i got the issues out of the way i could help add features to it.

Anyways... Excellent progress. I've gotten a new system, openSUSE 10.3, and i've gotten various things to compile. When i get home today i'll try to start working on various improvements. Keep up the great work man.

edit: Oh yeah, i figured it was the texture caching. For some reason i managed to miss any bad code! But now looking back i actually remember looking at the commented out CRC checking, and i was thinking "What the hell? oh well, must be right" because my 32-bit builds worked (But why? because for some reason i mixed up the official build with my 32-bit one. I have absolutely no idea how that happened.)

Well, now i feel stupid :p
 
Last edited:
OP
R

Richard42

Emulator Developer
You can also install a 32bits operating system on a 64bit proc (what I normally do). So even without 32bits processor I'm sure I could help out with testing. Just don't expect me to be able to help with programming. :p

I'm thinking of reworking the config/makefiles to support both 32-bit and 64-bit builds on 64-bit machines, as well as 32-bit builds on 32-bit machines.

Does anyone know if RiceVideo 6.1.0 works without artifacts on Windows for Mario Kart?? Tonight I demonstrated that both 32-bit and 64-bit builds of RiceVideo show a particular artifact on Linux: it looks like on certain frames (maybe 1-2 frames in a few seconds) during gameplay, about 20%-50% of the triangles making up the track will disappear and you'll see the blue background; it flashes. If people also see this artifact on Windows, I'll start with porting all the changes in Mudlord's SVN onto my build, in hopes that it was fixed. Otherwise, if these artifacts are not present in Windows, I'll start by looking at Hacktarux's port to Linux to see if anything was broken in that process.

It seems more likely that it's a general bug in RiceVideo 6.1.0, but if anyone knows for sure that would help me out. Thanks. :)
 

mudlord

Banned
artifact on Linux: it looks like on certain frames (maybe 1-2 frames in a few seconds) during gameplay, about 20%-50% of the triangles making up the track will disappear and you'll see the blue background; it flashes. If people also see this artifact on Windows, I'll start with porting all the changes in Mudlord's SVN onto my build, in hopes that it was fixed. Otherwise, if these artifacts are not present in Windows, I'll start by looking at Hacktarux's port to Linux to see if anything was broken in that process.

This artifact also occurs in Windows OpenGL Rice builds as well. Seems to be definitely a general bug, as the Direct3D renderer does not have this issue. Same goes for Mario 64, I'm afraid.
 
OP
R

Richard42

Emulator Developer
This artifact also occurs in Windows OpenGL Rice builds as well. Seems to be definitely a general bug, as the Direct3D renderer does not have this issue. Same goes for Mario 64, I'm afraid.

Ah, thanks for the reply. I presume then that the bug is still present in 6.1.2 and porting the changes from your SVN won't fix it. :unsure: glN64 also displays correctly, without these artifacts, so it's definitely a renderer bug.
 

nmn

Mupen64Plus Dev.
Oh, hi mudlord. I guess its not fixed after all. Oh well. BTW, that plugin rocks :D

Anyways...

i'm considering a qt4 port (that would be much more windowsish) and also porting netplay to a multiplatform network library. I'm not very good in the Video Plugin department, but i'll also give porting Mudlords version of Rice Video if i find out his renderer does have this bug solved.

Also, maybe its a dumb question, but the latest versions of Rice and Mudlords Rice VIdeo have multiple OpenGL modes - Has anyone tried other modes to test the bug? I might want to consider testing all of these modes - because in everything i've tested so far, a different mode gives different output (Sometimes its a difference between an effect working badly but it is somewhat a difference)
 

Top