Intro to Dynamic Recompilation in Emulation

Discussion in 'Web development / Programming' started by marco9999, Mar 11, 2016.

  1. marco9999

    marco9999 New Member

    Messages:
    7
    Likes Received:
    2
    Hi everyone!

    Over 4 weeks late last year I set out to learn and discover how to create a dynamic recompiling emulator, after having completed building a basic interpretive emulator for the Chip8 system. Over this time I have learnt that making a dynamic recompiler is not an easy task - it is much more complicated than your basic interpreter emulator.

    As such, I want to share what I have learnt by the way of a guiding document in conjunction with full source code of a dynarec core Chip8 emulator. The document and source code will attempt to teach you about the core ideas behind a dynarec core, such as about the translator, emitter and caches. It also dives into some problems you may encounter for the Chip8 system, such as dealing with jumps (and provides solutions).

    This document is targeted at people new to dynamic recompilation in emulation. Even if you are not familiar with the Chip8 system, I still encourage you to read this if you are interested in making a dynarec emulator and are familiar with the interpretive process. If you have not made any emulator and are intersted in this, I suggest starting with making an interpreter for the Chip8 system as it is really easy to learn about.

    If you have any questions or (constructive!) criticism, please send an email to me (preferred, listed in the document) or post a message on the forum. I will try to answer where I can.

    Document: https://github.com/marco9999/Dynarec_Guide
    Emulator: https://github.com/marco9999/Super8_jitcore/tree/edu (Edu branch is simplified over the master branch, recommended for people learning. The guide also follows this branch.)

    I also want to mention a special thanks to M.I.K.e7 for their earlier guide which I have used to learn from (http://ngemu.com/threads/dynamic-recompilation-an-introduction.20491/)

    Good luck!
    Marco.
    Hatorijr likes this.
  2. NGEmu.com Advertisement

Share This Page