Jump to content
IGNORED

XBOX 360. Crazy Idea. I need sanity check from you.


Blues76

Recommended Posts

Hi,

 

I have an idea and there are threads that cover part of it:

 

Threads:

https://atariage.com/forums/topic/313827-has-anyone-tried-this-“new”-gamepad/

 

https://atariage.com/forums/topic/308542-converter-to-use-modern-controllers-on-atari/

 

https://atariage.com/forums/topic/307459-usb-adapter-for-cx-controllers-project-ideas/?tab=comments#comment-4552047

 

 

This idea maybe crazy and useless, so I may not pursue it but I needed some sanity check.

 

So, let's say I want an XBOX 360 controller (usb wired) be able to be used in the Atari (yes, probably useless idea, I know).

 

SO, the XBOX 360 thumb stick contain a value of X,Y in the range of 0 to 255. So, here we have two thumb stick. The Left and Right trigger also have a value of (0 to 255 or o to 127, I don't remember right now).

 

Then you have the other discrete buttons.

 

Assuming that I get the input from the XBOX 360 game pad into an Arduino or raspberry pi and then send it to the Atari, I'm a bit confused how would I be able to send it.

 

One idea is to scale down the values and use the two joystick ports.

 

For example, just to use the complete range of the left thumb stick,I would need 8 pins and 1 pin for one button.

 

I was just thinking about this. Of course, even if is done, I'm not sure what could it be use for.

Ideas? Opinions?

 

Correction: The range of thumb stick  may be different from what I remembered when I typed thisz 

 

 

Edited by Blues76
correction
Link to comment
Share on other sites

You could basically just try this now, by binding the controller analog inputs to paddle inputs in an emulator.

 

The analog inputs on these controllers aren't particularly precise. The analog stick, for instance, has a loose dead zone of around a quarter of the range and beyond that it's only about a quarter inch of physical movement. It's probably less precise to use than a 5200 controller and definitely less precise than a paddle controller with its large knob and range of movement. I have to apply acceleration curves to make games like Kaboom! and Missile Command playable with the Xbox 360 controller, and it still doesn't feel as direct as a trackball or a paddle controller.

 

The main thing you do get with a modern controller is a lot more buttons, and that does help a lot in some games. For instance, I added two button support when porting 2600 Raiders of the Lost Ark because it's more convenient than the original two-joystick setup.

Link to comment
Share on other sites

3 minutes ago, phaeron said:

You could basically just try this now, by binding the controller analog inputs to paddle inputs in an emulator.

 

The analog inputs on these controllers aren't particularly precise. The analog stick, for instance, has a loose dead zone of around a quarter of the range and beyond that it's only about a quarter inch of physical movement. It's probably less precise to use than a 5200 controller and definitely less precise than a paddle controller with its large knob and range of movement. I have to apply acceleration curves to make games like Kaboom! and Missile Command playable with the Xbox 360 controller, and it still doesn't feel as direct as a trackball or a paddle controller.

 

The main thing you do get with a modern controller is a lot more buttons, and that does help a lot in some games. For instance, I added two button support when porting 2600 Raiders of the Lost Ark because it's more convenient than the original two-joystick setup.

Yes, the dead zone ! I found a nice article a way back to smooth the input :) 

 

But how do I send the value into the atari. The 9 pin gives me only 2^9  or 2^18 if I used both connections. 

 

Am I missing something? 

Link to comment
Share on other sites

36 minutes ago, Blues76 said:

But how do I send the value into the atari. The 9 pin gives me only 2^9  or 2^18 if I used both connections.

You can't use all 9 pins for input since two of the pins are for +5V and ground. Two of the remaining pins are paddle inputs and are more difficult to read as a paddle scan is required.

 

The remaining pins can be multiplexed to push bigger data through a serial protocol, such as 3-5 bits at a time. You can either constantly push the data such that the joystick read routine can easily capture a whole block whenever it wants, or you can switch one of the joystick lines to output and use it to manually clock the input. The latter is slower but more timing tolerant.

 

Alternatively, you could build around one of the USB cartridges and have the Atari directly poll the HID controller.

 

  • Thanks 1
Link to comment
Share on other sites

1 hour ago, phaeron said:

The analog inputs on these controllers aren't particularly precise. The analog stick, for instance, has a loose dead zone of around a quarter of the range and beyond that it's only about a quarter inch of physical movement.

Dead zone? You mean, like no input change being registered near the centre? If so, it must be some Windows driver thing, as on Linux input changes are registered across the whole movement range including the centre. The controller itself does not seem to have any dead zone built in.

Edited by Kr0tki
Link to comment
Share on other sites

11 minutes ago, Kr0tki said:

Dead zone? You mean, like no input change being registered near the centre? If so, it must be some Windows driver thing, as on Linux input changes are registered across the whole movement range including the centre. The controller itself does not seem to have any dead zone built in.

What happens is that if you move the stick and let us back to the center position, it will keep sending positive/negative values and not 0,0. So it is called the dead zone 

 

 It has been a while —. I don’t remember the range any longer—    but is a range. Wow, it has been years since I coded that. 

Edited by Blues76
correction
Link to comment
Share on other sites

26 minutes ago, phaeron said:

You can't use all 9 pins for input since two of the pins are for +5V and ground. Two of the remaining pins are paddle inputs and are more difficult to read as a paddle scan is required.

 

The remaining pins can be multiplexed to push bigger data through a serial protocol, such as 3-5 bits at a time. You can either constantly push the data such that the joystick read routine can easily capture a whole block whenever it wants, or you can switch one of the joystick lines to output and use it to manually clock the input. The latter is slower but more timing tolerant.

 

Alternatively, you could build around one of the USB cartridges and have the Atari directly poll the HID controller.

 

thank you. Which USB cartridge? 

Link to comment
Share on other sites

5 minutes ago, Blues76 said:

What happens is that if you move the stick and let us back to the center position, it will keep sending positive values and not 0,0. So it is called the dead zone 

If the stick would be consistently reporting 0,0 when being sufficiently close to centre position, then it would surely be an indication of a dead zone. This is not the case. Both thumbsticks are reporting their position correctly even near the centre, without suddenly "jumping" to 0,0.

Link to comment
Share on other sites

Your Raspberry Pi can translate the analog values to discrete values similar to what I did here (read up to the third post where the range was sufficiently increased to reliable detect up/down left/right):

 

 

You don't need to know about a dead zone. Just the thresholds after which it is definitely up or down (left or right).

 

Edit: like -32768...-1500 is down, -1499...1499 is nothing, 1500...32767 is up. Remember, every direction on the joystick port has its own bit. So you can actually do nothing if you are not sure yet :)

Edited by ivop
  • Thanks 1
Link to comment
Share on other sites

1 minute ago, Kr0tki said:

If the stick would be consistently reporting 0,0 when being sufficiently close to centre position, then it would surely be an indication of a dead zone. This is not the case. Both thumbsticks are reporting their position correctly even near the centre, without suddenly "jumping" to 0,0.

The point is that there is a small range of values that are reported, so for example if you have a character, it will keep moving. I’m not in front of my computer. So, yes, while the gamepad may be reporting the correct position, it is noise for the game. 

Link to comment
Share on other sites

1 minute ago, ivop said:

Your Raspberry Pi can translate the analog values to discrete values similar to what I did here (read up to the third post where the range was sufficiently increased to reliable detect up/down left/right):

 

 

You don't need to know about a dead zone. Just the thresholds after which it is definitely up or down (left or right).

Thank you @ivop

 

I was just thinking about what would it take to transfer those values —> Of course, the option to have a threshold to convert to a direction is the best option for the atari. I was just thinking about this. Thanks 

Link to comment
Share on other sites

3 hours ago, Kr0tki said:

If the stick would be consistently reporting 0,0 when being sufficiently close to centre position, then it would surely be an indication of a dead zone. This is not the case. Both thumbsticks are reporting their position correctly even near the centre, without suddenly "jumping" to 0,0.

The dead zone is implemented in software and not in the controller/driver/API, but the controllers physically have designed dead zone regions when the sticks or triggers are not being pushed and where there is no intended game input, where the controller is at rest and the springs no longer push back. The point is that this region is actually fairly large on the Xbox 360 controller, in that there's a little bit of rattle and you can get values as large as +/-4K for an untouched controller. As you have seen on Linux, it is also the case on Windows that non-zero values are reported in these regions.

 

The xinput.h header on Windows actually defines the sizes of the dead zones for the sticks and the triggers, though I've found those thresholds to be bad and don't use them.

 

An advantage of implementing the dead zone in software is that it can be tailored for each interpretation of the sticks. Most of the time you want to implement it on both sticks together as a circle, but there are some cases where it's better to do so independently on both axes when you want to encourage but not mandate clean horizontal and vertical movements. Also, I find that the classic "threshold X and Y and map to 9-grid" produces a bad mapping from analog to digital joystick where either the dead zone is too big or it's too prone to diagonals; for this reason Altirra instead uses angle-based mapping to octants.

 

Link to comment
Share on other sites

This is the output from a Saitek Joypad

The first 2 columns are the Left analogue Joystick, the next 2 the Right

Values go from 0 to 255 with ~128 being the middle

The 5th column is the button decode, depending on which button(s) are pressed or the digital pad.

I would assume other controllers do much the same thing.

 

128,128,128,133,00
128,128,128,131,00
128,128,128,133,00
128,128,128,131,00
128,128,128,133,00
128,128,128,131,00
128,128,128,133,00
128,128,128,131,00
128,128,128,133,00

 

Button Outputs in column 5

128,128,128,129,128
128,128,128,131,128
128,128,128,129,128
128,128,128,131,128
128,128,128,131,64
128,128,128,129,64
128,128,128,131,64
128,128,128,129,16
128,128,128,131,16
128,128,128,129,32
128,128,128,131,32
128,128,128,129,32
128,128,128,129,01
128,128,128,131,05
128,128,128,129,05
128,128,128,131,07
128,128,128,129,07
128,128,128,131,07
128,128,128,129,03

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...