WinCE timers, continued

Here’s a strange timer for Windows CE that doesn’t ignore time across
suspends. It uses GetSystemTime to keep the time continuous, and GetTicks to
get finer-grained readings than 1 second. It detects the difference between
the GetTicks time and GetSystemTime time on power-on to keep the error within
one second max.

It’s not a patch on the current win32 timer code – took one look at that and
figured it had more than enough #ifdefs already. It’s windows-ce specific.

Another thing I’ve noticed is that the Windows CE 4.0 and newer API has
functions warn processes about suspends. This is something SDL REALLY needs
for audio in particular, because turning it off while it’s playing causes
anything that uses audio to hardlock the system on power-on. Unfortunately I
don’t have 4.0 to play with. :frowning:
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL_systimer.c
Type: text/x-csrc
Size: 2160 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20050930/597c3613/attachment.c

Tyler Montbriand wrote:

Here’s a strange timer for Windows CE that doesn’t ignore time across
suspends. It uses GetSystemTime to keep the time continuous, and GetTicks to
get finer-grained readings than 1 second. It detects the difference between
the GetTicks time and GetSystemTime time on power-on to keep the error within
one second max.

It’s not a patch on the current win32 timer code – took one look at that and
figured it had more than enough #ifdefs already. It’s windows-ce specific.

Another thing I’ve noticed is that the Windows CE 4.0 and newer API has
functions warn processes about suspends. This is something SDL REALLY needs
for audio in particular, because turning it off while it’s playing causes
anything that uses audio to hardlock the system on power-on. Unfortunately I
don’t have 4.0 to play with. :frowning:

This is in CVS now…however, I don’t have any way to update the WinCE
project files.

Tyler, can you retarget them at src/timer/wince/SDL_systimer.c (as
opposed to src/timer/win32/SDL_systimer.c), and send me the updates?

The current CVS will hit an #error now if it tries to build the win32
timer code for WinCE.

Also, does anyone have a PocketPC 4.0 device that wants to take a stab
at the suspend notification API?

Thanks,
–ryan.