Mercurial > touhou
comparison pytouhou/formats/ecl.py @ 51:0707ff53e7b5
Add support for a few instructions
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Mon, 22 Aug 2011 22:12:34 +0200 |
parents | 811cefefb5c8 |
children | ab826bc29aa2 |
comparison
equal
deleted
inserted
replaced
50:811cefefb5c8 | 51:0707ff53e7b5 |
---|---|
158 | 158 |
159 | 159 |
160 # Translate offsets to instruction pointers | 160 # Translate offsets to instruction pointers |
161 for instr_offset, (i, instr) in zip(instruction_offsets, enumerate(ecl.subs[-1])): | 161 for instr_offset, (i, instr) in zip(instruction_offsets, enumerate(ecl.subs[-1])): |
162 time, opcode, rank_mask, param_mask, args = instr | 162 time, opcode, rank_mask, param_mask, args = instr |
163 if opcode == 2: # relative_jump | 163 if opcode in (2, 31): # relative_jump |
164 frame, relative_offset = args | 164 frame, relative_offset = args |
165 args = frame, instruction_offsets.index(instr_offset + relative_offset) | 165 args = frame, instruction_offsets.index(instr_offset + relative_offset) |
166 elif opcode == 3: # relative_jump_ex | 166 elif opcode == 3: # relative_jump_ex |
167 frame, relative_offset, counter_id = args | 167 frame, relative_offset, counter_id = args |
168 args = frame, instruction_offsets.index(instr_offset + relative_offset), counter_id | 168 args = frame, instruction_offsets.index(instr_offset + relative_offset), counter_id |