Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

I recently upgraded to MAME 0.142 from 0.127UI.


I have an AHK script that runs alongside mame which has the following

#Persistent ; keep script running until someone closes it.joy10::If Getkeystate("Joy9") ;if joy 9 was down when you pressed joy10{Send {ESC down}Keywait Joy10Keywait Joy9Send {ESC up}}joy8::If Getkeystate("Joy7") ;if joy 7 was down when you pressed joy8{Send {TAB down}Keywait Joy8Keywait Joy7Send {TAB up}}


This basically maps 2 joystick buttons to a single key. This script works fine in gameEX and all emus including MAME32 but for some strange reason it is not working in MAME 0.142.

Its like the keys are not being sent. If I plug in the keyboard while MAME is running and press TAB or ESC it works fine.


Hopefully I missed something obvious

Regards
Posted

I think the issue here is that at some point MAME shifted to only accepting raw input rather than DirectInput (not sure what version made this change). The good news is that you should be able to make an adjustment to the MAME source code, and recompile which will re-enable support for DirectInput. I'm not sure if this is working in the latest versions, but I haven't heard otherwise. Here is a thread you might find interesting:

XPadder MAME mod

You can find additional information on this over at the BYOAC forums (searching for DirectInput in the Software forum brings up a number of related results).

I feel your pain on this one. I have a pet peeve about emulators that don't recognize DirectInput, as I feel it sort of hobbles the functionality of the emulator (at least in terms of helper programs like Xpadder, AHK, etc.).

Good Luck!

Posted

No problem, hope it helps! As a foot note to the thread I mentioned above, I believe that this is the more widely accepted method for re-enabling DirectInput in MAME (rather than the method proposed earlier in that thread):

Take a look in src\osd\windows\input.c and change

// For testing purposes: force DirectInput
#define FORCE_DIRECTINPUT 0

to

// For testing purposes: force DirectInput
#define FORCE_DIRECTINPUT 1

That should do it.

Posted

This is driving me insane.

I know how to compile MAME as I did it sucessfully 2 days ago but everytime I try with the edited src\osd\windows\input.c it errors.

Now I am not sure if thats the reason its failing but maybe if someone can check out this error and point me in the right direction :)


src/emu/hiscore.c: In function 'void hiscore_init(running_machine&)':
src/emu/hiscore.c:415: error: no matching function for call to 'running_machine::add_notifier(machine_notification, void (&)(running_machine&))'
src/emu/machine.h:376: note: candidates are: void running_machine::add_notifier(machine_notification, machine_notify_delegate)
make: *** [obj/windows/mame/emu/hiscore.o] Error 1
make: *** Waiting for unfinished jobs....
Compiling src/emu/input.c...
Finished!
0 Hours 10 Minutes and 13 Seconds Elapsed.

Posted (edited)

Ok I was being an idiot and had the wrong MAME version in my source folder.

changing

// For testing purposes: force DirectInput#define FORCE_DIRECTINPUT 0

to
// For testing purposes: force DirectInput#define FORCE_DIRECTINPUT 1


Works 100%

Thank you so much smile.gif Edited by nullPointer
This topic has been marked as RESOLVED and is now closed. Please begin a new thread if you are experiencing any similar issues.
Guest
This topic is now closed to further replies.
×
×
  • Create New...