Victor´s Dynarec Page


  Just another page about dynarec in The Dynarec Site.


My Docs


Emulation Docs


NEW   The Binary Translation Library (links fixed)
               (for a nicer color version, Dave, here ;) )
            A tar.gz with all the documents: library


This is  my page about dynamic binary translation (better known as
dynamic recompilation or "dynarec")  and emulation in general.

Here you will find documents I find useful for learning about
how to program emulators and dynarecs, links to other interesting
emulation related pages, documents written by myself and
my actual projects.

My Docs

Space Invaders Tutorial

  These are some docs I have been writing for a Space Invaders tutorial
which is being developed in the Mul8 list (look at links).

  The tutorial is still on development.

    SI Introduction

    It is an introduction to the arcade machine we are developing: the
old Space Invaders.

    Introduction to the process of emulation

    It is an introduction to know how an arcade machine emulator

    Starting the CPU core

    It explains the basis of the CPU emulation.

    Implementing the instructions

    It explains depthly how must be emulated a general CPU instruction.

    Arithmetic-Logic instructions

    A full explanation of the general behaviour of arithmetic instructions
and how they should be emulated.

    Memory and IO instructions

    Overview of memory and IO instructions.

    Memory Emulation

    Explanation of the memory emulation: memory maps, bankswitching, MMU.

   This last doc is from Kieron Wilkinson:

   Handling Condition Flags

    About the implementation of the condition flags calculation in our 8080 core.

    Flow control instructions

    About flow control instructions (jumps, calls, interrupts).

    Next Docs

    Testing the core, using macros and other stuff:  A brief introduction
    to other interesting subjects involved in the emulation of a CPU.

    Space Invaders Hardware: About the emulation of the Space Invaders
    hardware (video, sound, interrupts).

   Source   SIDEV5.TGZ

     Just the last 'official' source with the 8080 core.  It hasn't even been tested,
    so there is a lot of work to be done yet. ;)  STOPPED

    My own SI emulator

    source    Win32 binary

Documents about dynarec

    Dynamic Recompilation?

    He!  This is fun, my first 'what that dynarec thing is'.  It was
    a mail I sent to the Mul8 list, when I was still starting long
    time ago and Mul8 was still at egroups (and alive!).  It actually
    was november '99 or so ...  It shows that I write about something
    althought even when I don't know about it. ;))

    Emulators and dynamic recompilation

    The start of a document about dynamic recompilation.  It was
    written the first time I started my university project, and I'm
    still starting it ;).  It was discontinued.  I will write a new version
    but will have many changes.



