Linux port
Moderator: ZSNES Mods
Linux port
Ok basically want input from the linux community here and basically what I am asking is what would you guys like to see in this port. Linux is my main operating system now so this will be my primary focus from now on.
-
- Lurker
- Posts: 109
- Joined: Sun Jan 30, 2005 10:06 pm
- Location: Wouldn't you like to know?
- Contact:
Since you are running Linux, this might apply too. See if it can run more flawlessly on other *nix variants too, like I run FreeBSD and in order to get ZSNES to even run, I have to edit a small section of the linux/zfilew.c file, otherwise it crashes on load with a free() error. Plus, I dunno if it's my system or what, but the OpenGL video modes go very, very slow for me while the few non-OpenGL ones run nice and fast.
[url=http://www.cyberbotx.com/]SNES Sprite Animations[/url], made by an Insane Killer Robot.
I'm a computer programmer (in C++) and a future game designer.
I'm a computer programmer (in C++) and a future game designer.
Re: Linux port
OpenGL code that was *not* spawned by the Devil, please.pagefault wrote:Ok basically want input from the linux community here and basically what I am asking is what would you guys like to see in this port. Linux is my main operating system now so this will be my primary focus from now on.
-
- Lurker
- Posts: 109
- Joined: Sun Jan 30, 2005 10:06 pm
- Location: Wouldn't you like to know?
- Contact:
I probably should've posted this last night, but I was tired and didn't think about it.
When I first was trying to use ZSNES *nix version on my FreeBSD system (which I think was back when 1.36 was the only official (non-WIP) one out), it worked fine for me. But then, I updated it to 1.42 via the FreeBSD ports system, and then whenever I tried to use it, it wouldn't load. Instead, this would happen: (and it happened with 1.41's code and up, including the WIPs)In order to fix that, I had to go into the linux/zfilew.c file and change the following part of the obtaindir() function:to this:I believe this is because the getenv() function in FreeBSD returns a memory address outside the ZSNES program memory store, so trying to free is means that it's trying to free memory it didn't create. Thus the junk pointer message. Adding that 'int alloc' and using it as a flag got around that problem.
Also, I have to use the following shell script to successfully compile ZSNES, as normally it wouldn't include the right include directories: (I got the sed commands out of the FreeBSD port of ZSNES)
Hope this helps at all.
When I first was trying to use ZSNES *nix version on my FreeBSD system (which I think was back when 1.36 was the only official (non-WIP) one out), it worked fine for me. But then, I updated it to 1.42 via the FreeBSD ports system, and then whenever I tried to use it, it wouldn't load. Instead, this would happen: (and it happened with 1.41's code and up, including the WIPs)
Code: Select all
[kirby /shared/zsnes_1_42/src]# ./zsnes
ZSNES v1.42 (c) 1997-2005, ZSNES Team
Be sure to check http://www.zsnes.com/ for the latest version.
Please report crashes to zsnes-devel@lists.sourceforge.net.
ZSNES is written by the ZSNES Team (See AUTHORS.TXT)
ZSNES comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions;
please read 'LICENSE' thoroughly before doing so.
Use ZSNES -? for command line definitions.
zsnes in free(): error: junk pointer, too high to make sense
Abort (core dumped)
Code: Select all
void obtaindir()
{
char *homedir = 0;
DIR *tmp;
if ((homedir = (char *)getenv("HOME")) == 0)
{
homedir = (char *)malloc(ZCFG_DIR_LEN);
getcwd(homedir, ZCFG_DIR_LEN);
}
strcpy(zcfgdir, homedir);
free(homedir);
strcat(zcfgdir, ZCFG_DIR);
...
Code: Select all
void obtaindir()
{
char *homedir = 0;
DIR *tmp;
int alloc = 0;
if ((homedir = (char *)getenv("HOME")) == 0)
{
homedir = (char *)malloc(ZCFG_DIR_LEN);
getcwd(homedir, ZCFG_DIR_LEN);
alloc = 1;
}
strcpy(zcfgdir, homedir);
if (alloc) free(homedir);
strcat(zcfgdir, ZCFG_DIR);
...
Also, I have to use the following shell script to successfully compile ZSNES, as normally it wouldn't include the right include directories: (I got the sed commands out of the FreeBSD port of ZSNES)
Code: Select all
#!/bin/sh
aclocal15 --acdir=`sdl11-config --prefix`/share/aclocal # thanks asfand
autoconf253
sed -i.bak -e 's| -pipe||g ; s| -I/usr/local/include||g ; s| -I/usr/include||g ; s| -O3 .* -s||g' ./configure
sed -i.bak -e 's|@CXX@ @CFLAGS@ -o|@CXX@ @CXXFLAGS@ @CPPFLAGS@ -o|g ; s|@CC@ @CFLAGS@ |@CC@ @CFLAGS@ @CPPFLAGS@ |g' ./Makefile.in
env CPPFLAGS="-I/usr/local/include -I/usr/X11R6/include" LDFLAGS="-L/usr/local/lib -L/usr/X11R6/lib" ./configure
gmake
[url=http://www.cyberbotx.com/]SNES Sprite Animations[/url], made by an Insane Killer Robot.
I'm a computer programmer (in C++) and a future game designer.
I'm a computer programmer (in C++) and a future game designer.
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
Um... No.CyberBotX wrote:I believe this is because the getenv() function in FreeBSD returns a memory address outside the ZSNES program memory store, so trying to free is means that it's trying to free memory it didn't create.
The problem is getenv() is simply not failing for you.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
Um... Not really.Nach wrote:Um... No.CyberBotX wrote:I believe this is because the getenv() function in FreeBSD returns a memory address outside the ZSNES program memory store, so trying to free is means that it's trying to free memory it didn't create.
The problem is getenv() is simply not failing for you.
The problem is that the string returned by getenv() should probably not be free()ed. It returns "a pointer to the value in the environment".
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
That's what I just said.anomie wrote:Um... Not really.Nach wrote:Um... No.CyberBotX wrote:I believe this is because the getenv() function in FreeBSD returns a memory address outside the ZSNES program memory store, so trying to free is means that it's trying to free memory it didn't create.
The problem is getenv() is simply not failing for you.
The problem is that the string returned by getenv() should probably not be free()ed. It returns "a pointer to the value in the environment".
The problem is it not failing thus freeing something not malloc'd.
It's also been fixed for a while now.
Code: Select all
if ((homedir = (char *)getenv("HOME")) == 0)
{
getcwd(zcfgdir, ZCFG_DIR_LEN);
}
else
{
strcpy(zcfgdir, homedir);
}
strcat(zcfgdir, ZCFG_DIR);
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
-
- Lurker
- Posts: 109
- Joined: Sun Jan 30, 2005 10:06 pm
- Location: Wouldn't you like to know?
- Contact:
And I'm guessing that the getenv() call in that file must've been changed after the latest 2/28 WIP, because I know the code wasn't like that in the 2/28 WIP. But good to know that it has been fixed and I don't need to mess with the code next time.
[url=http://www.cyberbotx.com/]SNES Sprite Animations[/url], made by an Insane Killer Robot.
I'm a computer programmer (in C++) and a future game designer.
I'm a computer programmer (in C++) and a future game designer.
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
Yeah, I commited the fix yesterday once I saw your post on the forum. I meant to earlier but forgot about it.CyberBotX wrote:And I'm guessing that the getenv() call in that file must've been changed after the latest 2/28 WIP, because I know the code wasn't like that in the 2/28 WIP.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
-
- Dark Wind
- Posts: 1271
- Joined: Thu Jul 29, 2004 8:58 pm
- Location: Texas
- Contact:
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
All ports.Noxious Ninja wrote:Does your checkin "Major framerate improvement when using new graphics engine" only apply to the Linux port, or is it for all ports?
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
-
- Dark Wind
- Posts: 1271
- Joined: Thu Jul 29, 2004 8:58 pm
- Location: Texas
- Contact:
-
- Locksmith of Hyrule
- Posts: 3634
- Joined: Sun Aug 08, 2004 7:49 am
- Location: 255.255.255.255
- Contact:
...you know PF, every OS has its advantages and disadvantages...
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
NSRT here.
-
- Lurker
- Posts: 109
- Joined: Sun Jan 30, 2005 10:06 pm
- Location: Wouldn't you like to know?
- Contact:
You guys are right about that, but I've experienced less problems with *nix-based systems than with Windows-based systems. Hell, my FreeBSD only crashes or stops working because of me using it constantly, espcially with VMware running non-stop too. That on it's own could probably kill any machine running FreeBSD, since it's not designed for FreeBSD, but for Linux. But yeah, Linux does have it's problems, but it doesn't crash as often as Windows does if it's used right.
[url=http://www.cyberbotx.com/]SNES Sprite Animations[/url], made by an Insane Killer Robot.
I'm a computer programmer (in C++) and a future game designer.
I'm a computer programmer (in C++) and a future game designer.
...And, surprise, Windows XP doesn't crash often (read: at all) if used properly either unless met with a hardware failure or a really horrible bug in software. Thus voiding your post and your argument halfway CyberBotX.
As for stopping, I myself don't get any if I let it initally sit idle after bootup for... ten seconds?
Please stop the outright general OS superiority biases (on ALL sides), they are bullshit a grand majority of the time.
As for stopping, I myself don't get any if I let it initally sit idle after bootup for... ten seconds?
Please stop the outright general OS superiority biases (on ALL sides), they are bullshit a grand majority of the time.
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
I bought a new machine with WinXP pre installed. And I got it to crash within the first week. In fact, ~1/3 times I use XP it crashes on me.Metatron wrote:...And, surprise, Windows XP doesn't crash often (read: at all) if used properly either unless met with a hardware failure or a really horrible bug in software.
Perhaps what I use a PC for WinXP just can't handle...
Regardless of how good WinXP is overall, I find it personally one of the worst operating systems I could possibly use.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
Coding + Debugging.Metatron wrote:What kind of insanity were you subjecting it to? I've left my two year old XP machine on for a weeks at a time when DLing some monstrous, multi-GB files times five, and I didn't get any kind of crash...
Video Editing.
IRC.
GAIM.
Locks up XP all the time.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
Well, the preinstalled WindowsXP is part of the problem. OEM-default installations of WinXP are VERY buggy. Usually lots of bloatware in there too. My suggestion is to back up, format, and reinstall.
By the very nature of Windows, every new program you install increases the chance of decreased reliability of WinXP. Old Win95 programs can nicely screw up a system. It really just depends.
By the very nature of Windows, every new program you install increases the chance of decreased reliability of WinXP. Old Win95 programs can nicely screw up a system. It really just depends.
[url=http://zsnes-docs.sf.net]Official ZSNES Docs[/url] | [url=http://zsnes-docs.sf.net/nsrt]NSRT Guide[/url] | [url=http://endoftransmission.net/phpBB3/viewtopic.php?t=394]Using a Wiimote w/ emulators[/url]
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
I hosed the disk, partitioned, installed WinXP fresh and Linux on it the same day I got it.bitcopy wrote:Well, the preinstalled WindowsXP is part of the problem. OEM-default installations of WinXP are VERY buggy. Usually lots of bloatware in there too. My suggestion is to back up, format, and reinstall.
WinXP on it still gives me trouble, hence why I rarely use it in WinXP.
WinXP on other machines give me trouble too, I find it to be a lousy OS.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding