boot: update for 13.0.0/aula parameter changes (closes #1477)

This commit is contained in:
Michael Scire
2021-10-15 19:03:11 -07:00
parent 990daec3a2
commit d1bc1a5c57
10 changed files with 96 additions and 68 deletions

View File

@@ -43,7 +43,7 @@ namespace ams::powctl::impl {
constexpr inline int GetDisplayPercentage(double raw_percentage, double min, double max) {
/* Calculate the display percentage. */
constexpr const double BaseDisplayPercentage = 2.0;
const auto display_percentage = BaseDisplayPercentage + ((static_cast<double>(MaxDisplayPercentage - MinDisplayPercentage) * (raw_percentage - min)) / (max - min));
const auto display_percentage = BaseDisplayPercentage + ((static_cast<double>(MaxDisplayPercentage - BaseDisplayPercentage) * (raw_percentage - min)) / (max - min));
/* Clamp the display percentage within bounds. */
return std::max(std::min(static_cast<int>(display_percentage), MaxDisplayPercentage), MinDisplayPercentage);