ZSNES Windows Compilation Errors

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

Post Reply
Sir Camehan
Rookie
Posts: 14
Joined: Tue Aug 03, 2004 7:04 am

ZSNES Windows Compilation Errors

Post by Sir Camehan »

I'm getting a very annoying compilation error when I'm trying to compile ZSNES (the Windows port). I'm trying to compile the second-latest Windows WIP(10/24).

I did these things:

1) Copied the DirectX 9.0c SDK libs and headers to the Visual C++ "Lib" and "Include" directories respectively.
2) Copied the Zlib and libpng libs and headers in the same fashion AND also into the DJGPP directory (for me it is C:\DJGPP).
3) Copied NASMW into the BIN directory of the Visual C++ "Bin" folder (the Visual C++ install foder for me is: C:\PROGRA~1\MICROS~1\VC98\)
4) Added the BIN folder of the DJGGP install to the PATH variable (My path variable is : PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\djgpp\bin)
5) Made a DJGPP entry in my enviroment variables (the variable is : DJGPP=C:\djgpp\djgpp.env)
6) Set up the directories in Visual C++ for the location of the DJGPP headers and libs
7) I also put the DirectX 9.0c SDK into a directory in the root of my harddrive called "mssdk"

To compile ZSNES I'm using Visual Studio 6.0 SP6, the latest Zlib and libpng headers and libs,and the latest NASM (the Windows port).

My OS is Windows Millennium , if that matters for something.

The error is :

zfilew.c
C:\PROGRA~1\MICROS~1\VC98\INCLUDE\zconf.h(280) : fatal error C1083: Cannot open
include file: 'unistd.h': No such file or directory
make.exe: *** [win/zfilew.obj] Error 2

All the assembler source files assemble fine and winlink.cpp compiles fine. Its just this one error that is stopping me to compile ZSNES.

I also followed the compilation instructions that came with the sources to compile. And I've also followed the instructions to set up DJGPP. So is there something I've missed?
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

To be honest, I have no idea what you're doing.
Your error is related to not having zlib setup for MSVC.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Sir Camehan
Rookie
Posts: 14
Joined: Tue Aug 03, 2004 7:04 am

Post by Sir Camehan »

That's bizzaire, as I put the Zlib headers and libs into the Visual C++ directory. This problem has been downright frustrating, as I have added some bug fixes to ZSNES.

To the source:

