First steps: French language and dead code

Got the disassembly of the French version of Operation Stealth (There was already some work done on it by another person so I’m not starting totally from scratch here) and also the disassembly of the French version of Future Wars (Les Voyageurs du Temps) so I’ve got another version of the Cinématique engine to compare functions with. Luckily enough I know at least a little bit of French (I studied French as a fourth language in elementary school and gymnasium) – although I’ve forgotten most of it ;-). Learned that échec in French means failure btw.

Found where in the Operation Stealth’s disassembly the opcode list was and named the functions according to the current namings in the ScummVM’s cinE-engine. Also commented a couple of small functions in the disassembly (readScriptU8 and readScriptU16) and found out that Turbo C wasn’t so hot on dead code elimination back in the day. Look at this code from readScriptU16:

seg002:0035 mov al, es:[bx]
seg002:0038 mov ah, 0
seg002:003A mov si, ax
seg002:003C mov ax, si
seg002:003E mov cl, 8
seg002:0040 shl ax, cl
seg002:0042 mov si, ax

Now isn’t that beautiful?-). I mean, bouncing stuff around without any meaning. They could’ve just done:

mov ah, es:[bx]
xor al, al
mov si, ax

7 instructions boiled down to 3. That’s quite a reduction I’d say. But well, don’t know what compiler optimization settings they used for compiling Operation Stealth and to be fair computer horsepower back when Turbo C was hot stuff was mildly different than today :-D.

Advertisements

Tags: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: