Page 1 of 1

Tiles displaced vertically

Posted: Mon Nov 23, 2009 8:22 am
by mic_
I'm having a weird problem where tiles in certain columns are drawn 10-15 tile rows below where they should be. I don't have the ROM on this computer so I don't have an actual screenshot, but I made a mockup in paint to illustrate what I'm talking about:

Image

I'm using mode 2 and draw on BG0. I tried displaying a picture across the entire screen and it worked fine, but when I try to draw text on individual rows this keep happening. It doesn't matter if I copy the tile data in a loop or using DMA. The setup code is taken from the SNES Programming wiki, and it should reset the scrolling regs (like I said, I've filled the entire BG with a picture using the same code and there weren't any problems then).

Have any of you seen this or have a hunch about what the problem might be?

Posted: Mon Nov 23, 2009 8:30 am
by neviksti
Mode 2 has an "offset per tile" ability.
http://www.neviksti.com/wiki/Hardware_Registers#Mode_2

That's the only thing I know of that can shift things vertically like that.

Posted: Mon Nov 23, 2009 8:38 am
by mic_
Ah, how silly of me to just pick a mode with 16-color BGs at random. I guess I'll use mode 1 or mode 3 instead.