- [Sys-clk-OC] Add permanent override for overlay and manager, will add more toggles later and therefore deprecates InfoNX - [MEM] Replace 1331 MHz table with 1600 MHz (idea by 3DSBricker) - [MEM] Add more info on SDRAM and tips for timing calculation
93 lines
2.9 KiB
C++
93 lines
2.9 KiB
C++
/*
|
|
* --------------------------------------------------------------------------
|
|
* "THE BEER-WARE LICENSE" (Revision 42):
|
|
* <p-sam@d3vs.net>, <natinusala@gmail.com>, <m4x@m4xw.net>
|
|
* wrote this file. As long as you retain this notice you can do whatever you
|
|
* want with this stuff. If you meet any of us some day, and you think this
|
|
* stuff is worth it, you can buy us a beer in return. - The sys-clk authors
|
|
* --------------------------------------------------------------------------
|
|
*/
|
|
|
|
#include "main_gui.h"
|
|
|
|
#include "fatal_gui.h"
|
|
#include "app_profile_gui.h"
|
|
#include "global_override_gui.h"
|
|
// #include "misc_gui.h"
|
|
|
|
void MainGui::listUI()
|
|
{
|
|
this->enabledToggle = new tsl::elm::ToggleListItem("Enable", false);
|
|
enabledToggle->setStateChangedListener([this](bool state) {
|
|
Result rc = sysclkIpcSetEnabled(state);
|
|
if(R_FAILED(rc))
|
|
{
|
|
FatalGui::openWithResultCode("sysclkIpcSetEnabled", rc);
|
|
}
|
|
|
|
this->lastContextUpdate = armGetSystemTick();
|
|
this->context->enabled = state;
|
|
});
|
|
this->listElement->addItem(this->enabledToggle);
|
|
|
|
tsl::elm::ListItem* appProfileItem = new tsl::elm::ListItem("Edit app profile");
|
|
appProfileItem->setClickListener([this](u64 keys) {
|
|
if((keys & HidNpadButton_A) == HidNpadButton_A && this->context)
|
|
{
|
|
AppProfileGui::changeTo(this->context->applicationId);
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
});
|
|
this->listElement->addItem(appProfileItem);
|
|
|
|
this->listElement->addItem(new tsl::elm::CategoryHeader("Advanced"));
|
|
|
|
tsl::elm::ListItem* globalOverrideItem = new tsl::elm::ListItem("Temporary overrides");
|
|
globalOverrideItem->setClickListener([this](u64 keys) {
|
|
if((keys & HidNpadButton_A) == HidNpadButton_A)
|
|
{
|
|
tsl::changeTo<GlobalOverrideGui>();
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
});
|
|
this->listElement->addItem(globalOverrideItem);
|
|
|
|
tsl::elm::ListItem* globalPermanentOverrideItem = new tsl::elm::ListItem("Permanent overrides");
|
|
globalPermanentOverrideItem->setClickListener([this](u64 keys) {
|
|
if((keys & HidNpadButton_A) == HidNpadButton_A && this->context)
|
|
{
|
|
AppProfileGui::changeTo(0xA111111111111111);
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
});
|
|
this->listElement->addItem(globalPermanentOverrideItem);
|
|
|
|
// tsl::elm::ListItem* miscItem = new tsl::elm::ListItem("Miscellaneous");
|
|
// miscItem->setClickListener([this](u64 keys) {
|
|
// if((keys & HidNpadButton_A) == HidNpadButton_A && this->context)
|
|
// {
|
|
// tsl::changeTo<MiscGui>();
|
|
// return true;
|
|
// }
|
|
|
|
// return false;
|
|
// });
|
|
// this->listElement->addItem(miscItem);
|
|
}
|
|
|
|
void MainGui::refresh()
|
|
{
|
|
BaseMenuGui::refresh();
|
|
|
|
if(this->context)
|
|
{
|
|
this->enabledToggle->setState(this->context->enabled);
|
|
}
|
|
}
|