#85676 - HyperHacker - Thu Jun 01, 2006 7:02 pm
Since I don't have a DS Lite I know very little about its backlight, and haven't seen much documentation. I've heard the only levels it has are low, medium low, medium high and high; you can't turn the light completely off? Also how do you adjust the brightness, is it the same way as with the old DS? (The power management bits?)
_________________
I'm a PSP hacker now, but I still <3 DS.
#85740 - thundrestrike - Fri Jun 02, 2006 2:50 am
my friend got a DS Lite USA at one of those stores that broke release date... so he brought it over here and I can now answer your question!
You can not turn it completely off! strange huh? thats what I thought when I was playing with the brightness! :P
On the NDS firmware, the little light bulb in the bottom left of the screen, that is where you change brightness levels! Just keep pressing it! :D
_________________
popcorn
#85742 - HyperHacker - Fri Jun 02, 2006 3:12 am
Hm, that is odd. It's hard to see with the light off though. Which level is the same as the original's?
thundrestrike wrote: |
On the NDS firmware, the little light bulb in the bottom left of the screen, that is where you change brightness levels! Just keep pressing it! :D |
Yeah, I meant how would you do it in code? I know to turn it on and off on the original, you do some fiddling with the power management/SPI on the ARM7, but I haven't seen any mention of how it's done on Lite.
_________________
I'm a PSP hacker now, but I still <3 DS.
#85748 - swimgod - Fri Jun 02, 2006 3:58 am
i would say check moonshells code...
i believe it has a way to remember the last bright setting :P
they problem is that from what i have heard no code is avalible to change it while in homebrew >.<;
weird eh?
_________________
1x WII 2x remotes
2x NDS/L(FMv7-ORG:v4,FMv7-org:DSL)
1x GBAMP
2x 1gb (MicroDrive{typeII}&SanDisk{typeI})
1x SuperPass2
1x Supercard-CF
MoonShell skins
#85750 - HyperHacker - Fri Jun 02, 2006 4:14 am
Well here's what I gathered from Moonshell:
Code: |
#define PM_NDSLITE_ADR (4)
#define PM_NDSLITE_ISLITE BIT(6)
#define PM_NDSLITE_BRIGHTNESS(x) ((x & 0x03)<<0)
#define PM_NDSLITE_BRIGHTNESS_MASK (PM_NDSLITE_BRIGHTNESS(3))
//Determine if we're on DS Lite
if(PM_GetRegister(PM_NDSLITE_ADR) & PM_NDSLITE_ISLITE) DSLite = true;
//Adjust the brightness - Brightness is a value from 0 to 3
data = PM_GetRegister(PM_NDSLITE_ADR);
data &= ~PM_NDSLITE_BRIGHTNESS_MASK;
data |= PM_NDSLITE_BRIGHTNESS(Brightness);
PM_SetRegister(PM_NDSLITE_ADR,data); |
All I can really do is make sure that that detection method doesn't say I have a Lite. :-/
_________________
I'm a PSP hacker now, but I still <3 DS.
#85758 - HyperHacker - Fri Jun 02, 2006 5:29 am
Well, here's a test app and source. It succeeds in saying I don't have a Lite, that's about all I can do. It's based on the half-finished code from GBA Booter, so mind the mess. You need to make a small modification to ipc.h to compile it:
Before this:
Code: |
//---------------------------------------------------------------------------------
typedef struct sTransferRegion { |
add:
Code: |
#ifndef HH_NEW_IPC_STRUCT |
and after this:
Code: |
} TransferRegion, * pTransferRegion; |
add:
This shouldn't affect any other programs, unless you've defined HH_NEW_IPC_STRUCT for some reason. I use it to override the definition with my own, which is in main.h.
_________________
I'm a PSP hacker now, but I still <3 DS.
#85777 - daninski - Fri Jun 02, 2006 9:55 am
moonshell turns the light off on my dslite. its a dark blue japanese one.
#98492 - Lick - Tue Aug 15, 2006 4:41 pm
I'm intentionally giving this topic a rebirth, because it's really of important that this 'simple' problem is resolved.
Anyone had success controlling the brightness settings?
_________________
http://licklick.wordpress.com
#98496 - Nushio - Tue Aug 15, 2006 5:14 pm
Lick wrote: |
I'm intentionally giving this topic a rebirth, because it's really of important that this 'simple' problem is resolved.
Anyone had success controlling the brightness settings? |
I havent given it a thought, but I did notice that if I leave my DSPHat with the screens open on the alarm, the light will shut off. On the DSLite though, it just switches to the lowest screen setting. They wont turn off unless you actually close the lid.
I'd say check on Moonshell, but thats already been said. Sorry for not being more helpful.
#98499 - Lick - Tue Aug 15, 2006 5:26 pm
Okay i found it! It works on the DS Lite.
I haven't tested this on a Phat DS, if anyone can try?
Arm7 (has access to the PowerManagement settings, Arm9 does not)
Code: |
// These are just values I use to send from Arm9 to Arm7
// as message-identifiers..
#define GET_BRIGHTNESS (0x1211B210)
#define SET_BRIGHTNESS_0 (0x1211B211)
#define SET_BRIGHTNESS_1 (0x1211B212)
#define SET_BRIGHTNESS_2 (0x1211B213)
#define SET_BRIGHTNESS_3 (0x1211B214)
// Set up a Arm7 FIFO handler to
// handle the above messages.
u32 msg = REG_IPC_FIFO_RX;
if(msg == GET_BRIGHTNESS)
{
// send back the value (0 - 3)
REG_IPC_FIFO_TX = readPowerManagement((4)) - 64;
return;
}
else if(msg == SET_BRIGHTNESS_0)
{
// write value (0)
writePowerManagement((4), 0);
return;
}
else if(msg == SET_BRIGHTNESS_1)
{
// write value (1)
writePowerManagement((4), 1);
return;
}
else if(msg == SET_BRIGHTNESS_2)
{
// write value (2)
writePowerManagement((4), 2);
return;
}
else if(msg == SET_BRIGHTNESS_3)
{
// write value (3)
writePowerManagement((4), 3);
return;
} |
Arm9 (use Fifo to send commands to Arm7)
Code: |
u32 NDSX_GetBrightnessLevel()
{
REG_IPC_FIFO_TX = GET_BRIGHTNESS;
while(REG_IPC_FIFO_CR & IPC_FIFO_RECV_EMPTY);
return REG_IPC_FIFO_RX;
}
void NDSX_SetBrightnessLevel_0()
{
REG_IPC_FIFO_TX = SET_BRIGHTNESS_0;
}
void NDSX_SetBrightnessLevel_1()
{
REG_IPC_FIFO_TX = SET_BRIGHTNESS_1;
}
void NDSX_SetBrightnessLevel_2()
{
REG_IPC_FIFO_TX = SET_BRIGHTNESS_2;
}
void NDSX_SetBrightnessLevel_3()
{
REG_IPC_FIFO_TX = SET_BRIGHTNESS_3;
}
|
Thanks HyperHacker (and originally Moonshell src)!
_________________
http://licklick.wordpress.com
#98515 - HyperHacker - Tue Aug 15, 2006 7:14 pm
Nushio wrote: |
I did notice that if I leave my DSPHat with the screens open on the alarm, the light will shut off. On the DSLite though, it just switches to the lowest screen setting. They wont turn off unless you actually close the lid. |
So nobody's found a way to turn them off through software? It sounds like that might be done in hardware when you close the lid, and software can only choose the 4 levels. What happens in an older game like Mario 64?
_________________
I'm a PSP hacker now, but I still <3 DS.
#98523 - MaHe - Tue Aug 15, 2006 8:04 pm
It's possible to turn it off, but since the screens are different than in DS Phat, they won't be visible even under the extreme light in case the backlight is off ...
_________________
[ Crimson and Black Nintendo DS Lite | CycloDS Evolution | EZ-Flash 3-in-1 | 1 GB Transcend microSD ]
#98524 - Mallin - Tue Aug 15, 2006 8:04 pm
I missed it if anyone said but the lowest seeting of the DSlite equals the same brightness as the DSphat, I can see why they didn't have off as an option, off is a useless option, especially when it runs for, what? 18 hours or so when on the lowest setting.
#98586 - Lick - Wed Aug 16, 2006 5:47 am
http://www.bottledlight.com/ds/index.php/System/PowerManagement
My guess at this is that the 4 brightness levels are just 'extra'. The screens can be turned on (4 levels) and off. Will have to test it to confirm though.
The AlarmClock probably stays on so you can look at the time, while you're trying to sleep/wake up.
_________________
http://licklick.wordpress.com
#98591 - HyperHacker - Wed Aug 16, 2006 5:54 am
OK, so you toggle the lights on and off as usual, and there's an addition register used to set the brightness? So it's really max/high/medium/low/off? Again I don't have a Lite to test this on. :-/ When you call writePowerManagement((4), 0), what does that end up doing? Eg shift the value x bits left and OR with the 16 bits at this address, etc etc...
_________________
I'm a PSP hacker now, but I still <3 DS.
#98597 - Lick - Wed Aug 16, 2006 9:00 am
If you look on NDSTech's PowerManagement page, you'll see that the four bits (7..4) are logged as -. This is probably data from the Phat DS. I believe that the DS Lite uses these bits to set its brightness (bit 4-5) and the fact tat it's a Lite (bit 6). I don't know what bit 7 is for, but perhaps reserved for later versions. =/
Those are all different bits, -not- used by the Phat DS.
writePowerManagement() does the same as Moonshell, I assume. (Referring to the code you 'gathered' above)
_________________
http://licklick.wordpress.com
#98602 - ghaxaq - Wed Aug 16, 2006 9:58 am
Anyone tested it on the DS Phat or else can provide a file to test it myself.
#98619 - Lick - Wed Aug 16, 2006 2:42 pm
Tested by BigRedPimp and Kenny, it makes the Phat ASs power off.
Probable solution: check if bit 6 is set, before doing bit 4-5 operations. (A) I'll post it when I wrote it, and if by that time someone else has not posted it already.
_________________
http://licklick.wordpress.com