ZSNES on Intel Mac, further progress

Strictly for discussing ZSNES development and for submitting code. You can also join us on IRC at irc.libera.chat in #zsnes.
Please, no requests here.

Moderator: ZSNES Mods

hector
Rookie
Posts: 49
Joined: Fri Jun 09, 2006 12:47 am

ZSNES on Intel Mac, further progress

Post by hector »

In earlier attempts the executable would crash with an illegal instruction exception because in dyld_stub a SSE instruction raises this exception as the stack is not aligned to 16 bytes. Using the new -mstackrealign parameter to gcc, this particular problem is mitigated.

I will probably do more work on this later, but for now the familiar zsnes window is drawn, but with the text pointers pointing in the wrong places, so that the text is not readable. Also, the message "Code Alignment Failure : Data Alignment Failure : 18" is printed.

Here's a screenshot of the progress so far:

Image
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

The code alignment warning come from an internal check and means the data isn't properly aligned, of course what you experience is directly linked to that.

If you find a way to rewrite the ALIGN* macros in source it so that it respects the alignment tests, you may just find a fix for that. Of course, I have no idea how to pull that.

Btw, if you want to try and realign the data itself (not recommended) the 5x5 font data (which is at fault in your pic) is found at the end of gui/gui.asm. Good luck ! :)
皆黙って俺について来い!!

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
hector
Rookie
Posts: 49
Joined: Fri Jun 09, 2006 12:47 am

Post by hector »

Image

This result was reached by modifying gui.asm, moving the lines

%include "gui/guimisc.inc"
%include "gui/guimouse.inc"
%include "gui/guiwindp.inc"
%include "gui/guikeys.inc"
%include "gui/guicheat.inc"
%include "gui/guicombo.inc"
%include "gui/guiload.inc"

onto line 777, just before the DrawSnow routine. What is confusing me is why this works. I could really use a hand here.
Mike
ZBoard Prince
Posts: 452
Joined: Tue Aug 16, 2005 11:59 am
Location: Long Island
Contact:

Post by Mike »

grinvader wrote:The code alignment warning come from an internal check and means the data isn't properly aligned, of course what you experience is directly linked to that.

If you find a way to rewrite the ALIGN* macros in source it so that it respects the alignment tests, you may just find a fix for that. Of course, I have no idea how to pull that.

Btw, if you want to try and realign the data itself (not recommended) the 5x5 font data (which is at fault in your pic) is found at the end of gui/gui.asm. Good luck ! :)
Grinvader is so cool.. haha 8)
**Prince of the Zsnes board**
*Smash Champ*
snkcube
Hero of Time
Posts: 2646
Joined: Fri Jul 30, 2004 2:49 am
Location: In front of the monitor
Contact:

Post by snkcube »

hector wrote:Image

This result was reached by modifying gui.asm, moving the lines

%include "gui/guimisc.inc"
%include "gui/guimouse.inc"
%include "gui/guiwindp.inc"
%include "gui/guikeys.inc"
%include "gui/guicheat.inc"
%include "gui/guicombo.inc"
%include "gui/guiload.inc"

onto line 777, just before the DrawSnow routine. What is confusing me is why this works. I could really use a hand here.
Bravo! Nice work.
Try out CCleaner and other free software at Piriform
Image
hector
Rookie
Posts: 49
Joined: Fri Jun 09, 2006 12:47 am

Post by hector »

GUI works perfectly now. Emulation doesn't :x
hector
Rookie
Posts: 49
Joined: Fri Jun 09, 2006 12:47 am

Post by hector »

Or perhaps I should say, Super FX doesn't. :P

Image
Ichinisan
Veteran
Posts: 603
Joined: Wed Jul 28, 2004 8:54 am

Post by Ichinisan »

SCHWEET!

An Intel-based Mac Mini WILL BE MINE.
Need a new sig...
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

There's a chance the SuperFX rom is interleaved.. use NSRT to check it out.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
PHoNyMiKe
Retrosexual
Posts: 1011
Joined: Wed Jul 28, 2004 2:09 am
Location: Rapture

Post by PHoNyMiKe »

