Tuesday, December 27, 2011

How to NOT make an SNES game slowdown.

It has been a long time since I written anything in this blog. In fact I wanted to post this back then, but since the world of video game forums were so uncivilized and barbaric, I knew that there would be lots of trolling in the comments section.

Thankfully internet forums seem to have matured a lot since when I first started going online. Especially when it comes to the SNES homebrew/dev scene. So I feel confident this wouldn't cause a big fuss as it would've back then.

Okay, here is my argument. Both the SNES and the Genesis are equally as fast. The 65816 can do twice as much work per cycle as the 68000. The reason why SNES games tend to slowdown more is because people are programming it wrong.

See, the 65816 has something called a Direct Page register. It is one of the most beneficial features of the 65816, but nobody seems to use it. Unlike most CPUs which have static local memory, where data is copied to and from to be used efficiently, the 65816 has moveable local memory where the location of the local memory can be changed using the DP regsiter.

If you have 10 objects on the screen with a specific amount of memory devoted to each object, for the 68000, it has to copy everything into it's internal registers to use, and store everything back into ram when the it is done processing the object. For the 65816, all it needs to do is change the DP location from one object to another.

For whatever reason, programmers just didn't do that. They just left the DP at $0000 through the entire game, and just copied memory to and from it, instead of doing it the more effective way.

No comments:

Post a Comment