Skip to content

How to compile FCEUXD SP yourself

Here's a quick description of how to compile FCEUXD SP yourself just in case you want to add things to FCE Ultra that nobody else wants to add. There's also another guide which helped me a lot to get started.

I use the following tools and libraries to compile FCEUXD SP.
- MinGW 3.1.0.1 (MinGW-3.1.0-1.exe)
- MSYS 1.0.10 (MSYS-1.0.10.exe)
- zlib 1.2.2 (zlib122.zip)
- The DirectX 7 libraries for MinGW (dx70_mgw.zip)
1. Installing MinGW
MinGW is "a collection of freely available and freely distributable Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs". This tool collection contains the C compiler necessary to compile FCEUXD SP. Installing MinGW is extremely simple. After starting the setup file you only need to click the Next/Yes button until installation is complete.

2. Installing MSYS
MSYS is a "Minimal SYStem to provide POSIX/Bourne configure scripts the ability to execute and create a Makefile used by make". The only thing MSYS is necessary for is the compilation of the zlib library in the next step. Nevertheless you should check out MSYS some more, it's an awesome shell for Windows. Installation of MSYS is as simple as installation of MinGW.

3. Compiling zlib
zlib is "A Massively Spiffy Yet Delicately Unobtrusive Compression Library (Also Free, Not to Mention Unencumbered by Patents)". zlib is used in FCEUXD SP for handling ZIP files.

To be able to use zlib in your C/C++ programs you need to compile the library yourself. Thanks to MSYS this is quite easy. Extract the zlib archive somewhere, start MSYS and navigate to the directory where you unpacked zlib to. Once you're there use the command "configure && make && make install". This configures the compiler, compiles zlib and copies the compiled files to your MinGW directory.

Here's the output I get:
QUOTE:
$ configure && make && make install
Checking for gcc...
Building static library libz.a version 1.2.2 with gcc.
Checking for unistd.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()
Checking for vsnprintf() in stdio.h... Yes.
Checking for return value of vsnprintf()... Yes.
Checking for errno.h... Yes.
Checking for mmap support... No.
gcc -O3 -c -o example.o example.c
gcc -O3 -c -o adler32.o adler32.c
gcc -O3 -c -o compress.o compress.c
gcc -O3 -c -o crc32.o crc32.c
gcc -O3 -c -o gzio.o gzio.c
gcc -O3 -c -o uncompr.o uncompr.c
gcc -O3 -c -o deflate.o deflate.c
gcc -O3 -c -o trees.o trees.c
gcc -O3 -c -o zutil.o zutil.c
gcc -O3 -c -o inflate.o inflate.c
gcc -O3 -c -o infback.o infback.c
gcc -O3 -c -o inftrees.o inftrees.c
gcc -O3 -c -o inffast.o inffast.c
ar rc libz.a adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infback.o inftrees.o inffast.o
gcc -O3 -o example example.o -L. libz.a
gcc -O3 -c -o minigzip.o minigzip.c
gcc -O3 -o minigzip minigzip.o -L. libz.a
cp zlib.h zconf.h /usr/local/include
chmod 644 /usr/local/include/zlib.h /usr/local/include/zconf.h
cp libz.a /usr/local/lib
cd /usr/local/lib; chmod 755 libz.a
cd /usr/local/lib; if test -f libz.so.1.2.2; then \
rm -f libz.so libz.so.1; \
ln -s libz.so.1.2.2 libz.so; \
ln -s libz.so.1.2.2 libz.so.1; \
(ldconfig || true) >/dev/null 2>&1; \
fi
cp zlib.3 /usr/local/share/man/man3
chmod 644 /usr/local/share/man/man3/zlib.3


4. Installing the DirectX files
It's entirely sufficient to extract the dx70_mgw.zip file into your MinGW directory. This archive contains two directories, include and lib, which are then merged with the include and lib directories of MinGW. Afterwards you need to rename the file libmsacm32.a in the lib directory to libacm32.a.

5. Compiling FCEUXD SP
To compile FCEUXD SP I use the normal Windows command line. Just make sure the path to your compiler is correctly set in the command line. Go to the FCEUXD SP source directory and enter makewin (The name of a bat file) which builds FCEUXD SP.

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

Ice Ranger on :

How difficult would it be to port FCEUXDSP using the source code to function on an os x apple? I'm a user or mac and pc now and I knew a few people interested in seeing this available for them. All I could do was point them toward the source code on here.

sp on :

I don't really know as I don't have a Mac and I have no experience with them.

Trying to port the Windows version is probably a huge pain. There's a lot of Windows-specific code in there.

Trying to port the Linux version is probably a better idea. Try http://fceultra.sourceforge.net/download.php . The website says they have a version that runs on MacOS.

Of course the version from that website does not have the features I added. If you want to have these features on Mac OS too you need to find the relevant code in the Windows version (where I added my stuff) and port them to the Mac OS version. This should be relatively straightforward as I marked all code I added. It's still at least a few days of work (possibly more).

Gil-Galad on :

After asking a few people to add additional mapper support to FCEUXDSP and later versions of the emulator, I've decided to attempt to add additional mapper support myself.

Before I add additional mappers, I would like the compile process to be clean and error free as possible. So far I've met with a certain ammount of success after messing with it for the past couple of days. However, I am still having some problems.

I might mention that I do not have any prior HLL coding experience.

I would like some suggestions on how to deal with these error messages that I am getting while trying to compile Zlib in MSYS. I am using all of the packages that you had recommended, the exact versions as well.

I will show you a screen shot of the errors.

http://gilgalad.arc-nova.org/junk/msys_zlibcompile.png

Thanks for any assistance that you can provide, in advance.

sp on :

At first I'd recommend to get in touch with the people at http://sourceforge.net/projects/fceultra/ . Your help with adding new mappers is probably appreciated there.

Second, I haven't yet had time to look at the problem. Give me another 24-48 hours please.

sp on :

Hi again,

when I'm trying to compile zlib I get the following: http://www.the-interweb.com/bdump/fceuxdsp/zlib.png

The difference I'm seeing to your screenshot is that mine says "Building static library ... with gcc" while yours says "with cc". Can you please do a "gcc -v" like I did in my screenshot and check what gcc version you have?

Gil-Galad on :

Sorry for the delay in response, I've been pretty busy lately with various things.

I have just made a screen shot, rather strange if you ask me. gcc apparently doesn't exist and neither does cc when I try it.

http://gilgalad.arc-nova.org/junk/msys_zlibcompile1.png

After talking to one of the administrators of the now titled FCEUX, they have everything that they need. So I'll be continuing on with my studies, as I still need the functions for some of my projects.

If MinGW proves to be easy for me to use in building projects from the ground up, I may continue on with it since I'm becomming familiar with MinGW to some extent, despite the problems.

I do appreciate your assistance.

sp on :

Apparently MSYS is not aware of the gcc compiler of MingW. Did you install MinGW before installing MSYS? I think MSYS asks you for your MinGW directory during installation. Are you sure you specified the proper directory? Can you try it with foward slashes instead of backslashes? Maybe there was a problem because your directory name had spaces?

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
BBCode format allowed
Form options

Submitted comments will be subject to moderation before being displayed.