Casio PV-1000/Controller: Difference between revisions

From Obscure Wiki
Jump to navigationJump to search
(Created page with "The Casio PV-1000 Joystick is a 2-axis, 4-button joystick. Pictures are available here: https://commons.wikimedia.org/wiki/Category:Casio_PV-1000_accessories Reading its status is much like one how one reads the buttons on a Game Boy. == Input (port $FD write) == 7 bit 0 ---- ---- xxxx ABCD |||| |||+-- 1: include information about joysticks' "Attack" buttons ||+--- 1: include information about joysticks' up and left directions |+---- 1: in...")
 
(→‎Hardware: actual real-world timing data)
Line 31: Line 31:
The values written to port $FD appear on the pins of the ULA. The voltages are then current-limited by four 10kΩ resistors, where they go to the joystick ports, through diodes in the joystick, and if the relevant button is pressed, back to the joystick port to a 330pF capacitor and then back to the ULA.
The values written to port $FD appear on the pins of the ULA. The voltages are then current-limited by four 10kΩ resistors, where they go to the joystick ports, through diodes in the joystick, and if the relevant button is pressed, back to the joystick port to a 330pF capacitor and then back to the ULA.


This means that it takes approximately 12 T-states after the selection is written before a pressed button can be detected. Since a Z80 IN instruction takes 11-12 T states all by itself, this is not a timing constraint.
'''However''' if a button is '''not''' pressed, the 330pF capacitor is instead discharged by a 56kΩ resistor on the mainboard.


'''However''' if a button is '''not''' pressed, the 330pF capacitor is instead discharged by a 56kΩ resistor on the mainboard. This means it takes approximately 56 T-states after the selection is made before an '''unpressed''' button can be detected.
   ULA----10kΩ----jack----|>|----button----jack----+----+----10kΩ----ULA
   ULA----10kΩ----jack----|>|----button----jack----+----+----10kΩ----ULA
                                                 330pF 56kΩ
                                                 330pF 56kΩ
                                                   |    |
                                                   |    |
                                                 gnd  gnd
                                                 gnd  gnd
Experimental measurements have established that it takes 0-41 T states after a row is selected before a button press can be detected, and 126-147 T states after a row is cleared before a ''lack'' of button press can be detected.

Revision as of 20:30, 21 May 2023

The Casio PV-1000 Joystick is a 2-axis, 4-button joystick. Pictures are available here: https://commons.wikimedia.org/wiki/Category:Casio_PV-1000_accessories

Reading its status is much like one how one reads the buttons on a Game Boy.

Input (port $FD write)

7  bit  0
---- ----
xxxx ABCD
     ||||
     |||+-- 1: include information about joysticks' "Attack" buttons
     ||+--- 1: include information about joysticks' up and left directions
     |+---- 1: include information about joysticks' down and right directions
     +----- 1: include information about joysticks' start and select buttons

Output (port $FD read)

7  bit  0
---- ----
xxxx ABCD
     ||||
     |||+-- 1: if Player 1 "Attack", left, down, or select was pressed, depending on above
     ||+--- 1: if Player 1 "Attack", up, right, or start was pressed
     |+---- 1: if Player 2 "Attack", left, down, or select
     +----- 1: if Player 2 "Attack", up, right, or start

A 2-position-2-pole switch on the controller lets each player swap the two "Attack" buttons, so there is no consistent mapping of "button at tip of joystick" vs "button above start and select buttons" to which bit above.

Hardware

The values written to port $FD appear on the pins of the ULA. The voltages are then current-limited by four 10kΩ resistors, where they go to the joystick ports, through diodes in the joystick, and if the relevant button is pressed, back to the joystick port to a 330pF capacitor and then back to the ULA.

However if a button is not pressed, the 330pF capacitor is instead discharged by a 56kΩ resistor on the mainboard.

 ULA----10kΩ----jack----|>|----button----jack----+----+----10kΩ----ULA
                                               330pF 56kΩ
                                                 |    |
                                                gnd  gnd

Experimental measurements have established that it takes 0-41 T states after a row is selected before a button press can be detected, and 126-147 T states after a row is cleared before a lack of button press can be detected.