Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: positional gun pt 2 (somewhat directed at urebel)  (Read 2013 times)

0 Members and 1 Guest are viewing this topic.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8183
  • Last login:April 12, 2023, 09:22:35 pm
  • The Bears Still Suck!
positional gun pt 2 (somewhat directed at urebel)
« 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?
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: positional gun pt 2 (somewhat directed at ureb
« Reply #1 on: February 27, 2002, 07:25:54 pm »
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. ;)
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »
Robin
Knowledge is Power

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8183
  • Last login:April 12, 2023, 09:22:35 pm
  • The Bears Still Suck!
Re: positional gun pt 2 (somewhat directed at ureb
« Reply #2 on: February 27, 2002, 07:48:36 pm »
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.
« Last Edit: December 31, 1969, 07:00:00 pm by 1026619200 »