Modifying MAME or its modifications to re-add Xpadder support

Modifying MAME or its modifications to re-add Xpadder support

Post » 01 Apr 2011, 12:00

This topic was last tested with and updated for MAME v0.152 (released 2013-12-24) but should work for all future versions too.
I used a clean, offline Windows 7 SP1 PC and the resulting MAME.exe was shown as 80,565KB in explorer (the official exe is slightly smaller).
If any of these instructions are unclear, inaccurate or out-of-date or any of the links no longer work please let me know and I will update this tutorial


A new input method was introduced in MAME v0.118 which prevents the current version from working with Xpadder.
This also applies to MAME modifications such as MAMEUIFX32 and MESS.

Here is a detailed step-by-step tutorial for modifying MAME yourself to re-enable Xpadder support.

Stage 1: Prepare compilation environment (it's a lot easier than it sounds!)
No programs need installing and no changes are made to your system
Text/Images: Show
Create compilation folders
01) Go to C:\Windows\TEMP or any writable drive or folder where the full path contains no spaces
02) Create a folder called XMM (XMM stands for XpadderMAMEmod)
03) Create a folder inside the XMM folder called source

Download the compiler from the official MAME tools page
04) Visit the tools page here: http://mamedev.org/tools/
05) Download the compiler package program mingw-mame-w32-20121207.exe (32-bit only)
06) Move the downloaded compiler package program into the XMM folder

Extract the compiler
07a) The compiler is stored in a self-extracting 7zip archive. You can either run the program to extract the files
OR
07b) use 7zip or a compatible archiver program to extract the files (make sure you extract directly into the XMM folder - the archive already contains a folder so a new one does not need creating)

Check the compiler
08) Inside the XMM folder there should be the compiler package program you downloaded, a new folder named mingw64-w32 and the source folder you created earlier
09) Inside the mingw64-w32 folder there should be 7 folders and 3 batch files
10) Delete the compiler package program you downloaded (mingw-mame-w32-20121207.exe) from the XMM folder - it is no longer needed

Create the compile batch file
11) Open Notepad
12) Paste the following lines into Notepad:

Code: Select all
@echo off
SET starttime=%TIME%
set path=%PATH%;%CD%\mingw64-w32\bin
cd source
make
echo Start Time  %starttime%
echo Finish Time %TIME%
pause


If compiling a MAME modification such as MESS then the line "make" may be different. Please see the MESS homepage for compilation instructions

13) Select the Save As option from the File menu
14) In the "Save As Type" box select "All files (*.*)"
15) Select the XMM folder
16) Save as compileXMM.bat

Check the compilation environment
17) Inside the XMM folder there should be the compileXMM batch file, the compiler folder mingw64-w32 and the source folder

Backup the compilation environment (optional)
18) To avoid having to do this again in the future you can zip up the XMM folder


Stage 2: Download and extract the MAME source
Text/Images: Show
Download the MAME source
01) Visit the downloads page here: http://mamedev.org/release.html
02) The file you need to download is called mameXXXXs.exe (replace XXXX with the version number you want)
It is located in the Official Source Code Packages section at the bottom of the page
03) Download the source package program
04) Move the source package program into the source folder which is inside the XMM folder

Extract the MAME source
05a) The MAME source is stored in a self-extracting 7zip archive. You can either run the program to extract the files
OR
05b) use 7zip or a compatible archiver program to extract the files (make sure you extract directly into the source folder and not into a folder named after the 7zip file)

Check the MAME source
06) Inside the XMM folder you should have a source folder (and other items)
07) Inside the source folder you should have the MAME source package program you downloaded, one or more folders and a one or more files (one file is named makefile)
08) Delete the source package program you downloaded (mameXXXXs.exe) from the source folder - it is no longer needed

If compiling a MAME modification such as MESS you also need to download its source. Please see the MESS homepage for compilation instructions


Stage 3: Modify for Xpadder
Text/Images: Show
01) In Notepad open XMM\source\src\osd\windows\input.c (if extensions are hidden edit the first, larger file named "input")
03) Find the line: #define FORCE_DIRECTINPUT 0
02) Change the zero to a one


Stage 4: Compile
Text/Images: Show
1) Run compileXMM.bat batch file in the XMM folder
2) Wait while MAME compiles
2a) Text will constantly appear while the compilation is in progress
2b) Compilation will take between 10 minutes and 1 hour depending on the speed of your PC
3) Finally you are asked to press any key to continue - when you do the compilation window will close


