NXEngine (Cavestory) port to IRIX
#1
NXEngine (Cavestory) port to IRIX
Some months ago I was toying with getting NXengine, an open source Cave Story rewrite in SDL, to run on IRIX. I figured it would be a fun game to have and would run ok because it's a rather old game and isn't too demanding.

There were of course some hurdles to get it compiled and running, and so I'm using this post to document everything (or at least everything I can remember, as my memory is a little fuzzy now) that I did to fix it and get a version working. Because my memory isn't perfect on what I did or what files I had to patch, I'll be including a tarball of my entire source directory with the patches, as well as binaries in case they happen to run on your system, to this post. 

Firstly, I'll get dependencies and compiler setup out of the way - The game needs SDL (can be SDL1.2) and SDL_TT , other than that no real dependencies. For this I used nekoware SDL, as even though I'm not aware of an SDL2 that exists for IRIX, they have managed to get SDL_TTF working with SDL1.2 despite TTF being a 2.X exclusive (afaik). I also decided to choose SGUG-RSE/didbs GCC9 over MIPSPro or other GCC versions, this was mainly just personal preference and better compatibility with random C++ software but YMMV if you decide to use other compilers. Finally, I used the 1.0.0.6 bz2 source tarball from the NXEngine website I linked above. (Note that there is a refactor/rewrite of NXEngine called NXEngine-Evo, these are different projects and the latter uses SDL2 anyway, so I would suggest you stick with the original NXEngine if you are looking to try this.)

The first issue I encountered was with a file that needed endian.h. If I'm not wrong that header does not exist on IRIX by default - thankfully the SGUG-RSE team has a library to solve compatibility issue like this called libdicl. Just add libdicl to the list of include directories in the make, and that should be resolved.

Second issue was more with my system, rather than the program itself - but it makes use of cmath/math.h, which is broken by default on a lot of 6.5 installs, whether you're using GCC or MipsPro. I forget the details of the issue but you'll want to make sure you have working cmath; if that's not the case, the fix is to remove a couple bad patches put out by SGI from your system. Here is a guide on how to do so.

At this point, it should compile if you've applied the previous two fixes. But there are two endian-related problems that still need to be fixed that prevent the game from fully launching. In common/misc.cpp, there is an ifdef check for little endianness, but I don't think it quite works because the code still runs anyway and causes errors at launch. All you need to do to fix this is replace the line with an SDL-based endianness check, as detailed here. (This patch is for NXEngine-EVO, but works on the original NXEngine as well). Finally there is an issue with the sound initialization where it expects little endian sound format, you just need to go in sound/sslib.cpp and replace AUDIO_S16 with AUDIO_S16MSB on line 29.

And that's it! Here's a screenshot of it running on my O2:

[Image: UeZMk5h.png]

It doesn't run great, but it might be worth trying on a faster system like an Octane.

As promised, my source tarball is attached to this post.


Attached Files
.gz nx-IRIX.tar.gz Size: 9.17 MB  Downloads: 283

systems:
Indy x2  :Altix-350: O2  :where's-my-altix-330-emote:
(This post was last modified: 08-09-2020, 01:21 AM by Raion.)
partitionpenguin
panther_

Trade Count: (0)
Posts: 16
Threads: 5
Joined: Dec 2018
Find Reply
08-09-2020, 12:46 AM


Messages In This Thread
NXEngine (Cavestory) port to IRIX - by partitionpenguin - 08-09-2020, 12:46 AM
RE: NXEngine (Cavestory) port to IRIX - by Raion - 08-09-2020, 01:22 AM
RE: NXEngine (Cavestory) port to IRIX - by partitionpenguin - 08-09-2020, 01:51 AM
RE: NXEngine (Cavestory) port to IRIX - by commodorejohn - 08-09-2020, 03:23 AM
RE: NXEngine (Cavestory) port to IRIX - by jpstewart - 08-10-2020, 12:33 AM
RE: NXEngine (Cavestory) port to IRIX - by partitionpenguin - 08-10-2020, 04:03 PM
RE: NXEngine (Cavestory) port to IRIX - by Raion - 08-10-2020, 12:48 AM
RE: NXEngine (Cavestory) port to IRIX - by jpstewart - 08-11-2020, 11:18 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)