Jump to content


- - - - -

Tutorial: Compile Mame Plus to remove Nag screens


  • You cannot reply to this topic
12 replies to this topic

#1 chriss

    Ultimate GameEx Guru!

  • Members
  • PipPipPipPipPipPip
  • 635 posts
  • Gender:Male
  • Location:Joymany - Aik!

Posted 28 August 2008 - 08:03 PM

Tutorial: How to compile Mame Plus


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 -v
8. 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)

#2 B2K24

    Member

  • Members
  • PipPipPip
  • 54 posts

Posted 12 November 2010 - 07:00 PM

Wonderful guide Thank you so much for posting.
I'm trying all of this with the 140 source that has been posted here
http://www.mameworld...o=&fpart=1&vc=1

It looks like the contents of render.c have slightly changed, but I applied the changes anyway and am compiling now.
Too be more specific it has changed to this now.

else
	{
		render_primitive *prim = list.alloc(render_primitive::QUAD);
		set_render_bounds_xy(&prim->bounds, 0.0f, 0.0f, (float)m_width, (float)m_height);
		set_render_color(&prim->color, 1.0f, 1.0f, 1.0f, 1.0f);
		prim->texture.base = NULL;
		prim->flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA);
		list.append(*prim);

		if (m_width > 1 && m_height > 1)
		{
			prim = list.alloc(render_primitive::QUAD);
			set_render_bounds_xy(&prim->bounds, 1.0f, 1.0f, (float)(m_width - 1), (float)(m_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);
			list.append(*prim);
		}
	}


I will update if all goes well :) Thanks so much !!!!!!!! I have been looking to do this for days.
Posted Image

#3 B2K24

    Member

  • Members
  • PipPipPip
  • 54 posts

Posted 12 November 2010 - 07:33 PM

OK just an update here This guide works for 0140 mamepui64.exe
Can someone please chime in and describe how to remove the nag screen from mamepgui.exe please?
This information would be very helpful too me.

When I compile with make all command it does not produce a mamepgui.exe
I only can create mamepui64.exe and mamep64.exe

Any help or information will be very much appreciated :)
Thank You.

[EDIT]
It appears if I don't use any existing .ini's from before and re-config everything from scratch
the no nag is removed from both mamepgui.exe and mamepui64.exe :)
The key is after compile when mamepgui.exe is opened you select the mamep64.exe and result is success :)
More testing to come.
Posted Image

#4 Draco1962

    Grand Poobah of the Loyal Order of Procrastinating Misanthropes

  • Admin
  • PipPipPipPipPipPipPip
  • 3,174 posts
  • Gender:Male
  • Location:Jacksonville, Florida USA
  • Interests:Anything PC, Arcade, or Xbox related.

Posted 19 November 2010 - 03:29 AM

Are there similar instructions for compiling mameui32/64 for 0.140?

#5 fRequEnCy

    GameEx God (Top Rank)

  • Moderators
  • PipPipPipPipPipPipPip
  • 3,468 posts
  • Gender:Male
  • Location:Albuquerque, NM USA

Posted 19 November 2010 - 04:23 AM

This be done easily using HK's Mame Compiler tool for mameui32/64?

#6 B2K24

    Member

  • Members
  • PipPipPip
  • 54 posts

Posted 19 November 2010 - 05:46 AM

compiling your own MAMEUI can have many benefits, such as always staying updated with latest u builds and having the nag screen removed is very nice!
This guide is for windows 7 users, but should work on older versions as well.


I STRONGLY suggest not using C:\ drive and using a different drive, because windows 7 is VERY picky about activities on C:\ and even with UAC disabled directories have lock icon and compile was unsuccessful.
In this guide I will use G:\


DOWNLOAD REQUIREMENTS
mingw-mame-w64-20100102.exe <<<< ONLY IF YOU HAVE 64 BIT O/S X64
http://mamedev.org/downloader.php?file=too...64-20100102.exe
mingw-mame-w32-20100102.exe <<<< IF YOU'RE 32 BIT O/S X86 THIS ONE
http://mamedev.org/downloader.php?file=too...32-20100102.exe
latest MAME source code, in this case it's MAME0141s.exe
http://mamedev.org/downloader.php?file=rel...s/mame0141s.exe
download latest MAMEUI source code
http://www.mameui.info/
hiscore diff (with no nag/white box removal)
http://forum.arcadec...p?topic=64298.0

