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 > GFX_COLOR, GFX_NORMAL + Demo

#41157 - Ethos - Tue Apr 26, 2005 12:37 am

I am noticing when I try to set my normals using glNormal, the Color is being reset to RGB 0,0,0 (Black).


Are the registers overflowing or resetting?
I can't seem to figure this one out.


Code:


#define GFX_COLOR             (*(vuint32*) 0x04000480)
#define GFX_NORMAL            (*(vuint32*) 0x04000484)

#define RGB15(r,g,b)  ((r)|((g)<<5)|((b)<<10))

void glColor3b(uint8 red, uint8 green, uint8 blue)
{
  GFX_COLOR = (vuint32)RGB15(red, green, blue);
}

void glNormal(uint32 normal)
{
  GFX_NORMAL = normal;
}


Also here is a gluSphere demo...I am still in the process of writing/optimizing the routine.

Demo[PassME Version]
Demo[ideas 1.0.0.3 Version]