Structural Overview - NTmatter/LLBoy GitHub Wiki
The system design revolves around a virtual machine data structure with operations that act upon the data structure. This functionality is compiled down into a single LLVM module that is combined with dynamically generated method calls matching those used during execution of the game.
Items that must be tracked include:
- Branch targets to guide splitting LLVM Blocks
- Instructions from ROM
- Constant Data used by instructions (eg, register_a += 0xFF, goto 0xABCD)
- Translation coverage of contiguous instructions and data
- Attempts to access data across bank boundaries
- Execution of modifiable data
Sequences of instructions will be built and added to the cache as execution progresses. Contiguous instructions and data can be merged into blocks for direct execution, bypassing the need for an external interpreter loop. LLVM can then be used to inline and optimize the translated instructions.