- print len(uncalled_funcs), 'functions found in', game_asm, 'were never called'
-
-print 'Functions that consumed the most time (excluding children):'
-ls = functions.values()
-ls.sort(lambda x1, x2: cmp(x2.self_time, x1.self_time))
-for func in ls[:10]:
- func.dump()
-
+ if (not dumb_frotz_mode):
+ print len(uncalled_funcs), 'functions found in', game_asm, 'were never called'
+
+if (dumb_frotz_mode):
+ ls = functions.values()
+ ls.sort(lambda x1, x2: cmp(x2.total_ops, x1.total_ops))
+ ops_executed = 0
+ routine_calls = 0
+ max_stack_use = max([func.max_stack_use for func in ls])
+ for func in ls:
+ if (func.total_ops > ops_executed):
+ ops_executed = func.total_ops
+ routine_calls = routine_calls + func.call_count
+ print 'Total opcodes: %lu' % ops_executed
+ print 'Total routine calls: %lu' % routine_calls
+ print 'Max. stack usage: %li' % max_stack_use
+ print ''
+ print '%-35s %-10s %-10s %-10s %-4s' % ('Routine', 'Ops', 'Ops(+Subs)', 'Calls', 'Nest')
+ for func in ls:
+ func.dump_dumbfrotz_style()
+else:
+ print 'Functions that consumed the most time (excluding children):'
+ ls = functions.values()
+ ls.sort(lambda x1, x2: cmp(x2.self_time, x1.self_time))
+ for func in ls[:10]:
+ func.dump()