diff --git a/Source/sys-clk/overlay/src/ui/gui/about_gui.cpp b/Source/sys-clk/overlay/src/ui/gui/about_gui.cpp index ee443dac..bb95119b 100644 --- a/Source/sys-clk/overlay/src/ui/gui/about_gui.cpp +++ b/Source/sys-clk/overlay/src/ui/gui/about_gui.cpp @@ -18,9 +18,12 @@ #include #include +tsl::elm::ListItem* SpeedoItem = NULL; +tsl::elm::ListItem* IddqItem = NULL; AboutGui::AboutGui() { + memset(strings, 0, sizeof(strings)); } AboutGui::~AboutGui() @@ -29,6 +32,22 @@ AboutGui::~AboutGui() void AboutGui::listUI() { + this->listElement->addItem( + new tsl::elm::CategoryHeader("Speedo/IDDQ") + ); + + SpeedoItem = + new tsl::elm::ListItem("Speedos:"); + this->listElement->addItem(SpeedoItem); + + IddqItem = + new tsl::elm::ListItem("IDDQ:"); + this->listElement->addItem(IddqItem); + + this->listElement->addItem( + new tsl::elm::CategoryHeader("Credits") + ); + this->listElement->addItem( new tsl::elm::CategoryHeader("Developers") ); @@ -154,8 +173,7 @@ void AboutGui::listUI() this->listElement->addItem( new tsl::elm::ListItem("The Switch Homebrew Community") - ); - + ); } void AboutGui::update() @@ -169,7 +187,11 @@ void AboutGui::refresh() if (!this->context) return; - + // Format strings once per refresh + sprintf(strings[0], "%u/%u/%u", this->context->speedos[HorizonOCSpeedo_CPU], this->context->speedos[HorizonOCSpeedo_GPU], this->context->speedos[HorizonOCSpeedo_SOC]); + sprintf(strings[1], "%u/%u/%u", this->context->iddq[HorizonOCSpeedo_CPU], this->context->iddq[HorizonOCSpeedo_GPU], this->context->iddq[HorizonOCSpeedo_SOC]); + SpeedoItem->setValue(strings[0]); + IddqItem->setValue(strings[1]); } /* ## Credits diff --git a/Source/sys-clk/overlay/src/ui/gui/about_gui.h b/Source/sys-clk/overlay/src/ui/gui/about_gui.h index 4056e6ec..7d9775c6 100644 --- a/Source/sys-clk/overlay/src/ui/gui/about_gui.h +++ b/Source/sys-clk/overlay/src/ui/gui/about_gui.h @@ -25,7 +25,7 @@ class AboutGui : public BaseMenuGui { protected: - // char strings[32][32]; // Pre-formatted strings + char strings[32][32]; // Pre-formatted strings public: AboutGui(); diff --git a/Source/sys-clk/overlay/src/ui/gui/info_gui.cpp b/Source/sys-clk/overlay/src/ui/gui/info_gui.cpp deleted file mode 100644 index 28816f2e..00000000 --- a/Source/sys-clk/overlay/src/ui/gui/info_gui.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Souldbminer and Horizon OC Contributors - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#include "info_gui.h" -#include "../format.h" -#include -#include - -tsl::elm::ListItem* SpeedoItem; -tsl::elm::ListItem* IddqItem; - -InfoGui::InfoGui() -{ - // Initialize display strings - memset(strings, 0, sizeof(strings)); -} - -InfoGui::~InfoGui() -{ -} - -void InfoGui::listUI() -{ - SpeedoItem = - new tsl::elm::ListItem("Speedos:"); - this->listElement->addItem(SpeedoItem); - - IddqItem = - new tsl::elm::ListItem("IDDQ:"); - this->listElement->addItem(IddqItem); - -} - -void InfoGui::update() -{ - BaseMenuGui::update(); -} - -void InfoGui::refresh() -{ - BaseMenuGui::refresh(); - - if (!this->context) - return; - - // Format strings once per refresh - sprintf(strings[0], "%u/%u/%u", this->context->speedos[HorizonOCSpeedo_CPU], this->context->speedos[HorizonOCSpeedo_GPU], this->context->speedos[HorizonOCSpeedo_SOC]); - sprintf(strings[1], "%u/%u/%u", this->context->iddq[HorizonOCSpeedo_CPU], this->context->iddq[HorizonOCSpeedo_GPU], this->context->iddq[HorizonOCSpeedo_SOC]); - SpeedoItem->setValue(strings[0]); - IddqItem->setValue(strings[1]); - -} \ No newline at end of file diff --git a/Source/sys-clk/overlay/src/ui/gui/info_gui.h b/Source/sys-clk/overlay/src/ui/gui/info_gui.h deleted file mode 100644 index 1e9f3925..00000000 --- a/Source/sys-clk/overlay/src/ui/gui/info_gui.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Souldbminer and Horizon OC Contributors - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once -#include "../../ipc.h" -#include "base_menu_gui.h" -#include "freq_choice_gui.h" -#include "value_choice_gui.h" -#include "fatal_gui.h" -#include -#include - -class InfoGui : public BaseMenuGui -{ -protected: - char strings[32][32]; // Pre-formatted strings - -public: - InfoGui(); - ~InfoGui(); - - void listUI() override; - void update() override; - void refresh() override; -}; \ No newline at end of file diff --git a/Source/sys-clk/overlay/src/ui/gui/main_gui.cpp b/Source/sys-clk/overlay/src/ui/gui/main_gui.cpp index f8d08a52..dc4dea94 100644 --- a/Source/sys-clk/overlay/src/ui/gui/main_gui.cpp +++ b/Source/sys-clk/overlay/src/ui/gui/main_gui.cpp @@ -31,7 +31,6 @@ #include "app_profile_gui.h" #include "global_override_gui.h" #include "misc_gui.h" -#include "info_gui.h" #include "about_gui.h" void MainGui::listUI() @@ -98,20 +97,7 @@ void MainGui::listUI() return false; }); - this->listElement->addItem(miscItem); - #if IS_MINIMAL == 0 - tsl::elm::ListItem* infoItem = new tsl::elm::ListItem("Information"); - infoItem->setClickListener([this](u64 keys) { - if((keys & HidNpadButton_A) == HidNpadButton_A && this->context) - { - tsl::changeTo(); - return true; - } - return false; - }); - this->listElement->addItem(infoItem); - #endif tsl::elm::ListItem* aboutItem = new tsl::elm::ListItem("About"); aboutItem->setClickListener([this](u64 keys) { if((keys & HidNpadButton_A) == HidNpadButton_A && this->context)