Port of mame emulator to java language (almost 1:1 conversion)