Mercurial > touhou
comparison pytouhou/vm/eclrunner.py @ 185:68e6d3faeee6
Don’t reinitialize variables when another sub is called.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Wed, 26 Oct 2011 03:03:39 -0700 |
parents | b6d7ce644f34 |
children | dbe6b7b2d3fc |
comparison
equal
deleted
inserted
replaced
184:54eb6b254b7b | 185:68e6d3faeee6 |
---|---|
437 self.stack.append((self.sub, self.frame, self.instruction_pointer, | 437 self.stack.append((self.sub, self.frame, self.instruction_pointer, |
438 self.variables, self.comparison_reg)) | 438 self.variables, self.comparison_reg)) |
439 self.sub = sub | 439 self.sub = sub |
440 self.frame = 0 | 440 self.frame = 0 |
441 self.instruction_pointer = 0 | 441 self.instruction_pointer = 0 |
442 self.variables = [param1, 0, 0, 0, | 442 self.variables[0] = param1 |
443 param2, 0., 0., 0., | 443 self.variables[1] = param2 |
444 0, 0, 0, 0] | |
445 | 444 |
446 | 445 |
447 @instruction(36) | 446 @instruction(36) |
448 def ret(self): | 447 def ret(self): |
449 self.sub, self.frame, self.instruction_pointer, self.variables, self.comparison_reg = self.stack.pop() | 448 self.sub, self.frame, self.instruction_pointer, self.variables, self.comparison_reg = self.stack.pop() |