<< Newer | Article #85 | Older >> |
MAME 0.94
Looks like Haze took the opportunity to make this the official 0.94 release. Yes, the Y board driver is faster than I said it would be. This is for two reasons. The first is simple: I had the CPU interleaving turned up higher than was necessary, and this was slowing things down quite a bit.
The second reason is quite interesting. The rotation RAM contains the rotation parameters, of course, but those occupy only 24 bytes of the 2k allotted to the rotation. Looking at the rest of the data I noticed that it appeared to specify a number of start/end pairs that were in the same coordinate range as the sprites. Furthermore, I noticed that these values seemed to change as the rotation changed. Strange.
Then it hit me: this was a clipping list, with one entry for each pair of scanlines in the unrotated sprite buffer. Looking back at OG's code, he had supposed this too. But it makes total sense. The games would compute the rotation, and then fill in this list of coordinates that explained where the beginning and end of the clipping region was for each scanline of the sprite buffer. Then, when the sprites were rendered, they could be clipped to the area specified. This would save the hardware a lot of rendering time, since it wouldn't be drawing sprite data that wasn't visible on the screen.
So I implemented this, and just like the hardware, it speeds things up quite a bit. My laptop can run the Y board games at 100% pretty much across the board now.
One side note: it appears that Galaxy Force 2 was a little sloppy about the clipping on the top and bottom. This was likely lost in the overscan on the real game and probably saved a tiny bit of extra rendering power for those really insanely complex scenes it likes to render!