[Scummvm-cvs-logs] SF.net SVN: scummvm:[51734] tools/branches/gsoc2010-decompiler/decompiler/ kyra/disassembler.cpp

pidgeot at users.sourceforge.net pidgeot at users.sourceforge.net
Wed Aug 4 14:50:14 CEST 2010


Revision: 51734
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51734&view=rev
Author:   pidgeot
Date:     2010-08-04 12:50:13 +0000 (Wed, 04 Aug 2010)

Log Message:
-----------
Minor fixes to function detection

Modified Paths:
--------------
    tools/branches/gsoc2010-decompiler/decompiler/kyra/disassembler.cpp

Modified: tools/branches/gsoc2010-decompiler/decompiler/kyra/disassembler.cpp
===================================================================
--- tools/branches/gsoc2010-decompiler/decompiler/kyra/disassembler.cpp	2010-08-04 12:41:00 UTC (rev 51733)
+++ tools/branches/gsoc2010-decompiler/decompiler/kyra/disassembler.cpp	2010-08-04 12:50:13 UTC (rev 51734)
@@ -570,12 +570,12 @@
 //				continue;
 			// Kyra2 sometimes has an addSP instruction between the two popPos instrucitons, so we ignore those
 			if (_insts[i]._name.compare("addSP") == 0)
-					continue;
+				continue;
 
-			if (lastWasPop && _insts[i]._name.compare("popPos") == 0) {
-				_engine->_functions[_insts[nextFunc]._address] = Function(addrMap[_insts[nextFunc]._address], addrMap[_insts[i]._address]);
+			if ((lastWasPop && _insts[i]._name.compare("popPos") == 0) || _insts[i+1]._address == minFuncAddr) {
+				_engine->_functions[_insts[nextFunc]._address] = Function(addrMap[_insts[nextFunc]._address], addrMap[_insts[i+1]._address]);
 				nextFunc = i+1;
-				break;
+//				break;
 			}
 
 			lastWasPop = (_insts[i]._name.compare("popPos") == 0);
@@ -584,6 +584,7 @@
 
 	// Add metadata to newly found functions
 	for (FuncMap::iterator it = _engine->_functions.begin(); it != _engine->_functions.end(); ++it) {
+		std::clog << boost::format("Processing function at 0x%08X\n") % it->first;
 		std::stringstream s;
 		s << boost::format("sub0x%X") % it->second._startIt->_address;
 		int maxArg = 0;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list