Attract-Mode Support Forum

Related Stuff => Emulators => Topic started by: hermine.potter on August 19, 2015, 05:04:08 AM

Title: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on August 19, 2015, 05:04:08 AM
Hi there!

Unfortunately the official binary package of mame (current version : 0.204) includes auto-disclaimer-messages, warnings and so on.
There are different websites and board entries (http://mrdo.mameworld.info/compile.php) editing and compiling the source code to disable these nag screens.

But these descriptions are often out of date, because the named tools are not longer available on github-webspace of mame (MinGW, install.exe, buildtools.7z : links are simply dead).

Since Version 0.171 mame offers a new GUI with Filters, Infos, Images and a own Hiscore-Support
 
So this is a tutorial and workaround:

Older Releases to 0.170 see (http://forum.attractmode.org/index.php?topic=348.msg4826#msg4826)
Since Version 0.171 follow tutorial...




=patch with .diff and compile mame.exe (using .diff-file):




01)
on x86 / 32bit-system download msys32-2017-12-26.exe (https://github.com/mamedev/buildtools/releases/download/3.0/msys32-2017-12-26.exe)
on x64 / 64bit-system download msys64-2017-12-26.exe (https://github.com/mamedev/buildtools/releases/download/3.0/msys64-2017-12-26.exe)



02)
on x86 / 32bit-system extract msys32-2017-02-05.exe to C:
on x64 / 64bit-system extract msys64-2017-02-05.exe to C:
(http://fs5.directupload.net/images/160704/abygtrmh.gif)

( so you get folder C:\msys32 or C:\msys64 )
(http://fs5.directupload.net/images/160208/m99jcopo.png)
(http://fs5.directupload.net/images/160208/z7g5poj5.png)




03)
After extraction is finished, start:
win32env.bat



04)
After first start, exit the compiler-window by typing:
exit
or
clicking on X of compiler-window
(http://fs5.directupload.net/images/160704/upezzura.gif)



05)
mamedev doesn't longer contain patch-command. So you've to download it:

start:
win32env.bat



06)
type command and execute:
pacman -Syuu patch
y
y
y
(http://fs1.directupload.net/images/180614/ahyykamq.png)

if download stucks, press CTRL+C (abort)
(http://fs1.directupload.net/images/180614/6nnzorb7.png)

type command and execute (again):
pacman -Syuu patch
y
(http://fs5.directupload.net/images/180614/ls5y3yxh.png)



07)
confirm installation with y
http://fs5.directupload.net/images/160704/rzs6kn6r.gif




08)
After first start, exit the compiler-window by typing:
exit
or
clicking on X of compiler-window
(http://fs5.directupload.net/images/160704/upezzura.gif)



09)
download source code (https://github.com/mamedev/mame/releases/download/mame0204/mame0204s.exe):



10)
execute:
mame0204s.exe
on x86 / 32bit-system extract to C:\msys32\src
on x64 / 64bit-system extract to C:\msys64\src
(http://fs5.directupload.net/images/160704/pg37395w.gif)



11)
download .diff file here (http://mamestuff.lowtrucks.net/MKChamp/) (current patchfile for Mame 0.204 is suppression_0204u0.txt ) (previous than 0.178 : hi_0178.txt)
Thanks to MKChamp offering diff-Files



12)
Rename suppression_0204u0.txt to hi_0204.diff
(earlier 0.178 : Rename hi_0178.txt to hi_178.diff )



13)
on x86 / 32bit-system move .diff-file to C:\msys32
on x64 / 64bit-system move .diff-file to C:\msys64
(http://fs5.directupload.net/images/160406/nq44e7s7.png)



14)
start:
win32env.bat



15)
on x86 / 32bit-system: patch --binary -p0 -E <C:\msys32\hi_204.diff
on x64 / 64bit-system: patch --binary -p0 -E <C:\msys64\hi_204.diff

(http://fs5.directupload.net/images/160704/e7ej2q5t.gif)



16)
After finishing the patch-process, exit the cmd-window by exit command or clicking the x of compiler window
(http://fs5.directupload.net/images/160704/upezzura.gif)



17)
Execute:
win32env.bat



18)
execute the following command if your compiling computer provides a quad-core-processor (-j5 means 5 jobs simultaneously):
make -j5
(http://fs5.directupload.net/images/160704/uodc42gz.gif)

execute the following command if your compiling computer provides a dual-core-processor (-j3 means 3 jobs simultaneously):
make -j3
(http://fs5.directupload.net/images/160704/ep3v98vq.gif)

in all other cases:
make
(http://fs5.directupload.net/images/160704/v5mdcnrp.gif)



19)
Wait for finishing. Just copy the compiled mame.exe (on x86 system) or mame64.exe (on x64 system) to your mame-folder & overwrite existing one.

Now nag screens and loading messages are removed, if you use command line:
mame.exe "path_to_your_mame_roms\game_xyz123.zip" -skip_gameinfo

if you start a game in new mame-gui, you'll still get nag game-problem-disclaimer:
(http://fs5.directupload.net/images/160512/5zfgub9b.png)
 
highscore support is added too (for further information please see : http://forum.arcadecontrols.com/index.php/topic,64298.0.html )




IMPORTANT NOTE: All steps are tested and works on:
- Windows 7 32bit
- Win7 x64
- WinXP x86



documentation about mame compiling commands and different parameters here (http://docs.mamedev.org/_files/MAME.pdf)
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: playerzero on August 19, 2015, 05:13:25 PM
well done hermine. This is a fantastic guide.

I assume hi_164 is for hiscores?
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on August 19, 2015, 10:01:39 PM
@playerzero
That's right. See #16 of =patch with .diff and compile mame.exe (using .diff-file):
Quote
highscore support is added too (for further information please see : http://forum.arcadecontrols.com/index.php/topic,64298.0.html )
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: akafox on August 20, 2015, 04:59:37 AM
good write-up hermine.potter :) thanks for your contribution. I "cheat" on windows because I use headkaze's compiler there. http://headsoft.com.au/index.php?category=mame&page=mc64

I was compiling for linux yesterday and I swear i didn't patch it with no nag/high score patch however it worked just like I had patched it.
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: Obiwantje on August 20, 2015, 09:33:26 AM
hermine.potter, thanks for your elaborate post - any guidance on how to have MAME compile for "MAME, arcade" only? So excluding the now integrated MESS piece?
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: akafox on August 20, 2015, 03:22:23 PM
Not gonna happen. The xml being merged screws that up. However I am working on that.

 Actually you can. Follow hermine.potter's excellent example but when compiling add 'SUBTARGET=arcade' That is make (-j3 or -j5) SUBTARGET=arcade will create a mame that does not have the mess listings in the xml. You can also make (-j3 or -j5) SUBTARGET=mess to make just a mess executable. (Thus just a mess listxml and no arcade games.)

Another question is if can someone compile mame/mess with a nonag/high score patch and then place it here for people to download. What do you all think? I'll grab ray and ask too.
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: JMD on August 23, 2015, 09:53:11 AM
Hello,

Thanks a lot, it's a great guide !

I just patch and compile an arcade only groovy mame (https://code.google.com/p/groovyarcade/) binary with this guide and everything works fine, at the first time !
I also add -o2 optimization flag (https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html) and mame seems faster but it's just a feeling.
Code: [Select]
patch -p0 -E <C:\buildtools\hi_0164.diff
patch -p0 -E <C:\buildtools\0164_groovymame_015h.diff

Code: [Select]
make -j3 -o2 SUBTARGET=arcade
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on August 31, 2015, 09:58:12 PM
Version 0.165 is available (http://mamedev.org/release.html)

Note: In my opinion it's not a good idea to upload a finished / compiled mame.exe, because of the security risks (e.g. distribute virus, trojan, etc. etc.).
So I've wrote this guide to compile your own mame.exe step by step and in the current version and so it's not necessary downloading from any dubious hoster.
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: verion on August 31, 2015, 10:33:50 PM
I would like to compile OS X version - can you point me to the right direction?
If necessary - I can compile with windows tools (I have Windows XP set up it VirtualBox).
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on September 01, 2015, 12:20:36 AM
@verion
Mac is not my world, so I'm not sure (as seen as the thread title : mame + windows + x86 + x64) ^-^
I think you need SDLMame and the .zip-sourcecode from mame. Path to ui.c and the parameters are the same:

http://wiki.mamedev.org/index.php/SDL_Supported_Platforms
http://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=58897#Post58897
http://www.mamedev.org/downloader.php?file=mame0165/mame0165s.zip

The steps should work in virtual environment too.
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: verion on September 01, 2015, 12:22:52 AM
OK, thanks. I'll try that.
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on September 03, 2015, 05:09:11 AM
@verion
Tested today successfully on Full WinXP (not VM).
So it should works on VirtualBox too.
Note : on first start of buildtools.bat/Cmder.exe on WinXP there are two failure windows. Press OK. They are never seen again and compiling works correct.
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: verion on September 03, 2015, 09:57:24 AM
I'm not sure if I understand. I want to compile 64-bit mame (SDLmame) to have OS X executable - not to compile MS Windows executable on mac.
I was assuming that I have to make this on OS X using Xcode (mac developer enviroment) to have OS X compatible executable.

EDIT:
Sorry for off-topic, after some research I've found some info about compiling mame on OSX.
If someone wants to compile SDLmame on OSX - here is a tutorial that looks fairly complete and easy to follow: http://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=58897
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on September 03, 2015, 11:10:27 AM
I can compile with windows tools (I have Windows XP set up it VirtualBox).
So I thought, you've got WinXP x86 in Virtualbox, because not many people uses WinXP 64bit ^-^
And you could use WinXP as another option or Plan B instead mame for OSX.
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: verion on September 03, 2015, 02:16:28 PM
WinXP is not an option for me :)
I've worked really hard to restrict myself to just one system (which is OS X) on just one laptop - to get rid of mix-and-match set of computers and different systems.

---

But the description from that link is pretty straightforward. And I'm assuming that the changes in source will be the same. Am I right?
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on September 03, 2015, 10:23:33 PM
I think, that source will be the same. Edit the file ui.c or patch it with .diff-file. Give it a try.
Quote
8 )
Open the following file with editor, notepad++, or another editor of your choice:
C:\buildtools\src\src\emu\ui\ui.c

9)
Add in line #316 (it's a empty line)

from:
Code: [Select]
int state;

// disable everything if we are using -str for 300 or fewer seconds, or if we're the empty driver,

to:
Code: [Select]
int state;
show_gameinfo = show_warnings = show_disclaimer = show_mandatory_fileman = FALSE;
// disable everything if we are using -str for 300 or fewer seconds, or if we're the empty driver,

10)
Edit line #444, #445, #446 and #447 as a comment:

from:
Code: [Select]
if (osd_ticks() < m_popup_text_end)
draw_text_box(container, messagebox_poptext.c_str(), JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor);
else
m_popup_text_end = 0;

to:
Code: [Select]
// if (osd_ticks() < m_popup_text_end)
// draw_text_box(container, messagebox_poptext.c_str(), JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor);
// else
// m_popup_text_end = 0;

11)
Edit line #1275 as a comment:

from:
Code: [Select]
machine.ui().draw_text_box(container, messagebox_text.c_str(), JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
to:
Code: [Select]
//machine.ui().draw_text_box(container, messagebox_text.c_str(), JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
13)
Save and overwrite the file:
C:\buildtools\src\src\emu\ui\ui.c
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: akafox on September 04, 2015, 03:05:25 PM
I think this web site has pre compiled binaries for mac http://sdlmame.lngn.net/ (http://sdlmame.lngn.net/)

I think they are stock mame..not a "no nag high score" patched version
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: verion on September 04, 2015, 05:32:46 PM
Yes, It's vanilla mame for OS X (with nag screens) - currently I'm using x64 SDLmame .164 (from this site) with SDL 2.0.
Working perfectly ok. The only reason for compiling is to get rid of the nag screens.
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: beto20a on November 10, 2015, 06:09:06 AM
I have a problem compiling the 167 version with this step-by-step. I start with the second option(using .diff patch)
Error :

Compiling 3rdparty/bgfx/src/renderer_d3d12.cpp....

Someone can help me?
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: akafox on November 10, 2015, 03:08:53 PM
Note: In my opinion it's not a good idea to upload a finished / compiled mame.exe, because of the security risks (e.g. distribute virus, trojan, etc. etc.).
So I've wrote this guide to compile your own mame.exe step by step and in the current version and so it's not necessary downloading from any dubious hoster.

And you are very right to have that opinion. However that is why I want to host it here..from someone here that we know here and can trust. Compiling is NOT for everyone..anything can happen. I have tried and tried to compile the new AM and can not..for whatever reason..however I have done it before with the older versions many times no problem.
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on November 11, 2015, 01:28:09 AM
@beto20a
You're right. It seems that the current mame-buildtools v1.2 contains bugs. I've uninstalled & installed the buildtools (v1.2) and getting now same errors too.

Here is my workaround (right now succesfully tested):

1) install the buildtools as told as by install.exe (you'll get the bug-version 1.2 installed, BUT you'll get the correct environment and registry entries and so on)
2) delete the folder C:\buildtools
3) download the previous release v1.1 (https://github.com/mamedev/buildtools/releases/download/1.1/buildtools.7z)
4) unzip it (so you can found the correct folder structure : C:\buildtools\buildtools.bat)
5) start buildtools.bat or Cmder.exe as told as (IMPORTANT : ignore step4 in tutorial and DO NOT UPDATE the mame tools or you'll get the bug version v1.2 again).

This is how it works at the moment.
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on November 11, 2015, 01:39:42 AM
@akafox
Providing a compiled version of mame that's not showing warnings, disclaimer and so on, is not allowed by mamedev-team and violates their specifications (http://www.mamedev.org/about.html):

Quote
Do not remove the startup screen that contains information about why certain non-working games don't work. This only serves to generate a bunch of useless email traffic to the developers asking why the games don't work.
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: beto20a on November 11, 2015, 07:31:52 AM
@beto20a
You're right. It seems that the current mame-buildtools v1.2 contains bugs. I've uninstalled & installed the buildtools (v1.2) and getting now same errors too.

Here is my workaround (right now succesfully tested):

1) install the buildtools as told as by install.exe (you'll get the bug-version 1.2 installed, BUT you'll get the correct environment and registry entries and so on)
2) delete the folder C:\buildtools
3) download the previous release v1.1 (https://github.com/mamedev/buildtools/releases/download/1.1/buildtools.7z)
4) unzip it (so you can found the correct folder structure : C:\buildtools\buildtools.bat)
5) start buildtools.bat or Cmder.exe as told as (IMPORTANT : ignore step4 in tutorial and DO NOT UPDATE the mame tools or you'll get the bug version v1.2 again).

This is how it works at the moment.

Thanks dude! I'll try your workaround
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: akafox on November 16, 2015, 01:25:23 PM
@akafox
Providing a compiled version of mame that's not showing warnings, disclaimer and so on, is not allowed by mamedev-team and violates their specifications (http://www.mamedev.org/about.html):

Quote
Do not remove the startup screen that contains information about why certain non-working games don't work. This only serves to generate a bunch of useless email traffic to the developers asking why the games don't work.
It gets annoying to see that screen every time..yes I already not it's not 100%!  However I understand your point..maybe I can put a disclaimer there or something..or just pull it.
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: beto20a on November 19, 2015, 01:33:12 AM
Hello guys!
I had success with mame compiling workaround, but not with mameui.
Somebody could help me with step-by-step for mameui 0.167 compiling?
Thanks
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on November 19, 2015, 04:30:32 AM
@beto20a
I'm not sure, because I don't know mameui. It's a mame frontend too, right?!
Tried this, but not sure about it (that the same steps are the correct way):

01 ) open folder C:\buildtools\src
02 ) you see different folders (3rdparty, artwork and so on)
03 ) delete or move complete folder content
04 ) download zip-file (https://github.com/Robbbert/mameui)
05 ) open the mameui-master.zip
06 ) extract the content to src folder, so you get the same content and structure like in step 02 (3rdparty, artwork and so on)
07 ) open buildtools.bat or Cmder.exe
08 ) As told as here : (https://github.com/Robbbert/mameui)  make subtarget=arcade osd=winui
09 ) wait for finish compiling

