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 > Sprite Wrapping problem

#45223 - cooky - Wed Jun 08, 2005 8:23 pm

Hi I'm having trouble with the wrapping on sprite graphics on the DS

The sprites wrap perfectly on the y axis but only wrap on the right on the x axis. I've lead to believe this code works for correst wrapping on the x axis but it doesn't seem to work.

Code:
oam->attribute[1] &= 0xFE00;
oam->attribute[1] |= (x & 0x01FF);


I however don't have a gba flash cart as my old one broke. So I haven't been able to test this on hardware. It may actually work but I cannot be sure. If it does that is fine.
_________________
Rolling a six is unlikely but how do you know if you have never picked up the dice.
www.ceorron.co.uk

#45225 - josath - Wed Jun 08, 2005 8:38 pm

wrapping? why not do something like

Code:

#define MAXWIDTH 128 // is this the widest sprite you can have ?

while(x > 256)
  x -= 256;
while(x < -MAXWIDTH)
  x += 256;

#45228 - Mollusk - Wed Jun 08, 2005 8:44 pm

maybe because doing &255 is much faster...

Anyway, what version of the emulators do you have ? Some were having problems with wrapping sprites... try dualis r9 and see if it's different

#45231 - cooky - Wed Jun 08, 2005 9:04 pm

No with dualis i just get white screens and very little shows up in the memory veiwers either and DSemu just puts rubbish to the screen.