DE-9 Joystick

From IndividualComputers
(Redirected from DB9-Joystick)
Jump to: navigation, search
Deutsch

Contents


See also DE-9 Connector, DE-9 Mouse, DE-9 Lightpen, DE-9 Paddle

Pinout

Pinout at the solder side in the computer is equivalent to the pinout at the outside of the plug at the cable, pinout at the solder side of the plug at the cable is equivalent to the pinout at the outside of the computer.


Pin Chameleon Atari 800
Atari VCS
Atari 7800
(*1)
Atari ST
(*2)
VIC-20
C-64
C64GS
(*3)
Amiga CD32
(*4)
Amstrad
CPC
MSX
X68000
(J-PC)
Mastersystem
(*6)
Megadrive
(Genesis)
(*6)
Sinclair
(*7)
3DO
(*8)
Sam Coupé
(*9)
Kempston Interface
(Sinclair ZX Spectrum)
1 /Up /Up /Up /Up /Up /Up /Up /Up /Up /Up /Up unused GND /Up /Up
2 /Down /Down /Down /Down /Down /Down /Down /Down /Down /Down /Down GND VCC (+5V) /Down /Down
3 /Left /Left /Left /Left /Left /Left /Left /Left /Left /Left 1Y (-, /Left) unused Audio.1 Out /Left /Left
4 /Right /Right /Right /Right /Right /Right /Right /Right /Right /Right 2Y (-, /Right) Button Audio.2 Out /Right /Right
5 /Button 3 Paddle B Button Right unused Button 3 (POTY) /Button 3 (POTX) Shift Load OUT /Button 3 VCC VCC (+5V) VCC (+5V) Up VCC (+5V) 0V /Button 3
6 /Button 1 /Button Button common /Button 1 /Button 1 /Button 1 /Fire, Clock OUT /Button 2 /Button 1 TL (/A) TL (/A, /B) Right P/S Out /Button 1 /Button 1
7 VCC (+5V) VCC (+5V) VCC (+5V) VCC (+5V) VCC (+5V) VCC (+5V) VCC (+5V) /Button 1 /Button 2 TH (unused) TH (Select OUT) Left CLK Out (125kHz) VCC (+5V) VCC (+5V)
8 GND GND GND GND GND GND GND GND (Row 9) (*5) Strobe OUT GND GND GND GND Joy1 GND (Strobe) GND
9 /Button 2 Paddle A Button Left /Button 2 Button 2 (POTX) /Button 2 (POTY) Serial Data IN GND (Row 6) (*5) GND TR (/B) TR (/Start, /C) Down Serial Data In Joy2 GND (Strobe) /Button 2

(*1) The Atari 7800 buttons require special wiring (Atari FAQ)

(*2) Pin9 (RMB) of the first port is shared with Pin6 (Fire) of the second port to be able to use a mouse with two buttons (in the first port). On the second port Pin9 is not connected. That means only the first port supports two buttons, and only when the second port is not used at the same time. Atari STe and Atari Falcon have two DE-15 Extended Joystick Ports, which could with a passive adapter be connected to two DE-9 joysticks (see here). Atari Jaguar Controllers also have DE-15 connectors, but with different pinout which exposes a button matrix (see here).

(*3) For the second button/right mouse button the POT X line is used (and for 3rd button/middle mouse button POTY), which - different to the other lines - must be pulled to VCC via the button.

(*4) The CD32 supports "game pad mode" and uses pin 5 to switch to it (it is pulled to active high by the CD32). Actual CD32 controllers have active components. Regular "atari" joysticks will work at the CD32, but CD32 controllers will not work at eg a C-64 (see here and here)

(*5) The respective GND lines are pulled low to select the respective "row". Regular Joystick uses row 9.

(*6) The "SEGA" controllers can not be converted into "Atari" Joysticks simply by rewiring them. Unlike regular "Atari sticks" they contain pull-up resistors for each signal line (which might interfere with scanning the keyboard on C64) and some controllers may contain active circuits and will not work without the VCC. The Megadrive controllers use an active circuit. (see here or here). Megadrive Controllers can be used as "Atari" Joysticks with a simple adapter, see here.

(*7) Pinout refers to the "Interface Two" ("Sinclair" aka "+3")

(*8) 3DO controllers use a serial interface, similar to SNES controllers.

(*9) regular "Atari" Joysticks will work on the Sam Coupé. To connect two joysticks a special interface is needed, see here.

The Apple-II uses analog joysticks and can not use the common digital joystick with the pinout shown above, see here.

