What's the correct method to port a game?

slinga

Established Member
Hey all,

I need some high-level advice in regards to porting a game. I'm attempting to port an open source game written in C. The game uses SDL and DJ. What's the correct method to begin porting? Should I start with the main.c file and import lines one at a time, fixing errors as I progress? Or should I import the entire project at once and attempt to compile it. Thanks in advance.
 
Well, there's more than one way to approach this. Personally I'd examine the code and try to figure out what functions contain most of the platform-specific code, then create a "skeleton" file of dummy implementations and modify the build script (makefile, project file, or whatever) to build/link that instead of the usual functions. Then basically try to build and see where errors pop up...
 
(I assume you wouldn't want to port the SDL or other libraries used in the game to port)

Before looking in the code, it's a good idea to play the game. There you can have a first impression and see if there are some things you couldn't do on Saturn (too high resolution...).

Then you need to view through the code and look for SDL specific stuff.

I made two approaches: a) both, an SDL and SGL version of the graphic engine and (see http://www.rockin-b.de/wintersportseins.html) b) C macros which wrap SDL calls to SGL stuff (see http://www.rockin-b.de/saturn-tictactoe.html). The latter one needs only few or even no modifications of the original code, but might only be applicable, when very few SDL functions are used.

In either case, you'd need to convert the graphic and sound files to saturn formats.
 
Back
Top