pudding
Posts: 92
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

STICKY: MAME4ALL for Pi

Tue Mar 05, 2013 2:50 pm

I've ported MAME4ALL to the Pi.

It uses MAME v0.37b5 ROMS. Optimised for the Raspberry Pi with dispmanx graphics, SDL input and ALSA sound. Works in X-Windows or Console. Runs with a frontend gui or traditional MAME command line mode.

Get it from here http://sourceforge.net/projects/mame4allpi/
Last edited by pudding on Tue Feb 17, 2015 11:12 pm, edited 1 time in total.
(aka squid). Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

BBUK
Posts: 126
Joined: Tue Dec 18, 2012 10:34 am

Re: MAME4ALL for Pi

Tue Mar 05, 2013 4:39 pm

Thanks pudding - I'll give this a go.

I've looked at the Makefile on git and notice that you appear to have cross-compiled. I don't have a cross-compile environment set up (yet!) and wonder if you have tried to compile this on a R-Pi (with edits to the Makefile)? (I would like to get joystick support going and am happy to help if you are not already working on this.)

Rgds

PhillyNJ
Posts: 112
Joined: Sat Dec 29, 2012 4:07 am

Re: MAME4ALL for Pi

Tue Mar 05, 2013 6:29 pm

pudding wrote: It uses MAME v0.37b5 ROMS. Optimised for the Raspberry Pi with dispmanx graphics, SDL input and ALSA sound. Works in X-Windows or Console. Runs with a frontend gui or traditional MAME command line mode.
Hi,

Does it support Multiple Keyboards? Many people are using uinput and pikeyd to wire the joystick and buttons to the GPIO. The issue with Advmame is it does not like to have the GPIO and a USB keyboard at the same time.

pudding
Posts: 92
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: MAME4ALL for Pi

Tue Mar 05, 2013 8:23 pm

BBUK, I always compile on the Pi. I'm working on joystick support and it is going OK thanks.
(aka squid). Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

mongrol
Posts: 76
Joined: Wed Aug 01, 2012 2:43 am

Re: MAME4ALL for Pi

Wed Mar 06, 2013 1:13 am

Mame4all uses GLES at the backend doesn't it? Therefore you'll gain nothing by attempting to use DISPMANX with it.

Vanfanel
Posts: 403
Joined: Sat Aug 18, 2012 5:58 pm

Re: MAME4ALL for Pi

Wed Mar 06, 2013 9:37 am

@pudding: great work! How's the speed on 68000-based games? are they 60FPS with this port?

@mongrol:

I believe Dispmanx is better suited for situations where the whole frame has to be transferred to video ram to be displayed at a very fast rate (blitting operations in MAME are done in the "emulated machines" anyway): with MAME you're uploading 60 frames per second, ie, you're uploading 60 complete bitmaps per second.
GLES (on the Pi at least) is better suited for situations where you upload some textures to video memory, you leave them there, and then you process them and build the actual frames... so to say.
In both cases you obtain cpu-free scaling and proper double-buffered graphics, wich is what you expect from any usable graphics hardware :)

pudding
Posts: 92
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: MAME4ALL for Pi

Wed Mar 06, 2013 10:31 am