* I have modified it so that stereo sound is not enabled at startup and the "bug" of stereo sound enabled all the time is fixed.(It now defaults to mono sound & you can change to stereo sound later if you want
* I have modified it so that the location of where the savestate & SRAM files are saved can be edited through the GUI.
* Mode7 bugs in Skyblazer are completely fixed (the bug fixes might fix other games.)

If I could compile ZSNES, then I can test these fixes out. But at the moment, I'm completely stumped to get it to compile.
Last edited by Sir Camehan on Thu Dec 23, 2004 1:28 am, edited 1 time in total.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Sir Camehan wrote:That's bizzaire, as I put the Zlib headers and libs into the Visual C++ directory. This problem has been downright frustrating, as I have added some bug fixes to ZSNES.
What libs?
Sir Camehan wrote: * I have modified it so that stereo sound is not enabled at startup and the "bug" of stereo sound enabled all the time is fixed.(It now defaults to mono sound & you can change to stereo sound later if you want
I believe we want stereo sound enabled by default. Although I wasn't aware there was a bug here.
Sir Camehan wrote: * I have modified it so that the location of where the savestate & SRAM files are saved can be edited through the GUI.
I would be extremely interested in seeing your patch for this.
Sir Camehan wrote: * Mode7 bugs in Skyblazer are completely fixed (the bug fixes might fix other games.)
I would be interested in having the fix for this as well.
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 »

I believe we want stereo sound enabled by default. Although I wasn't aware there was a bug here.
Play Der Langrisser with stereo sound enabled. As of the latest official version on zsnes.com, the sound will crash (play the same note forever) after 10-20 minutes or so, and the game itself will run at 3-5fps. Saving a ZST and restarting ZSNES does not fix the problem.
That may be fixed in 1.40, though.

The only bug in ZSNES with mode7 that I've noticed is that it does not emulate $211a screen repetition mode 2 (bits 6-7 = 10).
It causes character 0 to be repeated offscreen, but instead it does the same as mode 3, it repeats palette color 0 instead. There's a possibility that I misunderstood this mode and it is my mistake, however.
Sir Camehan
Rookie
Posts: 14
Joined: Tue Aug 03, 2004 7:04 am

Post by Sir Camehan »

Nach wrote:What libs?
the libs that come with the DLL and static lib distribution of the zlib windows 9x/nt sdk.

How I made the savestates & SRAM location editible through the ZSNES GUI:
This was easy. All I did was make the entry in the "saves" part of the GUI copy to the "SaveDirectory" variable of zsnes*.cfg when you click "Save CFG".

The Mode7 fixes, however, took a lot longer to do. I looked at the Snes9X source and looked through its Mode7 code, to see what it was doing different to ZSNES, in terms of drawing the Mode7 object bitmaps. I remember that Pagefault was intending to use a Mode7 precision fix to fix the Skyblazer Mode7 bugs, but he didn't get around to do it, so thats what I did.

I intend of giving you the code to these fixes, but unless I can thoroughly test them(and compile ZSNES), and make up a webpage in the meantime to showcase my work, then I'm stuck for the time being unfortunatly
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Sir Camehan wrote:
Nach wrote:What libs?
the libs that come with the DLL and static lib distribution of the zlib windows 9x/nt sdk.
I have no idea what that is. I would compile zlib myself. Although ZSNESW is a major pain to get to link correctly. The DOS port on the other hand is extremely easy to build.
Sir Camehan wrote: How I made the savestates & SRAM location editible through the ZSNES GUI:
This was easy. All I did was make the entry in the "saves" part of the GUI copy to the "SaveDirectory" variable of zsnes*.cfg when you click "Save CFG".
That's not a real fix then. The config file is saved in several different ways, not just via that button. Major problems will also arise when one variable has the location and not the other one. Your quick hack does nothing about those issues. A simple example would be is that I load ZSNES after deleting zsnes(w/l).cfg and my saves start going in my ROM directory, even though when I quickly looked in the paths window it said it was going somewhere else.
Sir Camehan wrote: The Mode7 fixes, however, took a lot longer to do. I looked at the Snes9X source and looked through its Mode7 code, to see what it was doing different to ZSNES, in terms of drawing the Mode7 object bitmaps. I remember that Pagefault was intending to use a Mode7 precision fix to fix the Skyblazer Mode7 bugs, but he didn't get around to do it, so thats what I did.
Sounds good, any chance you'd be interested in doing more work on the graphics core?
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Sir Camehan
Rookie
Posts: 14
Joined: Tue Aug 03, 2004 7:04 am

Post by Sir Camehan »

Nach wrote:That's not a real fix then. The config file is saved in several different ways, not just via that button. Major problems will also arise when one variable has the location and not the other one. Your quick hack does nothing about those issues. A simple example would be is that I load ZSNES after deleting zsnes(w/l).cfg and my saves start going in my ROM directory, even though when I quickly looked in the paths window it said it was going somewhere else.
Your'e completely right there, I should have put more thought into that "fix". I'll look into more detail the complexity of the source of the 'paths' window


Thanks for that suggestion on the DOS port. Maybe I can do my assembly code testing and ZSNES bug fixing on it!

I would be more than happy to help out with doing more work on the graphics core, but I'm flat out with a lot of other things. But maybe when I've finished my computer game project I'm working on, then I definately would love to.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Sir Camehan wrote: Your'e completely right there, I should have put more thought into that "fix". I'll look into more detail the complexity of the source of the 'paths' window
The paths window is that complex. The problem is the save directory variable in the .cfg file is split in two, and is called from all over the place.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
jdratlif
Regular
Posts: 317
Joined: Tue Sep 14, 2004 12:48 am
Location: In a small padded white room
Contact:

Post by jdratlif »

It took me forever to get it to compile under Windows properly, but I made some notes. These were for compiling the 10/20 version I think though, and I haven't retested them for 1.40.

http://games.technoplaza.net/zsnes/install.txt
http://jdrrant.blogspot.com/ - CODEpendent Blog
http://games.technoplaza.net/ - Emulation Goodies
Sir Camehan
Rookie
Posts: 14
Joined: Tue Aug 03, 2004 7:04 am

Post by Sir Camehan »

Thanks for the notes, jdratlif. Your notes should be included in every source code distribution of ZSNES from now on.

These notes are a definate life-saver. I've been putting up with very weird compile errors for weeks, and it has being hard as hell to try to make it compile.

By the way, because of those notes, I can test out the Mode7 fixes I made to ZSNES. Thanks a lot!!!
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

If you have enough time, I'd appreciate if you could find what causes the mode7 problem with Energy Breaker's world map (Snes9x has it right).
皆黙って俺について来い!!

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
Post Reply