VOGONS


Reply 20 of 23, by UCyborg

User metadata
Rank Member
Rank
Member

BES just suspends and resumes the process on regular intervals, which means iterating through its threads and suspending them one by one calling SuspendThread. Limiting FPS usually work by calling Sleep from the main thread, which is where the most interesting things happen, effectively suspending it for the specified time.

Either way, you're not really throttling CPU speed with BES. What you're seeing in Prince of Persia 3D sounds like an interesting phenomenon, I could never influence the behavior of my games with BES that way.

Arthur Schopenhauer wrote:

A man can be himself only so long as he is alone; and if he does not love solitude, he will not love freedom; for it is only when he is alone that he is really free.

Reply 21 of 23, by xcomcmdr

User metadata
Rank Oldbie
Rank
Oldbie
Dege wrote:

Since rewriting the code by changing the float in question to a double would take too much time, I experimented with a stub WINMM.DLL where timeGetTime returns a value having the highest 8 bits masked out, to keep only the lower 24.
And voila, XG-2 ran at 34 FPS again.
😎

Cool ! Could you share this stub WINMM ? 😀

I think I have a similar problem with MechWarrior 2 : Ghost Bear Legacy (Win32 version). On Windows 10 it calls timeGetTime and then crashes (the crash doesn't happen on Windows 7 and lower).

A stub re-implementing timeGeTime would be a good starting point ! 😀

Reply 22 of 23, by Dege

User metadata
Rank l33t
Rank
l33t
Jorpho wrote:
That sounds strangely familiar. […]
Show full quote

That sounds strangely familiar.

A quick search reveals that similar problems were reported with UT99.
Re: How do you fix the timing glitch on Unreal Tournament '99?

Will this fix be pushed to the Steam version?

Yes. 😀

xcomcmdr wrote:
Cool ! Could you share this stub WINMM ? :) […]
Show full quote
Dege wrote:

Since rewriting the code by changing the float in question to a double would take too much time, I experimented with a stub WINMM.DLL where timeGetTime returns a value having the highest 8 bits masked out, to keep only the lower 24.
And voila, XG-2 ran at 34 FPS again.
😎

Cool ! Could you share this stub WINMM ? 😀

I think I have a similar problem with MechWarrior 2 : Ghost Bear Legacy (Win32 version). On Windows 10 it calls timeGetTime and then crashes (the crash doesn't happen on Windows 7 and lower).

A stub re-implementing timeGeTime would be a good starting point ! 😀

Well, that stub wasn't a complete WINMM implementation because WINMM has 100+ functions and I didn't want to reimplement all of them.
I just whipped up a very minimal one that was enough for XG-2.

Reply 23 of 23, by teleguy

User metadata
Rank Member
Rank
Member
Dege wrote:

Well, that stub wasn't a complete WINMM implementation because WINMM has 100+ functions and I didn't want to reimplement all of them.
I just whipped up a very minimal one that was enough for XG-2.

Couldn't you just add it here:
https://github.com/rkkoszewski/ogg-winmm/

That winmm is used to emulate CD audio and passes all other functions to Windows' native winmm.dll.