Overview

Paddle Control (code HPD-200)

The Paddle Control was only released in Japan. It consists of a knob which rotates within a fixed range (not freely as in a "spinner") and two buttons, connected in parallel to give a single software button.

Schematics

Paddle Control schematic by Enri

How it works

The button is connected identically to button 1 in a regular Control Pad.

The knob position is measured with 8 bits of accuracy, from 0 (fully anti-clockwise) to 255 (fully clockwise). Thus, 128 is the centre position.

This position is broken into two 4-bit "nibbles" and returned over the input lines normally used for the up, down, left and right directions. A clock crystal inside the controller toggles between which nibble is output, and it sets the TR (button 2) line accordingly: 0 for the low 4 bits, 1 for the high 4 bits. Here is a table of the bits output:

TR valuePaddle position bits
 76543210
1RightLeftDownUp    
0    RightLeftDownUp

Games can thus input from the controller port in the normal way, waiting for both nibbles to be returned, to determine the paddle position.

Sample code:

ReadPaddle:
-:  in     a,($dc)         ; Wait for TR input to be 0
    bit    5,a
    jr     nz,-
    and    $0f             ; Save RLDU bits in e
    ld     e,a
-:  in     a,($dc)         ; Wait for TR input to be 1
    bit    5,a
    jr     z,-
    rrca                   ; Get low 4 bits into 4 high bits
    rrca
    rrca
    rrca
    and    $f0
    or     e               ; Merge with e
    ret                    ; result in a (position 0..255)

Some games use a "weighted history" to smooth out any noise or abrupt changes; this is achieved by adding the latest "raw" position to the last smoothed position and dividing by two. This will however introduce a small control lag.

Detection

Because TR toggles between 0 and 1 constantly, with a 50% duty cycle, the paddle may be detected by sampling the value of TR a large number of times (eg. 256) and detecting a paddle if it is found to have a value of 1 approximately 50% of the time.

Sample code:

DetectJapanesePaddle:
    ld     bc,$0000        ; b = 0 for 256 loops; c = 0 for counting
-:  in     a,($dc)
    bit    5,a             ; Get TR input
    jr     nz,+            ; If 1, don't increment c
    inc    c
+:  djnz   -               ; repeat 256 times
    ld     a,c             ; inspect counter
    ; If the counter value is between $60 and $a0 (50% +/- 12.5% of 256)
    ; then set b=$ff else set b=0
    ld     b,$00
    sub    $60
    jr     c,_DetectionEnd
    cp     $40
    jr     nc,_DetectionEnd
    dec    b
_DetectionEnd:
    ld     a,b
    ret                    ; result in a ($ff if detected, 0 if not)

The non-Japanese paddle

Since the paddle was not released outside Japan, this is really a non-existent controller. However, some games have code to support a paddle on export systems. To complicate matters, they detect the system region and manage the paddle differently for export systems.

The differences

The "export paddle" would appear (based on examining code in Out Run 3D) to not have an internal clock to toggle which nibble is returned; instead, the TH line is configured as an output from the console and is used to select which nibble is read. The code must then include a delay to allow the paddle hardware to respond, and check that the TR value has changed. This operation seems to be similar to how the Sports Pad works.

The confusion

It has been reported that plugging a Japanese paddle into an Export system works. If so, this confuses matters since it would seem that it shouldn't except by chance 33% of the time. This issue has yet to be resolved. See this forum discussion for more information.




Return to top
0.068s