1. Create 2 directories (New Folders) on root of G:\ name them mingw and mamesrc
2. Extract mingw-mame-w64-20100102.exe OR mingw-mame-w32-20100102.exe to mingw directory
3. Extract MAME source code.exe (in this case it's mame0141s.exe) to mamesrc directory
4 Make sure all diff files are in mamesrc directory
5. Extract MameUIs.exe to G:\mamesrc\src\osd
6. Copy file MameUI.mak in G:\mamesrc\src\osd\MameUIs paste to location G:\mamesrc
7. Copy directory winui located at G:\mamesrc\src\osd\MameUIs copy to location G:\mamesrc\src\osd
8. Rename hi_141u1.txt to hi_141u1.diff then place in G:\mamesrc
9. We will need to create 1 .bat file
name it WhateverYouWant.bat

contents of WhateverYouWant.bat
set path=G:\mingw\mingw64-w64\bin

patch -p0 -E < 0141u1.diff

patch -p0 -E < hi_141u1.diff

make -f mameui.mak

(this operation can take 10 or MORE minutes depending how fast your PC is. Once completed you shiny new MAMEUI will be in mamesrc directory. Congrats you are all finished, easy eh :)

Posted Image
Posted Image

#7 Draco1962

    Grand Poobah of the Loyal Order of Procrastinating Misanthropes

  • Admin
  • PipPipPipPipPipPipPip
  • 3,174 posts
  • Gender:Male
  • Location:Jacksonville, Florida USA
  • Interests:Anything PC, Arcade, or Xbox related.

Posted 20 November 2010 - 03:27 AM

B2K24 or Chriss,

Are the instructions for disabling the "nag" screens the same as Chriss posted? Also how can I enable the high scores in MAMEUI?

Thanks again!

.:.EDIT I finally found HK's 64 Compiler and instructions and it appears fairly complete and to the point - will have to give it a go.

#8 B2K24

    Member

  • Members
  • PipPipPip
  • 54 posts

Posted 09 February 2011 - 06:42 AM

I thought my guide was straight and too the point :P
Posted Image

#9 Draco1962

    Grand Poobah of the Loyal Order of Procrastinating Misanthropes

  • Admin
  • PipPipPipPipPipPipPip
  • 3,174 posts
  • Gender:Male
  • Location:Jacksonville, Florida USA
  • Interests:Anything PC, Arcade, or Xbox related.

Posted 10 February 2011 - 12:05 AM

Yours is - I just found HK's MAMEUI Compiler to be easier for me since I have been using Mameui since it was Mame32 and I am most familiar with it.

#10 saaga

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 19 May 2011 - 02:55 PM

Thanks for the guide!

#11 stshepana

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 07 August 2011 - 04:59 PM

I need knowlege about how to make an exit combo (eg hold 1P+2P for 3 secs to exit) and the software needed (scripts and all).

#12 brentmcd

    Newbie

  • Members
  • Pip
  • 1 posts
  • Gender:Male
  • Location:Scottsdale Arizona
  • Interests:God, Golf, Family.... & gadgets

Posted 24 October 2011 - 03:05 AM

B2K24

I am grateful for your guide.

Some questions:

I'm trying to put this together using the current 143u8

The current highscore diff indicates it is for versions 5-7.... Will it work for u8?
The current available version of MAMEUI Source is 143.8.1

I've followed the directions to the letter several times and I never end up with a file named "MameUI.mak located in the G:\mamesrc\src\osd\MameUIs -----What am I missing?

What do you creat a bat file in??? Wordpad?

I sure wish there was someplace I could simply download a compiled version.
Thanks for your help.
Gratefully yours,
Brent

#13 B2K24

    Member

  • Members
  • PipPipPip
  • 54 posts

Posted 22 December 2011 - 04:09 PM

Sorry brentmcd, I didn't see this thread until now. Do you still need help with this?
Posted Image





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users