Author Topic: how to patch mame with .diff and compile mame source code on windows x86 and x64  (Read 93406 times)

hermine.potter

  • Hero Member
  • *****
  • Posts: 767
    • View Profile
Hi there!

Unfortunately the official binary package of mame (current version : 0.220) includes auto-disclaimer-messages, warnings and so on.
There are different websites and board entries 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
Since version 0.218 only x64 / 64bit is supported.
 
So this is a tutorial and workaround:




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




01)
on x64 / 64bit-system download msys64-32-2019-12-23.exe



02)
on x64 / 64bit-system extract msys64-2017-02-05.exe to C:


( so you get folder C:\msys64 )





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




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


if download stucks, press CTRL+C (abort)


type command and execute (again):
pacman -Syuu patch
y
y
y




07)
After first start, exit the compiler-window by typing:
exit
or
clicking on X of compiler-window




08)
download source code:



09)
execute:
mame0220s.exe
on x64 / 64bit-system extract to C:\msys64\src




10)
download .diff file here (current patchfile for Mame 0.220 is suppression_0220u0.txt ) (previous than 0.178 : hi_0178.txt)
Thanks to MKChamp offering diff-Files



11)
Rename suppression_0220u0.txt to hi_0220.diff
(earlier 0.178 : Rename hi_0178.txt to hi_178.diff )



12)
on x64 / 64bit-system move .diff-file to C:\msys64




13)
start:
win32env.bat



14)
on x64 / 64bit-system: patch --binary -p0 -E <C:\msys64\hi_220.diff





15)
After finishing the patch-process, exit the cmd-window by exit command or clicking the x of compiler window




16)
Execute:
win32env.bat



17)
execute the following command if your compiling computer provides a quad-core-processor (-j5 means 5 jobs simultaneously):
make -j5


execute the following command if your compiling computer provides a dual-core-processor (-j3 means 3 jobs simultaneously):
make -j3


in all other cases:
make




18)
Wait for finishing. Just copy the compiled 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:

 
highscore support is added too (for further information please see : http://forum.arcadecontrols.com/index.php/topic,64298.0.html )




documentation about mame compiling commands and different parameters here
« Last Edit: May 22, 2020, 12:20:56 AM by hermine.potter »
AM Version : 2.6.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : Windows10 Pro
System : Dell Precision T3500 ; Intel X5650 ; 12GB RAM

playerzero

  • Jr. Member
  • **
  • Posts: 15
    • View Profile
well done hermine. This is a fantastic guide.

I assume hi_164 is for hiscores?

hermine.potter

  • Hero Member
  • *****
  • Posts: 767
    • View Profile
@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 )
AM Version : 2.6.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : Windows10 Pro
System : Dell Precision T3500 ; Intel X5650 ; 12GB RAM

akafox

  • Moderator
  • Hero Member
  • *****
  • Posts: 985
    • View Profile
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.
« Last Edit: August 20, 2015, 05:05:38 AM by akafox »
People want life easy..then complain about it

Obiwantje

  • Jr. Member
  • **
  • Posts: 14
    • View Profile
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?

akafox

  • Moderator
  • Hero Member
  • *****
  • Posts: 985
    • View Profile
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.
« Last Edit: August 21, 2015, 12:00:56 PM by akafox »
People want life easy..then complain about it

JMD

  • Newbie
  • *
  • Posts: 5
    • View Profile
Hello,

Thanks a lot, it's a great guide !

I just patch and compile an arcade only groovy mame binary with this guide and everything works fine, at the first time !
I also add -o2 optimization flag and mame seems faster but it's just a feeling.
  • download 0164_groovymame_015h.diff and hi_0164.diff files here
  • patch sources (replace step 12)
Code: [Select]
patch -p0 -E <C:\buildtools\hi_0164.diff
patch -p0 -E <C:\buildtools\0164_groovymame_015h.diff

  • compile binary
Code: [Select]
make -j3 -o2 SUBTARGET=arcade
    AM Version : 1.5.3
    Input : Cabinet (J-Pac); Mouse; Keyboard
    Cabinet : Yes (15kz CRT Monitor)
    OS : Windows7 x64
    System : Intel E6670 ; 4Go RAM ; ATI HD4850 
    Emulators : mame; gens; fs-uae

    hermine.potter

    • Hero Member
    • *****
    • Posts: 767
      • View Profile
    Version 0.165 is available

    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.
    « Last Edit: August 31, 2015, 10:03:48 PM by hermine.potter »
    AM Version : 2.6.1
    Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
    Cabinet : Yes
    OS : Windows10 Pro
    System : Dell Precision T3500 ; Intel X5650 ; 12GB RAM

    verion

    • Global Moderator
    • Hero Member
    • *****
    • Posts: 863
      • View Profile
      • new projects
    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).

    hermine.potter

    • Hero Member
    • *****
    • Posts: 767
      • View Profile
    @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.
    AM Version : 2.6.1
    Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
    Cabinet : Yes
    OS : Windows10 Pro
    System : Dell Precision T3500 ; Intel X5650 ; 12GB RAM

    verion

    • Global Moderator
    • Hero Member
    • *****
    • Posts: 863
      • View Profile
      • new projects
    OK, thanks. I'll try that.

    hermine.potter

    • Hero Member
    • *****
    • Posts: 767
      • View Profile
    @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.
    « Last Edit: September 03, 2015, 05:12:11 AM by hermine.potter »
    AM Version : 2.6.1
    Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
    Cabinet : Yes
    OS : Windows10 Pro
    System : Dell Precision T3500 ; Intel X5650 ; 12GB RAM

    verion

    • Global Moderator
    • Hero Member
    • *****
    • Posts: 863
      • View Profile
      • new projects
    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
    « Last Edit: September 03, 2015, 10:01:03 AM by verion »

    hermine.potter

    • Hero Member
    • *****
    • Posts: 767
      • View Profile
    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.
    « Last Edit: September 03, 2015, 11:14:04 AM by hermine.potter »
    AM Version : 2.6.1
    Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
    Cabinet : Yes
    OS : Windows10 Pro
    System : Dell Precision T3500 ; Intel X5650 ; 12GB RAM

    verion

    • Global Moderator
    • Hero Member
    • *****
    • Posts: 863
      • View Profile
      • new projects
    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?