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 > weird thingy.

#4133 - Daikath - Thu Mar 20, 2003 11:08 am

When I load my code I see this weird little spot in the right upper part in the screen.

http://212.187.35.37/jordi/springy.jpg

Then I looked in the last part of my tile checker in VisualBoyAdvance and then instead of the normal black I see this

16 colours: http://212.187.35.37/jordi/tiles.jpg

256 colours: http://212.187.35.37/jordi/tiles1.jpg

and this is my source code : http://212.187.35.37/jordi/springy.c (if you want it ill post it here with code tags but its a bit long to just put on the forum).
_________________
?There are no stupid questions but there are a LOT of inquisitive idiots.?

#4135 - Daikath - Thu Mar 20, 2003 1:06 pm

Its solved

this:
Code:
void CopyOAM()
{
u16 loop;
u16* temp;
temp = (u16*)Sprites;
for(loop = 0; loop < 128; loop++)
{
OAMData[loop] = temp[loop];
}
}


should have been
Code:
void CopyOAM()
{
u16 loop;
u16* temp;
temp = (u16*)Sprites;
for(loop = 0; loop < 512; loop++)
{
OAMData[loop] = temp[loop];
}
}

_________________
?There are no stupid questions but there are a LOT of inquisitive idiots.?

#4140 - NEiM0D - Thu Mar 20, 2003 5:38 pm

Odd.. you seem to be writing a OAMEntry( 4 16bit values) structure to one 16bit value.
Either you make OAMData=(*OAMEntry)0x07000000;
or you make temp[] a 16bit.

The choice is yours.

And I get that spot error I mostly when I forgot to set the sprites Y value off screen.

So for each sprite, initialise the Y coordinate to 160.

Cheers.