ZSNES 1.51b Experimental Linux Binaries

General area for talk about ZSNES. The best place to ask for related questions as well as troubleshooting.

Moderator: ZSNES Mods

greytangerine
New Member
Posts: 7
Joined: Sat Apr 04, 2009 2:58 am

Thanks!

Post by greytangerine »

THANKS! I was pulling out hair for a moment trying to figure out why sda worked and alsa wouldn't :-), the vendor's emulation repository didn't include the patch.
The pentium-4 build works fine under on my opensuse 11.1 box.
RedDwarf
Rookie
Posts: 37
Joined: Thu Jan 27, 2005 7:28 pm

Post by RedDwarf »

Nach wrote:
RedDwarf wrote:I though about packaging it for openSUSE and saw this patch in the actual 1.51(a) package:

Code: Select all

--- src/initc.c  
+++ src/initc.c 2007/08/17 14:20:26  
@@ -2621,7 +2621,7 @@  
     }  
   
     sramsavedis = 0;  
-    memcpy(&sndrot, regsbackup, 3019);  
+    //memcpy(&sndrot, regsbackup, 3019);  
   
     if (yesoutofmemory) { asm_call(outofmemfix); }  
     asm_call(GUIDoReset);
...makes any sense or better I remove it?
That breaks start up state on subsequent games or on making movies, I have no idea why someone would do that.
I don't remember what happened the last time, but I have looked again at the package.

The compiler outputs this

Code: Select all

initc.c: In function 'init65816':
initc.c:2764: warning: array subscript is above array bounds
In function 'memcpy',
    inlined from 'powercycle' at initc.c:2624:
/usr/include/bits/string3.h:52: warning: call to __builtin___memcpy_chk will always overflow destination buffer
That the packaging tools interpret this way:

Code: Select all

I: A function overflows or underflows an array access. This could be a real error,
   but occasionaly this condition is also misdetected due to loop unrolling or strange pointer
   handling. So this is warning only, please review.
W: zsnes arraysubscript initc.c:2764

I: Statement is overflowing a buffer
E: zsnes bufferoverflow initc.c:2624
Ok, whoever did that... commenting it without asking probably wasn't a great idea. But it seems to be a problem.

And... I suppose there will be no more 1.x releases. But, since I wanted to put zsnes in /usr/games I found I needed this patch:

Code: Select all

--- src/Makefile.in
+++ src/Makefile.in
@@ -142,8 +142,8 @@
 	./autogen.sh --recheck
 
 install:
-	@INSTALL@ -d -m 0755 $(DESTDIR)/@prefix@/bin
-	@INSTALL@ -m 0755 @ZSNESEXE@ $(DESTDIR)/@prefix@/bin
+	@INSTALL@ -d -m 0755 $(DESTDIR)/@bindir@
+	@INSTALL@ -m 0755 @ZSNESEXE@ $(DESTDIR)/@bindir@
 	@INSTALL@ -d -m 0755 $(DESTDIR)/@prefix@/man/man1
 	@INSTALL@ -m 0644 linux/zsnes.1 $(DESTDIR)/@prefix@/man/man1
 uninstall:
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

RedDwarf wrote: The compiler outputs this

Code: Select all

initc.c: In function 'init65816':
initc.c:2764: warning: array subscript is above array bounds
In function 'memcpy',
    inlined from 'powercycle' at initc.c:2624:
/usr/include/bits/string3.h:52: warning: call to __builtin___memcpy_chk will always overflow destination buffer
False positive, due to assembly tricks.

And I never see that warning with my GCCs.
RedDwarf wrote: And... I suppose there will be no more 1.x releases.
Don't be so certain of that. I've been toying with the idea of putting out an interim release.
RedDwarf wrote: But, since I wanted to put zsnes in /usr/games I found I needed this patch:

Code: Select all

--- src/Makefile.in
+++ src/Makefile.in
@@ -142,8 +142,8 @@
 	./autogen.sh --recheck
 
 install:
-	@INSTALL@ -d -m 0755 $(DESTDIR)/@prefix@/bin
-	@INSTALL@ -m 0755 @ZSNESEXE@ $(DESTDIR)/@prefix@/bin
+	@INSTALL@ -d -m 0755 $(DESTDIR)/@bindir@
+	@INSTALL@ -m 0755 @ZSNESEXE@ $(DESTDIR)/@bindir@
 	@INSTALL@ -d -m 0755 $(DESTDIR)/@prefix@/man/man1
 	@INSTALL@ -m 0644 linux/zsnes.1 $(DESTDIR)/@prefix@/man/man1
 uninstall:
I'm not sure what that might break...
Sounds like it couldn't go in /use/local/bin anymore...
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
RedDwarf
Rookie
Posts: 37
Joined: Thu Jan 27, 2005 7:28 pm

Post by RedDwarf »

Nach wrote:
RedDwarf wrote: The compiler outputs this

Code: Select all

initc.c: In function 'init65816':
initc.c:2764: warning: array subscript is above array bounds
In function 'memcpy',
    inlined from 'powercycle' at initc.c:2624:
/usr/include/bits/string3.h:52: warning: call to __builtin___memcpy_chk will always overflow destination buffer
False positive, due to assembly tricks.

And I never see that warning with my GCCs.
Probably because openSUSE compiles with "-D_FORTIFY_SOURCE=2 -fstack-protector".
Both are false positives? The 2764 one is just a warning, but I will need black magic to make the packaging tools accept the 2624.
Nach wrote:
RedDwarf wrote: And... I suppose there will be no more 1.x releases.
Don't be so certain of that. I've been toying with the idea of putting out an interim release.
RedDwarf wrote: But, since I wanted to put zsnes in /usr/games I found I needed this patch:

Code: Select all

--- src/Makefile.in
+++ src/Makefile.in
@@ -142,8 +142,8 @@
 	./autogen.sh --recheck
 
 install:
-	@INSTALL@ -d -m 0755 $(DESTDIR)/@prefix@/bin
-	@INSTALL@ -m 0755 @ZSNESEXE@ $(DESTDIR)/@prefix@/bin
+	@INSTALL@ -d -m 0755 $(DESTDIR)/@bindir@
+	@INSTALL@ -m 0755 @ZSNESEXE@ $(DESTDIR)/@bindir@
 	@INSTALL@ -d -m 0755 $(DESTDIR)/@prefix@/man/man1
 	@INSTALL@ -m 0644 linux/zsnes.1 $(DESTDIR)/@prefix@/man/man1
 uninstall:
I'm not sure what that might break...
Sounds like it couldn't go in /use/local/bin anymore...
In configure scripts from autoconf by default "bindir" is "exec-prefix/bin", "exec-prefix" is "prefix" and "prefix" is "/usr/local". So "/usr/local/bin" would still be the default install path.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

RedDwarf wrote:
Nach wrote:
RedDwarf wrote: The compiler outputs this

Code: Select all

initc.c: In function 'init65816':
initc.c:2764: warning: array subscript is above array bounds
In function 'memcpy',
    inlined from 'powercycle' at initc.c:2624:
/usr/include/bits/string3.h:52: warning: call to __builtin___memcpy_chk will always overflow destination buffer
False positive, due to assembly tricks.

And I never see that warning with my GCCs.
Probably because openSUSE compiles with "-D_FORTIFY_SOURCE=2 -fstack-protector".
Both are false positives? The 2764 one is just a warning, but I will need black magic to make the packaging tools accept the 2624.
I don't see "both", unless you're referring to something I don't know about. There's only one line of code in question as far as I know.

Go review the code yourself, you'll see the memcpy() is fine.
RedDwarf wrote:
Nach wrote:
RedDwarf wrote: And... I suppose there will be no more 1.x releases.
Don't be so certain of that. I've been toying with the idea of putting out an interim release.
RedDwarf wrote: But, since I wanted to put zsnes in /usr/games I found I needed this patch:

