mirror of
https://github.com/LumaTeam/Luma3DS.git
synced 2026-02-22 01:44:38 +00:00
sysmenu: fix luminance calculation, and allow going above preset 5 in many cases.
Unlike SetLuminanceLevel, SetLuminance doesn't check if preset <= 5, and actually allows the lumiance levels provisioned for the "brightness boost mode" (brighter when adapter is plugged in), even when the feature is disabled (it is disabled for anything but the OG model, iirc).
This commit is contained in:
parent
97cc70d35d
commit
da66af3f8a
@ -104,8 +104,13 @@ u32 getMinLuminancePreset(void)
|
||||
|
||||
u32 getMaxLuminancePreset(void)
|
||||
{
|
||||
// Unlike SetLuminanceLevel, SetLuminance doesn't
|
||||
// check if preset <= 5, and actually allows the lumiance
|
||||
// levels provisioned for the "brightness boost mode" (brighter
|
||||
// when adapter is plugged in), even when the feature is disabled
|
||||
// (it is disabled for anything but the OG model, iirc)
|
||||
readCalibration();
|
||||
return s_blPwmData.luminanceLevels[s_blPwmData.numLevels - 1];
|
||||
return s_blPwmData.luminanceLevels[6];
|
||||
}
|
||||
|
||||
u32 getCurrentLuminance(bool top)
|
||||
@ -114,7 +119,8 @@ u32 getCurrentLuminance(bool top)
|
||||
|
||||
readCalibration();
|
||||
|
||||
const float *coeffs = s_blPwmData.coeffs[top ? (isN3DS ? 2 : 1) : 0];
|
||||
bool is3d = (REG32(0x10202000 + 0x000) & 1) != 0;
|
||||
const float *coeffs = s_blPwmData.coeffs[top ? (is3d ? 2 : 1) : 0];
|
||||
u32 brightness = REG32(regbase + 0x40);
|
||||
float ratio = getPwmRatio(s_blPwmData.brightnessMax, REG32(regbase + 0x44));
|
||||
|
||||
|
||||
@ -560,7 +560,7 @@ void SysConfigMenu_ChangeScreenBrightness(void)
|
||||
posY = Draw_DrawString(10, posY, COLOR_WHITE, "Press A to start, B to exit.\n\n");
|
||||
|
||||
posY = Draw_DrawString(10, posY, COLOR_RED, "WARNING: \n");
|
||||
posY = Draw_DrawString(10, posY, COLOR_WHITE, " * value will be limited by the presets.\n");
|
||||
posY = Draw_DrawString(10, posY, COLOR_WHITE, " * value will be limited by calibration.\n");
|
||||
posY = Draw_DrawString(10, posY, COLOR_WHITE, " * bottom framebuffer will be restored until\nyou exit.");
|
||||
Draw_FlushFramebuffer();
|
||||
Draw_Unlock();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user