mame emulator in java (arcadeflex)

I am working for the past 2 years on a java port of mame emulator (arcadeflex) based on old mame 0.36 src

I have succesfully ported a number of drivers (most noticeable - pang , double dragon , pkladies , 1942 )

source is available in github

If anyone interesting on helping just drop a note . Looking for help mostly in sound part (none of the drivers has sound yet)

I just love emulation :slight_smile:
I’ve made a few myself (with collaborators), probably most notably JEmu2. It emulates lots of arcade games (up to games like Galaxy Force 2, Rail Chase, After Burner and Outrun), and a few consoles and home computers (Sega Master System, MSX, MSX2, Spectrum) and it supports sound.

A few questions though:
Any reason why you’re porting such an old MAME release? Is it because later releases started to depend on macros and such so much?

And why a direct port? I haven’t looked at your code yet, but I found that following MAME to the letter will make the code very rigid and ‘static’. In JEmu2 I would never have been able to implement things like ‘VirtuArcade’ (i.e. 20 arcades running in parallel in 3D) if JEmu2 was a straight MAME port.

If I were to write an emulator again, I’d not follow MAME too closely but just make some helper classes to make porting MAME drivers easier. MAME is a beautiful piece of code that despite its age is still quite well designed and is an invaluable treasure of knowledge. But IMHO it doesn’t translate that well into java, especially if you want to take emulators further than MAME.

Anyway, I’ll check out your project and see if I can merge some of my sound code in there.

yah i have seen jemu2 nice work :slight_smile:

0.36 was an random choice mostly ( and it has less macros true) . Most of the games i wish to see on arcadeflex exists there so why go to much more complex code?

Direct port sure has some disadvantages but it’s benefits are also a lot . I have also made a parser to translate most of mame drivers to java code automatically ( i will put it on github soon).

Thanks for the helping offer . it would be amazing if you can figure out how to add sound :wink:

just posted on my github (https://github.com/georgemoralis/arcadeflex036/commits/master) my automatic tool for converting mame 0.36 source files ( drivers , machine , vidhrdw , sndhrdw files) from c code to java .

The conversion is more than 70% most of the times (it will improve more) and saves a lot of time to manual conversion :wink:

I’ll see what I can do about sound. The sound code in JEmu2 should be quite easily integrated in arcadeflex, I think (it has been reused before).

It was a bit tricky to add JavaSound support in JEmu2; not so much because JavaSound is that hard to use, but to make it work well (and across platforms).
My problem was to keep latency as low as possible and avoid buffer under-runs, since JavaSound doesn’t provide any (reliable) way to measure how many bytes are in the queue. So I ended up timing everything and keep adjusting whenever there is a buffer under-run.
IIRC I had to rely on System.currentTimeMillis, so I suppose going to nanoTime will help there.

Anyway, if you have a use for the JEmu2 sources, just PM me; you can use it however you like as long its my own parts of the code (most of it is, but some parts were written by collaborators, for example the Out Run driver and the M68000 CPU emulator, so I can’t be sure about those parts).
But I have to warn you, emulators were sort of my Java ‘Hello World’ getting out of hand, so things can get a bit messy in places :wink:

That conversion stuff is interesting BTW.
A guy named Julien Frelat has done something similar in a project called ‘JAPE’ (http://www.innoveware.com/projects.html). I think he’s more into .net these days, but it might be worth it to hook up with him to exchange ideas on the subject. Very nice guy (I’ve worked with him on ‘CottAge’).

I just tried a few drivers with my latest fixes in automatic tool , for example timepilot84 (tp84) . For tp84 driver i have convertion rate over 90% , some small things to fix by hand (and done the imports) , machine driver was okay too , only vidhrdw needed a bit of work by hand but hmm i can improve the converter more :wink:

I was motivated by JAPE , in fact my early versions ( JAPE last public version was porting 0.20 mame) was based on that ( arcadeflex first version was 0.28 mame and was mostly an improvement of JAPE) . For arcadeflex 0.36 i had to write most of the stuff for scratch since mame’s API from 0.28 to 0.36 changed heavily…

new working 6502 cpu core , and i guess you all have played this game :wink:

http://www.arcadeflex.com/screenies/pcktgal.jpg

Hypersports support on last commit (of course there is already track and field )

Vulgus driver available in latest commit

and let’s not forget ddragon , ddragon 2 :slight_smile:

From my knowledge arcadeflex is the first java arcade emu that emulate these

Looks so cool! :slight_smile:

Kev

Thanks :wink:

Working on custom konami video chips
K052109 , K051960 and i have more interesting games running (ignore the glitch on the right of the screen :P)

Looks really really good :point:

Botton of ninth on last commit . Game seems to have a few issues left with the zoom chips but okay results looks interesting :wink:

After months of silence i finally managed to get an interesting update on arcaflex which is sound!

I have already emulated Namco chip , AY8910 , SN76496 , MSM5205 , OKI6295 , ADPCM and progress will continue with yahama chips .

This is a quite interesting update considering that it’s the first time arcadeflex has proper sound :wink:

you can check the progress at official git page at :

More sound progress !

Added working YM3526 , YM3812 , YM2413 , K007232 , K051649 chips

Also now we got hcastle (konami’s early castlevania) with full sound !

Build it from github and play

Tetris anyone? ;D

You should try and get multiplayer working for things like tetris where there are 2 identical instances of the game running on either machine and controle inputs are sent over

yah it is something i consider doing it sometime later