Build Your Own Arcade Controls Forum
Main => Main Forum => Topic started by: SirPoonga on February 27, 2002, 01:00:58 pm
-
URebel said something about the deadzone in directx would affect a positional gun.
Deadzone I believe is how much the joystick moves form center before the computer picks up it moved.
So, if you happen to have the gun centered and it is pointing at thecenter of the screen, there would be an area in the center that you couldn't pinpoint where the gun was pointing.
how would one make that area smaller Or get rid of it all teogether.
How about when the joystick is centered it is aiming off screen slightly, then calibrate it with the screen?
-
You need to set the deadzone (sometimes called deadband) to zero. I think most joystick default setting to deadzone is about 10% (it is set in hundredths of a percent).
(Note, although I want to add this as a settable feature to Analog+, I haven't tried to yet, so this is not tested.)
IIRC, if you set the deadzone in one program, it will stick unless you st it back, or reboot the computer. So you can set deadzone in mame or in a small program that only sets deadzone to 0, and every game you play, not just mame, will have zore deadzone. Example below is for changing mame.
To hard code the deadband to 0% in mame:
I would suggest, in scr/windows/input.c, in the enum_joystick_callback() function, after "// set absolute mode" and just before "// attempt to set the data format" add :
value.diph.dwSize = sizeof(deadzone);
value.diph.dwHeaderSize = sizeof(deadzone.diph);
value.diph.dwObj = DIJOPS_X;
value.diph.dwHow = DIPH_BYOFFSET;
value.dwData = 0; // this is the size of the deadzone
result = IDirectInputDevice_SetProperty (joystick_device[joystick_count], DIPROP_AXISMODE, &value.diph);
if (result != DI_OK)
goto cant_set_axis_mode; //can't set X deadzone
and repeat for y axis (change DIJOPS_X to DIJOPS_Y)
Please tell me if it works. ;)
-
I will have to try it in a few weeks. Got some other stuff I need to work on first. Unless anyone else want's a go at it.