Skip to content

Commit

Permalink
Merge pull request #38 from darkxex/master
Browse files Browse the repository at this point in the history
Work in Progress (Custom OC)
  • Loading branch information
darkxex authored Feb 11, 2022
2 parents db6cf69 + 24531e1 commit fdcb7f7
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 deletions.
6 changes: 6 additions & 0 deletions include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class Config{
void setSlang(int lang);
//End Slang

bool getUseOc(bool tmpvalue);
void setUseOc(bool _val);

int getSubFontSize(bool tmpvalue);
void setSubFontSize(int val);

Expand Down Expand Up @@ -110,6 +113,9 @@ class Config{
int tmpslang;
int slang;
//End Slang

bool tmpuseoc;
bool useoc;

int tmpsubfontsize;
int subfontsize;
Expand Down
25 changes: 13 additions & 12 deletions source/SwitchSys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,22 @@ bool SwitchSys::setClock(const SwitchSys::Module &module, int hz) {
}

void SwitchSys::maxClock()
{ int clock_old = SwitchSys::getClock(SwitchSys::Module::Cpu);
SwitchSys::setClock(SwitchSys::Module::Cpu, (int) SwitchSys::CPUClock::Max);
SwitchSys::setClock(SwitchSys::Module::Gpu, (int) SwitchSys::GPUClock::Max);
SwitchSys::setClock(SwitchSys::Module::Emc, (int) SwitchSys::EMCClock::Max);
printf("setting max cpu speed (old: %i, new: %i)\n",
clock_old, SwitchSys::getClock(SwitchSys::Module::Cpu));}
{ int clock_old = SwitchSys::getClock(SwitchSys::Module::Cpu);
SwitchSys::setClock(SwitchSys::Module::Cpu, (int) SwitchSys::CPUClock::Max);
SwitchSys::setClock(SwitchSys::Module::Gpu, (int) SwitchSys::GPUClock::Max);
SwitchSys::setClock(SwitchSys::Module::Emc, (int) SwitchSys::EMCClock::Max);
printf("setting max cpu speed (old: %i, new: %i)\n",
clock_old, SwitchSys::getClock(SwitchSys::Module::Cpu));
}

void SwitchSys::defaultClock(int stock_cpu_clock_temp,int stock_gpu_clock_temp,int stock_emc_clock_temp)
{
int clock_old = SwitchSys::getClock(SwitchSys::Module::Cpu);
SwitchSys::setClock(SwitchSys::Module::Cpu, (int) stock_cpu_clock_temp);
SwitchSys::setClock(SwitchSys::Module::Gpu, (int) stock_gpu_clock_temp);
SwitchSys::setClock(SwitchSys::Module::Emc, (int) stock_emc_clock_temp);
printf("restoring cpu speed (old: %i, new: %i)\n",
clock_old, SwitchSys::getClock(SwitchSys::Module::Cpu));
int clock_old = SwitchSys::getClock(SwitchSys::Module::Cpu);
SwitchSys::setClock(SwitchSys::Module::Cpu, (int) stock_cpu_clock_temp);
SwitchSys::setClock(SwitchSys::Module::Gpu, (int) stock_gpu_clock_temp);
SwitchSys::setClock(SwitchSys::Module::Emc, (int) stock_emc_clock_temp);
printf("restoring cpu speed (old: %i, new: %i)\n",
clock_old, SwitchSys::getClock(SwitchSys::Module::Cpu));
}

#endif
18 changes: 18 additions & 0 deletions source/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ Config::Config(std::string inifile){
tmpslang = slang;
//endSlang

useoc = ini->GetBoolValue("Main", "useoc");
tmpuseoc = useoc;

const char* themenamepv;
themenamepv = ini->GetValue("Main", "theme");
std::string themenamestring = "Default";
Expand Down Expand Up @@ -322,6 +325,15 @@ void Config::setSlang(int lang){
}
//end Slang

bool Config::getUseOc(bool tmpvalue){
if(tmpvalue){
return tmpuseoc;
}
return useoc;
}
void Config::setUseOc(bool _val){
tmpuseoc = _val;
}

int Config::getSubFontSize(bool tmpvalue){
if(tmpvalue){
Expand Down Expand Up @@ -433,6 +445,9 @@ void Config::saveSettings(){
//slang
useslang = tmpuseslang;
//end slang

useoc = tmpuseoc;

subfontsize = tmpsubfontsize;
deint = tmpdeint;
dbactive = tmpdbactive;
Expand Down Expand Up @@ -482,6 +497,9 @@ void Config::saveSettings(){
ini->SetValue("Main", "slang", Utility::getLanguages()[tmpslang].lang3.c_str());
//end slang

ini->Delete("Main", "useoc");
ini->SetBoolValue("Main", "useoc", useoc, NULL, false);

ini->Delete("Main", "subfontsize");
ini->SetLongValue("Main", "subfontsize", subfontsize, NULL, false);

Expand Down

0 comments on commit fdcb7f7

Please sign in to comment.