Joysticks: Difference between revisions
From NerdConsole
Jump to navigationJump to search
NerdOfEpic (talk | contribs) (Created page with "As with nearly all game systems, joysticks are how users get input into NerdConsole. NerdConsole uses standard SNES controllers because they are easy to find and in my opinion, excellent. They have enough buttons to allow for flexibility when defining how your game uses them while not so many as to be complicated. NerdConsole has joystick ports built into the front of the system for players 1 and 2. These are always available. There is a 6-pin connector that through...") |
NerdOfEpic (talk | contribs) No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
As with nearly all game systems, joysticks are how users get input into NerdConsole. NerdConsole uses standard SNES controllers because they are easy to find and in my opinion, excellent. They have enough buttons to allow for flexibility when defining how your game uses them while not so many as to be complicated. | As with nearly all game systems, joysticks are how users get input into NerdConsole. NerdConsole uses standard SNES controllers because they are easy to find and in my opinion, excellent. They have enough buttons to allow for flexibility when defining how your game uses them while not so many as to be complicated. | ||
Regardless of which port is being used, the joysticks all work in the same way. A pattern of latching the button state and then reading the data 1-bit at a time. For additional information check out [[Register - Input]]. | Regardless of which port is being used, the joysticks all work in the same way. A pattern of latching the button state and then reading the data 1-bit at a time. For additional information check out [[Register - Input]]. | ||
| Line 11: | Line 9: | ||
! Order !! Button | ! Order !! Button | ||
|- | |- | ||
| 1 || B | | align="center" | 1 || align="center" | B | ||
|- | |- | ||
| 2 || Y | | align="center" | 2 || align="center" | Y | ||
|- | |- | ||
| 3 || Select | | align="center" | 3 || align="center" | Select | ||
|- | |- | ||
| 4 || Start | | align="center" | 4 || align="center" | Start | ||
|- | |- | ||
| 5 || Up | | align="center" | 5 || align="center" | Up | ||
|- | |- | ||
| 6 || Down | | align="center" | 6 || align="center" | Down | ||
|- | |- | ||
| 7 || Left | | align="center" | 7 || align="center" | Left | ||
|- | |- | ||
| 8 || Right | | align="center" | 8 || align="center" | Right | ||
|- | |- | ||
| 9 || A | | align="center" | 9 || align="center" | A | ||
|- | |- | ||
| 10 || X | | align="center" | 10 || align="center" | X | ||
|- | |- | ||
| 11 || L | | align="center" | 11 || align="center" | L | ||
|- | |- | ||
| 12 || R | | align="center" | 12 || align="center" | R | ||
|} | |} | ||
The pattern for reading joysticks is: | |||
# Set the latch signal to 1 and then back to 0. | |||
# Read the button state of the B button. | |||
# Set the clock signal to 1 and then back to 0. | |||
# Read the state of the next button. | |||
# Return to 3 if not done. | |||
Latest revision as of 21:10, 23 January 2024
As with nearly all game systems, joysticks are how users get input into NerdConsole. NerdConsole uses standard SNES controllers because they are easy to find and in my opinion, excellent. They have enough buttons to allow for flexibility when defining how your game uses them while not so many as to be complicated.
Regardless of which port is being used, the joysticks all work in the same way. A pattern of latching the button state and then reading the data 1-bit at a time. For additional information check out Register - Input.
When reading controllers, the buttons are always read in a specific order.
SNES Button Order
| Order | Button |
|---|---|
| 1 | B |
| 2 | Y |
| 3 | Select |
| 4 | Start |
| 5 | Up |
| 6 | Down |
| 7 | Left |
| 8 | Right |
| 9 | A |
| 10 | X |
| 11 | L |
| 12 | R |
The pattern for reading joysticks is:
- Set the latch signal to 1 and then back to 0.
- Read the button state of the B button.
- Set the clock signal to 1 and then back to 0.
- Read the state of the next button.
- Return to 3 if not done.