#132632 - HyperHacker - Thu Jun 28, 2007 9:45 am
I'm using this code copied from Moonshell to tell the difference between DS and DS Lite:
Code: |
#define PM_NDSLITE_ISLITE BIT(6)
//See if this is a DS Lite
SerialWaitBusy();
REG_SPICNT = SPI_ENABLE | SPI_DEVICE_POWER | SPI_BAUD_1MHz | SPI_CONTINUOUS;
REG_SPIDATA = 0x80;
SerialWaitBusy();
REG_SPICNT = SPI_ENABLE | SPI_DEVICE_POWER | SPI_BAUD_1MHz;
REG_SPIDATA = 0;
SerialWaitBusy();
if(REG_SPIDATA & PM_NDSLITE_ISLITE) SysInfo |= SI_DSLITE; |
It seems this bit is never set on either type of system. What's the problem here?
_________________
I'm a PSP hacker now, but I still <3 DS.
Last edited by HyperHacker on Fri Jun 29, 2007 1:34 am; edited 1 time in total
#132647 - Lick - Thu Jun 28, 2007 11:15 am
Just use this: Code: |
bool Lite = (bool)(readPowerManagement(4) & BIT(6)) |
The problem with your code is the first variable to go in REG_SPIDATA is not 0x80, but (0x80 | 0x4) because you want to read SPI4's bit6, not sPI0's bit6.
_________________
http://licklick.wordpress.com
#132649 - Rajveer - Thu Jun 28, 2007 12:33 pm
Why would you want to detect if it's a Lite or not? I remember something about the regular and Lite screens being different, but what else? I'm just wondering, maybe it will be useful for my project ;).
#132654 - tepples - Thu Jun 28, 2007 12:53 pm
Possibly to display the control help on the correct background?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#132659 - spinal_cord - Thu Jun 28, 2007 1:53 pm
aren't the lcds a different way round? BGR instead of RGB?
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage
#132666 - Lino - Thu Jun 28, 2007 2:17 pm
Is there then a 4th register? Do you know its configuration?
#132669 - Lick - Thu Jun 28, 2007 2:54 pm
spinal_cord wrote: |
aren't the lcds a different way round? BGR instead of RGB? |
The physical-order, yes. Though the pixeldata are still in RGB. So it only matters when you're using sub-pixel techniques.
Lino: bit0 and bit1 control the current backlight strength and bit6 is always set on a Lite. This information was first found in Moonshell.
_________________
http://licklick.wordpress.com
#132733 - HyperHacker - Fri Jun 29, 2007 12:07 am
Rajveer wrote: |
Why would you want to detect if it's a Lite or not? I remember something about the regular and Lite screens being different, but what else? I'm just wondering, maybe it will be useful for my project ;). |
To have backlight brightness controls, of course.
[edit] So is it not possible to adjust the brightness of each screen individually?
_________________
I'm a PSP hacker now, but I still <3 DS.
#132801 - Lick - Fri Jun 29, 2007 3:54 pm
Nope, but you can shut down each screen individually.
Also, you could screw with the Master Brightness setting of a screen so it seems to be darker. Not sure how that affects the power usage though, it probably doesn't.
_________________
http://licklick.wordpress.com
#132808 - silent_code - Fri Jun 29, 2007 5:32 pm
the master brightness is just sort of a gama shift... i included that in my volume shadow demo. ;^)
#132836 - GPFerror - Fri Jun 29, 2007 11:57 pm
Lick wrote: |
Just use this: Code: | bool Lite = (bool)(readPowerManagement(4) & BIT(6)) |
|
arm7 only ?
#132846 - HyperHacker - Sat Jun 30, 2007 3:54 am
Yeah, only ARM7 can access power management. Kind of a shame since it's great for debugging, to be able to blink lights and play sound with only one or two lines of code. All ARM9 can do (short of talking to ARM7) is display something, which requires setting up VRAM etc etc.
_________________
I'm a PSP hacker now, but I still <3 DS.