Stage 5: Done!
Text/Images: Show
1) In the source folder there will now be a new program called MAME (or the name of the mod you added)
2) Copy this new program into your original MAME folder and overwrite the original program already there
3) MAME is now compatible with Xpadder again :D
User avatar
Jonathan
Xpadder creator
Posts: 1590
Joined: 24 Aug 2009, 11:33
Location: England

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 23 Feb 2013, 05:34

I cannot get it to produce a mame.exe file. When I run the batch file it goes through a bunch of operations that say
Code: Select all
mkdir.exe -p obj/windows/mame/....

It does this for a few seconds and then finally it comes to a point where it says
Code: Select all
Compiling src/osd/windows/vconv.c...

After a few more lines of code it says:
Code: Select all
make: *** [obj/windows/mame/build/vconv.exe] Error 1

Does that error mean anything to you?

Note, I am trying to compile version 144 of MAME.
User avatar
koopan
Posts: 4
Joined: 16 Feb 2013, 19:35

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 24 Feb 2013, 19:16

Tested with 0.148 and compiles ok.
I have also updated the tutorial with up-to-date filenames and folder content lists (the core tutorial is still accurate though)
User avatar
Jonathan
Xpadder creator
Posts: 1590
Joined: 24 Aug 2009, 11:33
Location: England

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 02 Mar 2013, 04:13

Hopefully others will have better luck than me, but if anyone doesn't I was finally able to get it to work using this application and instructions:
http://www.headsoft.com.au/index.php?ca ... &page=mc64
User avatar
koopan
Posts: 4
Joined: 16 Feb 2013, 19:35

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 03 Mar 2013, 17:12

Couple of notes:
1) Compile fails in Windows XP SP3 as new 20121207 tools use Python 2.7.3 but this doesn't run under XP for some reason (installing Python separately fixes the problem but I installed 3.3.0 which results in syntax errors - maybe installing 2.7.3 would fix this)
2) Compile works in Windows 7 SP1 clean install
3) http://mamedev.org/?p=378 states 2 batch files that need running but I did not need to do this (a 3rd batch file also exists which I also did not need to run)
4) While testing I found that if these batch files are called from compileXMM.bat (via the call command) some paths are broken due to the desktop folder path containing spaces. Will need to move to C:\ in the future if these batch files become necessary
5) There are number of tool versions available now - it would be useful to know if the latest source requires the latest tools to compile
User avatar
Jonathan
Xpadder creator
Posts: 1590
Joined: 24 Aug 2009, 11:33
Location: England

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 24 May 2013, 23:30

Sorry about this question but is this still working?
Thanks!
User avatar
Pollux
Posts: 37
Joined: 26 Aug 2009, 22:41
Location: Sesimbra, Portugal

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 06 Jun 2013, 23:16

I had the same question. I just bought Xpadder ONLY for MAME! Finding out it doesn't work is a little disappointing. Does anyone have a version of MAME already compiled and working? I don't want to feel like I just wasted 10 bucks on this program. LOL

Thanks!
User avatar
bobcappel
Posts: 6
Joined: 06 Jun 2013, 23:08

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 07 Jun 2013, 01:23

I tested this and is still working.
Just follow the steps above and wait.
I did it in my laptop and it took 2h15m (more time than jonathan's tutorial).
Oh... and it's windows 7 here.
User avatar
Pollux
Posts: 37
Joined: 26 Aug 2009, 22:41
Location: Sesimbra, Portugal

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 07 Jun 2013, 02:46

Would you be able to share the binary you created? I'm about to try it myself, but it would be awesome if you could share. :-) Thanks!!
User avatar
bobcappel
Posts: 6
Joined: 06 Jun 2013, 23:08

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 07 Jun 2013, 11:39

Sure!
I suggest you try the method first to know how to use this things.
If you can't get it right than ask me about my file and I'll send it to you.

Cheers!
User avatar
Pollux
Posts: 37
Joined: 26 Aug 2009, 22:41
Location: Sesimbra, Portugal

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 07 Jun 2013, 18:03

Sure thing. I'm not having much luck but I will start over and post any errors I get this time around. I seem to be missing some required files which seems odd.


Pollux wrote:Sure!
I suggest you try the method first to know how to use this things.
If you can't get it right than ask me about my file and I'll send it to you.

Cheers!
User avatar
bobcappel
Posts: 6
Joined: 06 Jun 2013, 23:08

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 07 Jun 2013, 21:15

I'm on my second try now, and this time the compiler seems to be rolling right along. Not sure what I did wrong the first time. LOL

Anyway, we'll see what happens....! *fingers crossed*
User avatar
bobcappel
Posts: 6
Joined: 06 Jun 2013, 23:08

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 08 Jun 2013, 00:45

Well it worked! Got it to compile perfectly. :-)

