View unanswered posts | View active topics It is currently Mon Jul 23, 2018 4:33 pm



Reply to topic  [ 18 posts ] 
Mac OS X Version 
Author Message
New Member

Joined: Wed Dec 30, 2009 5:31 pm
Posts: 5
Location: Massachusetts
Reply with quote
Post Mac OS X Version
After an obnoxious amount of effort to shoehorn ZSNES into Xcode, I've managed to compile a Mac OS X version.

OK, so ZSNES has always had support for Mac OS X, but I've added a few changes that make it a "true" Mac OS X app. This is mostly adding configuration data to the ".app" bundle NextSTEP - I mean, Mac OS X - uses.

Sadly it did involve some mucking with the ZSNES code itself - mainly to change the main method (since I'm not using SDL's normal Mac OS X startup) but also due to a few other issues (such as memset/memcpy being too smart for their own good and bombing if they thought they'd overflow the buffer they're writing to).

I also had to add some code to ignore the "-psn_0_x" argument that Mac OS X passes to applications launched from Finder. (What's it for? No clue. And since PSN means "PlayStation Network" to Google, I haven't had any luck finding out.)

Next up there's some additional glue code to intercept the "open document" message Mac OS X sends. Unlike most other OSes, double clicking on a file registered to an application doesn't just invoke the application with the file as an argument - it sends a special message to the application instead. There's some other UI-related code changes (such as making the buttons in the About dialog work under Mac OS X).

In short, this isn't just "./configure && make && make install", there is some actual new stuff here.

Some screenshots:

Image
Image

I haven't really tested this to make sure it works, but if anyone wants to try it: ZSNES 1.51-3.dmg

My SVN repository is also online for the code: http://svn.xenoveritas.org/zsnes/trunk

This repository includes an embedded copy of SDL, which is missing any code not related to the Mac OS X port. Likewise, the Windows/DOS specific code for ZSNES is missing in that repository.


Last edited by Xenoveritas on Thu Jan 07, 2010 6:54 pm, edited 1 time in total.



Fri Jan 01, 2010 11:06 pm
Profile WWW
Inmate
User avatar

Joined: Mon Dec 06, 2004 7:47 am
Posts: 1751
Location: WA
Reply with quote
Post 
what differentiates your build from the build found here:
http://board.zsnes.com/phpBB2/viewtopic.php?t=7502

i'm just curious. if those authors are still active, you guys could collaborate

_________________
Image


Sat Jan 02, 2010 3:20 am
Profile
New Member

Joined: Wed Dec 30, 2009 5:31 pm
Posts: 5
Location: Massachusetts
Reply with quote
Post 
Well, off the top of my head:
  • My build uses 1.51, the existing one appears to have never moved past 1.43.
  • My build associates ROM files with ZSNES, so they open in ZSNES, and you can drag and drop them onto ZSNES's dock tile. This involved skipping SDL's Mac OS X launch code and a very little bit of custom code.
  • My build includes SDL as an embedded framework, which means you don't need to install it separately.
  • My build has ZSNES place its configuration files in the "correct" Mac OS X location. Which is something that happened with the ZSNES code between 1.43 and 1.51, but... it's a difference.
  • My build includes the ZSNES documentation as a "help book" which makes it accessible via the Help menu.
  • My build is against Mac OS X 10.6, which means there's no hope that anyone can ever try and run it on Power PC. :)
Sadly, it appears the original authors of that Mac OS X build are no longer active.

And with ZSNES 2.0 right on the horizon, of course, it's unclear how much effort is worth putting into a Mac OS X version. ;)


Sun Jan 03, 2010 2:56 am
Profile WWW
Lurker

Joined: Sat Feb 25, 2006 7:47 pm
Posts: 102
Reply with quote
Post 
This version seems to work perfectly fine. Well done! :-)


Mon Jan 04, 2010 5:23 am
Profile WWW
Inmate
User avatar

Joined: Mon Dec 06, 2004 7:47 am
Posts: 1751
Location: WA
Reply with quote
Post 
if i had a mac, then, i'd totally be all over this.

sounds like an awesome job. kudos

_________________
Image


Mon Jan 04, 2010 8:31 am
Profile
New Member

Joined: Wed Dec 30, 2009 5:31 pm
Posts: 5
Location: Massachusetts
Reply with quote
Post 
I've bumped the version one to fix a bug I introduced while trying to fix a really weird problem where ALIGN32 is off-by-seven on Mac OS X.

