{"id":18,"date":"2008-05-29T10:33:43","date_gmt":"2008-05-29T08:33:43","guid":{"rendered":"https:\/\/blogs.scummvm.org\/buddha\/?p=18"},"modified":"2022-04-15T10:41:57","modified_gmt":"2022-04-15T08:41:57","slug":"first-steps-french-language-and-dead-code","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/buddha\/2008\/05\/29\/first-steps-french-language-and-dead-code\/","title":{"rendered":"First steps: French language and dead code"},"content":{"rendered":"<p>Got the disassembly of the French version of <a href=\"http:\/\/www.mobygames.com\/game\/james-bond-the-stealth-affair\">Operation Stealth<\/a> (There was already some work done on it by another person so I\u2019m not starting totally from scratch here) and also the disassembly of the French version of <a href=\"http:\/\/www.mobygames.com\/game\/future-wars\/\">Future Wars<\/a> (Les Voyageurs du Temps) so I\u2019ve got another version of the Cin\u00e9matique 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 <a href=\"http:\/\/en.wikipedia.org\/wiki\/Gymnasium_(school)\">gymnasium<\/a>) \u2013 although I\u2019ve forgotten most of it ;-). Learned that <a href=\"http:\/\/scummvm.svn.sourceforge.net\/viewvc\/scummvm\/scummvm\/trunk\/engines\/cine\/anim.cpp?revision=32358&amp;view=markup&amp;pathrev=32358#l_733\">\u00e9chec in French means failure<\/a> btw.<\/p>\n<p><!--more--><\/p>\n<p>Found where in the Operation Stealth\u2019s disassembly the opcode list was and named the functions according to the current namings in the ScummVM\u2019s cinE-engine. Also commented a couple of small functions in the disassembly (readScriptU8 and readScriptU16) and found out that Turbo C wasn\u2019t so hot on dead code elimination back in the day. Look at this code from readScriptU16:<\/p>\n<pre>seg002:0035 mov al, es:[bx]\r\nseg002:0038 mov ah, 0\r\nseg002:003A mov si, ax\r\nseg002:003C mov ax, si\r\nseg002:003E mov cl, 8\r\nseg002:0040 shl ax, cl\r\nseg002:0042 mov si, ax\r\n<\/pre>\n<p>Now isn\u2019t that beautiful? :-). I mean, bouncing stuff around without any meaning. They could\u2019ve just done:<\/p>\n<pre>mov ah, es:[bx]\r\nxor al, al\r\nmov si, ax\r\n<\/pre>\n<p>7 instructions boiled down to 3. That\u2019s quite a reduction I\u2019d say. But well, don\u2019t 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 <em>mildly<\/em> different than today :-D.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Got the disassembly of the French version of Operation Stealth (There was already some work done on it by another person so I\u2019m not starting totally from scratch here) and also the disassembly of the French version of Future Wars (Les Voyageurs du Temps) so I\u2019ve got another version of the Cin\u00e9matique engine to compare [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-18","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/posts\/18","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/comments?post=18"}],"version-history":[{"count":1,"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/posts\/18\/revisions"}],"predecessor-version":[{"id":19,"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/posts\/18\/revisions\/19"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/media?parent=18"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/categories?post=18"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/tags?post=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}