Malvineous wrote:For what it's worth, as someone who
ported Xargon from DOS to Linux/Windows, it can be easy or hard depending entirely on how the code is structured.
For well written games, there are usually a set of functions that deal with the hardware directly, so you only have to replace these with modern equivalents and the game will work on another platform. But in reality there are other things that even programmers don't normally think about. For example, with Xargon:
- Any code loading or saving files (saved games, levels, graphics, etc.) assumed integers were 16-bit and all values were little endian. These all have to be rewritten to load the structures field by field in a platform neutral way. It is possible to change "int" to "short" to quickly make the code work, but then it only works on little-endian (Intel) systems - it won't run on ARM systems like tablets.
- Some code relies on integer wraparound. 32767+1 = -32768 for example. Trying to find all these variables and changing them to the correct type (int to short for example) can be quite a lot of effort.
These points surely apply. It may be just me, but I think that when such code is ported to multiple platforms, it's really better to use types with fixed sizes like int32_t or uint16_t, rather than anything such as short or long.
Considering file handling, one non-portable operation is a read/write of a struct. Even if endianness isn't a problem at all, the actual size of a struct may be a bit larger than you think (a compiler magic, more or less).
- Because DOS gave you full control of the hardware, some games accidentally wrote into random memory locations due to various bugs (typically reading or writing past the end of an array.) Under DOS nothing was using that memory so nothing bad happened, but today this is a security risk so when it happens your program crashes. Finding and fixing these bugs can take a while.
That is surely a lot of fun. As someone wrote in your website, even while playing the game in DOS you may spot some strange behaviors like corrupted saved game names. I surely saw a few of these at the least back then.
If anybody is curious to know, it does look like Keen 1-3 doesn't suffer from such errors so much, although they do exist!
lemm wrote:tulip wrote:I'm pretty sure it's not really about protecting the IP. It's because they don't want to spent any working time at all on thinking about releasing the source, since working time is money.
Yeah, but some guy already has the source in a zip file. They just need to take 5 minutes to send out a permissory email.
It may seem to be the case, but as mentioned before it's not necessarily so simple. At least one lawyer may need to make a code audit in order to ensure that nothing bad occurs in the legal sense. What happened before the release of the Doom 3 source code (with an application of a patent) is a good example.