Make "plasma_tunnel.elf" work.
Posted on 2005-10-21 00:00:00
This demo simulates some fancy tunnel with pretty colors. It's a port of an existing demo that's available on www.sulaco.co.za. Here's what this demo should be displaying:


Screenshot #000037
Win32 version of this demo running.


First time I executed it, it was doing some wierd stuff with the SIF routines: Sending bad commands (0x08000000), accessing bad registers (0x08000001). Most of the command and register IDs that should have thier most significant byte set at 0x80, had it set at 0x08. I tried to make some changes to the SIF emulation code to be able to process those commands, but another wierd thing was occuring... The structure that needs to be filled for the 0x80000002 (INIT) command wasn't filled properly. Instead of using SW to write the members, it is using SB...

Looking through the program disassembly, I didn't find other stuff using the SIF except the main function calling the RPC initialization routine. The initialization code doesn't make sense at all, and I'm assuming it is broken for some reason. So I'm gonna keep the thing I've changed to the SIF register handling for now, and if I encounter another program that use odd values like those, I'll reconsider.

After fixing the SIF stuff, an unhandled instruction occured (BLTZL). I'll need to implement this one tomorrow. But even if this instruction wasn't there, it was able to execute normally.

It needed the "NEVER" alpha testing condition, so I added this one. I also fixed a small bug with the TEX1 register decoding.

Now though, it's doing stuff that I'm not supporting for the moment. It uses the PRMODE / PRMODECONT registers. PRMODECONT controls from where the primitive properties (texture mapping, alpha blending, etc.) are to be taken (either from the PRMODE register or from the PRIM register) and PRMODE contains the value of those properties. It also sets the PRIM register only once and feeds tons of vertices to the GS to generate primitives, something that I haven't implemented yet.

Those aren't going to be hard to do, so I should have them done tomorrow.