Build Your Own Arcade Controls Forum

Main => Software Forum => Topic started by: Stormrider on October 25, 2009, 03:06:03 am

Title: Error compiling: defining input in neogeo.c
Post by: Stormrider on October 25, 2009, 03:06:03 am
I am trying to change the enter bios input (only in input this game) for all Neogeo games editing the source code. I'm using neogeo.c, where I've found this:

   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Enter BIOS") PORT_CODE(KEYCODE_F2)   \

I can change keycode_f2 to keycode_b and it compiles and works. I can change it to JOYCODE_BUTTON8 and it compiles and works. However it doesn't compile if I write JOYCODE_1_BUTTON8 and the same with JOYCODE_1_BUTTON8 JOYCODE_1_BUTTON9 or what I first tried: KEYCODE_F2 OR JOYCODE_1_BUTTON8 JOYCODE_1_BUTTON9, which is what I have in a neogeo cfg file after editing the enter bios input (button combination to enter bios)

Any idea what's going wrong?
Title: Re: Error compiling: defining input in neogeo.c
Post by: SirPeale on October 25, 2009, 07:35:09 am
That's an awful lot of work, why don't you just change the inputs on the input menu?
Title: Re: Error compiling: defining input in neogeo.c
Post by: Stormrider on October 25, 2009, 01:30:37 pm
Because I'm masochist
Title: Re: Error compiling: defining input in neogeo.c
Post by: Stormrider on October 26, 2009, 06:48:04 am
Nah, it's just that creating a neogeo.cfg with the custom input configuration simple doesn't work.
Title: Re: Error compiling: defining input in neogeo.c
Post by: u_rebelscum on October 26, 2009, 05:56:05 pm
I am trying to change the enter bios input (only in input this game) for all Neogeo games editing the source code. I'm using neogeo.c, where I've found this:

   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Enter BIOS") PORT_CODE(KEYCODE_F2)   \

I can change keycode_f2 to keycode_b and it compiles and works. I can change it to JOYCODE_BUTTON8 and it compiles and works. However it doesn't compile if I write JOYCODE_1_BUTTON8 and the same with JOYCODE_1_BUTTON8 JOYCODE_1_BUTTON9 or what I first tried: KEYCODE_F2 OR JOYCODE_1_BUTTON8 JOYCODE_1_BUTTON9, which is what I have in a neogeo cfg file after editing the enter bios input (button combination to enter bios)

Any idea what's going wrong?

Mame can do ORs with two PORT_CODE()s:

PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Enter BIOS") PORT_CODE(KEYCODE_F2) PORT_CODE(KEYCODE_B)   \

results in "F2 or B".

But it's not setup for hardcoding ANDs.  If you want to do this, I think you'd need to #define a PORT_CODE_AND, setup the tokens and write the new input_seq_append_and() function.  (Copying from the INPUT_TOKEN_CODE token and input_seq_append_or() function)
Title: Re: Error compiling: defining input in neogeo.c
Post by: Stormrider on October 26, 2009, 06:59:49 pm
I've finally got to simplify an autohotkey script and make it work. I've added it to code of the script I'm using. This is the code:

#IfWinActive ahk_class MAME
~1Joy9::
if getkeystate("Joy3")
Send, {F2 down}
Send, {F2 up}
return

Apart from buttons for pause, show fps, coin and start, I use button combinations for using MAME's UI. The different action buttons + start button (joy9) perform functions: throtle, menu, overclock, service menu, reset, quit. Now, thanx to the script, when I press joy3 + the start button, I enter the service menu or bios (in case I am running a Neogeo game).