changeset 96:54929d495654

Handle ECL instruction 18
author Thibaut Girka <thib@sitedethib.com>
date Sun, 04 Sep 2011 21:50:50 +0200
parents e2d8f2a56ea4
children ac2e5e1c2c3c
files pytouhou/formats/ecl.py pytouhou/vm/eclrunner.py
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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'),
--- 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.