Detecting Joystick Interfaces

If you want to ask questions about how the machine works, peculiar details, the differences between models, here it is !
How to program the oric hardware (VIA, FDC, ...) is also welcome.
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Detecting Joystick Interfaces

Post by Twilighte »

Their have been a few Joystick interfaces over the years, but automatically detecting their presence has never been done and has been left to the user to decide what joystick interface is plugged in.
This is not a problem but it would be neat if the system could autodetect the following joystick interfaces.

How do we detect the PASE interface?

How do we detect the IJK Interface?
User avatar
Euphoric
Game master
Posts: 99
Joined: Mon Jan 09, 2006 11:33 am
Location: France

Post by Euphoric »

Better late than never ? :-)

I've found back the notes I wrote during last year's CEO meeting, when Hakan let me test his IJK interface....

The following information will allow you to detect an IJK interface:

Once 11000000 is written to DDRA, the two high bits of Port A select left and/or right joysticks whose state is read in the 5 low bits of Port A, whilst the 6th bit will allow to detect if the interface is present.

So, after writing $40 to ORA, you will then read
01 0 xxxxx in Port A (IRA), where xxxxx reflects left joystick status (11111 in idle position)

Similarly, after writing $80 to ORA, you will read
10 0 xxxxx, where xxxxx reflects right joystick status

And after writing $00 to ORA, you will read
00 0 xxxxx, where xxxxx reflects the combined status of the two joysticks, and is 11111 when both joysticks are in idle position

Now, the interesting thing is that if you write $C0 to ORA, you will read
11 1 11111, whatever action is selected on the joysticks, i.e the joysticks have no effect.

So, as you can see, you can detect the joystick interface without asking the user to move a joystick, you just have to read bit 5: it will be read as a 0 when you write at least a 0 in bits 6 and 7, and of course this does not happen when no joystick interface is connected...

Cheers,

Fabrice

PS: I have not had the chance to test a PASE interface...
User avatar
Symoon
Archivist
Posts: 2310
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Post by Symoon »

PS: I have not had the chance to test a PASE interface...
If you ever have time to have a look at it, I can lend you mine Fabrice...

Simon
mmu_man
Flight Lieutenant
Posts: 322
Joined: Thu Sep 21, 2006 7:45 pm
Location: 26000 Valence, FRANCE
Contact:

Post by mmu_man »

as long as it doesn't make the printer fill 10 pages...:)
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

Does anyone have documentation (driver code) for the following Joystick interfaces..

PASE interface (Not black ALTAI interface)
OPEL interface (I did have but i think SM has all of them now)
MCP interface
User avatar
waskol
Flight Lieutenant
Posts: 415
Joined: Wed Jun 13, 2007 8:20 pm
Location: FRANCE, Paris

Post by waskol »

for the PASE I have written something that works great (forgive everithing else found on the web) :
http://forum.defence-force.org/viewtopi ... 2&start=15

:wink:

It works perfect, at least on my real Atmos :
- BASIC
- C
- ANd some assembly code that is awaiting for you to adapt in order to make it not statically linked to a particular memory location.

Hope you will enjoy. :P
User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte »

I am guessing the easiest way to auto-detect joysticks is to perform the following realtime repeating test of the fire button..

Turn off IJK and detect PASE/ALTAI Left joystick fire
Turn off IJK and detect PASE/ALTAI Right joystick fire
Turn on IJK and detect Left joystick fire
Turn on IJK and detect Right joystick fire
Detect Telestrat Left Joystick fire on second VIA
Detect Telestrat Right Joystick fire on second VIA

Also this way we can detect the actual joystick, not just the interface :)
Post Reply