gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Do text backgrounds always wraparound?

#4178 - Psyk - Sat Mar 22, 2003 10:33 am

I didn't think text backgrounds could wrap around but mine does. I've tried setting the wraparound bit to 0 and it still does it. So does that mean text backgrounds always wraparound or is it a glitch in the emulator im using?

#4180 - tepples - Sat Mar 22, 2003 5:15 pm

Text backgrounds always wrap. This is true on NES, Super NES, and GBA. To keep text backgrounds from wrapping, you'll need to use the window registers.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#4239 - sketcher - Tue Mar 25, 2003 7:44 am

I prevent wrapping real simply. For each bg that I don't want to wrap I just get the size of that bg in the x and y directions. Then I have a max_x_scroll/max_y_scroll.

max_x_scroll = x_dimenstion - 240;
max_y_scroll = y_dimension - 160;

when attempting to scroll the bg is capped at 0 and max_xORy_scroll
_________________
"Oh yeah, so what kind of warrior are you? A code warrior? HAHAHA!"

#4249 - TooTall - Tue Mar 25, 2003 7:15 pm

With rotation text backgrounds it appears to repeat the first tile outside of the map area instead of wraping the entire map. Is this correct, or am I seeing something else?

TT
_________________
Knowledge speaks, wisdom listens.
-Jimi Hendrix