Very WIP and very bad quick hack to port MAME 0.139 for libretro. just rewrite it !