diff --git a/src/gmenu2x.cpp b/src/gmenu2x.cpp index 7d4db05..d384a99 100644 --- a/src/gmenu2x.cpp +++ b/src/gmenu2x.cpp @@ -1210,7 +1210,7 @@ void GMenu2X::editLink() { #ifdef HAVE_LIBOPK } #endif - sd.addSetting(new MenuSettingInt(this, ts, tr["Clock (default: 336)"], tr["Cpu clock frequency to set when launching this link"], &linkClock, cpuFreqMin, confInt["maxClock"], cpuFreqMultiple)); + sd.addSetting(new MenuSettingInt(this, ts, tr["Clock frequency"], tr["Cpu clock frequency to set when launching this link"], &linkClock, cpuFreqMin, confInt["maxClock"], cpuFreqMultiple)); sd.addSetting(new MenuSettingDir(this, ts, tr["Selector Directory"], tr["Directory to scan for the selector"], &linkSelDir)); sd.addSetting(new MenuSettingBool(this, ts, tr["Selector Browser"], tr["Allow the selector to change directory"], &linkSelBrowser)); #ifdef HAVE_LIBOPK @@ -1350,13 +1350,7 @@ void GMenu2X::scanner() { #ifdef PLATFORM_PANDORA //char *configpath = pnd_conf_query_searchpath(); #else - if (confInt["menuClock"]<336) { - setClock(336); - scanbg.write(font,tr["Raising cpu clock to 336MHz"],5,lineY); - scanbg.blit(s,0,0); - s->flip(); - lineY += 26; - } + setSafeMaxClock(); scanbg.write(font,tr["Scanning filesystem..."],5,lineY); scanbg.blit(s,0,0); @@ -1399,14 +1393,7 @@ void GMenu2X::scanner() { s->flip(); lineY += 26; - if (confInt["menuClock"]<336) { - setClock(confInt["menuClock"]); - scanbg.write(font,tr["Decreasing cpu clock"],5,lineY); - scanbg.blit(s,0,0); - s->flip(); - lineY += 26; - } - + setMenuClock(); sync(); #endif diff --git a/src/gmenu2x.h b/src/gmenu2x.h index 6fb2542..38d63e5 100644 --- a/src/gmenu2x.h +++ b/src/gmenu2x.h @@ -159,6 +159,9 @@ public: void changeWallpaper(); void setClock(unsigned mhz); + unsigned getDefaultAppClock() { return cpuFreqAppDefault; } + void setMenuClock() { setClock(cpuFreqMenuDefault); } + void setSafeMaxClock() { setClock(cpuFreqSafeMax); } void setInputSpeed(); diff --git a/src/linkapp.cpp b/src/linkapp.cpp index 8d70c12..9372669 100644 --- a/src/linkapp.cpp +++ b/src/linkapp.cpp @@ -68,7 +68,7 @@ LinkApp::LinkApp(GMenu2X *gmenu2x_, Touchscreen &ts, InputManager &inputMgr_, manual = ""; file = linkfile; dontleave = false; - setClock(336); + setClock(gmenu2x->getDefaultAppClock()); selectordir = ""; selectorfilter = ""; icon = iconPath = ""; @@ -418,7 +418,7 @@ void LinkApp::showManual() { string ext8 = manual.substr(manual.size()-8,8); if (ext8==".man.png" || ext8==".man.bmp" || ext8==".man.jpg" || manual.substr(manual.size()-9,9)==".man.jpeg") { //Raise the clock to speed-up the loading of the manual - gmenu2x->setClock(336); + gmenu2x->setSafeMaxClock(); Surface *pngman = Surface::loadImage(manual); if (!pngman) { @@ -441,7 +441,7 @@ void LinkApp::showManual() { ss >> spagecount; //Lower the clock - gmenu2x->setClock(gmenu2x->confInt["menuClock"]); + gmenu2x->setMenuClock(); while (!close) { if (repaint) { @@ -496,12 +496,10 @@ void LinkApp::showManual() { string line; ifstream infile(manual.c_str(), ios_base::in); if (infile.is_open()) { - gmenu2x->setClock(336); while (getline(infile, line, '\n')) txtman.push_back(line); infile.close(); TextManualDialog tmd(gmenu2x, getTitle(), getIconPath(), &txtman); - gmenu2x->setClock(gmenu2x->confInt["menuClock"]); tmd.exec(); } @@ -514,12 +512,10 @@ void LinkApp::showManual() { string line; ifstream infile(manual.c_str(), ios_base::in); if (infile.is_open()) { - gmenu2x->setClock(336); while (getline(infile, line, '\n')) readme.push_back(line); infile.close(); TextDialog td(gmenu2x, getTitle(), "ReadMe", getIconPath(), &readme); - gmenu2x->setClock(gmenu2x->confInt["menuClock"]); td.exec(); } }