What's new

Z64 - a LLE graphics plugin

ziggy

New member
Hi all,

I am pleased to release a very experimental LLE graphics plugins for N64 that I started to develop about a month ago. I've called it Z64. It is originally based on the excellent work of Ville Linde in Mame/Mess, even though there isn't much of his own code left, it was the starting point of this project without which it wouln't exist today. Also , thanks for other plugin authors that released their source code, as it provided a lot of valuable informations (in particular but not limited to : glN64, Rivevideo, Glide64)

What is it exactly : it is mainly an RDP emulator implemented in OpenGL. Contrary to usual graphics plugins, it doesn't emulate the RSP part, so it requires a functionnal RSP emulator plugin to give any results. I'm providing two solutions to emulate the RSP, one that is based on the plugin from Project64 v1.4 with a few fixes, and another one slower based again on the work of Ville Linde in Mame/Mess. The first is much faster , but still has a few problems. My suggestion is to use the first one by default, and use the second one if the game freezes or crashes.

The advantage of emulating the RDP and RSP separately is that it is more direct and thus more accurate. It is also, in a way, much simpler, because you don't have to reverse engineer the RSP ucode of each specific games. The drawback is that it's pretty CPU intensive, because the RSP is quite heavy to emulate (and this even though the RSP emulator from Project64 is very well optimized)

What it is not ? :) Well , this project at the moment doesn't aim at competing with existing mature video plugins like for example Glide64. They have years of development behind them, and as said before , also are much faster. The aim instead is rather to possibly emulate those rare games that no other plugins could emulate fully yet, because the ucode wasn't reversed engineered. And of course, for me to have fun developing it.

Instructions to use it

You need to install in your core emulator plugins directory a few files :

- z64gl.dll the RDP emulator
- z64gl.conf the configuration file
- z64-rsp.dll the slow RSP emulator
- RSPcomp-pj64.dll the much faster RSP emulator based on Project64

To select the RSP plugin, it depends on which core emulator you're using :

- with mupen64, simply select it just like you would select an audio or video plugin
- with Project64, you need to rename the plugin "RSP.dll". Don't forget to backup your original RSP.dll plugin (that is the one provided by the core emulator) before doing that Indeed, the RSP plugins I'm providing won't work with other standard HLE video plugins.

Under Linux, it's similar, but you'll need before that to compile it, just type "make" in the source directory for both Z64 and the RSP emulator.

I am not looking yet for feedbacks about emulation inacuracies. There are still many problems, and they are pretty obvious. However I'm interested in feedbacks related to compatibility with hardware as well as "success stories", that is if you find a game that is actually better emulated with Z64 than with other plugins.

Regarding hardware requirement, you'll need a graphics card with GLSL extensions as well as Framebuffer Objects extension. That means mainly a decent nVidia or ATI card. You'll also need a pretty fast CPU because of the RSP emulation part. Regarding multicore CPU, in the future I plan to emulate the RSP in a separate thread, meaning that multicore CPUs will greatly benefit from it. This is not done yet however.

Finally, it is early development, so in particular there aren't yet any configuration dialog. There is now a configuration file though.

Well, have fun :)

Below a screenshot of Goldeneye showing the sky, one effect that uses a "non standard" ucode.

EDIT : forgot to include glew32 dll that is required for z64gl.dll. Just install this dll either in your windows installation path, either in the core emulator directory (not in the plugin directory)

EDIT : release R2 that write debug messages into a file called z64log.txt, fix black border texels and possibly crash on exit

EDIT : release R3 (now R4) that should fix crash on exit in Pj64. However, you should toggle windowed mode before exiting a game, otherwise the screen resolution isn't going to be restored until you run a new ROM.

EDIT : release R5 that should fix part of the slowness issues on ATI cards

EDIT : R6 that should fix depth issue introduced in R5 . Now R7 that fixes a second depth issue.

EDIT : R8 possibly fixing another slowness issue on ATI when using certain clamping mode on non power of two sized textures.