Code: Select all

--- src/Makefile.in
+++ src/Makefile.in
@@ -142,8 +142,8 @@
 	./autogen.sh --recheck
 
 install:
-	@INSTALL@ -d -m 0755 $(DESTDIR)/@prefix@/bin
-	@INSTALL@ -m 0755 @ZSNESEXE@ $(DESTDIR)/@prefix@/bin
+	@INSTALL@ -d -m 0755 $(DESTDIR)/@bindir@
+	@INSTALL@ -m 0755 @ZSNESEXE@ $(DESTDIR)/@bindir@
 	@INSTALL@ -d -m 0755 $(DESTDIR)/@prefix@/man/man1
 	@INSTALL@ -m 0644 linux/zsnes.1 $(DESTDIR)/@prefix@/man/man1
 uninstall:
I'm not sure what that might break...
Sounds like it couldn't go in /use/local/bin anymore...
In configure scripts from autoconf by default "bindir" is "exec-prefix/bin", "exec-prefix" is "prefix" and "prefix" is "/usr/local". So "/usr/local/bin" would still be the default install path.
I'll look into it.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
byuu

Post by byuu »

Nach wrote:Don't be so certain of that. I've been toying with the idea of putting out an interim release.
That would be really awesome, especially if it had the SPC7110 and DSP-3 improvements added. Depending on who's faster, the former may be quite important. And if it had UPS, you could encourage me to write some proper Qt patching software as well :)
RedDwarf
Rookie
Posts: 37
Joined: Thu Jan 27, 2005 7:28 pm

Post by RedDwarf »

Nach wrote:
RedDwarf wrote:
Nach wrote:
RedDwarf wrote: The compiler outputs this

Code: Select all

initc.c: In function 'init65816':
initc.c:2764: warning: array subscript is above array bounds
In function 'memcpy',
    inlined from 'powercycle' at initc.c:2624:
/usr/include/bits/string3.h:52: warning: call to __builtin___memcpy_chk will always overflow destination buffer
False positive, due to assembly tricks.

And I never see that warning with my GCCs.
Probably because openSUSE compiles with "-D_FORTIFY_SOURCE=2 -fstack-protector".
Both are false positives? The 2764 one is just a warning, but I will need black magic to make the packaging tools accept the 2624.
I don't see "both", unless you're referring to something I don't know about. There's only one line of code in question as far as I know.

Go review the code yourself, you'll see the memcpy() is fine.
Well, I would say the memcpy is writing 3019 bytes where there is only space for one byte... but I don't talk assembly.
Since this is the one with the memcpy I suppose you are talking about this one, I trust you there. But then there is also the warning from "SPCRAM[0xFFC0+i] = SPCROM;", at line 2764. SPCRAM is supposed to be 0xFFC0 bytes long and the for writes until 0xFFFF. SPCRAM is also really bigger than it seems?

Between, I suppose changing the involved variable declarations to make the compiler think they are... "bigger than what them are supposed to be, but of the size them really are xD"... would not be good, true?
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

It's not bigger than it seems, but the data is aligned in a specific way and we read it all in one go.

If you change anything about that alignment, you'll break everything.
i.e. Don't.
皆黙って俺について来い!!

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
RedDwarf
Rookie
Posts: 37
Joined: Thu Jan 27, 2005 7:28 pm

Post by RedDwarf »

I have not tested them. But RPMFusion, from Fedora, has:
- To fix the bindir/mandir problem: http://cvs.rpmfusion.org/viewvc/rpms/zs ... e&view=log
- To fix the FORTIFY_SOURCE problem: http://cvs.rpmfusion.org/viewvc/rpms/zs ... e&view=log
gblues
Rookie
Posts: 22
Joined: Tue Jan 18, 2005 3:50 am

Post by gblues »

