Wednesday, September 9, 2009

Rotating 2 Backgrounds at One Time

Most people don't know this but you can actually rotate 2 backgrounds at one time on the Snes. How? It's really simple. There is a Mode named Mode-2; it has 2 backgrounds with 16 colors per tile. However instead of all the tiles being scrolled together, each vertical column is scrolled seperately. The offsets of the tiles for bg1 are stored in the bg3 tile map, on the 2nd row of tiles with a byte value of #$20 stored inbetween each offset. (I don't know why it is this way)

If offset the first collumn by zero; second by one, third by two, etc, the screen looks screw like a parallelegram. Then you can use the H-DMA to controll the horizontal bg scroll and decrement it every 8 lines, and it appears as if the screen was rotated 30 degrees. Then you can do it with every other tile instead, and decrement the horizontal bg scroll every 16 lines instead. Now it looks like it was scrolled 15 degrees.

I have a demo to show you, but I don't think this website has anyway of uploading it.

No comments:

Post a Comment