# HG changeset patch # User Thibaut Girka # Date 1315165850 -7200 # Node ID 54929d495654a7c14938f1af0095817c4b66cf86 # Parent e2d8f2a56ea4aa5afb6ca18b4514828c6dbf87ce Handle ECL instruction 18 diff --git a/pytouhou/formats/ecl.py b/pytouhou/formats/ecl.py --- a/pytouhou/formats/ecl.py +++ b/pytouhou/formats/ecl.py @@ -36,7 +36,7 @@ class ECL(object): 15: ('iii', 'multiply_int'), 16: ('iii', 'divide_int'), 17: ('iii', 'modulo'), - 18: ('i', None), + 18: ('i', 'increment'), 20: ('iff', 'add_float'), 21: ('iff', 'substract_float'), 23: ('iff', 'divide_float'), diff --git a/pytouhou/vm/eclrunner.py b/pytouhou/vm/eclrunner.py --- a/pytouhou/vm/eclrunner.py +++ b/pytouhou/vm/eclrunner.py @@ -249,6 +249,11 @@ class ECLRunner(object): self._setval(variable_id, self._getval(a) % self._getval(b)) + @instruction(18) + def increment(self, variable_id): + self._setval(variable_id, self._getval(variable_id) + 1) + + @instruction(23) def divide_float(self, variable_id, a, b): #TODO: takes only floats.