revert some of the ported code of MAME to restore some of the games functionality
fix warnings