MAMEWorld >> Programming
View all threads Index   Flat Mode Flat  

uRebelScum
Regular
Reged: 09/21/03
Posts: 538
Loc: California
Send PM
Re: Food Fight Rev 3 looking or walking to the right when not touching joystick
10/31/08 09:16 PM


> I'm playing "Food Fight (Rev. 3)" (foodf.zip) using SDLMAME 128u1.... Reference the long
> post at Logitech Cordless RumplePad 2 stuck to the right for more background and detail...

Interesting read, and good, complete testing.

I can help on how mame works (question 3). If you look at the source foodf driver (src/mame/drivers/foodf.c), the inputs are defined (lines ~260-300), and the inputs are read (lines ~195-205). It looks like mame just passes the 0-255 values to the game without any changes. More info on the port defines in src/emu/inptport.h (~690-805 mostly), and src/emu/inptport.c (~2400-3000 for decoding the tokens).

In short, foodf's define goes like this: PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_REVERSE PORT_PLAYER(1)

PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X )
mask = 0xff (0-255), default value = 0x7f (127), and the input type is analog stick, X axis. The default value is the game's "center".

PORT_SENSITIVITY(100)
100% analog sensitivity set as default for this port. Can be changed in game tab "Analog Controls", just like the others below.

PORT_KEYDELTA(10)
Sets speed a digital input is translated into an analog value for the game when digital input is pressed. This is why the keyboard input wasn't instant you mentioned in your prior thread. The number sets the change to 10 (in the 0-255 range defined earlier) per frame. Notice that autocenter speed isn't set in this define, so mame sets it to the same value. Autocenter speed is like keydelta, but is the speed mame returns the value to center when the digital input is released.

PORT_REVERSE
Reverses the analog values just before sending to game. Usually, left is min, right is max. When reversed, right is min, left is max.

----------
Okay, something you might want to try: for playing with your analog stick, decrease mame's deadzone to 5% or even 1% (0.05 or 0.01). I'm assuming your joystick driver doesn't have it's own deadzone, and that the stick is decent quality. Might help with looking needing less movement, but depends on the original code.


Robin
www.urebelscum.speedhost.com/ or
www.angelfire.com/retro/u_rebelscum or
rain.prohosting.com/urebel







Entire thread
Subject Posted by Posted on
* Food Fight Rev 3 looking or walking to the right when not touching joystick bgoodr 10/31/08 06:12 AM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick MAMEBase  11/01/08 02:51 AM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick bgoodr  11/01/08 08:06 AM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick uRebelScum  10/31/08 09:16 PM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick bgoodr  11/01/08 09:00 AM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick uRebelScum  11/04/08 01:45 AM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick bgoodr  11/04/08 07:10 PM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick StilettoAdministrator  11/04/08 07:51 PM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick uRebelScum  11/04/08 09:45 PM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick Canim  11/04/08 08:39 PM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick uRebelScum  11/04/08 10:13 PM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick Canim  11/04/08 10:59 PM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick uRebelScum  11/08/08 02:24 AM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick Canim  11/08/08 08:51 PM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick MAMEBase  11/03/08 11:18 PM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick bgoodr  11/04/08 07:14 PM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick Anonymous  11/08/08 11:53 PM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick bgoodr  11/10/08 05:05 AM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick MAMEBase  11/27/08 03:24 AM
. * Re: Food Fight Rev 3 looking or walking to the right when not touching joystick bgoodr  11/27/08 09:44 PM

Extra information Permissions
Moderator:  Pi 
0 registered and 3 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 7231