Dolphin, the GameCube and Wii emulator - Forums
Dolphin SVN 3374 with Framelimiter (32+64bit) - Printable Version

+- Dolphin, the GameCube and Wii emulator - Forums (https://forums.dolphin-emu.org)
+-- Forum: Dolphin Emulator Discussion and Support (https://forums.dolphin-emu.org/Forum-dolphin-emulator-discussion-and-support)
+--- Forum: Development Discussion (https://forums.dolphin-emu.org/Forum-development-discussion)
+--- Thread: Dolphin SVN 3374 with Framelimiter (32+64bit) (/Thread-dolphin-svn-3374-with-framelimiter-32-64bit)

Pages: 1 2 3


Dolphin SVN 3374 with Framelimiter (32+64bit) - Iulius - 06-07-2009

edit :
nobody wanted to help, so i did it alone Tongue


download : http://ul.to/1z88m3 at uploaded.to
(includes .patch with source code changes)

version with 32bit + JITIL : http://ul.to/d2uobk


another mirror with 32bit + JITIL + 64Bit + sourcecode :
http://www.zshare.net/download/61105476a996db47/



hope you like it Smile


RE: Need help with my framelimiter - KHRZ - 06-07-2009

That's really cool, does it work in Metroid Prime? (E.g. Limiting frames to 30 instead of 50/60, keepinig speed at full)


RE: Need help with my framelimiter - Iulius - 06-07-2009

i dont know, only got the 4 games i wrote for testing.

but you can compile it yourself to test it.

at the moment its 75% chance that it works Tongue


edit : made a new one.

the old one changes waitingtime only once a second.
The new one uses each new frametime for cpu-suspend.

This produces much more stable FPS + will not cause any slowdown if game runs slower then choosen framelimit.

still, SSBM does not work. other 3 games work very well.


Code:
[b]static u32 targetfps = 30;
    static u64 old_frametime=0;
    u64 new_frametime;
    s16 wait_frametime;[/b]

    frames++;

    [b]new_frametime=Timer.GetTimeDifference()-old_frametime;

    old_frametime=Timer.GetTimeDifference();

    wait_frametime=((1000/targetfps)-new_frametime)-1;
    if (wait_frametime>0)
        Common::SleepCurrentThread(wait_frametime*2);
[/b]
    if (Timer.GetTimeDifference() >= 1000)
    {
        [b]old_frametime=0;[/b]



RE: Need help with my framelimiter - cmccmc - 06-08-2009

looks great, good job


RE: Need help with my framelimiter - Iulius - 06-08-2009

included it into main config window.

Few screens attached.

to compare : with "other audio on" its 18fps with 100% cpu use Smile


[attachment=535][attachment=536][attachment=537]


still need help with the thread management.

it seems "CurrentThread" isn't enough for every game. but i have no idea which threads are running and how i can make them go to sleep.


RE: Need help with my framelimiter - BlackLionPT - 06-08-2009

can you compile the lastest version of dolphin, with that plz?
To test, if my games work too =p
and this is one great think that MUST be implemented in googlecode, to the official dolphin project =p


RE: Need help with my framelimiter - Iulius - 06-08-2009

i created a patch that can be used to compile yourself :

http://rapidshare.com/files/241944421/framelimit-patch.patch.html


maybe i can provide compiled version later, if needed.


RE: Need help with my framelimiter - BlackLionPT - 06-08-2009

i don't know how to compile this, but isn't there a way to compile only the file tan contains this frame limit think, and than replace the file in normal dolphin?


RE: Need help with my framelimiter - Iulius - 06-08-2009

it would be possible for the same rev of dolphin, but as this changes 20 times a day, it would not make sense to do that.

i'll upload a compiled version of newest svn + framelimit tomorrow.


RE: Need help with my framelimiter - Iulius - 06-08-2009

edit : got it Big Grin

problem was the dualcore watchdog which was only checking every 4th frame at 60fps.

this means 3 frames were still running too fast resulting in too fast gameplay.


i updated it to check every frame @ 60fps and now SSBM also works Smile

compiled file and sourcecode in first post.