Deathlike2 wrote:There's a chance the SuperFX rom is interleaved.. use NSRT to check it out.
I swear you're nach posting under a different name. to bad nsrt doesn't hold you while you sleep at night.
[url=http://www.alexchiu.com/affiliates/clickthru.cgi?id=phonymike]ultimate immortality[/url]
[url=http://www.sloganizer.net/en/][img]http://www.sloganizer.net/en/image,zsnes,white,purple.png[/img][/url]
hector
Rookie
Posts: 49
Joined: Fri Jun 09, 2006 12:47 am

Post by hector »

Deathlike2 wrote:There's a chance the SuperFX rom is interleaved.. use NSRT to check it out.
The rom works under Windows.
adventure_of_link
Locksmith of Hyrule
Posts: 3634
Joined: Sun Aug 08, 2004 7:49 am
Location: 255.255.255.255
Contact:

Post by adventure_of_link »

Ichinisan wrote:SCHWEET!

An Intel-based Mac Mini WILL BE MINE.
Intel-based Macbook for me.

ftw. :D
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
Ichinisan
Veteran
Posts: 603
Joined: Wed Jul 28, 2004 8:54 am

Post by Ichinisan »

I hesitate to get a laptop due to the single-button mouse input thingie doohickey mabobber.
Need a new sig...
adventure_of_link
Locksmith of Hyrule
Posts: 3634
Joined: Sun Aug 08, 2004 7:49 am
Location: 255.255.255.255
Contact:

Post by adventure_of_link »

you know you CAN buy a mouse right ?
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
Ichinisan
Veteran
Posts: 603
Joined: Wed Jul 28, 2004 8:54 am

Post by Ichinisan »

adventure_of_link wrote:you know you CAN buy a mouse right ?
You do know that would defeat the purpost of a laptop computer, right? :roll:
Need a new sig...
DataPath
Lurker
Posts: 128
Joined: Wed Jul 28, 2004 1:35 am
Contact:

Post by DataPath »

I don't get it - how does a mouse interfere with the spermcount-lowering capabilities of a laptop?
BRPXQZME
Hazed
Posts: 54
Joined: Tue May 30, 2006 3:47 am
Location: Centreville, VA
Contact:

Post by BRPXQZME »

Oh, just turn on the durn option and use two fingers to right click already.

hector: RAWK. This saves me a lot of guesswork, especially since I have the assembly/gcc-flag hacking skills comparable to those of a fish :P

(P.S., the command "svn diff > blah.patch" helps everyone see exactly what modifications you've made. I loved it since that first morning I discovered it, and I think you will, too.)
Last edited by BRPXQZME on Sun Jun 11, 2006 5:54 am, edited 1 time in total.
Ichinisan
Veteran
Posts: 603
Joined: Wed Jul 28, 2004 8:54 am

Post by Ichinisan »

There is an option? Joy!

/me likes options.
Need a new sig...
BRPXQZME
Hazed
Posts: 54
Joined: Tue May 30, 2006 3:47 am
Location: Centreville, VA
Contact:

Post by BRPXQZME »

This topic might be relevant to your interests, yes.

(In the meantime, I've also been making efforts on the MAME end... I'm going to finally make up for all these years I've been bad at 2D fighters, I swear!)
CZroe
Rookie
Posts: 23
Joined: Fri Jan 13, 2006 7:01 pm

Post by CZroe »

Ichinisan wrote:
adventure_of_link wrote:you know you CAN buy a mouse right ?
You do know that would defeat the purpost of a laptop computer, right? :roll:
It's "notebook" now. Or haven't you heard? the word "laptop" does not appear once in the MacBook's manual.
BRPXQZME wrote:This topic might be relevant to your interests, yes.

(In the meantime, I've also been making efforts on the MAME end... I'm going to finally make up for all these years I've been bad at 2D fighters, I swear!)
I told Ichinisan about that the day the new MacBooks were released. Unfortunately, it's only the standard MacBook until they update the Pro models again. The main reason I wan't a MacBook at all is for the X1600 graphics *on the go* so a regular MacBook just wouldn't cut it.
McAffee says ZSNES has a virus in it!*nt*
im glad u think its funny a**hole o wate no im not go 2 hell
BRPXQZME
Hazed
Posts: 54
Joined: Tue May 30, 2006 3:47 am
Location: Centreville, VA
Contact:

Post by BRPXQZME »

Don't think I'll ever make the rookie mistake of keeping a "portable computer" or a "notebook" directly on my lap for longer than a few minutes ever again. The Pentium M-based ones are better, but after I got a nice burn scar from this Pentium 4, no never again!

To tell the truth, if/when I get a MacBook Pro, I'll be waiting for the 64-bit processors. Not only that, but I'd get a 17" one, only for the better battery and the "holy crap that screen is way too big" factor. Okay X1600 is nice, but obviously I'm perfectly content with my integrated graphics for now.
hector
Rookie
Posts: 49
Joined: Fri Jun 09, 2006 12:47 am

Post by hector »

Super FX now working.

Image

Now working on Mario Kart.

If anyone can provide pointers to where I can find hosting I can share the patch and the executable with you guys.

Regarding Macbooks, the one I have has no problems, the trackpad does not disadvantage me at all, the screen is excellent, all in all a very good investment, especially for coding.
hector
Rookie
Posts: 49
Joined: Fri Jun 09, 2006 12:47 am

Post by hector »

And now Mario Kart works too.

Image

In both cases the problem was caused by some fault in nasm on OSX, which I can't really articulate since I don't really understand the reasons myself. By moving around the EXTSYM lines in two files the bug appears to have been worked around. Yeah, frustrating I know. Maybe my next job should be to fix the assembler?

Nach, pagefault, are you ready for me to submit patches?
bztunk
Hazed
Posts: 84
Joined: Mon Dec 27, 2004 9:08 pm
Location: In A.D. 2101, war was beginning.

Post by bztunk »

What i want to know is, how did you find out what line to change where?

Blatant luck?
16:13 <Link`sAdventure> If I had my choice between Fedora and Windows, I'd pick windows.
Deathlike2
ZSNES Developer
ZSNES Developer
Posts: 6747
Joined: Tue Dec 28, 2004 6:47 am

Post by Deathlike2 »

It's just possible that the NASM compiler for the Mac is just crappy at the moment. I remember hearing about some registers that can't be used for "some stupid reason" when it works just fine on the Linux/Windows version...
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
Post Reply