{"id":48,"date":"2008-07-31T10:58:47","date_gmt":"2008-07-31T08:58:47","guid":{"rendered":"https:\/\/blogs.scummvm.org\/buddha\/?p=48"},"modified":"2022-04-15T11:06:00","modified_gmt":"2022-04-15T09:06:00","slug":"getting-systematic","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/buddha\/2008\/07\/31\/getting-systematic\/","title":{"rendered":"Getting systematic"},"content":{"rendered":"<p>Hi! These past few days have been pretty nerve wrecking. I\u2019d eagerly want to get on with the reverse engineering but getting savegames working in Operation Stealth is 1) essential, 2) broken at the moment, 3) not looking like the straightforwardest code to fix (Or more like not knowing what to fix exactly). Not really knowing how to swiftly and proficiently squash the bug but still knowing that I got to fix it before going forward with other stuff is infernal for motivation.<\/p>\n<p><!--more--><\/p>\n<p>Still, I have been doing some testing with the bug, not very much, but some. Now I know what data seems to not be up to date after loading. The next step is getting systematic about it. Identify the functions that manipulate the data that\u2019s making things break currently, understand why and where they are called and see where they should be called when loading a savegame to get the needed data up to date.<\/p>\n<p>Currently Operation Stealth <a href=\"http:\/\/scummvm.svn.sourceforge.net\/viewvc\/scummvm\/scummvm\/trunk\/engines\/cine\/various.cpp?revision=33446&amp;view=markup#l_2201\">throws an assertion<\/a> in <a href=\"http:\/\/scummvm.svn.sourceforge.net\/viewvc\/scummvm\/scummvm\/trunk\/engines\/cine\/various.cpp?revision=33446&amp;view=markup#l_2184\">addAni<\/a> function which is called from <a href=\"http:\/\/scummvm.svn.sourceforge.net\/viewvc\/scummvm\/scummvm\/trunk\/engines\/cine\/various.cpp?revision=33446&amp;view=markup#l_2290\">processSeqListElement<\/a> which is called from <a href=\"http:\/\/scummvm.svn.sourceforge.net\/viewvc\/scummvm\/scummvm\/trunk\/engines\/cine\/various.cpp?revision=33446&amp;view=markup#l_2412\">processSeqList<\/a> which is in turn <a href=\"http:\/\/scummvm.svn.sourceforge.net\/viewvc\/scummvm\/scummvm\/trunk\/engines\/cine\/main_loop.cpp?revision=33410&amp;view=markup#l_260\">called from the main loop<\/a> (Now *that* was a nice elongated sentence if any :-)). I did some debugging to see what values addAni is called with when playing the game and the only values I saw in the beginning of game were values related to the player character\u2019s animation:<\/p>\n<h3>Calls to addAni when walking around in the first room<\/h3>\n<ul>\n<li>param1=3, objIdx=1, var8=1, var14=0, param3=0 (Walking down)<\/li>\n<li>param1=2, objIdx=1, var8=1, var14=0, param3=0 (Walking up)<\/li>\n<li>param1=0, objIdx=1, var8=1, var14=1, param3=1 (Walking right)<\/li>\n<li>param1=1, objIdx=1, var8=1, var14=2, param3=1 (Walking left)<\/li>\n<li>param1=7, objIdx=1, var8=1, var14=0, param3=1 (Facing down)<\/li>\n<li>param1=6, objIdx=1, var8=1, var14=0, param3=1 (Facing up)<\/li>\n<li>param1=4, objIdx=1, var8=1, var14=0, param3=1 (Facing right)<\/li>\n<li>param1=5, objIdx=1, var8=1, var14=0, param3=1 (Facing left)<\/li>\n<\/ul>\n<h4>Some clarifications:<\/h4>\n<ul>\n<li>E.g. facing left means that the player character is standing still and looking left.<\/li>\n<li>var8 and var14 are actually member variables of a <a href=\"http:\/\/scummvm.svn.sourceforge.net\/viewvc\/scummvm\/scummvm\/trunk\/engines\/cine\/various.h?revision=33349&amp;view=markup#l_45\">SeqListElement<\/a> that\u2019s given as a reference parameter to addAni.<\/li>\n<\/ul>\n<h4>Hypotheses made from the given addAni calls:<\/h4>\n<ul>\n<li>param3 is 0 when the player character is walking vertically, otherwise it\u2019s 1.<\/li>\n<li>element.var14 is 1 when the player character is walking right, 2 when his walking left and otherwise 0.<\/li>\n<li>param1 identifies the used animation (Walking right, walking left, standing still and facing left etc).<\/li>\n<\/ul>\n<p>So, wish me luck with the debugging and let\u2019s hope it\u2019ll be over in no time!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi! These past few days have been pretty nerve wrecking. I\u2019d eagerly want to get on with the reverse engineering but getting savegames working in Operation Stealth is 1) essential, 2) broken at the moment, 3) not looking like the straightforwardest code to fix (Or more like not knowing what to fix exactly). Not really [&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-48","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/posts\/48","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=48"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/posts\/48\/revisions"}],"predecessor-version":[{"id":50,"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/posts\/48\/revisions\/50"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/media?parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/categories?post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/buddha\/wp-json\/wp\/v2\/tags?post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}