The Sega Saturn controllers use a different plug and also contain an active circuit (see here).

Like Sega Saturn controllers, the ColecoVision and IntelliVision II controllers work entirely different. (see eg here and here)

The Sinclair-QL has completely different controller ports. (The US and German versions of the QL later made by Samsung both had standard 9 pin serial and joystick ports, meaning that any Atari standard joystick could then be used.)

The Commodore C16/C116/Plus4 have two mini-DIN ports which are electrically compatible with standard DB9 ports, so they can be used with an adapter.

The Covox Sound Master is a rare PC Soundcard that has two Atari-compatible DB9 joystick ports.

2/3 Button modification

(thumbnail)
Schematic

Most traditional DB9 "Atari" Joysticks are wired for one button only, however some - such as the Competition Pro - have more than one button, so it is tempting to rewire them so the additional buttons can be used separately. This is supported by some classic Amiga and C64GS games (second button at the POTX line), and also supported by some Chameleon cores.

There have been two different ways to handle the additional buttons:

  • The classic C64GS two button joystick ("Cheetah Annihilator") uses the POTX line, which when the button is pressed is connected to VCC. For a third button, the same can be done with the POTY line. These two buttons can then be read from the paddle inputs: When the button is not pressed the POT line is floating, which equals a large resistance to VCC, and will read as $FF. When the button is pressed the POT line is connected to VCC, which equals no resistance to VCC, and will read as $00.
  • For use with the Amiga or the Chameleon docking station the above would not work, as their button inputs are low active (rather than "high active" as the POT lines are). So to be able to use the modified joystick with that, the respective lines must be pulled to GND rather than VCC.

Fortunately there is a switch contained in the Competition Pro Retro which is normally wired to disable the small switches. We can rewire this switch so we can toggle between pulling the POT lines to either GND for the docking station, or VCC for the C64. As a safety precaution, it is recommended to not connect the POT lines directly to VCC or GND, but to use a small resistor that acts as a current limiter in series. (Note that the classic joysticks usually do not have these)

After this modification, do NOT use the joystick on any other equipment than an Amiga, the chameleon docking station or a C-64 (or C64GS)! For this reason we recommend to somehow clearly mark it as modified (eg with a permanent marker).

Detailed instructions for modifying the Competition Pro Retro

  • First open the Joystick and find out if the required wires are available in the joystick cable (if not you will have to install a new one).
In the current (second and third) batch of the Competition Pro Retro this is the case and looks like this: (confirm this using a continuity tester / multimeter before proceeding, as it may change without notice)
Pin Signal Wire colour
9 POT X (second button) green
5 POT Y (third button) blue
7 VCC (+5V) grey
  • Pull out the small PCB that carries the switch, detach the small piece of plastic foam and desolder all wires from it.
  • Carefully pull out the mounting plate for the four directional micro switches
  • Disconnect the (green) wires that come from the small buttons from the micro switches at the normal fire buttons
  • Remove the (green) wires that come from the small buttons also from the small buttons
  • Connect the POTX (blue) and POTY (green) lines that come from the joystick cable to the small buttons where the (green) wires were
  • Get the switch PCB again, connect one end of the 270Ohm resistor to both of the two (orange) wires that come from the small buttons, and the other end of the resistor to the middle pin of the switch. (you may use a slightly larger resistor too, i used 330Ohm here because that was the closest i could find in my drawer :))
  • cut a small piece of electrical tape and wrap it around the resistor and the blank solder point to the cable
  • Connect the VCC line (grey) from the joystick cable to one side (eg left) and the leftover free (orange) cable (which is connected to GND) to the other (eg right) pin of the switch
  • Now check with a continuity tester that VCC at the switch has no shortcut with any other wires. Under no circumstances it should make contact to any other lines except the POT lines (when a button is pressed and the switch is in the respective position). Double check if you are not sure.
  • Attach the small piece of plastic foam to the back of the switch PCB, and reassemble the joystick in reverse order. Putting the back cover on can be a bit fiddly - very little force is needed - if it doesnt go back together easily, you may have to open the joystick again and relocate some cables slightly.

other modifications that provide extra buttons

  • 4 extra buttons, a schematic is available in the crystalct repo. It adds a 2nd and 3rd button as described above, additionally two buttons are provided by wiring "up and down" and "left and right" to extra buttons.
  • Protopad is compatibel to the above decribed modification, and adds 7 extra buttons in its "native" mode. This is implemented by using a custom protocol.
  • Joycart supports 3 Buttons with the C64

Test programs

C64

Games that support additional buttons

