The conversation

Lessons learnedExperience excerpt · English

I worked on port of a Konami game from PSX to PC, that was 1999-2000 - the code (C) had lots of …

I worked on port of a Konami game from PSX to PC, that was 1999-2000 - the code (C) had lots of #ifdefs like where inline assembly was placed, and the original "C" code was kept. It seemed all done by one specific programmer, and what really saved us (in porting) the game was the originallly kept "C" code. My mips knowledge was never as good as x86. So yes, it was the norm back then. My second job (1998), was working on a team that was going to do some software for Intel for the upcoming back then Katmai processor (Pentium I was it). It had all the new fancy SIMD instructions. The software was supposed to be something like media composer - you slap images, rotate them, etc all in realtime using software rendering (GPUs were still relatively expensive). I wrote a bilinear and bicubic texture mapper with marching squares for transparent areas. It was all in assembly, and I spent lots of time optimizing it. …

Original discussionOriginal Age of Empires 2 dev talks about its usage of assembly code107 source comments · at import
5

Community replies 0

No community replies yet. Add your perspective.

Replies from the source 5

Direct replies available in this import. Original-language excerpts.

AK

It was always so disappointing, spending hours coding up a tightly wound assembly language version of some inner loop that uses half the instructions generated by the C++ compiler, only to find that your slaved-over version is actually 5% slower . But OTOH... the thrill when it actually was faster! This was back in the Pentium 4 era, where there were deep pipelines and oddities like some simple ALU instructions (ADD, SUB, etc.) taking 0.5 cycles(!), while others (ADC, SHR) took 4 cycles IIRC.

Full original
PH

You worked on the port of Metal Gear Solid?! OH MY GOD THIS IS SO COOL! Edit: Looking it up you might have worked on a larger amount of games than I thought. Very awesome nonetheless. https://www.mobygames.com/game/company:99/from:1998/platform...

Full original
PJ

Another Flipcode user! I missed that other game forums of similar vintage are now gone. The way to being able to do Assembly in Borland products, and to lesser extent on VC++, was great. I always feel like vomiting when looking at the mess UNIX compilers have come up for it, instead of inferring how registers are being used, and the whole string concatenation stuff.

Full original
ER

Before I really knew how to program, I tried to port http://advsys.net/ken/voxlap.htm to Linux: https://github.com/Ericson2314/voxlap It was written in the same C / inline assembly style. Unfortunately seemed to me like the final ASM didn't quite do the same thing as the original C.

Full original
FE

Isn't that a pretty common tactic? Write everything in C and then at some point in the dev cycle start identifying functions/features that can be asm'd for performance reasons?

Full original
Continue on Hacker News

Respect different perspectives. Share concrete experiences.

Sign in to post, reply, repost, and quote.