Mercurial > touhou
annotate src/th06/ecl_vm.rs @ 653:16aa9a636d35
Some starting point for ecl_vm.
author | Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com> |
---|---|
date | Thu, 08 Aug 2019 16:03:38 +0200 |
parents | |
children | ec7e888e88f3 |
rev | line source |
---|---|
653
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
1 //! ECL runner. |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
2 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
3 use crate::th06::anm0::{ |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
4 Script, |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
5 Anm0, |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
6 Call, |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
7 Instruction, |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
8 }; |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
9 use crate::th06::interpolator::{Interpolator1, Interpolator2, Interpolator3, Formula}; |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
10 use crate::util::math::Mat4; |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
11 use crate::util::prng::Prng; |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
12 use std::cell::RefCell; |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
13 use std::rc::{Rc, Weak}; |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
14 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
15 fn run_instruction(&mut self, instruction: Instruction) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
16 let mut sprite = self.sprite.borrow_mut(); |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
17 match instruction { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
18 Instruction::Noop() { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
19 // really |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
20 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
21 // 1 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
22 Instruction::Stop() { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
23 self._enemy.removed = true; |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
24 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
25 // 2 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
26 Instruction::RelativeJump(frame, ip) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
27 self.frame = frame; |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
28 // ip = ip + flag in th06 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
29 self.ip = ip; |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
30 // we jump back to the main of the interpreter |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
31 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
32 // 3 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
33 // GHIDRA SAYS THERE IS A COMPARISON_REG BUFFER BUT THERE IS NOT!!! |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
34 // |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
35 // MOV ECX,dword ptr [EBP + 0x8] jumptable 00407544 case 31 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
36 // CMP dword ptr [0x9d4 + ECX],0x0 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
37 // JLE LAB_00407abb |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
38 // aka ECX = enemy pointer |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
39 // ECX->9d4 (aka enemy_pointer_copy->comparison_reg) == 0 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
40 // only the pointer is copied, not the value, thus we are safe |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
41 Instruction::RelativeJumpEx(frame, ip, var_id) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
42 // TODO: counter_value is a field of "enemy" in th06, to check |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
43 counter_value = self._getval(var_id) - 1 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
44 if counter_value > 0 { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
45 Instruction::RelativeJump(frame, ip); |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
46 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
47 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
48 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
49 //4, 5 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
50 Instruction::SetVariable(var_id, value) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
51 self._setval(var_id, value); |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
52 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
53 // 6 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
54 Instruction::SetRandomInt(var_id, maxval) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
55 self._setval(var_id, self._game.prng.rand_32()%self._getval(maxval)); |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
56 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
57 // 7 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
58 Instruction::SetRandomIntMin(var_id, maxval, minval) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
59 self._setval(var_id, (self._game.prng.rand_32()%self._getval(maxval))+self._getval(minval)); |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
60 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
61 // 8 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
62 Instruction::SetRandomFloat(var_id, maxval) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
63 self._setval(var_id, self._getval(maxval) * self._game.prng.rand_double()) |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
64 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
65 // 9 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
66 Instruction::SetRandomFloatMin(var_id, maxval, minval) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
67 self._setval(var_id, (self._getval(maxval) * self._game.prng.rand_double())+self._getval(minval)) |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
68 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
69 // 10 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
70 Instruction::StoreX(var_id) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
71 self._setval(var_id, self._enemy.x); |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
72 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
73 // 11 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
74 Instruction::StoreY(var_id) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
75 self._setval(var_id, self._enemy.y); |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
76 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
77 // 12 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
78 Instruction::StoreZ(var_id) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
79 self._setval(var_id, self._enemy.z); |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
80 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
81 // 13(int), 20(float), same impl in th06 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
82 Instruction::Add(var_id, a, b) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
83 self._setval(var_id, self._getval(a) + self._getval(b)); |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
84 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
85 // 14(int), 21(float), same impl in th06 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
86 Instruction::Substract(var_id, a, b) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
87 self._setval(var_id, self._getval(a) - self._getval(b)); |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
88 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
89 // 15(int), 22(unused) |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
90 Instruction::Multiply(var_id, a, b) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
91 self._setval(var_id, self._getval(a) * self._getval(b)); |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
92 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
93 // 16(int), 23(unused) |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
94 Instruction::Divide(var_id, a, b) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
95 self._setval(var_id, self._getval(a) / self._getval(b)); |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
96 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
97 // 17(int) 24(unused) |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
98 Instruction::Divide(var_id, a, b) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
99 self._setval(var_id, self._getval(a) % self._getval(b)); |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
100 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
101 // 18 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
102 // setval used by pytouhou, but not in game(???) |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
103 Instruction::Increment(var_id) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
104 var_id = self._getval(var_id) + 1 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
105 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
106 // 19 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
107 Instruction::Decrement(var_id) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
108 var_id = self._getval(var_id) - 1 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
109 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
110 //25 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
111 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
112 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
113 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
114 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
115 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
116 // 32 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
117 Instruction::RelativeJumpIfGreaterThan(frame, ip) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
118 if self.comparison_reg == 1 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
119 Instruction::RelativeJump(); |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
120 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
121 // 34 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
122 Instruction::RelativeJumpIfNotEqual(frame, ip) { |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
123 if self.comparison_reg != 0 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
124 Instruction::RelativeJump(); |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
125 } |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
126 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
127 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
128 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
129 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
130 |
16aa9a636d35
Some starting point for ecl_vm.
Gauvain "GovanifY" Roussel-Tarbouriech <gauvain@govanify.com>
parents:
diff
changeset
|
131 |