Now what? LOL

Do I now need to go and configure the control settings for my gamepad? Or is there a file I can download to plugin and work? Sorry to sound like such a n00b, but I really am new to this.

Thanks everyone!
User avatar
bobcappel
Posts: 6
Joined: 06 Jun 2013, 23:08

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 09 Jun 2013, 16:16

Now you are ready to configure your xpadder profiles.
This is the easy way, just follow the hints/help.
User avatar
Pollux
Posts: 37
Joined: 26 Aug 2009, 22:41
Location: Sesimbra, Portugal

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 10 Jun 2013, 07:15

Got everything working! Playin MAME like a boss now. LOL Only place where there are any issues is trying to put the coin drop and start buttons on th two small bittoms on either side of the green X button. Sometimes it works but more often than not it doesn't. Minor issue though. Otherwise it plays really well.

Thanks!
B
User avatar
bobcappel
Posts: 6
Joined: 06 Jun 2013, 23:08

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 10 Jun 2013, 08:44

I use it in hyperspin front-end and it works good.
Coin and start I use with shift buttons.
I'm experiencing one issue now (Controller D-PAD from P1 moves P2) but I think it's my key mapping. :oops:
Cheers!
User avatar
Pollux
Posts: 37
Joined: 26 Aug 2009, 22:41
Location: Sesimbra, Portugal

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 18 Jun 2013, 23:54

Solved my issue problem.
I got my Joystick option in MAME.ini file set to 1 instead of 0 (CORE INPUT OPTIONS).
After changed it to 0 everything is OK now.
Hope this can be usefull for someone.
User avatar
Pollux
Posts: 37
Joined: 26 Aug 2009, 22:41
Location: Sesimbra, Portugal

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 21 Oct 2013, 06:09

I Compiled MAME 150 a week ago and tried to use Xpadder. Could not get MAME to use Xpadder for the life of me :x . With this tutorial, I was able to get Xpadder to work :D .

Just a note for those who have already compiled MAME you don't have to follow all the steps. I already had the mingw set up and the mamesrc set up the way the MAME Dev website says to do. If you have done the same, then all you have to do is go into the folder that has the MAME source in it and change the input.c file.

For me the file was at C:\mamesrc\src\osd\windows. I changed the #define FORCE_DIRECTINPUT 0 to #define FORCE_DIRECTINPUT 1 as stated above in the tutorial. I recompiled MAME and viola Xpadder was working again!

My compile time was very short, less then a minute. I believe this is because I already used what was there. I also used the command make -j5. The -j5 tells the compiler to use all 4 processors. I believe you can also use -j3 for dual core. This should speed up compile time.

Hope this helps! And thank you for this great tutorial!
User avatar
Ryu
Posts: 5
Joined: 21 Oct 2013, 03:59

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 25 Mar 2014, 20:36

I tried to do this already but i'm stuck on creating a folder "inside" the XMM folder. There are no instructions on how to do this.
User avatar
aaronorosco
Posts: 6
Joined: 16 Feb 2014, 07:58

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 25 Mar 2014, 20:41

I did everything like first post and got just the minor issue that i wrote.
Lets wait if jonathan can help you.
User avatar
Pollux
Posts: 37
Joined: 26 Aug 2009, 22:41
Location: Sesimbra, Portugal

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 06 Apr 2014, 03:45

Im finally at the download mame source step trying to modify it with the xpadder but I can't open the mame program (even with winzip), this is pissing me off!
User avatar
aaronorosco
Posts: 6
Joined: 16 Feb 2014, 07:58

Re: Modifying MAME or its modifications to re-add Xpadder support

Post » 28 Apr 2014, 16:36

I have now updated the tutorial for the last stable version of 2013 (0.152). It should work for the new 0.153 too.
User avatar
Jonathan
Xpadder creator
Posts: 1590
Joined: 24 Aug 2009, 11:33
Location: England


Return to Xpadder not working in game

Who is online

Users browsing this forum: No registered users and 0 guests

cron