For further & detailed information, you should contact the experts of mameui forum (http://www.mameworld.info/ubbthreads/postlist.php?Cat=&Board=mameui)
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on November 30, 2015, 03:47:07 AM
Mame 0.168 is out (http://www.mamedev.org/). It seems that they have changed programming language to c++/cpp
Everything works correct again.
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: xev1n on January 24, 2016, 12:46:01 PM
OMG I have spent hours trying to do this. I am using Windows 10 x64. I am using mame 64 .151. I am just trying to remove the "left/right type OK" screen. I have downloaded everything and keep getting errors. Does this not work with .151? I have the hi_151.diff file and the mame 64bit .151 source.
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on January 25, 2016, 01:34:02 AM
Mame 0.169 is out (http://www.mamedev.org/release.php).
With new buildtools msys2, I wasn't able to compile a working build of mame with diff-file (patch command doesn't longer exists; install.exe isn't longer available on github, msys2 is awful ...)

My workaround:
-Download old buildtools.7z from archive.org (https://web.archive.org/web/20150430233326/https://github.com/mamedev/buildtools/releases/download/1.1/buildtools.7z)
-download source and diff-file in prefered version (https://github.com/mamedev/mame/releases)
-compile it with buildtools.bat (http://forum.attractmode.org/index.php?topic=348.0)
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on January 25, 2016, 05:05:40 AM
@xev1in
getting an error too. Try another version of mame (current : 0.169)
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on February 05, 2016, 03:08:04 AM
Mame 0.170 is out. (http://mamedev.org/release.html)
-Old Buildtools doesn't longer work.
-Msys (new mame buildtools) doesn't longer support the patch command (necessary for patching with .diff-files).
-Tools of msys are buggy on x86 (buildtools.bat stops with python-error).
-So you need to install GnuWin (to get patch.exe again)and install python too (to get correct Python-settings).
-Follow new tutorial (http://forum.attractmode.org/index.php?topic=348.0)
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: artyfarty on February 12, 2016, 03:35:56 PM
You can download patch for the new build tools by running "pacman --needed -Sy patch"

Check out my write up for compiling MAME 0.169 with new build tools and patches at http://forum.arcadecontrols.com/index.php/topic,149545.0.html
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on February 12, 2016, 11:00:26 PM
@artyfarty
Thank you for information and your workaround. I'm still on testing and writing a new workaround.
The mamedev-Team offers the missing patch/diff-files here. (http://wiki.mamedev.org/index.php/Submitting_Source_Code)

Could you do me a favor : I'm only was able to compile successfully on x64 too. x86 still doesn't works. Could you test your workaround on x86 too?
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: artyfarty on February 13, 2016, 09:45:25 PM
@hermine.potter

Yes I was able to compile a 32bit MAME binary with patches using the same technique as in my post. The only differences were:

1. Downloading and installing the dual 32bit/64bit MSYS2 (msys64-32-2016-01-07.exe) from mamedev.org/tools instead of the 64bit only (msys64-2016-01-07.exe)
2. Issuing the command "config32" immediately prior to running the make command
3. changing the make command to "make all -j8 OPTIMIZE=3 SYMLEVEL=1 SYMBOLS=0 PTR64=0 TOOLS=1 DIRECTINPUT=7"

Hope this helps.

Edit: This compiles a 32bit binary on a 64bit system. I haven't tried compiling a 32bit binary on a 32bit system, and don't know if the 32bit part of the dual 32bit/64bit MSYS2 is the same as the 32bit MSYS2 (msys32-2016-01-07.exe). The dual 32bit/64bit MSYS2 all extracts to a subdirectory msys64, whereas the 32bit MSYS2 extracts to a subdirectory msys32.

Edit2: I've now tried installing 32-bit MSYS2 (32-2016-01-07.exe) and following the same instructions, except using "msys32" instead of "msys64" in the directory path. Lots of error messages come up as windows errors "cmd.exe - System Error : The program cannot start because AD??PI??.dll is missing from your computer. Try reinstalling the program to fix this problem." Where the question marks are replace by different symbols in each popup. But if you keep clicking OK, the compile does eventually finish, and you end up with a mame.exe that seems to work (limited testing). Would be good to know what is causing these errors.

Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on April 06, 2016, 12:51:36 AM
This is tutorial for older releases to 0.170.
Newer Releases since 0.171 see (http://forum.attractmode.org/index.php?topic=348.msg2434#msg2434)




=edit mame sourcecode to disable nag screens and compile mame.exe (not using diff-patches):




01)
on x86 / 32bit-system download msys64-2016-01-07.exe (https://github.com/mamedev/buildtools/releases/download/1.4/msys32-2016-01-07.exe)
on x64 / 64bit-system download msys64-2016-01-07.exe (https://github.com/mamedev/buildtools/releases/download/1.4/msys64-2016-01-07.exe)



02)
download GnuWin (includes Patch.exe) (http://sourceforge.net/projects/gnuwin32/files/patch/2.5.9-7/patch-2.5.9-7-setup.exe/download)
download Python (includes correct registry entries and path variables) (https://www.python.org/ftp/python/2.7.11/python-2.7.11.msi)



03)
Start Installation of patch-2.5.9-7-setup.exe (GnuWin)
and install to C:\gnu
all remaining settings leave as standard
(http://fs5.directupload.net/images/160208/szq35ew7.png)



04)
Start Installation of python-2.7.11.msi (Python)
and install to C:\Python27\
all remaining settings leave as standard
IMPORTANT: Select this option to yes : Add python.exe to Path
(http://fs5.directupload.net/images/160208/6yuii7zs.png)



05)
on x86 / 32bit-system extract msys32-2016-01-07.exe to C:
on x64 / 64bit-system extract msys64-2016-01-07.exe to C:
(http://fs5.directupload.net/images/160208/jghtjhs7.png)

( so you get folder C:\msys32 or C:\msys64 )
(http://fs5.directupload.net/images/160208/m99jcopo.png)
(http://fs5.directupload.net/images/160208/z7g5poj5.png)




06)
After extraction is finished, you can either execute (whatever you prefered):
win32con.bat
or
win32env.bat



07)
After first start, exit the compiler-window by typing:
exit
or
clicking on X of compiler-window
(http://fs5.directupload.net/images/160208/72u8qihf.png)



08)
download source code (http://mamedev.org/downloader.php?file=mame0170/mame0170s.exe):



09)
execute:
mame0170s.exe
on x86 / 32bit-system extract to C:\msys32\src
on x64 / 64bit-system extract to C:\msys64\src
(http://fs5.directupload.net/images/160208/ypfey9qq.png)
(http://fs5.directupload.net/images/160208/gghts2s8.png)



10)
Open the file ui.cpp with editor, notepad++, or another editor of your choice:
on x86 / 32bit-system C:\msys32\src\src\emu\ui\ui.cpp
on x64 / 64bit-system C:\msys64\src\src\emu\ui\ui.cpp
(http://fs5.directupload.net/images/160208/khsj36zv.png)



11)
Add in line #318 (it's a empty line)

from:
Code: [Select]
int state;

// disable everything if we are using -str for 300 or fewer seconds, or if we're the empty driver,

to:
Code: [Select]
int state;
show_gameinfo = show_warnings = show_disclaimer = show_mandatory_fileman = FALSE;
// disable everything if we are using -str for 300 or fewer seconds, or if we're the empty driver,



12)
Edit line #445, #446, #447 and #448 as a comment:

from:
Code: [Select]
if (osd_ticks() < m_popup_text_end)
draw_text_box(container, messagebox_poptext.c_str(), JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor);
else
m_popup_text_end = 0;

to:
Code: [Select]
// if (osd_ticks() < m_popup_text_end)
// draw_text_box(container, messagebox_poptext.c_str(), JUSTIFY_CENTER, 0.5f, 0.9f, messagebox_backcolor);
// else
// m_popup_text_end = 0;



13)
Edit line #1291 as a comment:

from:
Code: [Select]
machine.ui().draw_text_box(container, messagebox_text.c_str(), JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
to:
Code: [Select]
//machine.ui().draw_text_box(container, messagebox_text.c_str(), JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);


14)
Save and overwrite the file ui.cpp



15)
either you start:
win32con.bat
or
win32env.bat



16)
execute the following command if your compiling computer provides a quad-core-processor (-j5 means 5 jobs simultaneously):
make -j5
(http://fs5.directupload.net/images/160208/4uw4mpgj.png)

execute the following command if your compiling computer provides a dual-core-processor (-j3 means 3 jobs simultaneously):
make -j3
(http://fs5.directupload.net/images/160208/n9jjrrj4.png)

in all other cases:
make
(http://fs5.directupload.net/images/160208/xk7wydmb.png)



17)
now wait, wait, wait, wait, wait (depends on your choice of the processor).
After finishing the compiling process, you'll find a new mame.exe (or on x64-systems : mame64.exe) in C:\msys32\src (or on x64-systems : C:\msys64\src )



IMPORTANT NOTE: Next time you'll compile the source code again, it doesn't take as long as the first time.




=patch with .diff and compile mame.exe (using .diff-file):




01)
on x86 / 32bit-system download msys64-2016-01-07.exe (https://github.com/mamedev/buildtools/releases/download/1.4/msys32-2016-01-07.exe)
on x64 / 64bit-system download msys64-2016-01-07.exe (https://github.com/mamedev/buildtools/releases/download/1.4/msys64-2016-01-07.exe)



02)
download GnuWin (includes Patch.exe) (http://sourceforge.net/projects/gnuwin32/files/patch/2.5.9-7/patch-2.5.9-7-setup.exe/download)
download Python (includes correct registry entries and path variables (https://www.python.org/ftp/python/2.7.11/python-2.7.11.msi)



03)
Start Installation of patch-2.5.9-7-setup.exe (GnuWin)
and install to C:\gnu
all remaining settings leave as standard
(http://fs5.directupload.net/images/160208/szq35ew7.png)



04)
Start Installation of python-2.7.11.msi (Python)
and install to C:\Python27\
all remaining settings leave as standard
IMPORTANT: Select this option to yes : Add python.exe to Path
(http://fs5.directupload.net/images/160208/6yuii7zs.png)



05)
on x86 / 32bit-system extract msys32-2016-01-07.exe to C:
on x64 / 64bit-system extract msys64-2016-01-07.exe to C:
(http://fs5.directupload.net/images/160208/jghtjhs7.png)

( so you get folder C:\msys32 or C:\msys64 )
(http://fs5.directupload.net/images/160208/m99jcopo.png)
(http://fs5.directupload.net/images/160208/z7g5poj5.png)



06)
After extraction is finished, you can either execute (whatever you prefered):
win32con.bat
or
win32env.bat



07)
After first start, exit the compiler-window by typing:
exit
or
clicking on X of compiler-window
(http://fs5.directupload.net/images/160208/72u8qihf.png)



08)
download source code (http://mamedev.org/downloader.php?file=mame0170/mame0170s.exe):



09)
execute:
mame0170s.exe
on x86 / 32bit-system extract to C:\msys32\src
on x64 / 64bit-system extract to C:\msys64\src
(http://fs5.directupload.net/images/160208/ypfey9qq.png)
(http://fs5.directupload.net/images/160208/gghts2s8.png)



10)
download .diff file here (http://forum.arcadecontrols.com/index.php/topic,64298.0.html) (current patchfile for Mame 0.170 is hi_170.txt )



11)
Rename hi_170.txt to hi_170.diff



12)
on x86 / 32bit-system move .diff-file to C:\msys32
on x64 / 64bit-system move .diff-file to C:\msys64
(http://fs5.directupload.net/images/160208/tqjgsenm.png)



13)
click start and type this command in search-field (just copy&paste and press enter):
on x86 / 32bit-system:
cmd /k cd C:\msys32\src & C:\gnu\bin\patch.exe -p0 -E <C:\msys32\hi_170.diff

on x64 / 64bit-system:
cmd /k cd C:\msys64\src & C:\gnu\bin\patch.exe -p0 -E <C:\msys64\hi_170.diff

(http://fs5.directupload.net/images/160208/g3uckuzx.png)



14)
After finishing the patch-process, exit the cmd-window by exit command or clicking the x of compiler window
(http://fs5.directupload.net/images/160208/kogh3uqi.png)



15)
Execute:
win32con.bat
or
win32env.bat



16)
execute the following command if your compiling computer provides a quad-core-processor (-j5 means 5 jobs simultaneously):
make -j5
(http://fs5.directupload.net/images/160208/4uw4mpgj.png)

execute the following command if your compiling computer provides a dual-core-processor (-j3 means 3 jobs simultaneously):
make -j3
(http://fs5.directupload.net/images/160208/n9jjrrj4.png)

in all other cases:
make
(http://fs5.directupload.net/images/160208/xk7wydmb.png)



17)
Wait for finishing. Just copy the compiled mame.exe (on x86 system) or mame64.exe (on x64 system) to your mame-folder & overwrite existing one.
Now nag screens and loading messages are removed.
highscore support is added too (for further information please see : http://forum.arcadecontrols.com/index.php/topic,64298.0.html )



IMPORTANT NOTE: All steps are tested and works on:
- Windows 7 32bit
- Win7 x64
- WinXP x86
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on April 06, 2016, 12:55:29 AM
New Version 0.172 is out. (http://www.mamedev.org/?p=424)
Mame offers own Hiscore-Support and more. See (http://mamedev.org/releases/whatsnew_0172.txt)
New msys-buildtools 2016-02-16 works again on x86 and x64
Since Version 0.171 mame offers a new gui with filters, images, gameinfos and so on.
(http://fs5.directupload.net/images/160407/pa566yj7.png)
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on May 10, 2016, 11:32:51 PM
New version 0.173 is out (http://mamedev.org/release.html).
mamedev-team changed many many files (e.g. ui.cpp doesn't longer exists).
If you start a game in mame-gui, you'll get still nag problem disclaimer:
(http://fs5.directupload.net/images/160512/5zfgub9b.png)

If you start game with parameter -skip_gameinfo, you'll not get not nag screens (no gameinfo and no problem disclaimer):
mame.exe "path_to_mame_roms_folder\game_xyz.zip" -skip_gameinfo
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: airix on May 11, 2016, 06:37:21 PM
with ozfalcon's patch, make sure to add
Code: [Select]
skip_gameinfo             1to your mame.ini to disable nag
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on May 12, 2016, 12:28:50 AM
@airix
I think it's a bug (don't come up in earlier versions up to 0.172):
If you start a game in mame-gui, you'll get still nag problem disclaimer.
But starting game with parameter -skip_gameinfo, you'll not get not any nag screens (no gameinfo and no problem disclaimer):
mame.exe "path_to_mame_roms_folder\game_xyz.zip" -skip_gameinfo
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on May 27, 2016, 05:57:04 AM
0.178 is out (http://www.mamedev.org/?p=431)
starting game in mame-gui => nag screen
starting game in console with parameters => no nag screens
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on November 11, 2016, 12:47:42 AM
Mame 0.192 is out (http://www.mamedev.org/?p=450)
now .diff files are uploaded here (http://mamestuff.lowtrucks.net/MKChamp/)
current diff file (version 0.192) is named suppression_0192u0.txt
new building-tools added : http://www.mamedev.org/tools/
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: casperroux on February 18, 2017, 03:30:04 AM
Can someone please help
The Link to the DIFF files for 0.182 does not work...

Thanks
Casper
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on February 18, 2017, 11:56:42 PM
@casperroux
files are without any problem available?! Please try again.
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on January 11, 2018, 03:00:05 AM
Mame 0.204 is out (https://www.mamedev.org/?p=463)

latest building-tools : 2017-12-26 (http://www.mamedev.org/tools/)

.diff files are uploaded here (http://mamestuff.lowtrucks.net/MKChamp/) (Thanks to MKChamp)

Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: gamesfan on November 13, 2018, 07:58:11 AM
Team,
 Has anyone did this with MAMEUI? The MKchamp DIFF wont fully patch it.
Im pretty sure I need to edit this file, I tried and removed the nags but somehow broke game loading for alot of games.
https://github.com/Robbbert/mameui/blob/master/src/frontend/mame/ui/ui.cpp

I can see some people have a MAMEUI with no NAGS, but no one includes thier source. Looking for help.

hermine.potter wrote an excellent guide, and Im really hoping hermine.potter has done this or can point me in the right direction.
Brian H
Title: Re: how to patch mame with .diff and compile mame source code on windows x86 and x64
Post by: hermine.potter on November 15, 2018, 01:14:39 AM
@ gamesfan
sorry, can't help. I'm not using mameui.
I'm offering you the relevant files (old = before patching ; new = after patching).
Use a tool like winmerge (http://winmerge.org/?lang=en) to see which codeline differs / changes and transfer it to mameui sourcecode (it seems similar to mame sourcecode).