libretro / mame2003-libretro

MAME 0.78 for libretro. Compatible with MAME 0.78 sets.
Other
90 stars 74 forks source link

Xybots (and clones) missing RetroPad mapping #69

Open paradadf opened 7 years ago

paradadf commented 7 years ago

Xybots should have action buttons (twist) mapped to RetroPad buttons by default and not only key strokes.

20161214_170937544_ios

dankcushions commented 7 years ago

good spot!

https://github.com/libretro/mame2003-libretro/blob/7b55725e744ac9702db092f996e2fca2276146b2/src/drivers/xybots.c#L122

it seems that this and many other games with inputs that use IP_JOY_DEFAULT are not actually bound to anything on the joypad. it's almost like a placeholder... very strange.

for this game, what would be good retropad buttons to use for this game? the original cabinet had a 'twist' stick. i think retropad Y and A as this maps well to the right_stick_as_btns core option, allowing you to the use the right stick to rotate the view, sort of like a modern FPS/3PS.

paradadf commented 7 years ago

Yes, RetroPad A and Y would be perfect. That's the most intuitive I would say.

markwkidd commented 6 years ago

Is this working now?

markwkidd commented 6 years ago

@SapphireTactician because you suggested that I might tag you again -- could you see if you think this input is working the way it ought to be in mame2003-plus?

ghost commented 6 years ago

T_BITX(0x0004, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2, "P2 Twist Right", KEYCODE_W, IP_JOY_DEFAULT )

this defaults to button 3

ghost commented 6 years ago

Thats one thing i never did understand why not just bind the buttons number to the retropad

dankcushions commented 6 years ago

it is? https://github.com/libretro/mame2003-libretro/blob/master/src/libretro/joystick.c#L20

i think the issue is with this IP_JOY_DEFAULT thing - it's avoiding this association for whatever reason. i never investigated beyond that.

ghost commented 6 years ago
{ IPT_BUTTON3             | IPF_PLAYER1, "P1 Button 3",    SEQ_DEF_5(KEYCODE_SPACE, CODE_OR, JOYCODE_1_BUTTON3, CODE_OR, JOYCODE_MOUSE_1_BUTTON2) },
ghost commented 6 years ago

@dankcushions ill check this behavior in mame078 and verify i just need to hook a joypad up to the pc dont have one where i am at the moment

ghost commented 6 years ago

code snippet

note ( IP_JOY_DEFAULT == CODE_DEFAULT)

if (seq_get_1((InputSeq*)&in->seq) != CODE_DEFAULT)
    return (InputSeq*)&in->seq;

i = 0;

while (inputport_defaults[i].type != IPT_END &&
        inputport_defaults[i].type != type)
    i++;

if ((in->type & ~IPF_MASK) == IPT_EXTENSION)
    return &inputport_defaults[i+1].seq;
else
    return &inputport_defaults[i].seq;

}

ghost commented 6 years ago

the code reads this way to me ill need to verify though

dankcushions commented 6 years ago

i'm sure that's how it works in standalone, but i'm saying it's not working in the libretro version for some reason. retropad's button3 mapping is being ignored when in IP_JOY_DEFAULT situations

ghost commented 6 years ago

@dankcushions maybe we are setting the binding too soon might be worth fixing at core level rather than every driver. Again its up to yourself seems like there are a few more to go by doing a grep

dankcushions commented 6 years ago

yeah my hunch is that this is an order thing. i don't like the idea of changing the inputs in the drivers for any reason.

ghost commented 6 years ago

@dankcushions xybots doesnt map to a joypad in mame078

however look here in alpha68k.c

game paddlema

PORT_BITX(0x0100, IP_ACTIVE_LOW, IPT_START1, "Button A (Start)", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
PORT_BITX(0x0200, IP_ACTIVE_LOW, IPT_START2, "Button B (Start)", IP_KEY_DEFAULT, IP_JOY_DEFAULT )

this code works maybe this setting is reserved for service,start ect ill need to look up the code more it might just be fixable with flag changes to use the right retropad buttons

ghost commented 6 years ago

@markwkidd I'll download the new code and recompile the core, then take a look into it for you.

ghost commented 6 years ago

@markwkidd Downloaded latest code, compiled, twist controls still not mapped to RetroPad.

2018-04-24--135641_1600x900

ghost commented 6 years ago

@markwkidd its yet time for work again please check the mame2003 thread. I believe the flags are set bad or some part of the code is missing something. I will track this little devil down its clear what it should be doing but isint for button mapping. its doing this in mame078 as well its just mapping the keys

ghost commented 6 years ago

@markwkidd I figured out what happened. It's not pretty. To get the new defaults you assigned for each twist, I had to "null" out those controls first. Meaning each twist can't be truly nulled anymore as nulling sets them to what you intended to be the defaults.

In other words, it seems you defined what null is for those inputs, not what their default is.

On a sidenote, this game is really fun. Glad to be introduced to it.

markwkidd commented 5 years ago

@paradadf and @SapphireTactician -- @grant2258 added remappable analog inputs to MAME 2003-Plus yesterday.

That means that analog inputs can be remapped from within the frontend (RetroArch) rather than from within the MAME Menu/Remapper.

If either of you is still interested in this game, would you be willing to give it a try with the latest MAME 2003-Plus build, and try to map the twister completely from within the frontend?

paradadf commented 5 years ago

@markwkidd I just tried to remapp the missing inputs from within retroarch‘s controls menu and had no luck. I couldn‘t map anything, no response.

ghost commented 5 years ago

The inputs where only added to the mame mapping and only on plus. youll need to use the tab menu unless someone adds code to add these finger for ra right now it just generic returns and wrong in some cases(the ra end).

paradadf commented 5 years ago

I used the plus core as markwkidd asked for.

ghost commented 5 years ago

Im not sure where mark is getting his wires crossed its just confusing people.

Lost of games have issues with the frontend mapping anything analog or not mapped to a button by default. like zwakery, birdtry, spacewars ect you need to use the tab menu.

Everything is settable in the tab menu all you can do in the frontend is remap whats mapped to default not all drivers map to default though and marks front end impemention only supports digital atm. I cant see any clear way to implement this in RA atm unless you have some sort of gui functionality like mame gui does

rsn8887 commented 5 years ago

How can I remove a Mame input menu mapping on a system without a keyboard? I think on PC it was „esc“.

ghost commented 5 years ago

enable legacy mode and press l3 go to the control press the button you want to change and press left 2 times instead of setting a key, This will return the default then just press it again and the key you want to use.

of nm forget that i was thinking you posted this on plus not sure what its set to 2003 ill check though

ghost commented 5 years ago

https://github.com/libretro/mame2003-libretro/blob/133ef799e03b29001ca274f17c5ab43558e28dd2/src/inptport.c#L405

https://github.com/libretro/mame2003-libretro/blob/133ef799e03b29001ca274f17c5ab43558e28dd2/src/mame2003/mame2003.c#L709

rsn8887 commented 5 years ago

Interesting. I wish Mame osd menu had a little reminder text how to do this, since it is impossible to figure it out without instructions.

ghost commented 5 years ago

https://docs.libretro.com/library/mame_2003/

rsn8887 commented 5 years ago

Nice docs! But the "press left twice to return to default" is not mentioned. That's the part I find impossible to figure out.