Screensaver not suppressed in ZSNES WIN since May 1st WIP

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

Post Reply
Balmorro
New Member
Posts: 7
Joined: Wed Sep 08, 2004 4:48 pm
Location: Ohio

Screensaver not suppressed in ZSNES WIN since May 1st WIP

Post by Balmorro »

I thought I'd make a post about this issue that has been creeping up in ZSNES for a while on my end. I apologize if this has already been addressed, but I searched through the documentation and these forums without mention of it. Anyway:

Having the "disable screensaver" option checked doesn't work on my machine since the May 1st WIP, and in subsequent WIPs since then (The newest build of October 19th 2004 included). Looking through ipher's page, it seems that the May 1st build was the first to implement a new code for disabling the Windows screensaver. Maybe this has something to do with it?

I'm running: Windows XP Pro Service Pack 2, if this helps. Additional information will gladly be provided upon request.
ipher
ZSNES Developer
ZSNES Developer
Posts: 269
Joined: Wed Jul 28, 2004 2:37 am
Contact:

Post by ipher »

Bug confirmed.
[url=http://www.ipherswipsite.com]ipher's WIP Site[/url]
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

Might as well add my request here.

Is there any easy way to prevent xscreensaver from activating while zsnesl is running ? I currently have to disable it manually to watch movies.

Note: please disregard this post if there's no easy way (i.e. ASM hell).
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
jdratlif
Regular
Posts: 317
Joined: Tue Sep 14, 2004 12:48 am
Location: In a small padded white room
Contact:

Post by jdratlif »

grinvader wrote:Might as well add my request here.

Is there any easy way to prevent xscreensaver from activating while zsnesl is running ? I currently have to disable it manually to watch movies.

Note: please disregard this post if there's no easy way (i.e. ASM hell).
Seconded.
http://jdrrant.blogspot.com/ - CODEpendent Blog
http://games.technoplaza.net/ - Emulation Goodies
jdratlif
Regular
Posts: 317
Joined: Tue Sep 14, 2004 12:48 am
Location: In a small padded white room
Contact:

Post by jdratlif »

grinvader wrote:Might as well add my request here.

Is there any easy way to prevent xscreensaver from activating while zsnesl is running ? I currently have to disable it manually to watch movies.

Note: please disregard this post if there's no easy way (i.e. ASM hell).
http://www.jwz.org/xscreensaver/faq.html#dvd
http://jdrrant.blogspot.com/ - CODEpendent Blog
http://games.technoplaza.net/ - Emulation Goodies
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

Is this code compatible with ZSNES ?

I was talking about snes movies...
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
jdratlif
Regular
Posts: 317
Joined: Tue Sep 14, 2004 12:48 am
Location: In a small padded white room
Contact:

Post by jdratlif »

grinvader wrote:Is this code compatible with ZSNES ?

I was talking about snes movies...
Yeah, I know. There isn't a difference. All zsnes needs to do is make that call to the xscreensaver command progam which tells it to disable. Course it needs a timer it seems. That might be difficult.
http://jdrrant.blogspot.com/ - CODEpendent Blog
http://games.technoplaza.net/ - Emulation Goodies
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

Zsnes must already be full of timers for synchronization purposes.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
jdratlif
Regular
Posts: 317
Joined: Tue Sep 14, 2004 12:48 am
Location: In a small padded white room
Contact:

Post by jdratlif »

This isn't a perfect solution. Maybe it's no better than disabling the screensaver before you start, but maybe it is.

I have written a little program and script that will disable xscreensaver using the method in the FAQ. Every 45 seconds, my little program calls the xscreensaver-command with -disable.

It also writes its PID to a file for later.

The script starts the program in the bg, starts zsnes, then kills the program and removes the PID file after zsnes has exited.

I only tested it for about 5 minutes, but it worked well for me.

Here is the C program (noblank.c). Compile it with gcc -o noblank noblank.c

Code: Select all

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>

int main(int argc, char *argv[]) {
    pid_t pid = getpid();
    const char pidfile[] = "noblank.pid";
    FILE *f;
    
    if ((f = fopen(pidfile, "wt")) == NULL) {
        fprintf(stderr, "error: unable to open pidfile for writing\n");
        return -1;
    }
    
    fprintf(f, "%hu", pid);
    fclose(f);
    
    for (;;) {
        system("xscreensaver-command -deactivate >&- 2>&- &");
        sleep(45);
    }
    
    // program will never reach here...
    return 0;
}
Here is the script, zsnes.sh

Code: Select all

#! /bin/sh

./noblank &
zsnes
kill `cat noblank.pid`
rm noblank.pid
Run sh zsnes.sh from a directory you have write access to, and zsnes will need to be in your path, or you could modify the script.

I think it's slightly easier than disabling and re-enabling the screensaver, because after you have the program compiled, you can simply use the script instead of calling zsnes, or put it on a menu if you like. Plus you don't have to reenable the screensaver.
http://jdrrant.blogspot.com/ - CODEpendent Blog
http://games.technoplaza.net/ - Emulation Goodies
Uranium-235
New Member
Posts: 9
Joined: Fri Jul 22, 2005 4:19 am

Post by Uranium-235 »

disabling screensaver worked for me...till I changed to 1280x1024 DS
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

With so little information, how do you expect us to help.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Starman Ghost
Trooper
Posts: 535
Joined: Wed Jul 28, 2004 3:26 am

Post by Starman Ghost »

This is very old, does this still apply to the latest wip? I don't run linux so I can't check.
[code]<Guo_Si> Hey, you know what sucks?
<TheXPhial> vaccuums
<Guo_Si> Hey, you know what sucks in a metaphorical sense?
<TheXPhial> black holes
<Guo_Si> Hey, you know what just isn't cool?
<TheXPhial> lava?[/code]
Uranium-235
New Member
Posts: 9
Joined: Fri Jul 22, 2005 4:19 am

Post by Uranium-235 »

It's the Windows version, version 1.42. Actually it's not doing it now. but it was earlier. Right after I changed resolution, it did it. I even restarted the computer and it still did it. I shut down last night and this morning it worked. there's still other problems. but It seems better then snes9x

OS: Windows 2000 SP4
snkcube
Hero of Time
Posts: 2646
Joined: Fri Jul 30, 2004 2:49 am
Location: In front of the monitor
Contact:

Post by snkcube »

Did you try the latest WIP version?
Try out CCleaner and other free software at Piriform
Image
Uranium-235
New Member
Posts: 9
Joined: Fri Jul 22, 2005 4:19 am

Post by Uranium-235 »

I posted my other problems in a new thread in this forum, and yes I did use the wip version
Post Reply