aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorKostas Nakos2007-11-13 19:46:21 +0000
committerKostas Nakos2007-11-13 19:46:21 +0000
commitd66e4901ed5a04a3328e72f76546a7d3fbd807eb (patch)
tree7985f5d212a1be0c18d2dc6a2d62af485edccb61 /backends/platform
parent2ae1c3c4965ff157f9f3232eec8173b0acddf3a3 (diff)
downloadscummvm-rg350-d66e4901ed5a04a3328e72f76546a7d3fbd807eb.tar.gz
scummvm-rg350-d66e4901ed5a04a3328e72f76546a7d3fbd807eb.tar.bz2
scummvm-rg350-d66e4901ed5a04a3328e72f76546a7d3fbd807eb.zip
don't trash the registry if proper startup has failed
svn-id: r29497
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/wince/CEDevice.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/backends/platform/wince/CEDevice.cpp b/backends/platform/wince/CEDevice.cpp
index 47eee74802..dccbc2208b 100644
--- a/backends/platform/wince/CEDevice.cpp
+++ b/backends/platform/wince/CEDevice.cpp
@@ -35,6 +35,7 @@ static DWORD (WINAPI* _ReleasePowerRequirement)(HANDLE) = NULL;
static HANDLE _hPowerManagement = NULL;
static DWORD _lastTime = 0;
static DWORD REG_bat = 0, REG_ac = 0, REG_disp = 0, bat_timeout = 0;
+static bool REG_tampered = false;
#ifdef __GNUC__
extern "C" void WINAPI SystemIdleTimerReset(void);
#define SPI_SETBATTERYIDLETIMEOUT 251
@@ -99,6 +100,7 @@ void CEDevice::init() {
// older devices
REG_bat = REG_ac = REG_disp = 2 * 60 * 60 * 1000; // 2hrs should do it
backlight_xchg();
+ REG_tampered = true;
SystemParametersInfo(SPI_GETBATTERYIDLETIMEOUT, 0, (void *) &bat_timeout, 0);
SystemParametersInfo(SPI_SETBATTERYIDLETIMEOUT, 60 * 60 * 2, NULL, SPIF_SENDCHANGE);
}
@@ -106,8 +108,8 @@ void CEDevice::init() {
void CEDevice::end() {
if (_ReleasePowerRequirement && _hPowerManagement)
_ReleasePowerRequirement(_hPowerManagement);
-
- backlight_xchg();
+ if (REG_tampered)
+ backlight_xchg();
SystemParametersInfo(SPI_SETBATTERYIDLETIMEOUT, bat_timeout, NULL, SPIF_SENDCHANGE);
}