3] Game Controller Interface Connector Specification 4]--------------------------------------------------- The two 9 pin D with pins (male) type connectors at the right of the Amiga nearer the front are used to interface to four types of devices: 1. Mouse or trackball, 3 buttons max 2. Digital Joystick, 2 buttons max 3. Proportional (pot or proportional joystick), 2 buttons max 4. Light Pen, including pen-pressed-to-screen button The connector pin assignments will be discussed in sections organized by similar hardware and/or software operating requirements as shown in the previous list. Signal names will follow those used in the appendices of the hardware manual when possible. J11 is the right controller port connector (joy1dat, pot1dat). J12 is the left controller port connector (joy0dat, pot0dat). 4] NOTE: While most of the following hardware discussed is directly 4] accessable, hardware should be accessed through ROM kernal software. 4] This will keep future hardware changes transparent to the user. 3] Game Controller Interface to Mouse/Trackball Quadrature Inputs 4]---------------------------------------------------------------- A mouse or trackball is a device that translates planar motion into pulse trains. Quadrature techniques are employed to preserve the direction as well as magnitude of displacement. The registers joy0dat and joy1dat become counter registers, with y displacement in the high byte and x in the low byte. Movement causes the following action: up: y decrements down: y increments right: x increments left: x decrements To determine displacement, joyxdat is read twice with corresponding x and y values subtracted (careful, modulo 128 arithmetic). Note that if either count changes by more than 127, both distance and direction become ambiguous. There is a relationship between the sampling interval and the maximum speed (i.e. change in distance) that can be resolved as follows: Velocity < Distance(max) / SampleTime Velocity < SQRT(DeltaX**2 + DeltaY**2) / SampleTime For an Amiga with a 200 count per inch mouse sampling during each vertical blanking interval, the maximum velocity in either the X or Y direction becomes: Velocity < (128 Counts * 1 inch/200 Counts) / .017 sec = 38 in/sec which should be sufficient for most users. 4] NOTE: The Amiga software is designed to do mouse update cycles during 4] vertical blanking. The horizontal and vertical counters are always 4] valid and may be read at any time. 3] Connector Pin Usage for Mouse/Trackball Quadrature Inputs 4]----------------------------------------------------------- pin mnuemonic description hardware register/notes 1 V Vertical Pulses joy[0/1]dat<15:8> 2 H Horiontal Pulses joy[0/1]dat(7:0> 3 VQ Vertical Quadrature Pulses joy[0/1]dat<15:8> 4 HQ Horizontal Quadrature Pulses joy[0/1]dat<7:0> 5 UBUT* Unused Mouse Button See Proportional Inputs 6 LBUT* Left Mouse Button See Fire Button 7 +5V 125ma max, 200ma surge total both ports 8 Ground 9 RBUT* Right Mouse Button See Proportional Inputs 3] Game Port Interface to Digital Joysticks 4]-------------------------------------------------- A joystick is a device with 4 normally opened switches arranged 90 degrees apart. The joy[0/1]dat registers become encoded switch input ports as follows: forward: bit#9 xor bit#8 left: bit#9 back: bit#1 xor bit#0 right: bit#1 Data is encoded to facilitate the mouse/trackball operating mode. 4] NOTE: The right and left direction inputs are also designed to be 4] right and left buttons, respectively, for use with proportional 4] inputs. In this case, the forward and back inputs are not used, 4] while right and left become button inputs rather than joystick inputs. The joy[0/1]dat registers are always valid and may be read at any time. 3] Connector Pin Usage for Digital Joystick Inputs 4]-------------------------------------------------- pin mnuemonic description hardware register/notes 1 FORWARD* Forward Joystick Switch joy[0/1]dat<9 xor 8> 2 BACK* Back Joystick Switch joy[0/1]dat(1 xor 0> 3 LEFT* Left Joystick Switch joy[0/1]dat<9> 4 RIGHT* Right Joystick Switch joy[0/1]dat<1> 5 unused 6 FIRE* Left Mouse Button See Fire Button 7 +5V 125ma max, 200ma surge total both ports 8 Ground 9 unused 3] Game Port Interface to Fire Buttons 4]-------------------------------------------------- The fire buttons are normally opened switches routed to the 8520 adapter PRA0 as follows: PRA0 bit 7 = Fire* Left Controller Port PRA0 bit 6 = Fire* Right Controller Port Before reading this register, the corresponding bits of the data direction register must be cleared to define input mode: DDRA0<7:6> cleared as appropriate 4] NOTE: Do not disturb the settings of other bits in DDRA0 (Use of ROM 4] kernal calls is recommended). Fire button are always valid and may be read at any time. 3] Connector Pin Usage for Fire Button Inputs 4]-------------------------------------------------- pin mnuemonic description 1 -x- 2 -x- 3 -x- 4 -x- 5 -x- 6 FIRE* Left Mouse Button/Fire Button 7 -x- 8 -x- 9 -x- 3] Game Port Interface to Proportional Controllers 4]------------------------------------------------------- Resistive (potentiometer) element linear taper proportional controllers are supported up to 528k Ohms max (470k +/- 10% recommended). The joy[0/1]dat registers contain digital translation values for y in the high byte and x in the low byte. A higher count value indicates a higher external resistance. The Amiga performs an intergrating analog to digital conversion as follows: 1. Pot[0/1]dat registers are reset and the analog input capacitors are discharged for the first 7 (261 lines) or 8 (262 lines) horizontal lines. 2. Once per horizontal line, each analog input is compared to an internal reference. 3. Any counter whose analog input exceeds the reference stops incrementing. The counter is stopped for the duration of the veritcal frame. 4. Any counter whose analog input is less than the reference continues to increment. 4] NOTE: The POTY and POTX inputs are designated as Right Mouse Button and 4] Unused Mouse button respectively. An opened switch corresponds to 4] high resistance, a closed switch to a low resistance. The buttons 4] are also available in potgo and potinp registers. It is 4] recommended that ROM kernal call be used for future hardware 4] compatability. The pot[0/1]dat registers are typically read during video blanking, but MAY be available prior to that. 3] Connector Pin Usage for Proportional Inputs 4]-------------------------------------------------- pin mnuemonic description hardware register/notes 1 unused 2 unused 3 LBUT* Left Button See Digital Joystick 4 RBUT* Right Button See Digital Joystick 5 POTX X Analog In pot[0/1]dat<7:0>, potgo, potinp 6 unused 7 +5V 125ma max, 200 ma surge 8 Ground 9 POTY Y Analog In pot[0,1]dat<15:8>, potgo, potinp 3] Game Port Interface to Light Pen 4]-------------------------------------------------- A light pen is an optoelectronic device whose light sensitive portion is placed in proximity to a CRT. As the electron beam sweeps past the light pen, a trigger pulse is generated which can be enabled to latch the horizontal and vertical beam positions. There is no hardware bit to indicate this trigger, but this can be determined in the two ways shown in the Hardware Manual. Light pen position is usually read during blanking, but MAY be available prior to that. 3] Connector Pin Usage for Light Pen Inputs 4]-------------------------------------------------- pin mnuemonic description hardware register/notes 1 unused 2 unused 3 unused 4 unused 5 LPENPR* Light Pen Pressed See Propotional Inputs 6 LPENTG* Light Pen Trigger vposr, vhposr 7 +5V 125ma max, 200 ma surge both ports 8 Ground 9 unused 3] Game Controller Interface Connector Specification 4]-------------------------------------------------- The two 9 pin D with pins (male) type connectors at the right of the Amiga nearer the front are used to interface to four types of devices: 1. Mouse or trackball, 3 buttons max 2. Digital Joystick, 2 buttons max 3. Proportional (pot or proportional joystick), 2 buttons max 4. Light Pen, including pen-pressed-to-screen button The connector pin assignments will be discussed in sections organized by similar hardware and/or software operating requirements as shown in the previous list. Signal names will follow those used in the appendices of the hardware manual when possible. J11 is the right controller port connector (joy1dat, pot1dat). J12 is the left controller port connector (joy0dat, pot0dat). 4] NOTE: While most of the following hardware discussed is directly 4] accessable, hardware should be accessed through ROM kernal software. 4] This will keep future hardware changes transparent to the user. 3] Game Controller Interface to Mouse/Trackball Quadrature Inputs 4]---------------------------------------------------------------- A mouse or trackball is a device that translates planar motion into pulse trains. Quadrature techniques are employed to preserve the direction as well as magnitude of displacement. The registers joy0dat and joy1dat become counter registers, with y displacement in the high byte and x in the low byte. Movement causes the following action: up: y decrements down: y increments right: x increments left: x decrements To determine displacement, joyxdat is read twice with corresponding x and y values subtracted (careful, modulo 128 arithmetic). Note that if either count changes by more than 127, both distance and direction become ambiguous. There is a relationship between the sampling interval and the maximum speed (i.e. change in distance) that can be resolved as follows: Velocity < Distance(max) / SampleTime Velocity < SQRT(DeltaX**2 + DeltaY**2) / SampleTime For an Amiga with a 200 count per inch mouse sampling during each vertical blanking interval, the maximum velocity in either the X or Y direction becomes: Velocity < (128 Counts * 1 inch/200 Counts) / .017 sec = 38 in/sec which should be sufficient for most users. 4] NOTE: The Amiga software is designed to do mouse update cycles during 4] vertical blanking. The horizontal and vertical counters are always 4] valid and may be read at any time. 3] Connector Pin Usage for Mouse/Trackball Quadrature Inputs 4]----------------------------------------------------------- pin mnuemonic description hardware register/notes 1 V Vertical Pulses joy[0/1]dat<15:8> 2 H Horiontal Pulses joy[0/1]dat(7:0> 3 VQ Vertical Quadrature Pulses joy[0/1]dat<15:8> 4 HQ Horizontal Quadrature Pulses joy[0/1]dat<7:0> 5 UBUT* Unused Mouse Button See Proportional Inputs 6 LBUT* Left Mouse Button See Fire Button 7 +5V 125ma max, 200ma surge total both ports 8 Ground 9 RBUT* Right Mouse Button See Proportional Inputs 3] Game Port Interface to Digital Joysticks 4]-------------------------------------------------- A joystick is a device with 4 normally opened switches arranged 90 degrees apart. The joy[0/1]dat registers become encoded switch input ports as follows: forward: bit#9 xor bit#8 left: bit#9 back: bit#1 xor bit#0 right: bit#1 Data is encoded to facilitate the mouse/trackball operating mode. 4] NOTE: The right and left direction inputs are also designed to be 4] right and left buttons, respectively, for use with proportional 4] inputs. In this case, the forward and back inputs are not used, 4] while right and left become button inputs rather than joystick inputs. The joy[0/1]dat registers are always valid and may be read at any time. 3] Connector Pin Usage for Digital Joystick Inputs 4]-------------------------------------------------- pin mnuemonic description hardware register/notes 1 FORWARD* Forward Joystick Switch joy[0/1]dat<9 xor 8> 2 BACK* Back Joystick Switch joy[0/1]dat(1 xor 0> 3 LEFT* Left Joystick Switch joy[0/1]dat<9> 4 RIGHT* Right Joystick Switch joy[0/1]dat<1> 5 unused 6 FIRE* Left Mouse Button See Fire Button 7 +5V 125ma max, 200ma surge total both ports 8 Ground 9 unused 3] Game Port Interface to Fire Buttons 4]-------------------------------------------------- The fire buttons are normally opened switches routed to the 8520 adapter PRA0 as follows: PRA0 bit 7 = Fire* Left Controller Port PRA0 bit 6 = Fire* Right Controller Port Before reading this register, the corresponding bits of the data direction register must be cleared to define input mode: DDRA0<7:6> cleared as appropriate 4] NOTE: Do not disturb the settings of other bits in DDRA0 (Use of ROM 4] kernal calls is recommended). Fire button are always valid and may be read at any time. 3] Connector Pin Usage for Fire Button Inputs 4]-------------------------------------------------- pin mnuemonic description 1 -x- 2 -x- 3 -x- 4 -x- 5 -x- 6 FIRE* Left Mouse Button/Fire Button 7 -x- 8 -x- 9 -x- 3] Game Port Interface to Proportional Controllers 4]------------------------------------------------------- Resistive (potentiometer) element linear taper proportional controllers are supported up to 528k Ohms max (470k +/- 10% recommended). The joy[0/1]dat registers contain digital translation values for y in the high byte and x in the low byte. A higher count value indicates a higher external resistance. The Amiga performs an intergrating analog to digital conversion as follows: 1. Pot[0/1]dat registers are reset and the analog input capacitors are discharged for the first 7 (261 lines) or 8 (262 lines) horizontal lines. 2. Once per horizontal line, each analog input is compared to an internal reference. 3. Any counter whose analog input exceeds the reference stops incrementing. The counter is stopped for the duration of the veritcal frame. 4. Any counter whose analog input is less than the reference continues to increment. 4] NOTE: The POTY and POTX inputs are designated as Right Mouse Button and 4] Unused Mouse button respectively. An opened switch corresponds to 4] high resistance, a closed switch to a low resistance. The buttons 4] are also available in potgo and potinp registers. It is 4] recommended that ROM kernal call be used for future hardware 4] compatability. The pot[0/1]dat registers are typically read during video blanking, but MAY be available prior to that. 3] Connector Pin Usage for Proportional Inputs 4]-------------------------------------------------- pin mnuemonic description hardware register/notes 1 unused 2 unused 3 LBUT* Left Button See Digital Joystick 4 RBUT* Right Button See Digital Joystick 5 POTX X Analog In pot[0/1]dat<7:0>, potgo, potinp 6 unused 7 +5V 125ma max, 200 ma surge 8 Ground 9 POTY Y Analog In pot[0,1]dat<15:8>, potgo, potinp 3] Game Port Interface to Light Pen 4]-------------------------------------------------- A light pen is an optoelectronic device whose light sensitive portion is placed in proximity to a CRT. As the electron beam sweeps past the light pen, a trigger pulse is generated which can be enabled to latch the horizontal and vertical beam positions. There is no hardware bit to indicate this trigger, but this can be determined in the two ways shown in the Hardware Manual. Light pen position is usually read during blanking, but MAY be available prior to that. 3] Connector Pin Usage for Light Pen Inputs 4]-------------------------------------------------- pin mnuemonic description hardware register/notes 1 unused 2 unused 3 unused 4 unused 5 LPENPR* Light Pen Pressed See Propotional Inputs 6 LPENTG* Light Pen Trigger vposr, vhposr 7 +5V 125ma max, 200 ma surge both ports 8 Ground 9 unused