SnesGT and double buffering

Announce new emulators, discuss which games run best under each emulator, and much much more.

Moderator: General Mods

vanfanel
Rookie
Posts: 34
Joined: Mon Mar 02, 2009 4:59 pm

SnesGT and double buffering

Post by vanfanel »

Hello all!

Well, I'm using SnesGT 0.230b6 these days in my new EEE BOX (no, it's NOT a laptop: it's a nano-desktop pc focussed on low power need, with an intel ATOM processor at 1,66 Ghz), since Bsnes is just too much for this little bastard and Zsnes sound leaves a lot to be desired in the last public version.

I can run avery game at full speed with SnesGT on this eeebox, but activating vsync option causes slowdows and framerate issues now and then. Obviously it's ok, since vsync is a very cpu-intensive task, but snesGT authors have posted abot a double buffering option in their bbs:

http://gigo.retrogames.com/bbs/c-board. ... tr;tree=90

However, the emulator runs at very high speed even if I specify 60 FPS...
Have you guys configured SnesGT without tearing, running at 60FPS, without using vsync? Does that USE_FLIP = 1 option work for you??

Thanks!!
Spanish third republic NOW!
vanfanel
Rookie
Posts: 34
Joined: Mon Mar 02, 2009 4:59 pm

Post by vanfanel »

I've also tried the "wait" option under "virtual fps", wich simulates 60FPS but without vsync (to get vsync I must activate the vsync option explicitly). Performance is just great! But tearing occurrs...and that makes the whole emulation stink.

C'mon...this post has been viewed a lot of times! No SnesGT users with double buffer out there?? It should be the most popular snes emulator right now, until Zsnes 2.0 appears...
Spanish third republic NOW!
Squall_Leonhart
Trooper
Posts: 369
Joined: Tue Jun 10, 2008 6:19 am
Location: Australia
Contact:

Post by Squall_Leonhart »

