← Keyboard handling (1)
  Joysticks
Sat 2nd January 2021   
Many of the 80ies micro computers had dedicated connectors for joystick controllers, but unfortunately the Oric were not one of these.

As a result, joystick interfaces appeared on the market as accessories you could buy, but unfortunately they had all to be programmed differently, and as a result most games don't support any joystick interface, or only some very specific models.

Then, finally, the Oric Telestrat (formerly known as Stratos) appeared, with two joystick ports in standard (one on each side) and not compatible with anything else that existed before.

Oric Telestrat joystick connector
Oric Telestrat joystick connector

These days there are not many of these joystick interfaces around, but fortunately some new ones are now available.

Oriclopedia Video

This article is designed to accompany the Oriclopedia Video1 about Joysticks, you can use it as a reference document to get a bit more details later on :)


Ok, let's continue!

The Atari joystick port

Origins

The first use of the 9-pin D-sub connector as a way to connect game controllers appeared with the release of the Atari VCS2 2600 in 1977 where you could connect up to two Atari CX40 joysticks.

Atari VCS 2600 and CX40 joystick
Atari VCS 2600 and CX40 joystick

And soon after that, you could find this connector used on pretty much every single 8bit computer released on the market, but with small changes here and there to support additional features3.

Pinout

Often called "DB-9"4, this DE-9 connector is implemented differently on different machines, sometimes supporting more than one action button, some support analog type devices (like Paddles, graphic tablets or mice), so beware of the pinout5.

DE-9 connector joystick pinout
DE-9 connector joystick pinout

