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 > Howto check for DS Lite

#145353 - AshaiRey - Wed Nov 14, 2007 12:01 pm

Is there a simple way to check if the DS is a DSLite or and older version that doesn't allow setting brightness?

I just want ot prevent that setting brightness results in a system hang on a older DS.

Ps, i searched the forum but didn't found a simple solution.
_________________
My personal ranting at blog.zoelen.net

#145357 - Mighty Max - Wed Nov 14, 2007 12:28 pm

You can test for the newer power management chip by testing if Bit(1) of Register0 can be set to 1 (mute sound) - dont forget to clear that bit again. (see http://nocash.emubase.de/gbatek.htm#dspowermanagement )
_________________
GBAMP Multiboot

#145360 - AshaiRey - Wed Nov 14, 2007 1:02 pm

@ Mighty Max

Thanks, i've found the description you mentioned and that seems what i am looking for however i have not the slightest idea how to read that bit.
_________________
My personal ranting at blog.zoelen.net

#145361 - Mighty Max - Wed Nov 14, 2007 1:10 pm

First off: it is only accessible on the arm7.

Check libnds sources ( http://devkitpro.cvs.sourceforge.net/devkitpro/libnds/source/arm7/spi.c?view=markup ) to take a look on how to read/write the power management register, or simply use the libnds provided function ;)
_________________
GBAMP Multiboot

#145402 - Cydrak - Wed Nov 14, 2007 10:42 pm

Another option is checking bit 6 of reg4. Lites have this set to 1. On the Phat it reads 0, apparently due to mirroring. (Caveat, I don't have a Phat myself...)

Also, you'll wanna disable interrupts during PM or other spi access, as per the warning in serial.h.

#145417 - HyperHacker - Thu Nov 15, 2007 2:49 am

Cydrak wrote:
Another option is checking bit 6 of reg4. Lites have this set to 1. On the Phat it reads 0, apparently due to mirroring. (Caveat, I don't have a Phat myself...)
Works for me.
_________________
I'm a PSP hacker now, but I still <3 DS.