Most 68000 seem to run at 100% (I haven't tested that many as there are a lot!), Neogeo are all 100%, SF2 is mostly 100% and sometimes dips to 55fps other CPS1 are mostly 100%. I'm running overclocked though at 950/350/500. The DRZ80 sound core would help a bit with performance but I can't get it to work.

I see a limit of around 300fps with dispmanx on the less cpu intensive games, so it has a low overhead.
(aka squid). Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

welshy
Posts: 1659
Joined: Mon Oct 29, 2012 2:07 pm

Re: MAME4ALL for Pi

Wed Mar 06, 2013 11:54 am

pudding
Great work! Just two points -

1. The colours look odd in some games (Is this changeable? I cannot seem to find a "Readable" config File, but it could be down to the dispmanx backend “Scaling”)
2. How do you get the executable stable in Console? (Without having to CD into the folder each time!). I tried moving it into /usr/local/bin but it intermittently looses connection with the “Skins” Folder

But, it plays excellently in “X” as well as Console, Out Run, Rolling Thunder, R-Type I, R-Type II, UN Squadron, Spy Hunter and Neo-Geo titles now work more or less flawlessly at a 900MHz Clock (Which they don't, even in AdvMAME 0.94 (Although, I have not, as yet, tried it with the dispmanx backend))
"The list of things I have heard now contains everything!"

pudding
Posts: 92
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: MAME4ALL for Pi

Wed Mar 06, 2013 12:24 pm

Thanks Welshy! Odd colours? Which games? Would appreciate it logged as an issue with the details at http://code.google.com/p/mame4all-pi/issues/list or else here. Possibly they're 16bit bitmaps, and I'm forcing 8bit only for performance. It won't be the scaling. There's no readable config file...yet. I'm keeping it simple. And there will be more command line options.

To run in the console simply put the full path in or create an alias:
alias mame='/usr/local/bin/indiecity/InstalledApps/mame4all_pi/Full/mame'
(aka squid). Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

welshy
Posts: 1659
Joined: Mon Oct 29, 2012 2:07 pm

Re: MAME4ALL for Pi

Wed Mar 06, 2013 12:52 pm

pudding
Yeah, it will be the 8bit colours then (I did think that may have been the case after I posted!). The only other thing is the Sound. With Donkey Kong (Amongst others) although the framerate is a constant 60FPS, the sound is not “Laggy” but SLOW (Although it’s in Treacle!) which is odd because if you take the “Frame Limit” off, DK runs at about 350-400%! Any ideas on what’s causing this?

The other nice functionality is that the Williams games don’t seem to suffer the indignity of getting “Stuck” on the “Factory Settings Restored” screen which is an issue with MAME4ALL (On the PSP version anyway, I had to devise a pretty convoluted way of getting over this)

I will do some further testing and log anything else as requested, but it's definitely the BEST performing version of MAME for the RPi thus far, it's running most Titles Fullspeed/Fullscreen under "X" in a 1920 X 1200 Framebuffer Window at 900MHz (My Settings)?! (Even AdvMAME 0.94 doesn't get anywhere NEAR that Performance) Congrats!

I have also put a Mention/Link in the "EMULATION ON THE RPi (UPDATE)" Thread
"The list of things I have heard now contains everything!"

welshy
Posts: 1659
Joined: Mon Oct 29, 2012 2:07 pm

Re: MAME4ALL for Pi

Thu Mar 07, 2013 10:51 am

pudding
After Further Testing I can Confirm -

1. Running under “X” vs Console - Little discernible difference in speed of any ROM
2. Raspbian Images - Little discernible difference in speed (Against: 2012-09-18-wheezy-raspbian and 2012-12-16-wheezy-raspbian) running in “X” or Console
3. 8Bit colour affects any game post 1984/5 - To many to list but including: ATARI SYSTEM 2 (Paperboy, A.P.B, etc), SEGA System 16 B (Golden Axe), IREM M72 Board (R-Type I & II ), SEGA Outrun Board (Hang On, Out Run), TAITO 68000 (Rainbow Islands, Operation Wolf), CAPCOM CPS (Forgotten Worlds, Ghouls N Ghosts etc) SNK NeoGeo MVS (Baseball Stars, Metal Slug etc), WILLIAMS Y UNIT (Smash TV), WILLIAMS Z UNIT (N.A.R.C)
4. Performance - After Testing many Titles across the range of what MAME4ALL can emulate the Performance is approximately 200-250% of AdvMAME 0.94. ALL games tested play at least 100% with the exception of: N.A.R.C (TMS34010 CPU 60%) and Out Run (Twin 68000 CPU’s 90%) This is no doubt due to the complexity of the Hardware involved, but they play more than acceptably
5. Some games suffer the “Treacly” slow Sound/Music (Seems to affect older ROMS Donkey Kong, Defender etc)
"The list of things I have heard now contains everything!"

kalehrl
Posts: 350
Joined: Tue Jul 24, 2012 10:49 am

Re: MAME4ALL for Pi

Thu Mar 07, 2013 2:08 pm

Is it possible to list all command line options somehow?
I treid using ./mame -h and ./mame --help but I only get a game list related options.
I see in the readme -nogui option so I would like to know all the options available.

Also, I can't for the life of me remap my keyboard.
I would like to use WASD for movement direction and I go to the TAB menu and choose a button, press enter and then press the wanted key but it is not registered. In advmame it works this way.

Baxter
Posts: 3
Joined: Fri Mar 08, 2013 1:15 pm

Re: MAME4ALL for Pi

Fri Mar 08, 2013 1:19 pm

This is excellent, thank you so much! Any chance of some sort of iCade support also? :)

pudding
Posts: 92
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: MAME4ALL for Pi

Fri Mar 08, 2013 1:59 pm

Keyboard remapping should work but it's very limited as the keyboard is currently treated as a joystick due to the way mame4all was originally written. I'm having to rewrite the mame4all input code to handle both keyboards and joysticks - and it's a big headache. I've got a joystick working but it maps to the keyboard keys which isn't flexible enough.

There's some undocumented command line params but they need more work, things like -ror, -rol work, most will break. Have a look in the config.cpp code if you want more.

I've found the problem with slow sound in dkong and defender and fixed it in the code - thanks Welshy for noticing that.

Just a note on incorrect colours etc, this is usually due to this version of mame (0.37b5) which is nowhere near as accurate as the latest version of mame. Can't say I notice though as I run it on a Sony 14" CRT (composite!!!) and it looks better than on an LCD (well the games were designed for CRTs) - an advantage of running MAME on the Pi.
(aka squid). Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

welshy
Posts: 1659
Joined: Mon Oct 29, 2012 2:07 pm

Re: MAME4ALL for Pi

Fri Mar 08, 2013 2:43 pm

pudding
Some are more noticeable than others (Neo-Geo games being a case in point). AdvMAME also suffers from this "Affliction" (When using the "Auto" settings for colour depth) which requires a manual change/save in the settings. BTW, what was causing the slow sound issue?

One Last Thing, how did you get MAME4ALL to compile with dispmanx graphics? I am currently building another revision of "pcengine". I have it working fine with the dispmanx backend (Which is a big improvement), BUT, cannot get it to compile including it (It selects the Standard SDL1.2-dev on Configure)
"The list of things I have heard now contains everything!"

FortyRock
Posts: 24
Joined: Fri Mar 08, 2013 5:33 pm
Location: Canada

Re: MAME4ALL for Pi

Fri Mar 08, 2013 6:09 pm

Really excited to try this out, but haven't had any luck. Both the precompiled binary, and one I built myself, both segfault after the standard disclaimers when run via the console or from within the X environment, with or without the GUI.

kalehrl
Posts: 350
Joined: Tue Jul 24, 2012 10:49 am

Re: MAME4ALL for Pi

Fri Mar 08, 2013 7:19 pm

Can't say I notice though as I run it on a Sony 14" CRT (composite!!!)
I also run it via composite on a CRT TV and the difference in brightness and color quality between advmame and mame4all is striking.

pudding
Posts: 92
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: MAME4ALL for Pi

Sat Mar 09, 2013 9:26 am

FortyRock, I'd need some more info about your setup. What gpu memory setting, Overclocking? Are your ROMS verified as being correct. Can you run mame from the command line as follows "./mame -log invaders" and send us the errorlog.
(aka squid). Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

FortyRock
Posts: 24
Joined: Fri Mar 08, 2013 5:33 pm
Location: Canada

Re: MAME4ALL for Pi

Sat Mar 09, 2013 5:08 pm

> What gpu memory setting, Overclocking?
gpu_mem=64, 930/350/500

> Are your ROMS verified as being correct.
the binary verifies them as ok

> Can you run mame from the command line as follows "./mame -log invaders" and send us the errorlog.
RPI immediately crashed with black screen this time (ran as user pi). ssh'd in and error.log was created, but 0 bytes so nothing to send I'm afraid :)

Other info that might help:
- 512MB model (rev 000F)
- Kernel 3.6.11+
- Audio is Creative SB Play! USB
- Video is HDMI to DVI monitor. only other thing that is set in the boot config is "hdmi_drive=1" have tried various hdmi groups, modes, forcing fb size, color depth, ignoring edid etc. but all to no avail.

Thanks,

FortyRock
Posts: 24
Joined: Fri Mar 08, 2013 5:33 pm
Location: Canada

Re: MAME4ALL for Pi

Sat Mar 09, 2013 8:30 pm

Another interesting note after a little more testing:

Same crash black screen when running as root from console. Interestingly, if I run "mame" from an ssh session, the title and menu bitmaps will be called up on the LCD and overlay the console terminal (which I can't get to happen when running locally).

I'm going to try with a fresh install later on another SD card to see if I can replicate this or get it to work (currently using an image from the PiMame project).

UPDATE: tried with fresh installs of 2013-02-09 and 2012-12-16 (only thing I did was change the keyboard, TZ, expanded roots and updated pistore when prompted).

Precompiled binary from the store works in X environment but still crashes to a blank screen when run via the console. Only way to recover is to cycle the power or reboot via ssh.

Could this be related to Issue 3?

UPDATE 2: Got it to work (at least on 2012-12-16). Not sure if/where it's documented, but the SDL12-kms-dispmanx project apparently needed to be installed. (https://github.com/vanfanel/SDL12-kms-dispmanx)

Now to get to testing!

pudding
Posts: 92
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: MAME4ALL for Pi

Sun Mar 10, 2013 12:40 pm

Nice one FortyRock! SDL is very buggy on the Pi. The latest Raspbian image has problems with SDL video init on the console and composite. Looks like the SDLdispmanx backend may have fixed that. I'm not using SDL for graphics but it has to be initialised to get the SDL keyboard input.
FortyRock wrote: UPDATE 2: Got it to work (at least on 2012-12-16). Not sure if/where it's documented, but the SDL12-kms-dispmanx project apparently needed to be installed. (https://github.com/vanfanel/SDL12-kms-dispmanx)
(aka squid). Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

FortyRock
Posts: 24
Joined: Fri Mar 08, 2013 5:33 pm
Location: Canada

Re: MAME4ALL for Pi

Sun Mar 10, 2013 5:03 pm

pudding wrote:Nice one FortyRock! SDL is very buggy on the Pi. The latest Raspbian image has problems with SDL video init on the console and composite. Looks like the SDLdispmanx backend may have fixed that. I'm not using SDL for graphics but it has to be initialised to get the SDL keyboard input.
FortyRock wrote: UPDATE 2: Got it to work (at least on 2012-12-16). Not sure if/where it's documented, but the SDL12-kms-dispmanx project apparently needed to be installed. (https://github.com/vanfanel/SDL12-kms-dispmanx)
Is there another package that could/should have been installed instead, perhaps?

Findings so far are:
-Fast!!! First time Raiden has been playable;
-Although its working, the image isn't quite as clear on the LCD as I've been able to get with advmame via in-game video adjustments (although I recognize that lcd won't ever get optimal picture);
-Exiting the game seems to take forever (guessing around 15 - 20 seconds). I think this is caused directly by he dispmanx as after exit the console shows messages about clearing dispmanx settings or something like that)

Thanks for the great work, btw!

welshy
Posts: 1659
Joined: Mon Oct 29, 2012 2:07 pm

Re: MAME4ALL for Pi

Sun Mar 10, 2013 5:14 pm

pudding
I tested MAME4ALL on Blank O/S’s and a few different revisions (Also on my own O/S Builds with various packages installed EXCLUDING dispmanx), I assumed the was part of the compile (It looked suspiciously like it was included as CAPCOM CPS titles had the “Elongated” look from its use), that’s why I asked how you managed to compile it in for my PC Engine Emulator Project Build. Kalehrl suggested it could be lGLESv2’s inclusion was having the same “Effect”, either way, it’s certainly VERY FAST (Like I suggested 200-250% over AdvMAME 0.94) and worked fine on any O/S Build I tested it on. I just need to include the same sort of solution for the PC Engine Emulator (It’s MUCH quicker with the SDLdispmanx backend!)

FortyRock
Which "Raiden" are you refering to? I have found anything at the Top end of the Scale (Hardware Wise) MAME4ALL will Emulate* was fine excluding N.A.R.C (60%) and Out Run (90%), but they are playable! Everything else was 100% or better including Smash TV! (Which runs at about 30-40% on AdvMAME 0.94)

NB These are ALL excluding dispmanx at 900MHz Clock
"The list of things I have heard now contains everything!"

pudding
Posts: 92
Joined: Sat Jan 12, 2013 3:55 pm
Location: UK

Re: MAME4ALL for Pi

Sun Mar 10, 2013 6:26 pm

FortyRock, there's no package dependency on anything else, the "SDL/dispmanx backend" can be installed to work around the buggy default Raspbian SDL drivers (when using Console) until it's fixed (looks like a kernel fix is required). On older versions of Raspbian it works without any problems. Slow exiting must be an issue with the SDL/dispmanx backend.

Welshy, I don't understand what you're saying, I don't use SDL for graphics, just dispmanx which I coded myself. I only use SDL for input.
(aka squid). Author of MAME4ALL for Pi, PiSNES, PiFBA & PiMenu

welshy
Posts: 1659
Joined: Mon Oct 29, 2012 2:07 pm

Re: MAME4ALL for Pi

Sun Mar 10, 2013 7:00 pm

pudding
K, I misunderstood (I assumed it was the SDLdispmanx backend)
"The list of things I have heard now contains everything!"

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 14 guests