PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Are you guys full time programmers?

Okay, let's say an intelligent but utterly ignorant guy like me wanted to port a game for the ppc, let's say Gabriel Knight 1, for example.

What skills would I need and where would I learn them?

Are you guys fulltime programmers or what?

Is the notion of learning this skill (these skills) from scratch ridiculous or is it within the realm of reasonable possibility?

Just wondering.
What skills would I need and where would I learn them?

That depends on what you're trying to port. Usually, at least a good working knowledge of C is required. Issues such as memory alignment and endian-ess may also have to be identified and addressed. Replacements or substitutes may have to provided for standard C library API calls that are not supported by Windows CE. Many older games contain Assembly routines, which were required at the time to make the game playable on the slow hardware of its day. One would have to be familiar with assembly for that target processor (usually intel x86), so it could be converted to C. Often times ASCII strings will have to be converted to / from UNICODE (which is the format that has to be used for Windows CE API calls).

Next, you should have a good knowledge of various schemes of representing an image in memory (bitmaps). Normally in older games the VGA hardware was accessed directly. Calls were made to the hardware to set video modes, store palettes, and draw graphics primitives. You would have to determine what does what, and provide new routines to generate the output directly to the Pocket PC display using Game API, in place of calls to the video hardware.

Another issue is input. Some games require extensive keyboard input, while others use only a few keys or a joystick for basic character control. Mouse input is separate issue, however most older games did not use the mouse. You often have to handle various windows messages (KEY_UP, KEY_DOWN, etc), and keep track of key states for the various keys, because games almost exclusively poll for states instead of using an event-driven mechanism.

Sound is IMO usually one of the toughest parts to port. Generally the game will have some routines that are called when a sound is to be played. Those routines would then do all the nasty direct-hardware access to the sound card(s) to play the sample. If you can get ahold of a general sound library that mixes and plays waveforms, then it could be used to play a given sample at a specific time. Music would be handled by a different set of routines that would access different hardware than the sfx routines.

Finally, a Pocket PC application must be created. This creates the window, handles messages which are ultimately routed to the game as user input,

Now, a graphics library that encapsulates Game API, Pocket PC stuff like window creation, taking over the whole screen, locking access to the hardware buttons, etc, can be used to save a lot of work. That would also preclude the need to know the Pocket PC API. Jacco's EasyCE would be a good choice. The new 2.0 version includes the MikMod sound library if I remember correctly.

A big part of porting a game is reliance on experience. The more software you write, the more applications you port, the more you know what to expect and the easier it is to look at a piece of code and determine what it is supposed to do.

Are you guys fulltime programmers or what?


I'm a full-time Windows CE programmer since 1997.

Is the notion of learning this skill (these skills) from scratch ridiculous or is it within the realm of reasonable possibility?


It is not unreasonable to learn all these abilities. There was of course a time when I could not port anything, and I now can, so it is possible to go from point A to B. :) If you do not know C programming, then additional time will be required to familiarize yourself with the language, which is the staple of the programming world.

Dan East
Dan East wrote:

Sound is IMO usually one of the toughest parts to port. Generally the game will have some routines that are called when a sound is to be played. Those routines would then do all the nasty direct-hardware access to the sound card(s) to play the sample. If you can get ahold of a general sound library that mixes and plays waveforms, then it could be used to play a given sample at a specific time. Music would be handled by a different set of routines that would access different hardware than the sfx routines.


Soundwise - it might be interesting to note that scummvm uses a file from MAME that is designed to emulate the adlib chip. This means that that is relatively straightforward. It has it's own mixing code though, which is quite disgusting ;>

There's quite a bit of open-source code to achieve quite a few of these aims interestingly enough - however, most of them are going to be under the GNU General Public License, and thus limit you to porting GPLd code. With careful hunting I guess you might find stuff that isn't GPLd.