Add an intermediate instruction set
alexguirre opened this issue · comments
This intermediate representation or instruction set should support the scripting features from multiple RAGE games (at least, GTA IV, MP3, GTA V and RDR3) so it can be converted to and from the real scripts bytecode.
It should also be simpler where possible, for example:
- Instead of all
PUSH_CONST_*
for integers or floats just a single opcode for integers and another for floats. - No
*_LOAD
or*_STORE
versions of other opcodes. Use theLOAD
andSTORE
opcodes after pushing the address instead. - Instead of versions of the same opcode with different operand size like
STATIC_U8
andSTATIC_U16
just a single opcode.
For now, the intermediate instruction set will only support the decompiler.
For the compiler, an abstraction over CodeGenerator
with specific implementations for each game should work.
Closed in #42.