Only a two words: too many. :)


    We started a new brand Motorola 68000 dynamic recompiler on the list,
    under the direction and ideas of Neil Bradley.   I want to continue it!! ;)
    It will be  fully StarScream API compliant so every emulator out there
    using that impressive M68K emulator could get access to the full
    speed of a dynarec.


    I'm working now in a Master System emulator as a training for a Mega
    Drive one.     Playable, a bit, but playable.  VDP implemented. Frameskip
    and frame adjust implemented.  Joystick player one implemented. It uses
    Neil Bradley's MZ80 (and profiler code).  Using SDL library for graphics
    and sound.  For Win32 and DirectX (through SDL).  Now only works in
    16-bit color modes.

    The last version of the source code (a lot of buggy and dirty yet).

    The last compiled binary plus a couple of ROMs so I can test it in
    in my Uni ;).(Columns and Sonic).

                Q    Quit.
                A    Button A (Start Master System)
                S     Button B
                ESPACE    Pause
                RETURN    Start (GameGear)
                DIRECTION KEYS    Well, it is obvious ;)
                KEYPAD    The same above
                0    Disable/Enable(default) FrameSkip/FrameControl
                KEYPAD +    More FPS
                KEYPAD -      Less FPS
                KEYPAD *     FPS = 60
                1  Disable/Enable Background
                2  Disable/Enable Sprites
                F1  Enable/Disable PSG channel 0
                F2  Enable/Disable PSG channel 1
                F3  Enable/Disable PSG channel 2
                F4  Enable/Disable PSG channel 3
                F10  Enable/Disable PSG sound
                F  FullScreen Mode On/Off(It's fun when you miss the JOY buttons ;)
                D  Double Size Video Mode On/Off (640x480) (The same above ;))
                B  Enable Bilinear/Enable Trilinear/Disable  Filter (only double size


    > MAS options filename

         -jap   Japan Master System.
         -usa   USA Master System [default].
         -m320   Video Mode 320x240 (Normal Size).
         -m640   Video Mode 640x480 (Double Size) [default].
         -fullscreen  Fullscreen Mode.
         -window   Window Mode [default].
         -bilinear  Bilinear filter (only 640x480) [default].
         -trilinear  Trilinear filter (only 640x480).
         -nofilter  No display filter (only 640x480).
         -nosound  Disables sound.
         -nolimit  Disables the sprite limitation.
         -gg   Game Gear Emulation Mode.
         -help   This ;).



        - Main structure
        - Joypad 1
        - VDP
            * BackGround Layer
            * Sprites
            * Many VDP options
        - Sound: PSG (It sounds horrible ...)
        - Software bilinear and trilinear (I can't see the difference) filter.
        - Game Gear Emulation.
        - SRAM is saved and restored.

     Not Implemented:

        - Sound: FM
        - Some VDP features:
            * Zoomed sprites
            * Old TMS9918 Modes (now with some doc :)
        - JoyPad 2
        - Game Gear Stereo.

     Further work:

        - Correct more MZ80BS bugs (try a dual version).
        - Test more games and correct bugs in the VDP.
        - Game Gear Stereo sound.
        - YM2413 (FM) emulation.
        - Save/Restore state.

    * The bilinear and trilinear filter only work in MMX CPUs.  The emulator
    crashes (it does not test it) if bilinear or trilinear is used in a non MMX

    * It actually goes at 300 FPS in my P-II 366 MHz in 320x240 window mode.  At
    80 FPS in 640x480 video mode with bilinear filter enabled. [As you can see
    my CPU is a bit 'abused', it is really an old P-II 333 MHz 66 MHz bus speed]


    SMS/GG VDP Documentation (Charles Mac Donald)

     Sega Master System Technical Information  (Richard Talbot-Walkins)

    My university project

    "A Study of the Techniques Used in Emulation" (or something like
    that).  I have to end it soon!  I hope it could be used later as another
    small reference doc about emulation.  It will include a more "technical"
    version of the SI tutorial with the code of the emulator, a document
    about dynamic binary translation (or dynarec), a document about
    graphic and sound emulation and a first stage Master System (well
    I don't have the time to end a Mega Drive one ... ) emulator.
    Just all in one. ;)

    First (partial) draft of the documentation:

        Study of the techniques for emulation programming

    Sega Mega CD emulator

    Sigh ...  Well this is more a hope than a project ...  Still hoping, looking
    and waiting ...  Right Bart? ;)

    The Last Emulation Documentation

    A dream: all the knowledge about the emulation of arcade machines,
    videoconsoles and old home computers stored and organized in a
    repository.  How to program emulators, dynarec, interpreters,
    graphics, sound, CPU ISAs, hardware descriptions, source examples
    ...   Yeah, only a dream. :(  I'm waiting that someone finishes this
    task for me ;).

Emulation Docs

    These are some useful documents related with general emulation
programming I have found out there and I think are useful.  For
dynarec related doc use MIKe's page. ;)   I  just don't want that we have
the same things. ;)

NEW      The Binary Translation Reference Library

        Take a look :). (Weird name)

Still working on it.  I have to sort and clear them:

    Some files related with some of the work(?) we have done in the
    list. (DISABLED)

    Backup (only? ;) documents about dynamic recompilation, binary
    translation and related topics.

    Docs about general emulation programming, the most common
    and some rare ones.

    An error safe (cleared) version of the well-known reference document
    about the Sega Mega Drive/Genesis.


    MUL8 List

    A list for people who want to learn about the development of emulators.
    But it is almost dead now :(.  Where are all those young guys wanting
    to make emulators? ;)  Sure not here.  Come on, this is your list.

    List subscription:  send a mail to with
    the word "subscribe" in the body of the mail.
    To send mails to the list:
    To unsubscribe: send a mail to with the
    word "unsubscribe" in the body of the mail.
    For problems and owner Neil "Big Boss" Bradley (don't send "test"
   messages to any of my list or I will ... ;):

    The official page of the list is :

    The Eidolon's Inn

    A very good page about Sega emulation and development.

    Emulation Programming Repository

    The old one.  A store about different consoles and CPUs.  Dead. :(

    Emulation Programming Repository NEW!!
    A new EPR site.

    Dan Boris' Emulator Page

    A good page about emulation.  It has useful files and links.

by Victor Moya del Barrio   Last update: 18 March 2001