MESS News - N64 emulation!
MooglyGuy has posted news and screenshots regarding N64 emulation and rendering working in MESS!
In renderer news, it would appear that I’ve found the source of the cracks between triangles in MESS.
Anyone who has attempted to run Mario Kart 64 in MESS has noticed the seams that are present in almost every scene:



The reason for this behavior is that the software rasterizer originally written by Ville Linde (currently MIA) does not handle fractional coordinates.
At all.
The end result of this is that triangles have their Y coordinates “snapped” to a full-pixel boundary, while the X coordinates remain the same, resulting in uneven boundaries between triangles that would otherwise be aligned.
This can only happen because of the funky way in which the N64 stores its coordinates. As opposed to virtually any rational system such as the Playstation or any modern 3D hardware, the N64 specifies its vertices in low edge / middle edge / high edge / slope form. This was clearly done to save processing time, as the edge-walking hardware on the RDP can take in the data virtually unmodified, but it can easily cause rasterization glitches if a person isn’t careful.
The RDP’s edge-walking hardware very likely operates in the following sequence:
- Load High-X and Middle-X into XLeft and XRight
- Load High-Slope and Middle-Slope into StepLeft and StepRight
- Load High-Y into Y index
- Rasterize 0.25-pixel scanline from XLeft to XRight
- Add 0.25*StepLeft to XLeft
- Add 0.25*StepRight to XEnd
- Increment Y index by 0.25
- If Y is less than Middle-Y, go to Step 4
- Load Low-X into XRight
- Load Low-Slope into StepRight
- Rasterize 0.25-pixel scanline from XLeft to XRight
- Add 0.25*StepLeft to XLeft
- Add 0.25*StepRight to XEnd
- Increment Y index by 0.25
- If Y is less than Low-Y, go to Step 11
- Done
It’s a fairly long list of steps, but it’s also fairly simple. Pretty much any software rasterizer functions that way, it usually translates X/Y triplets into that format.
With a quick-and-dirty fix that is going to need some massaging to get into a state that can be submitted, we now get these pretty screenshots:













Pretty, huh?
If you look closely, you’ll notice that alpha-blended triangles are overly “bold”. This is an outgrowth of the fact that each scanline is redrawn up to four times. A proper fix for this will be to emulate coverage, which is a bit of a daunting task. Wish me luck.


One word - greatness!
I agree too, that this is pure greatness.
The gaming emulation scene in the Windows front is truly astounding, when compared to other OS systems who seem to think that “We don’t need any stinking games!”.
This is why Microsoft Windows will be my OS of choice.