RedDwarf wrote:I have not tested them. But RPMFusion, from Fedora, has:
- To fix the bindir/mandir problem: http://cvs.rpmfusion.org/viewvc/rpms/zs ... e&view=log
- To fix the FORTIFY_SOURCE problem: http://cvs.rpmfusion.org/viewvc/rpms/zs ... e&view=log
I've begun trying to migrate my work in this thread so that it doesn't break the DOS/Linux builds; I am running Ubuntu 9.10 inside Virtual PC and experienced the FORTIFY_SOURCE issue; your patch worked perfectly. I am integrating the patch into mine.
Satoshi

Post by Satoshi »

I am sorry for bringing this thread up again, but how do I apply that patch?


I am getting the whole buffer overflow error:
http://pastebin.com/f5fb2f0f5 (the "make" part you may ignore).


I really don't know what to do.
jvhellraiser
New Member
Posts: 8
Joined: Sun Oct 10, 2010 9:20 pm

Re: ZSNES 1.51b Experimental Linux Binaries

Post by jvhellraiser »

Hi!!!well i need some help!!

1.i download http://zsnes.sf.net/zsnes-1.51b-pentium4.tar.gz
2.i have already the zsnes 1.51 version install do i need it to run 1.51b?or should i remove it first?
3.i haven't remove 1.51 version yet and i just extract 1.51b i wan to use but i don't know how?
4.i have click in the file zsnes and it open but in about it does not say is 1.51b it still says 1.51 so iam not sure if iam using your fix or zsnes (btw i'm too stupid to learn the name of the emulator) 1.51. so what i want is to install 1.51b can you please help?
5.can you fix zsnes so it can read cht the right way?my cht work on zsnes (btw i'm too stupid to learn the name of the emulator) for windows but not on linux i have ubuntu 10.04.
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Re: ZSNES 1.51b Experimental Linux Binaries

Post by kode54 »

As I already said in another topic, you probably need to rename your .cht files to work with the Linux version. Case sensitive filenames and all.
kakaodvm

Re: ZSNES 1.51b Experimental Linux Binaries

Post by kakaodvm »

hi,
I can't get ZSNes run in Debian amd64.
I do what says in this thread: http://board.zsnes.com/phpBB3/viewtopic.php?f=2&t=12339
but I only get a Segmentation fault.

If I delete the /usr/lib/ao/plugins-2 dir with its contents, then I can run ZSnes but without sound.
Any Hint?

PS: I can't post in the thread above, it seems to be closed.
jvhellraiser
New Member
Posts: 8
Joined: Sun Oct 10, 2010 9:20 pm

Re: ZSNES 1.51b Experimental Linux Binaries

Post by jvhellraiser »

hahaha no it does not,i have try all that CHT or cht it don't matter it wont work i have try
chrono trigger(u).cht or chrono trigger(u).CHT and it does nothing so it must have a bug
in there somewhere. and was asking how to install 1.51b so i can try it but no answer for that.
paulguy
Zealot
Posts: 1076
Joined: Sat Jul 02, 2005 2:01 am
Contact:

Re: ZSNES 1.51b Experimental Linux Binaries

Post by paulguy »

And your ROM is named what, taking any and all spaces, symbols and capitalization in to account? Also, do you have them in the right directory? I'm not 100% sure where they go by default but I'm willing to bet in $HOME/.zsnes (a "hidden" directory in your home).

Also, make sure they haven't got cleared for whatever reason.
Maybe these people were born without that part of their brain that lets you try different things to see if they work better. --Retsupurae
jvhellraiser
New Member
Posts: 8
Joined: Sun Oct 10, 2010 9:20 pm

Re: ZSNES 1.51b Experimental Linux Binaries

Post by jvhellraiser »

ok i have try this the home folder have a folder name .ZSNES but ZSNES wont read it cause is a hidden folder i try to see is ZSNES would read the folder by enabling view hidden folder option in ubuntu but still ZSNES dont know where that folder is. any ideas?
odditude
Official tech support dood
Posts: 2118
Joined: Wed Jan 25, 2006 7:57 am

Re: ZSNES 1.51b Experimental Linux Binaries

Post by odditude »

it's ~/.zsnes, not ~/.ZSNES. there is a significant difference.
Why yes, my shift key *IS* broken.
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Re: ZSNES 1.51b Experimental Linux Binaries

Post by kode54 »

Is your ROM image "chrono trigger (u).smc" ? If it is "Chrono Trigger (U).smc" then your cheat file must be "Chrono Trigger (U).cht" and not the all-lower-case filename you posted. It does make a difference. (I also checked the source code, the extension must be "cht" and not "CHT")
jvhellraiser
New Member
Posts: 8
Joined: Sun Oct 10, 2010 9:20 pm

Re: ZSNES 1.51b Experimental Linux Binaries

Post by jvhellraiser »

my smc is on a zip file and is Chrono Trigger (U).smc i have rename the cht file to match it like this Chrono Trigger (U).cht but still nothing happens i will extract it to see what happens.
odditude
Official tech support dood
Posts: 2118
Joined: Wed Jan 25, 2006 7:57 am

Re: ZSNES 1.51b Experimental Linux Binaries

Post by odditude »

and the cht file is in ~/.zsnes (or whatever you defined the CHEATS path to be)?
Why yes, my shift key *IS* broken.
kode54
Zealot
Posts: 1140
Joined: Wed Jul 28, 2004 3:31 am
Contact:

Re: ZSNES 1.51b Experimental Linux Binaries

Post by kode54 »

Actually, I think it has to match the name of the ZIP.
jvhellraiser
New Member
Posts: 8
Joined: Sun Oct 10, 2010 9:20 pm

Re: ZSNES 1.51b Experimental Linux Binaries

Post by jvhellraiser »

forget it, thanks for the help but this is not working i have done every single thing you guys have told me nothing happens i have rename the zip file to match the cht file and nothing i have extract it and put them together in a folder in the desktop try to load from there and nothing
i pass them to the home folder and nothing,i have try to use show hidden files in home folder to see if ZSNES will read from ~/.ZSNES but ZSNES wont find the folder where i put the game and cht file because when i enter the home folder using ZSNES it wont find ~/.ZSNES folder i have erase the space between the game name erase ( ) to see is that was the problem and nothing,is funny because when i use wine with ZSNES it will read the cht files oh well maybe you guys can fix this in someway.

Thanks for all the help guys. :(
Gonzo
Regular
Posts: 280
Joined: Wed Sep 22, 2004 3:46 am
Location: Tromaville

Re: ZSNES 1.51b Experimental Linux Binaries

Post by Gonzo »

jvhellraiser wrote:forget it, thanks for the help but this is not working i have done every single thing you guys have told me nothing happens i have rename the zip file to match the cht file and nothing i have extract it and put them together in a folder in the desktop try to load from there and nothing
i pass them to the home folder and nothing,i have try to use show hidden files in home folder to see if ZSNES will read from ~/.ZSNES but ZSNES wont find the folder where i put the game and cht file because when i enter the home folder using ZSNES it wont find ~/.ZSNES folder i have erase the space between the game name erase ( ) to see is that was the problem and nothing,is funny because when i use wine with ZSNES it will read the cht files oh well maybe you guys can fix this in someway.

Thanks for all the help guys. :(
I notice you are still referring to the folder as ~/.ZSNES. Have you or have you not tried what odditude said?
it's ~/.zsnes, not ~/.ZSNES. there is a significant difference.
jvhellraiser
New Member
Posts: 8
Joined: Sun Oct 10, 2010 9:20 pm

Re: ZSNES 1.51b Experimental Linux Binaries

Post by jvhellraiser »

in home folder there is a folder call .zsnes thats all and zsnes wont read it cause is a hidden folder but i believe is not where i put the game or the cht file cause i have try to make zsnes emu to boot almost by now everywhere in the desktop,in the home folder ,change names eliminate (),eliminate space between the name i really don't know what to do anymore.

~/.zsnes i have no idea where to add this? is there a way to configure zsnes to tell him that my cht are there?
Post Reply