Jump to content
IGNORED

Reading the Driving Controller


Recommended Posts

The fire button is same as for a joystick. According to the info I've found the rotation changes the lower 2 bits of the joystick input as repeating gray code, the upper 2 bits always read "11".

 

http://www.videogames.org/html/2600Stuff/DrivingControllers

The sequence occupies 90 Degrees of rotation so for a full revolution there's repeat 4 * 4 = 16 values.

So the values should step through as shown:

 

                          Rotating left             1100                          1101<--|                          1111   |                          1110   |                          1100----                          ...                          etc                          Rotating right            1100                          1110<--|                          1111   |                          1101   |                          1100----                          ...                          etc

Note I removed the reference to UDLR as shown on the linked page as it's wrong.

The way it works is similar to a mouse axis on ST or Amiga mouse except a mouse will return many more changes in value so need to be sampled more often to work well. With driving controller you could get away with 1 or 2 samples per frame. For the sampling, the best method would be to take the sample at VBlank and again halfway down the screen. Then do the processing during VBlank.

  • Like 2
Link to comment
Share on other sites

The fire button is same as for a joystick. According to the info I've found the rotation changes the lower 2 bits of the joystick input as repeating gray code, the upper 2 bits always read "11".

 

http://www.videogames.org/html/2600Stuff/DrivingControllers

The sequence occupies 90 Degrees of rotation so for a full revolution there's repeat 4 * 4 = 16 values.

So the values should step through as shown:

 

                          Rotating left             1100                          1101<--|                          1111   |                          1110   |                          1100----                          ...                          etc                          Rotating right            1100                          1110<--|                          1111   |                          1101   |                          1100----                          ...                          etc

Note I removed the reference to UDLR as shown on the linked page as it's wrong.

The way it works is similar to a mouse axis on ST or Amiga mouse except a mouse will return many more changes in value so need to be sampled more often to work well. With driving controller you could get away with 1 or 2 samples per frame. For the sampling, the best method would be to take the sample at VBlank and again halfway down the screen. Then do the processing during VBlank.

thanks Rybags, very helpful. Got it.

Link to comment
Share on other sites

Hello Eric

 

At the Fujiama 2014 I wrote a small BASIC program that reads the driving controller.

 

100 A=STICK(0)-11
110 B1=(A/2>1)
120 B0=(A-(2*B1)>1)
130 ? B0,B1
155 GOTO 100

 

It'll show you what happens when you turn the knob on the driving controller. Maybe it'll give you an idea for your own routine.

 

Sincerely

 

Mathy

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...