MAME Development

MAME, MESS, and HazeMD

 * MAME is the Multiple Arcade Machine Emulator.
 * MESS is the Multi Emulator Super System is a home game console emulator.
 * HazeMD (David 'Haze' Haywood's MegaDrive emulator) is a SEGA Mega Drive / Genesis emulator.

Windows
Follow the guide called 'The Easy Way', except you may have to replace set path=%PATH%;\mingw\bin with set path=\mingw\bin;%PATH% and you may want to change the target architecture in the makefile, here I set it to Pentium M:
 * 1) specify architecture-specific optimizations
 * 1) specify architecture-specific optimizations

ARCHOPTS = -march=pentium-m
 * 1) uncomment and specify architecture-specific optimizations here
 * 2) some examples:
 * 3)   optimize for I686:   ARCHOPTS = -march=pentiumpro
 * 4)   optimize for Core 2: ARCHOPTS = -march=pentium-m -msse3
 * 5)   optimize for G4:     ARCHOPTS = -mcpu=G4
 * 6) note that we leave this commented by default so that you can
 * 7) configure this in your environment and never have to think about it

Mac OS X

 * Install XCode
 * Download SDL Runtime libraries and install SDL.framework into /Library/Frameworks
 * Download and unpack SDLMAME
 * cd to SDLMAME dir and run
 * If you have an Intel machine:
 * If you have a PowerPC machine:
 * Make a pot of coffee.

Notes:


 * makes the compile run at low scheduling priority, which you always should do for lengthy compiles.
 * takes advantage of dual core processors to compile faster.

Prerequisites

 * Enable framebuffer support in the kernel.
 * Emerge libsdl with OpenGL, framebuffer (fbcon), and DirectFB support.
 * Emerge standard version to get all dependencies:  (may be unnecessary, try without).

Build

 * Download and unpack SDLMAME source.


 * Change the target architecture in the makefile, here I set it to Pentium 4 (Prescott):
 * 1) specify architecture-specific optimizations
 * 1) specify architecture-specific optimizations

ARCHOPTS = -march=prescott -msse3 -fomit-frame-pointer
 * 1) uncomment and specify architecture-specific optimizations here
 * 2) some examples:
 * 3)   optimize for I686:   ARCHOPTS = -march=pentiumpro
 * 4)   optimize for Core 2: ARCHOPTS = -march=pentium-m -msse3
 * 5)   optimize for G4:     ARCHOPTS = -mcpu=G4
 * 6) note that we leave this commented by default so that you can
 * 7) configure this in your environment and never have to think about it

Ignore Pending Anonymous Timers
I live life on the edge, so I dare to ignore pending anonymous timers, even though I don't know exactly what they are: In emu/machine.c:

void running_machine::handle_saveload {       ...

// if there are anonymous timers, we can't save just yet, and we can't load yet either // because the timers might overwrite data we have loaded /*	if (!m_scheduler.can_save) {		// if more than a second has passed, we're probably screwed if ((this->time - m_saveload_schedule_time) > attotime::from_seconds(1)) {			popmessage("Unable to %s due to pending anonymous timers. See error.log for details.", opname); goto cancel; }		return; }	*/

Ignore Pending Anonymous Timers
Disabling the always annoying 'unable to save due to pending anonymous timers'- edit src/emu/mame.c: handle_load and handle_save: comment out this if: /*  if (timer_count_anonymous > 0) {     ...   }   */ To avoid a warning (which is being treated as an error), uncomment the 'cancel' label at the bottom of handle_load and handle_save: //cancel: /* unschedule the load */ astring_free(mame->saveload_pending_file); mame->saveload_pending_file = NULL; mame->saveload_schedule_callback = NULL; }

Autosave
This hack enables autosave even though save states may not be officially supported for the game - edit src/emu/mame.c: static void saveload_init(running_machine *machine) {        ...         /* if we're in autosave mode, schedule a load */ else if (options_get_bool(mame_options, OPTION_AUTOSAVE) /*&& (machine->gamedrv->flags & GAME_SUPPORTS_SAVE)*/) mame_schedule_load(machine, "auto"); }

void mame_schedule_exit(running_machine *machine) {       ...        /* if we're autosaving on exit, schedule a save as well */ if (options_get_bool(mame_options, OPTION_AUTOSAVE) /*&& (machine->gamedrv->flags & GAME_SUPPORTS_SAVE)*/) mame_schedule_save(machine, "auto"); }

Start All Games from Menu
Start games with audit errors from ingame menu - edit src/emu/uimenu.c: void menu_select_game: /* if everything looks good, schedule the new driver */ /* if (audit_result == CORRECT || audit_result == BEST_AVAILABLE) { */ 	mame_schedule_new_driver(machine, driver); ui_menu_stack_reset(machine); //} /* otherwise, display an error */ /* else { 	ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_REF); menustate->error = TRUE; } */

Compiling a Small mame.exe Just For Pacman
Change your makefile - you cannot just run 'make pacmanonly', it doesn't work: ... ifeq ($(TARGET),) TARGET = pacmanonly endif

Create a src/pacmanonly.mak file (it's LARGE, because the pacman driver links to many many other drivers):

COREDEFS += -DTINY_COMPILE=1 COREDEFS += -DTINY_NAME="driver_pacman" COREDEFS += -DTINY_POINTER="&driver_pacman" CPUS+=M6502@ CPUS+=Z80@ CPUS+=N2A03@ SOUNDS+=NAMCO@ SOUNDS+=SAMPLES@ SOUNDS+=DISCRETE@ SOUNDS+=SN76496@ SOUNDS+=AY8910@ SOUNDS+=SN76496@ SOUNDS+=TMS36XX@ SOUNDS+=DAC@ SOUNDS+=NES@ SOUNDS+=TMS5110@ OBJS = $(OBJ)/vidhrdw/pacman.o $(OBJ)/drivers/pacman.o \ $(OBJ)/vidhrdw/galaxian.o $(OBJ)/sndhrdw/galaxian.o $(OBJ)/drivers/galaxian.o \ $(OBJ)/vidhrdw/phoenix.o $(OBJ)/sndhrdw/phoenix.o $(OBJ)/drivers/phoenix.o \ $(OBJ)/machine/scramble.o $(OBJ)/sndhrdw/scramble.o $(OBJ)/drivers/scramble.o \ $(OBJ)/drivers/cvs.o $(OBJ)/vidhrdw/cvs.o $(OBJ)/vidhrdw/s2636.o \ $(OBJ)/vidhrdw/dkong.o $(OBJ)/sndhrdw/dkong.o $(OBJ)/drivers/dkong.o \ $(OBJ)/vidhrdw/cclimber.o $(OBJ)/sndhrdw/cclimber.o $(OBJ)/drivers/cclimber.o \ $(OBJ)/vidhrdw/mario.o $(OBJ)/sndhrdw/mario.o $(OBJ)/drivers/mario.o \ $(OBJ)/vidhrdw/ladybug.o $(OBJ)/drivers/ladybug.o \ $(OBJ)/drivers/frogger.o \ $(OBJ)/machine/bagman.o $(OBJ)/vidhrdw/bagman.o $(OBJ)/drivers/bagman.o \ $(OBJ)/drivers/scobra.o \ $(OBJ)/drivers/epos.o $(OBJ)/vidhrdw/epos.o \ $(OBJ)/machine/8255ppi.o \ $(OBJ)/sndhrdw/pleiads.o \ $(OBJ)/machine/7474.o \ $(OBJ)/vidhrdw/res_net.o \ $(OBJ)/drivers/amidar.o \ $(OBJ)/machine/strtheat.o $(OBJ)/machine/drakton.o \ $(OBJ)/vidhrdw/pacman.o $(OBJ)/drivers/pacman.o \ $(OBJ)/machine/mspacman.o $(OBJ)/machine/pacplus.o \ $(OBJ)/machine/jumpshot.o $(OBJ)/machine/theglobp.o \ $(OBJ)/machine/acitya.o \ $(OBJ)/drivers/pengo.o \ $(OBJ)/drivers/jrpacman.o \ $(OBJ)/machine/segacrpt.o \ COREOBJS += $(OBJ)/tiny.o $(OBJ)/cheat.o
 * 1) uses these CPUs
 * 1) uses these SOUNDs

Copy src/tiny.c to src/pacmanonly.c and run: C:\MinGW\mame>make