EDIT : R9 another attempt at fixing slowness issue for ATI (based on the idea in the test tp2), seems to also speed a bit things on nVidia. Also fix black screen issue in Shadowgate

EDIT : R10 with again more ATI slowness fixes, plus a configuration file called z64gl.conf. This file should be copied into your Plugin/ directory, it allows to select screen resolution as well as other options.

EDIT : R11 with some framebuffer effects, multitexturing and screen setup fixes.

EDIT : R12 fixes in combiner/blender, 2d mapping, zbuffer for triangles in no Z mode, mapping in non perspective mode

EDIT : new version of the modified pj64 rsp plugin (R3). It fixes most differences with the z64-rsp plugin, games that now work fine with it include : Jet Force Gemini, Mario Party, Yoshi's Story , Zelda (these two had not visible problems because there was a hack in the rdp emulator), Telefoot. EDIT now R4 to get rid of a dialog box that pop up in Telefoot.

EDIT : z64 R13 with some texture formats fixes, a new option for video cards that do not support non power of two textures, the hack for the RSP plugin bug is now removed (make sure you use latest rsp plugin) EDIT now R14 to fix stupid bug in the z64-rsp plugin (some leftover debug code causing problems under windows)

EDIT : R15 more combiners improvements and fixes usage of tile #7.

EDIT : R17 now support asynchronous RDP emulation (try it preferably on dual core processors). To use it, set both "threaded" and "async" to 1 in the config file. It's a bit unstable, though once a game is booted successfully it should work well enough. Plus other various improvements.

EDIT:
Downloads:
Source code (r12 - r18) - http://adf.ly/HnLIM
Binary r12 - http://adf.ly/HnLVF
Binary r15 - http://adf.ly/HnLk0
Binary r17 - http://adf.ly/HnLrk
Binary r17(Angrylion custom build, may fix texture glitches in some games) - http://adf.ly/HnMQb
Glew32 - http://adf.ly/HnLwx
 
Last edited by a moderator:

PsyMan

Just Another Wacko ;)
Nice to see that there is still interest on N64 emulation. :)

Unfortunately I wasn't able to try this myself since I'm using Windows and the GFX plugin doesn't seem to be recognized by any of the emulators I use... PJ64 fails to load it and Mupen as well as 1964 fail to see it entirely.

The RSP plugins are both recognized by all emus but in conjunction with other GFX plugins (HLE plugins) they don't seem to work (I doubt they are even supposed to).

Edit: I just looked at the source and realized you use the glew libraries which means that I'll need the necessary dll to run it. :doh:
 
Last edited:
OP
Z

ziggy

New member
Yes, I just noticed my mistake, I've added the glew32 dll into in my original post.

I'm currently trying it under windows, it does work with Mupen64 and Project64, however there's a crash on exit with Pj64. That should be easy to fix, I'll do a new release soon.
 

PsyMan

Just Another Wacko ;)
Nice thing that you attached glew32 to your post. :)
By the way, the speeds I get here are about 2fps... is it normal to run so slow? I understand that this is LLE (and it's probably missing speed optimizations) so it's supposed to be much slower than HLE plugins but I don't know what's the target speed of the plugin...
 
OP
Z

ziggy

New member
Nice thing that you attached glew32 to your post. :)
By the way, the speeds I get here are about 2fps... is it normal to run so slow? I understand that this is LLE (and it's probably missing speed optimizations) so it's supposed to be much slower than HLE plugins but I don't know what's the target speed of the plugin...

Thanks for testing :) It should be much faster, but it also depends on your hardware of course. What CPU and graphics card are you testing with ? I suspect the problem is with GLSL (pixel shaders). When the GL hardware driver doesn't support a feature, then it fallback to CPU emulation, which is typically 100 times slower.

