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.

DS development > Text bg scroll?

#74653 - Webez - Mon Mar 06, 2006 8:29 pm

Hi.

I have set a text background in mode 0

Code:
  vramSetBankC(VRAM_C_SUB_BG);
 
  videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE| DISPLAY_BG1_ACTIVE);

SUB_BG1_CR = BG_256_COLOR | BG_TILE_BASE(char_base) | BG_MAP_BASE(screen_base);



And I wanted to test scrolling so I have put SUB_BG1_X0++ into a vblank function. In dualis it works ok but on desmume and hardware it doesn't scroll. Am I doing something wrong?

Other strange thing that happens is that when I set BG_WRAP_ON or GL_TEXTURE_WRAP_S/T (this with textures of course) then garbage appears in the tile image.

#74760 - Webez - Tue Mar 07, 2006 1:04 pm

I have printed SUB_BG1_X0 and only dualis seems to be update it. How is this possible?

#74772 - FluBBa - Tue Mar 07, 2006 4:02 pm

Can you actually read from the hardware registers?
_________________
I probably suck, my not is a programmer.

#74774 - Webez - Tue Mar 07, 2006 4:16 pm

Dualis can but it is a write only register isn't it?

Is it necessary something more to scroll a text background? I have tried the same with the hello world example and it didn't scroll either

#74784 - Sausage Boy - Tue Mar 07, 2006 5:54 pm

uhm, have you tried SUB_BG1_X0=44; or something? I'm pretty sure the problem is that you can't read the register, so ++ won't work.
_________________
"no offense, but this is the gayest game ever"

#74786 - Webez - Tue Mar 07, 2006 6:12 pm

So simple that I feel stupid. I also tried SUB_BG1_X0+=1 but I didnt thought it was trying to read the register. Now I see that += and ++ need to read it. Really stupid.

Thanks a lot!!

#74789 - Sausage Boy - Tue Mar 07, 2006 6:46 pm

No problem :D
_________________
"no offense, but this is the gayest game ever"