Getting it right
Posted on 2011-03-27 21:23:08
This past month, I completed the first version of my VU microprogram debugger that I was able to use to inspect what the FFX micro-programs does.

I've been able to find some issues with the DIV pipeline that wasn't emulated properly. I fixed those problems, but it didn't really change anything. I also saw that the micro-programs were using some MAC flags to determine if a polygon is visible or not. So, I added the appropriate MAC flags generation in some specific instructions and I was able to see that the terrain was now working properly. But it also made the rendering of other objects worse (characters and chests for example). So I investigated a bit further and I realized that I wasn't setting the sign flag properly when the result was minus 0. I'm not quite sure the sign flag should be cleared even on minus zero, but it seems to be what works best. With that, the characters were working again and after fixing a depth testing issue, I was able to get these results:


Screenshot #000216 Screenshot #000217 Screenshot #000218


It's way better than before! There's no more missing polygons. But there's still a lot of problems... First, the lighting doesn't seem to be blended in properly. I know it's computed in the VU micro-program because I've seen it in the vertex color values, but somehow, it's not being blended with the textures. Some of the textures are also wrong (as seen in the first and second screen shots), but that's probably because of another bug in my texture caching routines. There's also problems with most spell effects which seem to hide everything that's on screen, but that may be related to the general lack of stability of the game. I'm quite happy of the results and I'll try to go a bit further. I think I could make the lighting work first and see if I can something about the rest after.