So, there’s probably something wrong with me because I’m not enjoying this, yet something about it must appeal to some deep part of the brain because I’m still here, bashing my head against this wall.
I am of course trying to run an emulator. Actually, the emulator works just fine; it's my computer that’s not fast enough. This takes me right back to when I had a really crappy Acer laptop, 800 MHz Pentium III / Windows 98, and the only way I could play an N64 emulator was to kill every single process, including explorer. Then, _and only then_, would the emulator just manage to squeeze in 50 fps.
So, this emulator, I’m only getting 10-20 fps. The nuisance problem being that frameskip is broken on OSX and has been for two years, so I can’t get a cheap and easy optimisation that way :| After discovering the particular code revision that broke the problem, I looked at getting the Mac build for the previous one that worked—the official Mac downloads didn’t begin until the revision after the one I want (literally, that close) :| I would have to download and compile the code! >:[
Compiling code, and especially on a Mac is a real pain. It’s cryptic and fragile to the extreme. First of all CMake is not installed. I have to download and compile CMake just to be able to preconfigure the compiler configuration for the emulator (Yo dawg, I heard you like compilers, so I made you a compiler to compile your compiler). Then I run CMake and that fails because "cg" is missing. I can’t just
`brew install cg` so it’s something more complicated.
Anyway, side-track time. I give up on compiling for a moment (oh, but I haven’t escaped yet) and do some research trying to locate a Mac download of this revision. I come across some information that there is a particular revision (earlier) that is much faster than any other. Someone has kindly compiled a Mac binary! Yay! The binary is hosted on MegaUpload. Was hosted. Feck. Some googling later, and there’s no mirror anywhere.
So, I checkout the source for that revision and go back to trying to compile. After a bit of googling, I’m able to narrow down "cg" as an nvidia library, something to do about vertex shaders. I download their installer package, run that and try to recompile.
"CgGL not found". Hmm. :|
Turns out that CgGL is to do with cg (though there's next to nothing on Google about CgGL), but cg is installed, what gives? Turns out it’s a path problem. The location on OSX is different than other nixes and CMake can’t find cgcl within cg. I poke through the CMake file but can’t find anything obvious. After poking through some files I find a CMake cache file that describes the configuration produced by CMake. In here is a line that says
`CGGL:FILEPATH=notfound`. I modify that to point to the right location and run CMake again.
`wxwidgets not found`.
Okay, next hurdle. I try
`brew install wxmac`. Compile fails. wxwidgets 2.8 is Carbon and can’t be compiled 64-bit, I need the pre-release version of wxwidgets to compile to cocoa. So I download wxwidgets and compile that.
But the CMake is still failing because it’s trying to locate SVN info in the folder, and they have since moved to git. I comment out the CMake lines related to SVN and CMake again.
`Cannot find source file: Src/io_osx.m`
I do a search and find that the file is named
`io_osx.m` and fix the CMake file again.
CMake completes! Huzzah! I have finally managed to configure the compiler. Now I have to actually compile! :|
`cc1: error: unrecognized command line option "-Wno-unused-result"`
That’s where I am right now. I’ll keep you posted on the joy as it unfolds!
Kroc added on
That was caused by a change in GCC since this old code was written. I found the relevant CMake line and removed the option.
Now it says
`fatal error: 'AL/al.h' file not found`!
Kroc added on
Disabled the lines in CMake for OpenAL, I’ll be using CoreAudio anyway.
Unfortunately, now I may have hit my limit as there appears to be errors with the source code itself:
`error: expected unqualified-id @class NSString, Protocol;` which I doubt I’m going to be able to rectify :(
Kroc added on
That error was apparently caused by mixing C++ and Objective-C. The file must be ".mm" instead of ".cpp" so I rename the relevant code file and update the CMake. I think I’m learning… something… but I’m not sure what.
`use of undeclared identifier 'X11Utils'`
Kroc added on
That appears to have been a coding issue relating to a macro not including a header file, but the code trying to use it. Just removed the macro and forced the include since I do have X11.
`'gtk/gtk.h' file not found`