vsync is cpu intensive? lol wut?
[img]http://img.photobucket.com/albums/v253/squall_leonhart69r/Final_Fantasy_8/squall_sig1.gif[/img]
[url=http://vba-m.com/]VBA-M Forum[/url], [url=http://www.ngohq.com]NGOHQ[/url]
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Post by kode54 »

Squall_Leonhart wrote:vsync is cpu intensive? lol wut?
Depends on whether the video drivers are crappy and poll in a loop for vsync state.
vanfanel
Rookie
Posts: 34
Joined: Mon Mar 02, 2009 4:59 pm

Post by vanfanel »

poll in a loop? So ...what's the other option? "sleep for wait"?
There's that "sleep for wait" option in the SnesGT menu. Should that be faster?
No double/triple buffer, then?
Spanish third republic NOW!
byuu

Post by byuu »

vanfanel wrote:poll in a loop? So ...what's the other option?
Buffer the video frame and draw it when ready, make the application think the draw was immediately successful so that emulation can continue without impediment.

And most importantly, give the option to discard frames if emulation gets way too fast, so that videoInterface->Present() is guaranteed to never lock for up to ~16ms.
vanfanel
Rookie
Posts: 34
Joined: Mon Mar 02, 2009 4:59 pm

Post by vanfanel »

thanks byuu! I hope I can use bsnes someday, in a new multicore cpu.
Meanwhile, I've to stick with snesgt...

So, if my app is running slow when using vsync, I have crappy drivers without that intelligent design you described: that's ok, but...aren't there custom drivers for GMA 950? Searched with google, but I couln't find anything...
Spanish third republic NOW!
Squall_Leonhart
Trooper
Posts: 369
Joined: Tue Jun 10, 2008 6:19 am
Location: Australia
Contact:

Post by Squall_Leonhart »

only for linux.
[img]http://img.photobucket.com/albums/v253/squall_leonhart69r/Final_Fantasy_8/squall_sig1.gif[/img]
[url=http://vba-m.com/]VBA-M Forum[/url], [url=http://www.ngohq.com]NGOHQ[/url]
vanfanel
Rookie
Posts: 34
Joined: Mon Mar 02, 2009 4:59 pm

Post by vanfanel »

Fine; there's no snesGT for Linux, and BSnes isn't an option for ATOM processors. I'll wait for zsnes then...

Thanks!
Spanish third republic NOW!
sweener2001
Inmate
Posts: 1751
Joined: Mon Dec 06, 2004 7:47 am
Location: WA

Post by sweener2001 »

did you even try the buffer options?

in the time it took for these responses, couldn't you have tried all the options you were wondering about and found out if any of them do what you want?
[img]http://i26.photobucket.com/albums/c128/sweener2001/StewieSIGPIC.png[/img]
vanfanel
Rookie
Posts: 34
Joined: Mon Mar 02, 2009 4:59 pm

Post by vanfanel »

#sweener

hahaha!! what kind of Retarded Squirrell (tm) do you think I am? :P
I asked here because the ONLY buffer option, not available in the menu but only in the INI file if you add it manually (and only according to a post in the SNES GT BBS) doesn't work for me.
Of course I've tried! I've also tried enabled the tripple buffer option in my GMA950 drivers, but damn SnesGT uses DirectDraw and we don't get too many options to configure ddraw buffers manually those days...

About the "sleep for wait" comment I made, I meant that sleep for wait didn't have any difference here, so I asked if "it was supposed to make any difference."

So, to answer your question, YES, I TRIED. WAY before posting here :D
Well, my english is not perfect (half Spain is retarded, so we get translated and doubed films and series here...we had a civil war and most intelligent people was killed for being in the "wrong" side, the anti-fascist one), but I try to do my best!
Spanish third republic NOW!
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

Are you running Vista or XP? That is relatively important in respect to DirectDraw and VSync. If you run Vista, then you are SOL (shit outta luck).
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Post by kode54 »

I could share my shitty DirectDraw timer-based vsync code again, also useful on XP systems where shitty drivers will peg the CPU (or core) at full utilization while waiting for vsync.
vanfanel
Rookie
Posts: 34
Joined: Mon Mar 02, 2009 4:59 pm

Post by vanfanel »

I'm on XP, only because of WinUAE and SnesGT. For work I use Linux & Mac OSX in the same machine. I wouldn't be caught dead using Vista! (Well, I am only using the xp kernel: I'm not using the explorer.exe shell, and I've got only five services running: my system is fully optimizd for emulation, no need for AV shit, etc).

Sharing vsync code would be graet...if snesgt would be open source: but it is not... a real shame.

Kode54: is your avatar the final enemy of Whirlo?
Spanish third republic NOW!
Tallgeese
Justice is Blind
Posts: 620
Joined: Wed Jul 28, 2004 3:33 pm
Location: Test
Contact:

Post by Tallgeese »

kode54 wrote:I could share my shitty DirectDraw timer-based vsync code again, also useful on XP systems where shitty drivers will peg the CPU (or core) at full utilization while waiting for vsync.
...I wonder if that's why SMT Imagine, despite being ancient, has my Vista laptop running at 100% if fullscreened...
sweener2001
Inmate
Posts: 1751
Joined: Mon Dec 06, 2004 7:47 am
Location: WA

Post by sweener2001 »

vanfanel wrote:#sweener

hahaha!! what kind of Retarded Squirrell (tm) do you think I am? :P
I asked here because the ONLY buffer option, not available in the menu but only in the INI file if you add it manually (and only according to a post in the SNES GT BBS) doesn't work for me.
Of course I've tried! I've also tried enabled the tripple buffer option in my GMA950 drivers, but damn SnesGT uses DirectDraw and we don't get too many options to configure ddraw buffers manually those days...

About the "sleep for wait" comment I made, I meant that sleep for wait didn't have any difference here, so I asked if "it was supposed to make any difference."

So, to answer your question, YES, I TRIED. WAY before posting here :D
Well, my english is not perfect (half Spain is retarded, so we get translated and doubed films and series here...we had a civil war and most intelligent people was killed for being in the "wrong" side, the anti-fascist one), but I try to do my best!
someone always has to check that. if only you weren't the exception
[img]http://i26.photobucket.com/albums/c128/sweener2001/StewieSIGPIC.png[/img]
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

vanfanel wrote:Well, I am only using the xp kernel: I'm not using the explorer.exe shell
What shell?
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
vanfanel
Rookie
Posts: 34
Joined: Mon Mar 02, 2009 4:59 pm

Post by vanfanel »

GeoShell, a minimal shell that can subst explorer.exe and take it out of my computer forever and ever.
Spanish third republic NOW!
Tallgeese
Justice is Blind
Posts: 620
Joined: Wed Jul 28, 2004 3:33 pm
Location: Test
Contact:

Post by Tallgeese »

Sy kode, how do I find out if my driver is bad?
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Post by kode54 »

Try VBA or VBA-M with DirectDraw mode, note whether the CPU usage is higher with vsync enabled.
Tallgeese
Justice is Blind
Posts: 620
Joined: Wed Jul 28, 2004 3:33 pm
Location: Test
Contact:

Post by Tallgeese »

Does fullscreen or windowed matter?
funkyass
"God"
Posts: 1128
Joined: Tue Jul 27, 2004 11:24 pm

Post by funkyass »

vanfanel wrote:GeoShell, a minimal shell that can subst explorer.exe and take it out of my computer forever and ever.
you can specify which program to use as the shell in the registry.

subst explore.exe is not a sane solution.
Does [Kevin] Smith masturbate with steel wool too?

- Yes, but don’t change the subject.
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Post by kode54 »

Metatron wrote:Does fullscreen or windowed matter?
Possibly. Try windowed first.
vanfanel wrote:GeoShell, a minimal shell that can subst explorer.exe and take it out of my computer forever and ever.
Oh by the way, does that work with foobar2000's right click Open Containing Folder feature? It uses a shell API function to open the folder and hilight the track, and some replacement shells don't implement the function properly, so the function does nothing at all.
AamirM
Regen Developer
Regen Developer
Posts: 533
Joined: Sun Feb 17, 2008 8:01 am
Contact:

Post by AamirM »

kode54 wrote:I could share my shitty DirectDraw timer-based vsync code again, also useful on XP systems where shitty drivers will peg the CPU (or core) at full utilization while waiting for vsync.
Is it possible that this timer based approach may also work on Linux?
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Post by kode54 »

Only if Linux either has a function for polling vsync status without stalling, or if it can poll for the current scanline. Judging by the wine source code, there doesn't seem to be an easy answer for the latter, so I guess it's polling vsync a few times and timing the refresh rate. Although it seems that WaitForVerticalBlank is a stub too, so there's no easy way to poll vsync status either. Boo.
Post Reply