Seriously: if you check the address of any symbol after an ALIGN32, it'll end in 0x7. I have no clue why.

Unfortunately, I never undid the results of my screwing around, and in the process, broke ALIGN32.

Bottom line: save state files created with the 1.51-2 Mac OS X version won't work in 1.51-3. (Although both will work in the Windows 1.51 version.)

I've updated the link in my original post, but here it is again: ZSNES 1.51-3.dmg

Also, starting with the next version, I'm going to fully steal the Debian versioning scheme and call it 1.51-macosx4.

PS. Screw Comcast for dropping my Internet connection multiple times while I tried to post this. Seriously, WTF?


Thu Jan 07, 2010 7:27 pm
Profile WWW
ZSNES Developer
ZSNES Developer

Joined: Tue Dec 28, 2004 6:47 am
Posts: 6747
Reply with quote
Post 
Xenoveritas wrote:
PS. Screw Comcast for dropping my Internet connection multiple times while I tried to post this. Seriously, WTF?


Shhh, they are thinking you're uploading torrents! :wink:

_________________
Continuing FF4 Research...


Thu Jan 07, 2010 7:30 pm
Profile
Reply with quote
Post 
Cool, thanks for doing this. I didn't realise OSX was so weird about passing arguments to applications.

Unfortunately, this machine has 10.5 (no upgrade in sight) and, for some reason, Xcode is crap and segfaults, er go I can't build from the project files you've got (what, no ./configure? Toolchain works fine; I've verified that. ;) )

Could someone possibly do the lame-asses of the world a boon and make a build against 10.5? The dmg you posted tells me that it refuses to work because it's better than me or something.

Cheers.


Wed Feb 10, 2010 6:10 pm
New Member

Joined: Wed Dec 30, 2009 5:31 pm
Posts: 5
Location: Massachusetts
Reply with quote
Post Re: Mac OS X Version
Oof, I'm horrible at checking up on this.

Er, anyway, according to Xcode 3.2, it's an "XCode 3.1 compatible" project, so... uh...

In any case, I can't do a 10.5 compile because I don't have a 10.5 Mac to test on. (Well, that's not strictly true - I could always try on the old 10.5 PowerPC at work. Except for the "PowerPC" part. And the "misuse of company resources" part.)


Wed May 05, 2010 2:29 am
Profile WWW
Rookie

Joined: Mon Feb 19, 2007 11:23 am
Posts: 31
Reply with quote
Post Re:
Xenoveritas wrote:
Well, off the top of my head:
  • My build uses 1.51, the existing one appears to have never moved past 1.43.
  • My build associates ROM files with ZSNES, so they open in ZSNES, and you can drag and drop them onto ZSNES's dock tile. This involved skipping SDL's Mac OS X launch code and a very little bit of custom code.
  • My build includes SDL as an embedded framework, which means you don't need to install it separately.
  • My build has ZSNES place its configuration files in the "correct" Mac OS X location. Which is something that happened with the ZSNES code between 1.43 and 1.51, but... it's a difference.
  • My build includes the ZSNES documentation as a "help book" which makes it accessible via the Help menu.
  • My build is against Mac OS X 10.6, which means there's no hope that anyone can ever try and run it on Power PC. :)
Sadly, it appears the original authors of that Mac OS X build are no longer active.

And with ZSNES 2.0 right on the horizon, of course, it's unclear how much effort is worth putting into a Mac OS X version. ;)

Well, the latest build I posted is 1.51. It runs on Tiger and above. It also uses SDL as framework inside the .app. So that's points 1, 3 and 4 from your list.

I see your build also has a few bugs that only happen in OS X that were fixed after the 1.51 release (for example, you can't switch resolutions, I'm getting a white screen when I attempt to do that in your build), you might want to apply the diff I have here to 1.51 source. Good job working on better ZSNES OSX integration, though. Do you have a list/diff of files you changed (I suppose I could just run diff)?


Mon Jul 05, 2010 12:26 am
Profile
Retrosexual
User avatar

Joined: Wed Jul 28, 2004 2:09 am
Posts: 1011
Location: Rapture
Reply with quote
Post Re: Mac OS X Version
that's the smoothest I've ever seen zsnes run. right off the bat there was an automatic .smc association, I just double clicked a properly backed up .smc file. the usb microsoft sidewinder worked great after setting the keys, I have usb overdrive and that may have made the controller work. I couldn't use the C button on the controller, so in usb overdrive I set the keyboard ~ to the C button, and then zsnes sped up using the C on the controller. I was doing HQ video filter but 2x wouldn't click. I tried changing the resolution to my other monitor, and it went white. I hit escape and it went back to the game with video displaying. sound had a sparatic buzzing sound when the music and sound effects hit the right tone like before or after going through a door in metroid 3 every so often, or right after zsnes loads the rom but before the rom starts. Mac OSX 10.6

it wouldn't save directly to png, so I had to convert it from a bmp. but it gave me a great chance to play some zsnes jam.
Image


Mon Jul 12, 2010 9:41 am
Profile
New Member

Joined: Wed Dec 30, 2009 5:31 pm
Posts: 5
Location: Massachusetts
Reply with quote
Post Re: Re:
Krade wrote:
Well, the latest build I posted is 1.51. It runs on Tiger and above. It also uses SDL as framework inside the .app. So that's points 1, 3 and 4 from your list.

I see your build also has a few bugs that only happen in OS X that were fixed after the 1.51 release (for example, you can't switch resolutions, I'm getting a white screen when I attempt to do that in your build), you might want to apply the diff I have here to 1.51 source. Good job working on better ZSNES OSX integration, though. Do you have a list/diff of files you changed (I suppose I could just run diff)?

The entire thing is in a GIT repository on my machine, so I should be able to create a diff, since I believe I started it based on the original source code.

Unfortunately, that includes the entire libSDL framework, so the patch file created is nearly 4MB. (Not to mention the parts that read "Binary files /dev/null and b/zsnes.icns differ".)

Anyway, the important parts are the contents of the macosx folder, which is where I've tried to place most of the code, and hopefully this patch file which I think contains the basic changes.

Associating ZSNES with ROM files is done via the info.plist file, and doesn't require any special code.


Sat Aug 21, 2010 1:41 am
Profile WWW
New Member

Joined: Wed Apr 06, 2005 11:57 am
Posts: 6
Location: Spain
Reply with quote
Post Re: Mac OS X Version
Sorry if the post is too old, but i just found this OSX port and i just want to thank Xenoveritas for his work: THANKS A LOT!

I'm still waiting for the next version of THE BEST snes emu. Keep the good work. In fact, thanks to all the zsnes staff.


Sat May 21, 2011 10:31 am
Profile
Reply with quote
Post Re: Mac OS X Version
I've run into a bit of a problem with using ZSNES.
You see, I know nothing about computers. I just want to play SMW 3 on my mac... And sadly, I am unable lol. Anyone willing to help a poor, computer-knowledgeless soul?


Management edit: we sorta fucked up and deleted your account by mistake. No offense meant, lol. Feel free to register back. :3


Thu Sep 29, 2011 5:29 am
"Your thread will be crushed."
User avatar

Joined: Wed Jul 28, 2004 1:49 am
Posts: 1233
Location: Not in Winnipeg
Reply with quote
Post Re: Mac OS X Version
Learn how to use your computer?

If the binary in the first post doesn't work, I don't know what else to suggest.

_________________
<pagefault> i'd break up with my wife if she said FF8 was awesome


Thu Sep 29, 2011 10:00 am
Profile WWW
Zealot
User avatar

Joined: Sat Jul 02, 2005 2:01 am
Posts: 1076
Reply with quote
Post Re: Mac OS X Version
Are you sure you don't mean SMB 3 (Super Mario Bros 3)? Which is an NES game; zsnes only plays SNES games. If you want to play the SNES version, try super mario all stars.

_________________
Maybe these people were born without that part of their brain that lets you try different things to see if they work better. --Retsupurae


Thu Sep 29, 2011 10:04 am
Profile WWW
New Member

Joined: Wed Jun 20, 2012 4:05 pm
Posts: 1
Reply with quote
Post Re: Mac OS X Version
Looks great, the effort is noticeable.

Yet, Im unable to run Star Fox, i have to say is the only rom I have tested, but the Emulator close as soon I load the rom. I can provide as much information as necessary.

Im running in an iMac 21.5-inch, Mid 2011 with Lion 10.7.4


Wed Jun 20, 2012 4:10 pm
Profile
ZSNES Shake Shake Prinny
User avatar

Joined: Wed Jul 28, 2004 4:15 pm
Posts: 5613
Location: PAL50, dood !
Reply with quote
Post Re: Mac OS X Version
Check your ROM image first.

_________________
皆黙って俺について来い!!
Code:
<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)

Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54


Wed Jun 20, 2012 7:18 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 18 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software.