UPDATE: Works with 0.137
NOTE: Don't fear how long the post is! Instructions are very detailed thats why it looks like so much to do. In fact you only edit 3 files and only very little code. The whole thing usually takes 10 minutes to do and 20-30 minutes to compile!
I just compiled Mame Plus 0.128 and I thought I would share the procedure with everyone. Now I know there are a lot of tutorials out there but it still took me some time to figure out what goes in the mingw directory, where to put everything ...
So over here I will post a link to a ready to use made mingw directory to speed things up. I tried to keep everything as simple as possible!
Now what is the advantage of compiling your own mame build:
For me it was to remove the nag screens in mame. When gameex is displaying mame games in attract mode some games don't start because of an error message of incomplete emulation. I will show you how you can get rid of this!
Many other people use it also to get hiscore support back into mame (e.g. save your donkey kong high score even if you exit a game). Since Mame Plus already has this feature enabled we don't need to enable hi score support.
Mame Plus further offers to use graphical filters to remove the "blockyness" of some games (eg hq3x or 2x super sai)
For me this is the main reason of using Mame Plus
What you need to do:
1. Download mingw here and put it into c:\mingw. if link sould be dead you can find instructions for what you need over here: http://mameicons.free.fr/mame32p/
THESE ARE OLD INSTRUCTIONS THOUGH: You don't have to rename g++-slij to g++ anymore and you now find the extra utils on the download section at the bottom of the page
2. Download Mame Source Code here. The file name is something like this : mame0128s.zip
3. Download Mame Plus Source Code here. Look for Source code which matches the mame build you just downloaded. In this case "Source code 0.128"
4. Download the Mame Plus fonts from over here
5. Unpack Mame Source code to a directory eg "c:\mamecompile". Unpack Mame Plus Source to the same directory. If you did this right it will ask you to replace a file. Confirm this!
6. A mistake I made more then once: Unpack the just downloaded font pack to the same directory.
7. In c:\mamecompile there is a file called env.bat. Right click on it and go to edit (or right click=> open with notepad)
The file will look like this:
@echo off set MINGW_ROOT=D:\wgcc421 set PATH=%MINGW_ROOT%\bin;extra\bin;%PATH% set C_INCLUDE_PATH=extra\include set LIBRARY_PATH=extra\lib gcc -v
Replace the path with our mingw directory so it looks like this:
@echo off set MINGW_ROOT=c:\mingw set PATH=%MINGW_ROOT%\bin;extra\bin;%PATH% set C_INCLUDE_PATH=extra\include set LIBRARY_PATH=extra\lib gcc -v8. Now we have set up everything to start compiling! But before we do this we will still need to edit 2 files to remove the nag screens. This is the most tricky part :
Removing disclaimer
Go to
c:\mamecompile\src\emu\ui.c
Open with Notepad.
Search for:
int show_gameinfo = !options_get_bool(mame_options(), OPTION_SKIP_GAMEINFO); int show_warnings = TRUE; int state; /* disable everything if we are using -str for 300 or fewer seconds, or if we're the empty driver, or if we are debugging */
Add this line:
int show_gameinfo = !options_get_bool(mame_options(), OPTION_SKIP_GAMEINFO); int show_warnings = TRUE; int state; show_gameinfo = show_warnings = show_disclaimer = FALSE; /* disable everything if we are using -str for 300 or fewer seconds, or if we're the empty driver, or if we are debugging */
Notice the 'show_gameinfo = show_warnings = show_disclaimer = FALSE;" line was added
Search further for
/* display any popup messages */ if (osd_ticks() < popup_text_end) ui_draw_text_box(astring_c(messagebox_text), JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor); else popup_text_end = 0; /* cancel takes us back to the ingame handler */ if (ui_handler_param == UI_HANDLER_CANCEL) ui_set_handler(handler_ingame, 0); }
and replace with:
/* display any popup messages */ /* if (osd_ticks() < popup_text_end) ui_draw_text_box(astring_c(messagebox_text), JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor); else popup_text_end = 0; */ /* cancel takes us back to the ingame handler */ if (ui_handler_param == UI_HANDLER_CANCEL) ui_set_handler(handler_ingame, 0); }
notice /* and */ disable this part of the code
Search further for:
static UINT32 handler_messagebox(running_machine *machine, UINT32 state)
{
ui_draw_text_box(astring_c(messagebox_text), JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
return 0;
}
and replace with:
static UINT32 handler_messagebox(running_machine *machine, UINT32 state)
{
//ui_draw_text_box(astring_c(messagebox_text), JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
return 0;
}
Notice "//ui_draw.." disables this line
Removing border
Go to c:\mamecompile\src\emu\render.c
Look for:
else
{
render_primitive *prim;
prim = alloc_render_primitive(RENDER_PRIMITIVE_QUAD);
set_render_bounds_xy(&prim->bounds, 0.0f, 0.0f, (float)target->width, (float)target->height);
set_render_color(&prim->color, 1.0f, 1.0f, 1.0f, 1.0f);
prim->texture.base = NULL;
prim->flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA);
append_render_primitive(&target->primlist[listnum], prim);
if ((target->width > 1) && (target->height > 1))
{
prim = alloc_render_primitive(RENDER_PRIMITIVE_QUAD);
set_render_bounds_xy(&prim->bounds, 1.0f, 1.0f, (float)(target->width - 1), (float)(target->height - 1));
set_render_color(&prim->color, 1.0f, 0.0f, 0.0f, 0.0f);
prim->texture.base = NULL;
prim->flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA);
append_render_primitive(&target->primlist[listnum], prim);
}
}
and replace with:
else
{
/* render_primitive *prim;
prim = alloc_render_primitive(RENDER_PRIMITIVE_QUAD);
set_render_bounds_xy(&prim->bounds, 0.0f, 0.0f, (float)target->width, (float)target->height);
set_render_color(&prim->color, 1.0f, 1.0f, 1.0f, 1.0f);
prim->texture.base = NULL;
prim->flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA);
append_render_primitive(&target->primlist[listnum], prim);
if ((target->width > 1) && (target->height > 1))
{
prim = alloc_render_primitive(RENDER_PRIMITIVE_QUAD);
set_render_bounds_xy(&prim->bounds, 1.0f, 1.0f, (float)(target->width - 1), (float)(target>height - 1));
set_render_color(&prim->color, 1.0f, 0.0f, 0.0f, 0.0f);
prim->texture.base = NULL;
prim->flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA);
append_render_primitive(&target->primlist[listnum], prim);
} */
}
/* and */ was added
OPTIONAL:
Got to \src\osd\windows\input.c
// For testing purposes: force DirectInput #define FORCE_DIRECTINPUT 0
with
// For testing purposes: force DirectInput #define FORCE_DIRECTINPUT 1
This is useful if you want a delay for an exit combo (eg hold 1P+2P for 2 secs to exit). you can simply create a ahk script to do this. normally the RAW input system of Mame prevents this!
If you made it until here, the rest is simple:
9. Go to start=> run and type in cmd
10. type in
c: <enter>
cd\ <enter>
cd mamecompile<enter>
env<enter>
make<enter>
11. now the computer should start compiling the files. It takes around 20 minutes. If you have any questions, please go ahead and ask me!
I first used this guide with mame plus 0.124 and it worked for every version until now with 0.133 so I expect it to work with upcoming versions as well.
12. One tip: to disable the confirmation screen when exiting a game, open mamepgui.exe. then go to options=> default game options=>miscellaneous. uncheck quit game with confirmation
Happy gaming,
chriss
(thanks to headkaze for the infos)
