I'm using a nVidia 7600Gt (but I tried also on a 6800Gt and it was running fine as well), and an Athlon 64x2 5200 (2.6Ghz, but only one core used by the emulator at the moment). I get usually full speed emulation except in certain very crowded cases.
 

PsyMan

Just Another Wacko ;)
I use an ATi mobility Radeon X600 (it supports shaders v2.0) and a Pentium M 740 (32bit at 1.73GHz).
I believe that something is wrong with the shaders here...
 
OP
Z

ziggy

New member
Yes, it's most likely a shader problem. If you're ok to do more tests, I'll make a benchmark application to try to pinpoint where exactly the problem is.
 

PsyMan

Just Another Wacko ;)
Yeah, no problem. :)

My card supports up to OpenGL 2.0. When it comes to v2.1 it supports only GL_ARB_pixel_buffer_object. This of course excludes missing extensions.
 

toe_head2001

New member
Very Nice! I Love to see new things being developed.
I tried it with Mupen64 and Project64 and both crashed on game load. Maybe I did some thing wrong?

Digg it
 
Last edited:

Trotterwatch

New member
Very Nice! I Love to see new things being developed.
I tried it with Mupen64 and Project64 and both crashed on game load. Maybe I did some thing wrong?

Digg it

It's your graphics card, it doesn't support OpenGL 2.0.

////


I'm having the same issues as Psyman, using an ATI X700 graphics card, it either crashes or runs at a fraction of a frame per second.
 

mudlord

Banned
I did some testing with this sucker...

Suffice to say, it works exceedingly well....I didn't test other games though, yet...
 

smcd

Active member
I used the lle rsp and video plugin and rogue squadron shows some stuff, battle for naboo shows the initial screen (about the expansion pack) and then dies. Also, switching between games tends to crash the emulator. Nice :)
 

Iconoclast

New member
Dark Rift, LLE, full speed?

Holy fuck. Sad part is, I must miss out on it all. Don't have the required OpenGL support for those who didn't know.
 

toe_head2001

New member
It's your graphics card, it doesn't support OpenGL 2.0.

////


I'm having the same issues as Psyman, using an ATI X700 graphics card, it either crashes or runs at a fraction of a frame per second.


Yea, my video card only supports OpenGL v1.4. I think it's about time I upgraded!
 
Last edited:
OP
Z

ziggy

New member
Thanks for the feedbacks. I'll make a new release soon, my problem is that under Windows I do not have network connection at the moment so I'm doing a lot of switch back and forth between linux and windows which is pretty annoying.

About OpenGL requirement, version 1.5 should be enough. The necessary extensions are GL_ARB_fragment_program, GL_ARB_fragment_shader (so basically GLSL), GL_EXT_texture_mirror_clamp, GL_ARB_depth_texture, GL_EXT_packed_pixels, GL_EXT_framebuffer_object.

I'm going to make a debug release that dump some error messages in a file, that might help debugging for ATI card. I'm not surprised there are problems with ATI, GLSL on ATI tends to be much more tricky.

Nice screenshots Mudlord. I notice there are black borders in textures in your screenshot, the problem should be fixed already in next release, it's a problem with the texture clamping mode I was using (and for strange reasons, it doesn't behave the same under linux and windows)

EDIT : ok I made a new release called R2 in the original post .
 
Last edited:

mudlord

Banned
Nice screenshots Mudlord. I notice there are black borders in textures in your screenshot, the problem should be fixed already in next release, it's a problem with the texture clamping mode I was using (and for strange reasons, it doesn't behave the same under linux and windows)

Glad you thought so. I'm more than happy to test out the R2 release and post screens with that too :). I must say, with your plugin and modified RSP plugin, LLE runs a fair bit faster than Jabo's video/RSP set (which seems to be the method you're doing LLE with too.)

BTW, in case for the people who don't know, I'm running on a 3GHz P4 with a GeForce 6600 GT, so that might give a ballpark of what specs are needed :) (of course, the greater the specs, the faster things will be).
 
Last edited:

Top