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

hermine.potter

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
Mame 0.170 is out.
-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
« Last Edit: February 08, 2016, 07:26:26 AM by hermine.potter »
AM Version : 2.2.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy

artyfarty

  • Newbie
  • *
  • Posts: 8
    • View Profile
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

hermine.potter

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
@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.

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?
AM Version : 2.2.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy

artyfarty

  • Newbie
  • *
  • Posts: 8
    • View Profile
@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.

« Last Edit: February 15, 2016, 11:40:52 PM by artyfarty »

hermine.potter

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
This is tutorial for older releases to 0.170.
Newer Releases since 0.171 see




=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
on x64 / 64bit-system download msys64-2016-01-07.exe



02)
download GnuWin (includes Patch.exe)
download Python (includes correct registry entries and path variables)



03)
Start Installation of patch-2.5.9-7-setup.exe (GnuWin)
and install to C:\gnu
all remaining settings leave as standard




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




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:


( so you get folder C:\msys32 or C:\msys64 )






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




08)
download source code:



09)
execute:
mame0170s.exe
on x86 / 32bit-system extract to C:\msys32\src
on x64 / 64bit-system extract to C:\msys64\src





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




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


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




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
on x64 / 64bit-system download msys64-2016-01-07.exe



02)
download GnuWin (includes Patch.exe)
download Python (includes correct registry entries and path variables



03)
Start Installation of patch-2.5.9-7-setup.exe (GnuWin)
and install to C:\gnu
all remaining settings leave as standard




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




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:


( so you get folder C:\msys32 or C:\msys64 )





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




08)
download source code:



09)
execute:
mame0170s.exe
on x86 / 32bit-system extract to C:\msys32\src
on x64 / 64bit-system extract to C:\msys64\src





10)
download .diff file here (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




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





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




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


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




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
AM Version : 2.2.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy

hermine.potter

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
New Version 0.172 is out.
Mame offers own Hiscore-Support and more. See
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.
« Last Edit: April 07, 2016, 12:07:58 AM by hermine.potter »
AM Version : 2.2.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy

hermine.potter

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
New version 0.173 is out.
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:


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
« Last Edit: May 12, 2016, 12:38:29 AM by hermine.potter »
AM Version : 2.2.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy

airix

  • Newbie
  • *
  • Posts: 1
    • View Profile
with ozfalcon's patch, make sure to add
Code: [Select]
skip_gameinfo             1to your mame.ini to disable nag

hermine.potter

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
@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
AM Version : 2.2.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy

hermine.potter

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
0.178 is out
starting game in mame-gui => nag screen
starting game in console with parameters => no nag screens
« Last Edit: October 07, 2016, 06:59:01 AM by hermine.potter »
AM Version : 2.2.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy

hermine.potter

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
Mame 0.192 is out
now .diff files are uploaded here
current diff file (version 0.192) is named suppression_0192u0.txt
new building-tools added : http://www.mamedev.org/tools/
« Last Edit: November 30, 2017, 11:39:02 PM by hermine.potter »
AM Version : 2.2.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy

casperroux

  • Newbie
  • *
  • Posts: 1
    • View Profile
Can someone please help
The Link to the DIFF files for 0.182 does not work...

Thanks
Casper

hermine.potter

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
@casperroux
files are without any problem available?! Please try again.
AM Version : 2.2.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy

hermine.potter

  • Sr. Member
  • ****
  • Posts: 312
    • View Profile
Mame 0.193 is out
newest building-tools : 2017-12-26
AM Version : 2.2.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy