rosalina: display min/max luminance
This commit is contained in:
parent
514537a983
commit
781cd85b00
sysmodules/rosalina
@ -28,4 +28,6 @@
|
|||||||
|
|
||||||
#include <3ds/types.h>
|
#include <3ds/types.h>
|
||||||
|
|
||||||
|
u32 getMinLuminancePreset(void);
|
||||||
|
u32 getMaxLuminancePreset(void);
|
||||||
u32 getCurrentLuminance(bool top);
|
u32 getCurrentLuminance(bool top);
|
||||||
|
@ -96,6 +96,18 @@ static void readCalibration(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
u32 getMinLuminancePreset(void)
|
||||||
|
{
|
||||||
|
readCalibration();
|
||||||
|
return s_blPwmData.luminanceLevels[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 getMaxLuminancePreset(void)
|
||||||
|
{
|
||||||
|
readCalibration();
|
||||||
|
return s_blPwmData.luminanceLevels[s_blPwmData.numLevels - 1];
|
||||||
|
}
|
||||||
|
|
||||||
u32 getCurrentLuminance(bool top)
|
u32 getCurrentLuminance(bool top)
|
||||||
{
|
{
|
||||||
u32 regbase = top ? 0x10202200 : 0x10202A00;
|
u32 regbase = top ? 0x10202200 : 0x10202A00;
|
||||||
|
@ -170,13 +170,23 @@ void RosalinaMenu_ChangeScreenBrightness(void)
|
|||||||
// gsp:LCD GetLuminance is stubbed on O3DS so we have to implement it ourselves... damn it.
|
// gsp:LCD GetLuminance is stubbed on O3DS so we have to implement it ourselves... damn it.
|
||||||
// Assume top and bottom screen luminances are the same (should be; if not, we'll set them to the same values).
|
// Assume top and bottom screen luminances are the same (should be; if not, we'll set them to the same values).
|
||||||
u32 luminance = getCurrentLuminance(false);
|
u32 luminance = getCurrentLuminance(false);
|
||||||
|
u32 minLum = getMinLuminancePreset();
|
||||||
|
u32 maxLum = getMaxLuminancePreset();
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
Draw_Lock();
|
Draw_Lock();
|
||||||
Draw_DrawString(10, 10, COLOR_TITLE, "Screen brightness");
|
Draw_DrawString(10, 10, COLOR_TITLE, "Screen brightness");
|
||||||
u32 posY = 30;
|
u32 posY = 30;
|
||||||
posY = Draw_DrawFormattedString(10, posY, COLOR_WHITE, "Current luminance: %lu\n\n", luminance);
|
posY = Draw_DrawFormattedString(
|
||||||
|
10,
|
||||||
|
posY,
|
||||||
|
COLOR_WHITE,
|
||||||
|
"Current luminance: %lu (min. %lu, max. %lu)\n\n",
|
||||||
|
luminance,
|
||||||
|
minLum,
|
||||||
|
maxLum
|
||||||
|
);
|
||||||
posY = Draw_DrawString(10, posY, COLOR_WHITE, "Controls: Up/Down for +-1, Right/Left for +-10.\n");
|
posY = Draw_DrawString(10, posY, COLOR_WHITE, "Controls: Up/Down for +-1, Right/Left for +-10.\n");
|
||||||
posY = Draw_DrawString(10, posY, COLOR_WHITE, "Press A to start, B to exit.\n\n");
|
posY = Draw_DrawString(10, posY, COLOR_WHITE, "Press A to start, B to exit.\n\n");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user