Maybe this will be obsoleted soon by an official build from Brad Oliver, but I'm guessing that he'll be busy porting a certain other acronym for a while.
So I spent about a day on it and leveraged the Xcode build of MacMAME to 0.84. This is the first time I've leveraged MAME, and a lot of things have changed in the core since 0.77u2, so it's possible I broke stuff. For coding reference, these are roughly the steps I took:
* Start with mame084s.zip tree. Add Xcode projects and "override" from MacMAME 0.77u2c.
* Diff makefile, add commented-out HAS_* defines for new CPUs to MacMAME.h. Since I'm not sure which ones are actually used, uncomment them as needed by cpu/sound cores, after failed compilation. I end up with:
ghostwheel:~ arekkusu$ diff ~/Projects/MacMAME077u2c/override/macintosh/MacMAME.h ~/Projects/MacMAME084/override/macintosh/MacMAME.h
> //#define HAS_I386 1
> //#define HAS_M6809E 1
> //#define HAS_M68008 1
> //#define HAS_TMS99000 1
> //#define HAS_TI990_10 1
> //#define HAS_TMS32026 1
> #define HAS_ADSP2104 1
> //#define HAS_ADSP2181 1
> //#define HAS_R4700 1
> //#define HAS_QED5271 1
> //#define HAS_I960 1
> #define HAS_CDDA 1
> #define HAS_DMADAC 1
> #define HAS_NAMCO_15XX 1
> #define HAS_NAMCO_CUS30 1
> #define HAS_NAMCO_52XX 1
> #define HAS_NAMCO_54XX 1
> #define HAS_NAMCO_63701X 1
> #define HAS_PSXSPU 1
> #define HAS_YMF271 1
> #define HAS_ICS2115 1
> #define HAS_ST0016 1
* build the m68k opcode generator and run it:
ghostwheel:~/Projects/MacMAME084/src/cpu/m68000 arekkusu$ gcc -Os -s m68kmake.c -o m68kmake; ./m68kmake
* For each project [drivers machine sndhrdw vidhrdw MacMAME]:
* * diff relevant part of tree.
* * remove all deleted files in tree from project.
* * add all new files in tree to project.
* * add src/includes to include path.
* * compile and fix any compilation errors/warnings caused by core changes...
* Despite fixing the include path, two changes to core files were needed to get them to build properly:
ghostwheel:~ arekkusu$ diff ~/Projects/MacMAME084_org/src/drivers/cojag.c ~/Projects/MacMAME084/src/drivers/cojag.c
< #include "jaguar.h"
> #include "includes/jaguar.h"
ghostwheel:~ arekkusu$ diff ~/Projects/MacMAME084_org/src/machine/williams.c ~/Projects/MacMAME084/src/machine/williams.c
< #include "williams.h"
> #include "includes/williams.h"
* This change was leveraged from 0.77u2c to fix c99 compilation: (NOTE there are a few other instances of MAC_PORT which I did not leverage; seems to compile OK without them. Brad would have to confirm)
ghostwheel:~ arekkusu$ diff ~/Projects/MacMAME084_org/src/machine/stvcd.h ~/Projects/MacMAME084/src/machine/stvcd.h
> #if TARGET_RT_MAC_CFM || TARGET_RT_MAC_MACHO // MAC_PORT
> #undef true
> #undef false
> #define true stv_true
> #define false stv_false
* This #ifndef was wrong in the core; I fixed it to avoid some redefine warnings:
ghostwheel:~ arekkusu$ diff ~/Projects/MacMAME084_org/src/sha1.h ~/Projects/MacMAME084/src/sha1.h
< #ifndef _STDINT_H
> #ifndef _STDINT_H_
* Due to core reworking (get_info and encryption) two CPU cores had incompatibilities with the Mac Asgard asm wrappers: the m6809 and the m68000. For the m6809 I just disabled the Asgard wrapper and added the C core to the project directly. (The Asgard stuff will need to be updated for CodeWarrior, but in Xcode the assembly doesn't work anyway, so no big loss.) The 68k I was able to fix by hacking a core file to work with the funny Asgard redefine scheme:
ghostwheel:~ arekkusu$ diff ~/Projects/MacMAME084_org/src/cpu/m68000/m68kmame.c ~/Projects/MacMAME084/src/cpu/m68000/m68kmame.c
> #ifndef A68K0
* Core changes in 0.78u2 and 0.84 required two changes to macinfo.c:
ghostwheel:~ arekkusu$ diff ~Projects/MacMAME077u2c/override/macintosh/macinfo.c ~/Projects/MacMAME084/override/macintosh/macinfo.c
> // as of MAME 0.78u2, we must manually init the cpuintrf array
< const struct InputPortTiny *in;
> const struct InputPort* in;
> in = input_port_allocate(inGame->construct_ipt);
< in = inGame->input_ports;
* Core changes in 0.77u3 and later require a new osd function:
ghostwheel:~ arekkusu$ diff ~/Projects/MacMAME077u2c/override/macintosh/mac.c ~/Projects/MacMAME084/override/macintosh/mac.c
> // osd_die
> void CLIB_DECL osd_die(const char *text,...)
> va_list arg;
> /* standard vfprintf stuff here */
> va_start(arg, text);
> logerror(text, arg);
> vprintf(text, arg);
* Finally, I updated the Info.plist version to "0.84 unofficial".
The resulting Deployment binary is 37.8 megs, considerably bigger than 0.77u2c's 23.3 megs. I'm not sure if that's all due to new drivers, but I'll look into dead-code stripping later.
I tried out a couple old ROMs which all seem to work OK, including 6809 and 68000/68020 games. The CPU usage is pretty high on some like Joust 2 due to the C cores. Other games like Ms Pac Man take about 15% of my CPU (15" AlBook) and a lot of that is the blit.
The only relatively new ROM I have to test is Strider Hiryu 2, and it does not work. So I think the PSX core may still be busted on Mac. Somebody please fix it!
Problems that existed in 0.77u2a still exist-- for example, crashing in System16 when opening Major League, or the horizontally-squished NeoGeo games. But at least it is up-to-date now.
Source is on my iDisk.
Note: this is totally unofficial. If your favorite ROM doesn't work, tough. If you don't know how to use a compiler, double tough. I won't be posting a binary for end-users.