3 ms·
If you're writing code in a language that compiles to multiple CPU architectures, it's not hard to get 90% of the way towards supporting all those CPU architect
by nbm 8y ago
If you're writing code in a language that compiles to multiple CPU architectures, it's not hard to get 90% of the way towards supporting all those CPU architectures without trying much. The remainder certainly requires some effort (much less if you think about it up-front) - this is where standard types like int, long, even char, and pointers, have different sizes - and where you can't just write out the memory format to a file if that's the same file you're loading on a different platform (even with the same type sizes, because of endianness).
Writing cross-platform code, especially for early games where you're using a fairly restricted set of the platform code (and even less if you're doing a software renderer), is similarly not that hard in the common case if you've thought about it/have experience with it. There are a few different approaches, but even just having a single file that has POSIX and DOS compatibility functions (ie, above the stuff the C standard provides) and some macros could probably get you 90% of the way there.
I don't mean to downplay how hard it is to, say, support multiple renderers, which is a problem that came later, or porting code that was written without any thought given to future portability. But given they knew they were supporting two platforms, it's not that hard to do (compared to the other, actually hard, stuff they did).