[mythtv-users] Mythmusic to use zsnes instead of snes9x..

James Knight foom at fuhm.net
Mon Apr 28 02:35:49 EDT 2003


On Sunday, April 27, 2003, at 04:42  PM, chuck wrote:
> On Sun, 2003-04-27 at 19:30, James Knight wrote:
>> I have it running "fullscreen" but it only scales the snes screen to
>> double its normal size (thus 512x512 on my 640x480 screen) and has a
>> big black border around. If I have time I'm going to go diving into 
>> the
>> code to see what can be done to put more "full" in fullscreen.
>
> Are you able to run snes9x at fullscreen without the black border from
> outside of mythgame?  If so, what options are you using?

Nope. When I said "dive into the code", I meant the code of snes9x. 
AFAIK snes9x just doesn't do a real fullscreen.


The other thing about many of these emulators is that they just don't 
believe in sharing the CPU. They like to sit in busy-waitloops instead 
of calling a kernel sleep function. I've managed to fix this problem in 
xmame, snes9x, and fceu.


In case anyone's interested in that, I had to do the following. Since 
it's rather off-topic for this list, any questions should perhaps be 
directed back to me instead of the list.

xmame-0.65: This one's easy. ;) Make sure the option "sleepidle" is set 
to 1 in /etc/xmame/xmamerc (or wherever the config file is kept). 
Alternatively, add "-sleepidle" to the command line arguments.

fceu-0.94r2: add CFLAGS += -DDSPSOUND to Makefile.unixsdl. This tells 
it not to use its SDL sound output code, because that is what has a 
cpu-wasting loop in it (loop waiting for SDL's output buffer to get 
free space). The code could probably be fixed, but I didn't since the 
dsp sound output code works fine.

snes9x-1.39: Use threadsound ("-ts" command line argument), and replace 
this code in unix/unix.cpp,somewhere around line 1120:
                 do
                 {
                     CHECK_SOUND ();
                     S9xProcessEvents (FALSE);
                     while (gettimeofday (&now, NULL) < 0) ;
                 } while (timercmp(&next1, &now, >));
with this code:
               struct timeval sleeptime;
               struct timespec sleeptime_ns;
               timersub(&next1, &now, &sleeptime);
               sleeptime_ns.tv_sec = sleeptime.tv_sec;
               sleeptime_ns.tv_nsec = sleeptime.tv_usec * 1000;
               while(nanosleep(&sleeptime_ns, &sleeptime_ns) < 0) ;

This breaks if you don't use the threadsound option, because of the odd 
way in which non-threadsound code uses a SIGALRM timer with 1/100th of 
a second timeout (what a horrid use of signals! blech!) and thus 
nanosleep NEVER gets to sleep because the alarm interrupts it on 
*every* context switch.

James



More information about the mythtv-users mailing list