Compiling DOS MAME
IMPORTANT: DO NOT REDISTRIBUTE YOUR RECOMPILED VERSION OF MAME WITHOUT THE EXPLICIT CONSENT OF THE MAMEDEV'S. DOING SO CONTRAVENES THE LICENSE AGREEMENT AND COULD POTENTIALLY PUT MAME AT RISK OF FUTURE DEVELOPMENT - THIS INCLUDES ADDING IN GAMES AND REMOVING COPYRIGHT INFORMATION ETC. IF YOU ABSOLUTELY MUST RECOMPILE YOUR OWN VERSION OF MAME PLEASE BEAR IN MIND IT WILL NOT BE SUPPORTED BY ME OR THE MAMEDEV'S IN ANY WAY WHATSOEVER, SO DO NOT BUG THE MAMEDEV'S WITH ANY QUESTIONS REGARDING YOUR RECOMPILED VERSION
Why would you want to recompile your own version of MAME ?
When you download the MAME binary you are downloading a version which has been pre-compiled for your hardware/operating system, i.e. PC/MAC or DOS/WIN32/LINUX/BEOS etc.
MAME also has certain games and options added/removed as default which you can change if you download and modify the MAME source - See bottom of the page for more information :)
To recompile your own personal version of MAME you will need initailly to do 2 things. Firstly, you will have to download and extract the MAME C source to your hard disk. Then, you must install the compiler. We will only cover the DOS version of the C compiler. Once the compiler has been installed it can be repeatedly used to recompile future versions of the MAME source (assuming the compiler versions do not change)
You'll notice in my software configuration the following lines in the AUTOEXEC.BAT
:common
mode 80
echo Loading system drivers. Please wait...
echo.
c:\windows\smartdrv /x > null
set tmp=c:\temp
set temp=c:\temp
path c:\windows;c:\windows\command;c:\compiler\bin
SET BLASTER=A220 I5 D1 T4
C:\sound\cwrdos.exe > null
c:\mouse\mouse > null
set djgpp=c:\compiler\djgpp.env
These paths in RED point to my installation of the DOS compiler which can be found on the MAME home page.
Compiling MAME
Run the command;
make mameos=msdos
or for an Intel optimised executable
make I686=1 mameos=msdos
or for an AMD K6 optimised executable
make k6=1 mameos=msdos
When the compiler has completed compiling MAME your new executable is called DMAME.EXE
If you get an error message like "Error -1" after a line that starts with "nasmw -o", you have not installed nasmw.exe correctly
Your computer could take well over an hour to compile MAME (depending on it's specification) and it will stop two or three times saying 'Out of DOS memory', 'No DPMI selectors' or maybe even 'illegal operation'. Just run 'make' again and DJGPP will continue from where it stopped.
That's it!! assuming all went well, you should have a new MAME.EXE file - NOW you can add and remove those MAME options :)
Here are some source changes you can make for your own custom MAME...
CHANGE | FILE | CHANGE FROM | CHANGE TO |
Add in the uncommented games and test drivers | src/driver.c | TESTDRIVER | DRIVER |
Remove the OK message | src/mame.c | if (settingsloaded == 0) | if (0) |
src/mame.c | if (showgamewarnings (real_scrbitmap) == 0) | if (1) | |
To change other messages | src/ui_text.c | ||
Change the general MAME information | src/common.c | ||
Set DECO Tape loading to full speed | src/machine/decoass.h | Add after line 120 | extern int throttle; extern int frameskip; |
src/machine/decoass.c | Add after line 1459 | throttle = 0; frameskip = 11; |
|
src/machine/decoass.c | Add after line 170 | throttle = 1; frameskip = 0; |
|
Remove "IRQ2 enables, need raster driver" in some Neo-Geo games | src\drivers\neogeo.c |
Delete lines 318 & 319 if (irq2control & 0x10) |
MAME Source Changes Needed By Version
CHANGE | FILE | CHANGE FROM | CHANGE TO |
MAME Version | |||
0.53 onwards | makefile | MAMEOS = windows | MAMEOS = msdos |
Please, please adhere to the warning at the top of this page and leave credit where credit is due