Many early home computers and game consoles came with the classic one button joystick, and supporting more than that was rare. The following list omits the later released systems where controllers with two or more buttons became standard. (like MSX, SEGA Mastersystem, etc)

C64

Only the C64GS had some games which officially supported a second joystick button, and since the C64GS came out very late in the C64's lifespan, it never became common

  • 1942 (crystalct version)
  • 5th gear (crystalct version) - Second fire to select weapon.
  • Alien 8 by Rod & Emu - 2nd button can be used for pick/drop in directional mode.
  • Aliens (crystalct version) - C64GS compatible, 2nd fire to use doors, 3rd fire to cycle charters
  • Antiriad (crystalct version) (C64GS compatible, 2nd fire to pause (when paused: 2nd fire: unpause, fire to quit)
  • Archon (crystalct version) - C64GS compatible, 2nd fire (in game): reset and back to menu
  • Archon 2 (crystalct version) - C64GS compatible, 2nd fire (in game): reset and back to menu, 3rd fire: reset to title screen
  • Army Moves (crystalct version)
  • Arnie 2 (crystalct version) - C64GS compatible, 2nd fire to change weapon
  • Battle Command (Ocean Cartridge) - 2nd button toggles between tank- and menu control, hold for menu bar
  • Barbarian (crystalct version) (C64GS compatible, Joystick#2: left/right to change game mode, fire to start game, 2nd fire to pause/unpause, 3rd fire to quit)
  • Blue Baron (crystalct version) (2nd Button for dropping Bombs)
  • Blue Max (crystalct version) (2nd Button for dropping Bombs)
  • BOFH:Servers under Siege (crystalct version) (2nd FIRE to select next weapon)
  • Boulder Dash (crystalct version) (C64GS compatible, 2nd fire to choose players and joystick)
  • Breakthrou (crystalct version) (2nd Button to jump)
  • Briley Witch Chronicles (Sarah Jane Avory) (2nd Button: "back")
  • Bruce Lee (crystalct version) (2nd Button for Pause)
  • Bubble Bobble (crystalct version) (2nd Button for Jump)
  • Cauldron (Hexenküche) (crystalct version) - Fire: Shot forward (directions uneeded), 2nd fire: shot down, 3rd fire: shot up
  • Chase HQ2 (C64GS Cartridge) - 2nd button enables turbo boost
  • Choplifter (rh70 version) - 2nd Button to turn around
  • Choplifter (crystalct version) - 2nd Button to turn around
  • Commando (crystalct version)
  • Double Dragon (crystalct version)
  • Drop Zone (crystalct version) (C64GS compatible, Second fire to launch bomb, Third fire to cloak)
  • Dynamite Dux (crystalct version) (Second fire to jump)
  • Entombed (crystalct version) (2nd fire to change action, 3rd fire + down to pause, 3rd fire + up to restart)
  • Exile (crystalct version) (Second fire to change icon set)
  • Exolon (crystalct version) (Second fire to launch missile)
  • Fighting Warrior (crystalct version) (2nd fire to pause, 3rd fire to reset game)
  • First Strike (crystalct version) (2nd fire to change weapon, 3rd fire + Up/Down to accelerate/decelerate)
  • Forgotten Worlds (crystalct version) (Fire + 2nd Fire: fire by rotating the rifle clockwise, Fire + 3rd Fire: fire by rotating the rifle counterclockwise)
  • Future Knight (crystalct version) (2nd fire: change object)
  • Gauntlet (crystalct version) (Second fire: magic button)
  • Giana Sisters 30th Anniversary Hack by The Seven-A-Three (WIP)
  • Giana Sisters (rh70 version) (2nd and 3rd button can be used as either "jump" or "smartbomb")
  • Green Beret (crystalct version) (2nd fire to use additional weapon)
  • Green Beret (TREX version)
  • Gryzor (crystalct version) (2nd fire to jump)
  • Hard 'n Heavy (crystalct version) (2nd fire to select action)
  • H.E.R.O. (rh70 version) - 2nd fire: Bombs
  • He-Man and the Masters of the Universe: The Ilearth Stone (crystalct version) (C64GS compatible, 2nd Fire to jump, Fire to start and to restart after game over)
  • International Karate (crystalct version) (Fire 2: enable/disable sound)
  • Ikari Warriors (crystalct version)
  • Kung Fu Master (rh70 version) (Kick on Button1, Punch on Button2, Space to swap)
  • Kung Fu Master (crystalct version) (Kick on Button1, Punch on Button2, Space to swap)
  • Last Ninja (rh70 version) - (2nd Fire: "using", 3rd Fire: "holding")
  • Last Ninja Remix (C64GS Cartridge) - The button used to start the game becomes the "fighting moves" button, the other button becomes the "weapon select" button. The selection can be changed at the beginning of each level by pressing the respective button to start it.
  • Le Mans 2003 (crystalct version) (2nd fire: brakes, 3rd fire: high gear)
  • Lester (rh70 version) - 2nd fire to jump
  • Livingstone, i presume (crystalct version) (C64GS compatible, 2nd fire to cycle objects to the right, 3rd fire to cycle objects to the left)
  • MASK III: Venom Strikes Back (crystalct version) - C64GS compatible, 2nd fire: change Object, 3rd fire: Pause
  • Metal Warrior Ultra (Protovision) - 2nd and 3rd button with custom function
  • MIG29 Soviet Fighter (crystalct version) - 2nd fire: change weapon, 3rd fire: back to the title screen
  • Midnight Resistance (crystalct version) - 2nd fire: Jump, 3rd fire: fire the weapon in the satchel
  • Moon Shadow (crystalct version) - 2nd fire to change weapon, 3rd fire to activate the selected object
  • Myth (C64GS Cartridge) - hold 2nd button to change weapon with left+right
  • Navy Seals (Ocean) - 2nd button restarts the game
  • Nemesis (crystalct version) - 2nd Fire: Activate extra, 3rd Fire: Pause
  • Ninja Spirit (crystalct version) - 2nd fire: change weapon
  • Operation Wolf (crystalct version) - Fire2 to launch grenade. To start using neos mouse on port#2, press fire1 on Joystick inserted into port#1.
  • Oy Up! (rh70+crystalct version) - 2nd button rotates counter clockwise
  • Pang (Ocean) - 2nd button pauses the game
  • Paradroid Redux - "Press 2nd button while title screen is shown to start game in two-button mode. Use second button to go into transfer mode, first button for everything else."
  • A pigs quest (by Frank Further) (2nd fire to jump)
  • Pillars (crystalct version) (2nd FIRE to rotate the gems upwards)
  • Pitfall (crystalct version) (C64GS compatible, 2nd fire to pause/unpause, 3rd fire to restart game)
  • Pitfall II (crystalct version) (C64GS compatible, 2nd fire to pause/unpause, 3rd fire to restart game)
  • Pitstop II (crystalct version) (2nd fire to speed up heavily, 3rd fire to brake)
  • Polar Bear in Space! (supports two extra, one for shield, the other for smart bombs)
  • Popeye (crystalct version) (C64GS compatible, 2nd fire on joystick#1 to restart)
  • Rambo: First Blood Part II (crystalct version) (2nd fire to choose weapon and to make action)
  • Rambo III: The Rescue (crystalct version) (2nd fire to use object, 3rd fire to pick up/swap object)
  • Rastan: The Rescue (crystalct version) (C64GS compatible, 2nd fire to long jump)
  • Renegade (crystalct version) (Fire: Jump, 2nd Fire: Attack Left, 3rd Fire: Attack Right)
  • Retilate64 CE (crystalct version)
  • Robocop 2 (C64GS Cartridge) - optionally use 2nd button for "jump"
  • Rocky & Co (Psytronik) - (2nd button to to swap character)
  • Scramble[2015] (crystalct version)
  • Slapfight (crystalct version)
  • SNK vs Capcom (by Gianluca "RetroGL" Alberico (2nd button: Kicks)
  • Space Firehawk (crystalct version) (2nd fire: Shield Attack)
  • Spacegun - 2nd button to change weapon
  • Space Talisman (crystalct version) (C64GS compatible, 2nd fire to change object, 3rd fire to pause game)
  • Spy Hunter (crystalct version) (C64GS compatible, 2nd fire: fire the rear weapon, 3rd fire: back to the title screen)
  • Super Mario Bros (Zeropaige version) - optionally use 2nd button for "jump"
  • Terminator 2 - Judgement Day (crystalct version)
  • Terra Cresta - Judgement Day (crystalct version) (second Fire: Transform)
  • Tetris Recoded (by RetroBytes) (2nd fire: rotate in opposite direction)
  • Thunder Blade (crystalct version) (2nd fire to accelerate, 3rd fire to decelerate)
  • Turbo Charge - 2nd button enables turbo boost
  • Turbo Girl (crystalct version) (2nd fire to jump.)
  • Turrican (crystalct version) (2nd fire to activate two energy lines, 3rd fire to throw granade)
  • Turrican II (crystalct version) (2nd fire to activate two energy lines.)
  • OYUP! (crystalct version) (2nd Fire to rotate counterclockwise)
  • Wonderboy (crystalct version) (2nd Fire: walk fast or long jump, by holding 2nd fire you will be able to throw the axe)
  • Wizball (crystalct version) (2nd fire to choose the extra that is flashing at the upper border of the screen.)
  • Zeppelin (crystalct version) (C64GS compatible, second Fire: start game)

Amiga

On the Amiga supporting two buttons became much more common (also due to the popular WHDLoad that allows patching games accordingly):

  • 1943 (WHDLoad)
  • ADoom
  • Agony (WHDLoad/original?)
  • Aladdin
  • Alien 3
  • Alien Breed 2
  • Alien Breed - Tower Assault
  • Apidya
  • Arabian Nights
  • Banshee
  • Battle Squadron (WHDLoad)
  • BC Kid
  • Black Viper
  • Brutal Sports Football
  • Bubba'n'Stick
  • Bubble and Squeak
  • Cool Spot
  • Dennis
  • Desert Strike (WHDLoad)
  • Dragonstone
  • Fifa International Soccer
  • Fightin' Spirit
  • Fire and Ice
  • Flashback
  • Football Glory
  • The Great Giana Sisters (jump only)
  • Hybris (WHDLoad)
  • Joe & Mac: Caveman Ninja
  • John Madden American Football
  • Leander
  • Lionheart
  • Lollypop
  • Mega Typhoon
  • Mercs
  • Mega Twins (WHDLoad)
  • Midnight Resistance (WHDLoad)
  • Mortal Kombat
  • Mortal Kombat 2
  • Mr Nuts
  • Nigel Mansell's World Championship
  • Pegasus (WHDLoad)
  • Powder
  • Project X
  • Puggsy
  • R-Type
  • R-Type 2
  • Rainbow Islands (WHDLoad)
  • Ruff'n'Tumble (WHDLoad)
  • Shadow Fighter (CD32)
  • Skeleton Krew
  • Snow Bros
  • Soccer Kid (?)
  • Street Fighter 2
  • Super Street Fighter 2
  • Tony & Friends In Kellogg's Land
  • Total Football
  • Turrican
  • Turrican II
  • Turrican 3
  • Virocop
  • Xtreme Racing
  • Yo! Joe!

Sample Code

; 2nd/3rd Joystick button sample code (C64)
;
; This code reads the joystick- and paddle input and puts them together into
; a virtual "register" like this:
;
; Bit 6: Fire #3 (POT Y)
; Bit 5: Fire #2 (POT X)
; Bit 4: Fire
; Bit 3: Right
; Bit 2: Left
; Bit 1: Down
; Bit 0: Up

joy1reg = $fe
joy2reg = $ff

readjoy:
        ;sei                 ; incase this is called in main loop, disallow IRQs

        ; First set up the analog switch to route Port 1 POTX/POTY lines to the SID
        lda #%11000000      ; bit7+6 output, regular joystick bits to input
        sta $dc02
        lda #%01000000      ; analog switch: select port 1
        sta $dc00

        ; To make sure we actually sampled a value from the right port, we must
        ; wait at least two sample periods, ie 2*512 cycles, before we can read
        ; the POT input
        jsr delay

        ; Get the regular joystick bits and set the upper bits to 1 (=inactive)
        lda $dc01
        ora #%11100000

        ; Check the MSB of the paddle input, if 0, then assume the extra button
        ; is pressed, and mask the respective bit in our "joystick register"
        bit $d419           ; pot x (fire 2)
        bmi +
        and #%11011111
+
        bit $d41a           ; pot y (fire 3)
        bmi +
        and #%10111111
+
        sta joy1reg

        ;--- port 2

        lda #%00000000      ; set regular joystick bits to input
        sta $dc03

        lda #%11000000      ; bit7+6 output
        sta $dc02
        lda #%10000000      ; analog switch: select port 2
        sta $dc00

        jsr delay

        lda $dc00
        ora #%11100000

        bit $d419           ; pot x (fire 2)
        bmi +
        and #%11011111
+
        bit $d41a           ; pot y (fire 3)
        bmi +
        and #%10111111
+
        sta joy2reg

        ;cli                 ; incase this is called in main loop, allow IRQ again
        rts

delay:
        ldx #0
-       dex
        bne -
        rts

Links

Personal tools
Namespaces

Variants
Actions
Navigation
Icomp
Print/export
Administration