On this pinout picture, the pins in black are the ones available on (most of) the Oric interfaces, with simply the four directions and one single trigger button. The grayed out pins are typically used by Atari XL peripherals and are unfortunately not available to us :(

Types of interfaces

We can characterize the interfaces using multiple criteria, such as the number of joysticks you can connect, which port they are connected to on the Oric, how wildly supported they are by existing games, or even things like if they corrupt the sound or not when used.

Here is a small table that summarize these information.


Port Printer Port Expansion Port
Familly IJK PASE OPEL Dk'tronics Protek Downsnway
Models IJK Egoist Stingy PASE Altai Mageco
Inputs 2 1 1 2 ? ? ? ? ? ?
Programmable NO NOYES YES YES YES
Corrupts
Sound
NO YES NO NO NO NO
Game
support
Limited Common Rare Rare Universal
Disk
Compatible
YES YES YES NO ? ?

The first important criteria is the computer interface, so let's start by that one.

Where it connects

The two main connectors on the Oric are the IDC 34 expansion port, and the IDC 20 printer port.
Oric Connectors
Oric Connectors

Expansion Port

When connected to the expansion port, interfaces can basically act like if they were part of the Oric itself: They can expose registers in page 3, but they can also spy on other system components and act accordingly.

Some of these interfaces connecting to the Expansion port are basically simulating key presses: Through the expansion bus connection they are able to detect when the VIA is setup to poll the status of the keyboard, and all these interfaces do is to generate the proper signals to indicate that the player presses specific keys depending of the joystick inputs.

The nice thing about this system, is that any of the interfaces will work with any game you have: They really are universal interfaces.

Some other are adding registers that can be used to directly read the status of the joypads.

There are a few drawbacks:
  • Anything plugged on the expansion bus requires the machine to be switched off, otherwise you risk to damage the machine (or the interface itself)
  • Most of these expansions can't be used with a floppy disk drive
  • Most of the programmable models requires to be reprogramed each time you power-on the system or change game

Printer Port

The Oric printer port is bidirectional, so it can be used to send data to a printer, but can also be used to read data such as the status of joystick contacts.

Most of the Oric peripherals are designed to be connected on the Expansion port, the only useful device using the printer port is the 8bit hub, which comes with its own joystick port, so that's not actually a problem.

In term of usability, printer port based joystick interfaces are the way to go.

Gravis Destroyer Gamepad
Gravis Destroyer Gamepad

How many controllers

The number of joystick ports is not really critical due to the very limited number of games on the Oric that allow two players to play at the same time.

Some people have discussed the possibility to use the two joystick connectors together to allow the connection of a 10 button controller, allowing for a directional pad, four action buttons, and two triggers.

There is actually one existing game that would benefit from such a system: Le Secret du Tombeau / Axacatl, which currently require two hands (or more) to play!

Just look at the list of keys you need to play this game!
Axayacatl controls
Axayacatl controls

Now imagine that instead of having S and K used to stop the moment and shoot, instead the direction worked immediately as long as you press them, that would leave us with two buttons to handle open, close, take, inventory and jump.

This could be solved using context sensitive options such as:
  • 'Open' and 'Close' only need to use one button that opens if it's closed and close it if it's open
  • 'Jump' can only be used when moving, so if you are currently moving in a direction, then it's a jump, else it's one of the inventory options
  • The 'Take' button, could just show the inventory if there is nothing to take
and like that, the game is now perfectly playable on a 10 inputs controller, using the two joystick ports at the same time!

Game support

Having a joystick interface is nice.

Having games that actually use it, is definitely better.

If you have any of the programmable interfaces, it will work with all the games that support keyboard controls!

If you own an OPEL or Dk'Tronics interface, it will probably stay on your shelf6.

Most games support the PASE joystick interface, which unfortunately is one causing the most headaches for the programmers since using a PASE interface will lead to some serious sound corruption.

Fortunately, all the recent interfaces are IJK compatible, and many of the best games have been patched to run on IJK interfaces!

Sound corruption

It is impossible to mention PASE interfaces without talking about the sound issues7.

Because this interface keeps the joystick connector active at all time, using the joystick actually connect pins on the VIA that should not have been connected, and as a result, any attempt at sending data to the sound chip ends up having some bits toggled that should not have been, so depending of what was happening, it may result in high pitched sound, distortion, lower volume, or really anything you can imagine.

Gallery

Here is a quick reference guide of the various extensions you can find, it is not exhaustive, so if you find some models that are not mentioned here, please send me some photos and a description so I can update it.

PASE

Already presented, the PASE interface, with two joystick ports, and it's infamous ability in corrupting accesses to the soundchip.

PASE joystick interface
PASE joystick interface

Altai (PASE)

One of the PASE clones, that one looks like a set of cables but it's essentially the same hardware inside, which means it corrupts the sound.

Altai joystick interface
Altai joystick interface

IJK

The main difference between the IJK and PASE interfaces is that the IJK does not impact the sound at all: The IJK interface is only active during the brief time required to read the status of the various buttons, and when this is done, the connections are physically disconnected using transistor arrays, so any other code that need to access the VIA expansion ports will not get impacted.

IJK joystick interface
IJK joystick interface

Stingy (IJK)

The Stingy interface from Kenneth is quite smart, it's basically just a bunch of diodes and two connectors, and that just works as a normal IJK interface, except this system does not allow differentiating between two joysticks, so it only has one connector that gets detected as two joysticks doing exactly the same thing.

IJK Stingy joystick interface
IJK Stingy joystick interface

Egoist (IJK)

ISS's egoist interface is somewhat in-between the original IJK interface and the Stingy one.

It only has one connector, but it technically works in the same way as the original IJK interface.

Among the cool features, it can be setup to be the left or right port, and it connects directly on the printer port so there are no additional visible cables on the machine, and it also exists in white or red variants to match your Oric 1 or Atmos machines.

Buyer beware: It is technically possible to programmatically differentiate the Egoists interface from the other IJK interfaces, which means that an auto-detection routine that will detect the default IJK interface will other properly detected the Stingy and Egoist cards, but an auto-detection routine tested only using the Egoist may not detect the other types of IJK compatible interfaces.

IJK Egoist joystick interface
IJK Egoist joystick interface


OPEL

A strange interface, with only one joystick connector, that connects to the printer port and looks like it was glued together and then painted with Hammerite(tm).

It comes with two tapes, containing a Joystick Driver you can load before loading other games, as well as a Slalom Ski game and a painting program.

The driver code is actually unnecessary and this interface can be easily programmed in a way similar to how you access a IJK or PASE interface.

O.P.E.L joystick interface
O.P.E.L joystick interface

Dk'tronics

An unusual model that connects to the expansion bus and adds two registers ($310 and $320) that can be read to return the status of the two joystick ports.
  • 1 = UP
  • 2 = DOWN
  • 4 = FIRE
  • 8 = LEFT
  • 16 = RIGHT
Dk'Tronics joystick interface
Dk'Tronics joystick interface

Protek

One of the many programmable interfaces that connect to the expansion bus.

To program it, the user need to activate the PROG switch on the interface, and for each of the keys they want to use then need to press the key, move the joystick (or fire button) they want to use, release the joystick, then release the key. When the same operation is done without a key being pressed, the mapping is removed from the interface.

After switching back to PLAY, the interface is ready to use with the new settings.

Protek joystick interface
Protek joystick interface

Downsway / Challenger 1

From what I see, this interface works more or less like the Protek, with a similar programming/playing mode.

Downsway joystick interface
Downsway joystick interface

Master Paddle

This "Master Paddle" AX100, from Audio-Fix Productions was made in France, but I do not have any details about how it works.

It obviously connects on the expansion bus, has two joystick connectors, but that's about it, if you have informations, please contact me and I will update the article!

Master Paddle joystick interface
Master Paddle joystick interface

ECSI Expansion Board

I did have that one back in the days: Instead of programming the card using gestures, you actually have a visual representation of the keyboard matrix and five jumper cables you can connect to whatever key you want to use.

This one is one of the rare models leaving the expansion port available and actually adding some additional ones!

ECSI expansion board
ECSI expansion board

The main issue with this board is that it was gigantic, and none of the connectors are protected, which made it extremely unpractical to use if you had a small work area, but this gave me the idea for the mod I did on my Atmos back in the days:

Matrix soldered joystick
Matrix soldered joystick

Basically I removed the useless TV modulator and made a small notch in the PCB where the joystick connector would fit (the hole in the case is large enough), and then just connected wires between the joystick socket and the four arrows and the space bar keys on the keyboard printed board.

Other interfaces

The following devices are not really "joystick interfaces", they are more like complex devices that provide many new features, including ports on which you can connect joysticks.

8bit hub

The 8bit hub is a small hardware add-on designed to interface with the 8bit unity software development system.

It connects on the printer port and provides wifi connectivity, as well as mouse and joystick support.

In the current version, the joysticks are only usable through the 8bit unity API, but PASE support has been announced8.

8bit hub
8bit hub


Twilighte card

The Twilighte card original idea was to add to the Oric 1 and Atmos all the things that were added to the Telestrat (native joystick ports, cartridge system with memory banks), and then add on top of that a Unix inspired system (Orix) to control it all.

In theory the Twilighte card is compatible with the Telestrat, so code that access the second VIA should work with the Twilighte card as well, but there is also a complex system able to run original Oric software and dynamically patch it to add joystick support.

Orix Twilighte card
Orix Twilighte card

Emulation

Speedlink Competition Pro USB
Speedlink Competition Pro USB
Obviously, most software these days is developed and played on emulators, either because people don't own the actual hardware anymore, or simply because it is much easier to do it that way.

You can even get the retro feeling using modern versions of the classical joysticks, such as the famous Competition Pro.

Euphoric

Euphoric cam emulate a joystick using the numeric keypad on the PC (2,4,6,8 for direction and 0 for shoot).

Select a type of joystick interface with the line Joystick=... Indicate IJK or PASE for the corresponding interfaces, or No if you don't want a joystick emulated.

If you want to emulate a joystick on the integrated left port of the Telestrat, remove the emulation of an IJK or PASE joystick and set the line JoystickPort=Yes in the INI file.

It does not seem possible to directly use a physical joystick with Euphoric, due to the DOS origins of the code base... that being said, there is still the possibility to use programs that send keyboard events to applications, such as "JoyToKey" or "Xpadder".

Oricutron

Oricutron has supported joystick interfaces for quite a while, but up to version 1.3 there were issues, such as the DOWN direction appearing to be stuck, but apparently all these issues have been fixed last time I checked.

To enable joysticks in Oricutron, you need to edit the oricutron.cfg file:

; Joystick interface for Atmos/Oric-1 mode. Telestrat has its own built-in standard.
; Options are 'none', 'altai', 'pase' or 'ijk'
joyinterface = ijk

; How to emulate joysticks attached to the above interface
; Options are 'none', 'kbjoy1', 'kbjoy2', 'sdljoyN' (where n is 0 to 9)
joystick_a = sdljoy0
joystick_b = sdljoy1

; How to emulate joysticks attached to the telestrat
; Options are 'none', 'kbjoy1', 'kbjoy2', 'sdljoyN', 'mouse'
telejoy_a = kbjoy1
telejoy_b = none

; Keys to emulate joystick, set 1
; NOTE: "fire2" is only available on telestrat
; NOTE: "fire3" is only available on telestrat (right port)
kbjoy1_up = 'KP8'
kbjoy1_down = 'KP2'
kbjoy1_left = 'KP4'
kbjoy1_right = 'KP6'
kbjoy1_fire1 = 'KP_ENTER'
kbjoy1_fire2 = 'KP_PLUS'
kbjoy1_fire3 = 'KP_MINUS'

; Keys to emulate joystick, set 2
kbjoy2_up = 'W'
kbjoy2_down = 'S'
kbjoy2_left = 'A'
kbjoy2_right = 'D'
kbjoy2_fire1 = 'SPACE'
kbjoy2_fire2 = 'N'
kbjoy2_fire3 = 'LALT'
Basically you setup 'joyinterface' to one of the supported models ('ijk' in this example), and then you define how 'joystick_a' and 'joystick_b' are actually controlled, either using keyboard emulation, or using the actual joypads on your PC - assuming they get detected by SDL.

OSDK support

The OSDK version 1.18 provides a reasonably usable api that can be used to handle Joysticks in your C and assembly code programs, including some sample code showing how to do it.

The API may vary over time, and possibly will support new interfaces if it sounds worthwhile, but out of the box you get native support for IJK, PASE, OPEL and Telestrat joysticks.


// Interface selection
enum
{
JOYSTICK_INTERFACE_NOTHING, // 0 - Default handler that does nothing
JOYSTICK_INTERFACE_IJK, // 1 - IJK / Egoist / Stingy interfaces
JOYSTICK_INTERFACE_PASE, // 2 - PASE / Altai interfaces
JOYSTICK_INTERFACE_TELESTRAT, // 3 - Telestrat / Twilighte
JOYSTICK_INTERFACE_OPEL, // 4 - OPEL interface
JOYSTICK_INTERFACE_DKTRONICS, // 5 - Dk'Tronics interface
_JOYSTICK_INTERFACE_COUNT_
};

enum // Bitmask
{
JOYSTICK_RIGHT = 1<<0, // 1
JOYSTICK_LEFT = 1<<1, // 2
JOYSTICK_FIRE = 1<<2, // 4
JOYSTICK_DOWN = 1<<3, // 8
JOYSTICK_UP = 1<<4 // 16
};

extern unsigned char OsdkJoystickType; // Defaults to JOYSTICK_INTERFACE_NOTHING
void joystick_type_select(); // Set OsdkJoystickType first, and then call select

extern unsigned char OsdkJoystick_0; // Left port status
extern unsigned char OsdkJoystick_1; // Right port status
void joystick_read(); // Should be called 50 times per second

The principle is quite simple:
  • Select the interface you wish to use
  • Call joystick_read() every 50th of a second (ideally in a IRQ handler)
  • Check the content of OsdkJoystick_0 and OsdkJoystick_1

OSDK Interface Test sample
OSDK Interface Test sample

You will find the complete project in the sample\c\joystick subfolder of the OSDK (also in the SVN depot).

And here is the pre-build binary in TAP format

Special thanks and links

This article (and the video) would not have been possible without the help of a few persons (Symoon, Steve, HigashiJun, ISS, Dom, Chema, Fabrice, Didier, Jede, Xeron, Silicebit, musepat, Wikipedia, ...), who either had information on their website or forum, helped me transferring some software, provided me with some hardware, answered some questions, or simply tested that my OSDK joystick code was working.

Thanks a lot!

You can read more about some of the various interfaces (user manuals, historical notes) on Steve Marshall's site.

Another interesting source of information (in Spanish but auto-translates well) is a discussion thread on the RetroWiki forum.

And we should not forget Dom's "Shoot Again" articles and website which started the work of adding joystick support to many Oric games.

If you are curious about the Twilighte card, it's all on the Orix website.

If you are interested in the 8bit-hub, it's all on the 8bit-unity website.



1. If you liked it, don't hesitate to subscribe to the channel, this way you will get informed when a new video is released (about once a month in average)
2. Video Computer System
3. All incompatible with each other
4. Personal computers originally used DB-25 (where B refers to shell size) connectors for their serial and parallel ports. When they began to use 9-pin connectors, they were often labeled as DB-9 instead of DE-9 connectors.
5. The Wikipedia page about the Atari joystick port is worth reading
6. That being said, I added native support in the OSDK for these
7. You can actually hear the problem if you look at the video above
8. I sure hope it can be changed into IJK support, or even better support both protocols
comments powered by Disqus

Coverity Scan Build Status