Problems compiling hq3x32.asm

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

Post Reply
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Problems compiling hq3x32.asm

Post by Noxious Ninja »

Anybody else having nasm crash when building this file on Windows? It was working fine up until about a few days ago (I think). I'm not sure if something changed with the HQ code, or if something is up with my system.

I just pulled down a fresh copy of the CVS tree to make sure none of my files were corrupt.

I haven't changed anything in my build environment in quite a while. This is weird.

My build command (MinGW + msys) is

make -f makefile.ms PLATFORM="win32-unix-shell" CPUOPT="athlon-xp"

I'm trying with RELEASEGRADE="yes" now to see if it works with that.
Last edited by Noxious Ninja on Mon Apr 11, 2005 10:10 pm, edited 1 time in total.
[u][url=http://bash.org/?577451]#577451[/url][/u]
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

Any error messages when nasm dies on you ?
皆黙って俺について来い!!

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
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

Just the standard Windows "nasm.exe has encountered a problem and needs to close" message. Nothing from NASM itself.

It's very much repeatable. My optimized build just got to the HQ code, and did the same thing. I do have the latest version of NASM.

It goes through the preceeding HQ files just fine.

Code: Select all

nasm -O9999  -f win32 -D__WIN32__ -o video/hq2x16.obj video/hq2x16.asm
objfix video/hq2x16.obj
nasm -O9999  -f win32 -D__WIN32__ -o video/hq2x32.obj video/hq2x32.asm
objfix video/hq2x32.obj
nasm -O9999  -f win32 -D__WIN32__ -o video/2xsaiw.obj video/2xsaiw.asm
objfix video/2xsaiw.obj
nasm -O9999  -f win32 -D__WIN32__ -o video/hq3x16.obj video/hq3x16.asm
objfix video/hq3x16.obj
nasm -O9999  -f win32 -D__WIN32__ -o video/hq3x32.obj video/hq3x32.asm
make: *** [video/hq3x32.obj] Error 5
I wonder if some of your EXTSYM cleaning caused this? I see it touched pretty much everything.

EDIT: I'm downloading the source from ipher's WIP page to see if that builds. It obviously builds for him.
[u][url=http://bash.org/?577451]#577451[/url][/u]
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Are you using the latest NASM?
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

Code: Select all

$ nasm -v
NASM version 0.98.39 compiled on Jan 16 2005
I guess that's the latest.

ipher's source package does the same thing for me, so maybe the problem is my system.


EDIT: OK, this is bizarre. I tried yasm, just for the hell of it. It did EXACTLY THE SAME THING. But that's not the weird part. When I tried running the exact same command it crashed on manually, it compiled. I ran the makefile again, it crashed on hq4x32.asm. Built it manually, ran make, it works.

Running the nasm commands manually, however, still causes nasm to crash.

Now I'm going to try building it without msys, and see what happens.
Last edited by Noxious Ninja on Mon Apr 11, 2005 11:02 pm, edited 1 time in total.
[u][url=http://bash.org/?577451]#577451[/url][/u]
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

Weird... nasm error 5 ? Don't even know what that means... -_-;
皆黙って俺について来い!!

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
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

I would think so.

Anyways, have an object file: http://nsrt.edgeemu.com/hq3x32.obj

See how far you can get now that you have that. Make sure the date on the file is newer so it doesn't try to recompile it.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

I must've edited while you were posting. See the edit to my previous post.

Oh, building from cmd.exe with PLATFORM="win32" gets the same crash. Weird.

Well, I have a workaround now. Thanks for your help.
[u][url=http://bash.org/?577451]#577451[/url][/u]
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

There's prolly something not right in our makefiles.
皆黙って俺について来い!!

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
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

For some reason I smell Windows weirdness with bad handling of a slighly problematic file due to partition or HD issues.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

I'll set up a build environment in a VMWare WinXP VM when I have the time, just to see what happens.
[u][url=http://bash.org/?577451]#577451[/url][/u]
xamenus
Veteran
Posts: 907
Joined: Fri Jul 30, 2004 12:26 am

Post by xamenus »

I've been getting this problem as well, using MinGW.
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

IceFox wrote:I've been getting this problem as well, using MinGW.
Here's my workaround:

Grab YASM. The latest version can be found here:
http://www.tortall.net/projects/yasm/re ... .0-win.exe

Copy it somewhere in your path. I stuck it in MinGW\bin and named it yasm.exe for convenience.

Edit makefile.ms and change these lines:

Code: Select all

ASM=nasm
ASMOPT=-O1
to

Code: Select all

ASM=yasm
ASMOPT=
Now, when make crashes, just run the offending commands manually:

Code: Select all

yasm   -f win32 -D__WIN32__ -o video/hq3x32.obj video/hq3x32.asm
objfix video/hq3x32.obj
yasm   -f win32 -D__WIN32__ -o video/hq4x32.obj video/hq4x32.asm
objfix video/hq4x32.obj
Or, if you use msys, you can do them all at once:

Code: Select all

yasm   -f win32 -D__WIN32__ -o video/hq3x32.obj video/hq3x32.asm && objfix video/hq3x32.obj && yasm   -f win32 -D__WIN32__ -o video/hq4x32.obj video/hq4x32.asm && objfix video/hq4x32.obj
Then run make again. Hey, presto, it works. Yes, it's a very ugly hack.
Last edited by Noxious Ninja on Tue Apr 12, 2005 12:22 am, edited 1 time in total.
[u][url=http://bash.org/?577451]#577451[/url][/u]
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Noxious Ninja wrote: Side comment: Is objfix required if you use YASM? I tried removing it from the makefile, and ZSNES appears to still work.
objfix converts the object files from MSVC format to MinGW format, if YASM is outputting in MSVC format, then yes you need objfix.

Strange that both of you have the same problem, ipher nor I have it.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
MxC

Post by MxC »

change

Code: Select all

EXTSYM prevline,nextline,deltaptr,xcounter,w1,w2,w3,w4,w5,w6,w7,w8,w9,c1,c2,c3
EXTSYM c4,c6,c7,c8,c9,reg_blank,const7,cross,threshold
to

Code: Select all

EXTSYM prevline,nextline,deltaptr,xcounter,w1,w2,w3,w4,w5,w6,w7,w8,w9
EXTSYM c1,c2,c3,c4,c6,c7,c8,c9,reg_blank,const7,cross,threshold

Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

@Nach: Yeah, I just realized that ZSNES runs, but if you load a game it crashes. So I stick the objfix stuff back in and everything is great.


@MxC: Hey, that works. Excellent! Thanks!

This sounds like a NASM bug, but why it wouldn't be universal is REALLY bizarre.


EDIT: For hq4x32.asm, I had to make the last line

Code: Select all

EXTSYM c1,c2,c3,c4,c6,c7,c8,c9,reg_blank,const3,const5,const6,const7,cross,threshold
or it complained about undefined symbols.

EDIT2: YASM no longer crashes, either.
Last edited by Noxious Ninja on Tue Apr 12, 2005 4:59 am, edited 2 times in total.
[u][url=http://bash.org/?577451]#577451[/url][/u]
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Does sound like some sort of NASM bug.

Could be it's only present in the official versions which you both have.

I think ipher uses a special build I made for him, and I use some special stuff too.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Post Reply