Hi,
I finally made three versions of the JS routine
With the first one, you had to choose, JS or Keybord. It means that when you want to jump over an obstacle you have to press L shift key, the JS being in neutral position... A bit tricky even if quite playable. So I made a second version.

The second version of this routine checks the joystick first, then:
1- the Lshift Key Or
2-all the keybord if no action was detected on the js...
(The call for the JS routine is set at the begining of the keyboard routine)
I had a strange behavior when pressing the LShift Key while actuating the js on the right... (The star fighter jumps, but also goes up to top of the screenplay) No problem with other JS positions.

In order to fix this problem, I built a third version.

For this third version, I choosed to check the keyboard first then, any key pressed or not, I checked the JS...
(The call of the JS routine is set at the end of the keybord routine)
Everything is ok, except the jump (L Shift) while Js actuated to the right... (The star fighter jumps, but , this time, goes down to the bottom of the screenplay:)

I can't understand this problem It will remain a mystery for me, except if one of you has any idea

Nevertheless, it is quite playable as it is, so, if you want to play Oricium using a Joystick, try the following "Do it by yourself" ... Normaly, it should work ...

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

0 – first of all, make a back-up of your Oricium Disc (it is better to copy Oricium files on a double side formated disc to get more space to work )

That’s all ! keep in mind that this patch will only work with PASE joystick interface. The routine only test the right socket of the interface. At least, the jump command of your star fighter is kept to the Keyboard (to the LEFT SHIFT key).
Beware, If you re-define commands keys, the JS will not work anymore…

A last advice : Copy your disc image on a SD card and enjoy ORICIUM with your CUMULUS , on a real Oric with a real Joy-stick!
It's just a Fantastic oric gaming expérience !

Note 1: Only 3 bytes are modified in the original Oricium Code.
Note 2: Do not forgot the fifth point (GRAB) this will (normaly) prevents the oric to spoil the oricium code (#500 - #9AD7) with the string "ORICIUM" from the SAVEO command at point 8 ( normaly stored just under the HIMEM value (#9800 before GRAB)

Note 3: Let us know about your succes or problems with this procedure.

Last edited by Dom on Fri Sep 05, 2014 12:29 pm, edited 2 times in total.

Hi all,
If you want to understand what I did, and perhaps give some help, just read the here under explanations of what I tried to do

COMMENTED LISTING OF THE THIRD VERSION OF THE JS ROUTINE AND GENERALITIES UPON PASE INTERFACE

In order to add the JS routine, the end of Oricium's Keybord routine is changed as follows:

The original:

3C5B DEX Next row of keyboard matrix3C5C BPL $3C01 If it was not the last row , go on, checking the row3C5E CLI If it was the last one, authorise interrupts3C5F RTS and go out keyborad routine

becomes:

3C5B JMP $9C00 jump to JS routine3C5E CLI no more executed (replaced at the end of JS routine)3C5F RTS no more executed

JS routine

The joystick is made of five switches. Two of them, the fire buttons, are mounted in parallel. These switches are connected to port A of the VIA, through the PASE interface and printer port. An additional command allows you to address distinctly the right or left JS.

Here under, the signification of each bits of VIA port A:

0 (Input) to the left
1 (Input) to the right
2 (input) unused
3 (Input) down
4 (Input) Up
5 (Input) fire buttons

6 (Output): to adress right JS
7 (Output): to adress left JS

To read the joysticks, you must first put the first six bits of port A as inputs and the last two, as outputs. This is donne by writing #C0 ( 1100 0000 )in DDRA register of the VIA ($303). Each bit of this DAta Direction Register is the image of the correponding bit on PORT A. One bit to 1 means corresponding line is in output mode, a bit to 0 means corresponding line is in input mode.

A last thing to know : If none of the Joystick switches is actuated, then the six inputs will be at logic state 1. It means that when a switch is actuated, the logic status of the corresponding input changes to 0. To know the status of the JS you just have to read the port A of VIA. (LDA$301)

My JS routine simulates the use of the following Keyboard keys: left, right, up and down arrows for movements and Space bar for shoots.
All these keys are situated on the row 4 of the Matrix Keyboard. That means that the oricium keyboard routine write a value corresponding to the key pressed in $3BCC ( $3BC8,X with X=4). The values to write for each keys are:

9C00 DEX Replaced by our JPM$9C00 at the end of the keyboard routine9C01 BPL $9C4E BPL$3C01 is not posssible from here so this BPL leads to a JMP$3C019C03 LDA $0301 save VIA PortA data register 9C06 PHA on stack9C07 LDA $0303 Save VIA DDRA register9C0A PHA on stack9C0B LDA #$C0 1100 0000 PA0 to PA5 as Inputs9C0D STA $0303 PA6 and PA7 as outputs9C10 LDA #$40 Bit6 = 1, adresses right JS (just change by #80 (bit 7 =1) to adress Left JS)9C12 STA $0301 9C15 LDA $0301 Read JS state9C18 TAY Save this state, temporarily in Y register9C19 AND #$20 test the JS shoot button. (bit 5 of port A)9C1B TAX X = 0 if shoot button pressed, #20 if not9C1C TYA State of JS in the Accumulator9C1D LSR Logical shifts the bits one position to the right9C1E AND #$0C Test bits 2 and 3 (in fact, 3 et 4 before logical shift)9C20 STA $9C28 Temporarily saved in order to be added9C23 TYA State of JS in the Accumulator9C24 AND #$03 Test bits 0 and 19C26 CLC prepare addition9C27 ADC #$0C adds results of tests b0b1 and b3b49C29 TAY result in Y as an index9C2A LDA $9C51,Y Get precomputed value in a table9C2D STA $9C61 Temporarily saved9C30 TXA Shoot button test result in A9C31 BNE $9C3B If no shoot, jump to $9C3B9C33 LDA #$01 If shoot, logical OR with #019C35 ORA $9C61 and the value corresponding to the JS position9C38 STA $9C61 Temporarily save the result9C3B LDA $9C61 We may be here from $9C319C3E ORA $3BCC in case the keybord might have been used before this checking of JS 9C41 STA $3BCC result in $3BCC, as the keyboard routine would have done9C44 PLA9C45 STA $0303 DDRA recovery9C48 PLA9C49 STA $0301 port A recovery9C4C CLI this CLI is the one that should have been excuted at the end of keybord routine9C4D RTS This RTS allows return from keybord AND JS scans9C4E JMP $3C01 The BPL in $9C01 leads here to go on checking the next row of the keyboard matrix

9C51: 0000000000882808 In this table, the values corresponding to a single keys pressed (JS position) 9C59: 00C0604000802000 but also calculated values by logical OR, corresponding simultaneus movments (2 or More keys pressed)9C61: 00

As I said in the the former post, I can't explain why jumping while the JS is actuated to the right, the star fighter goes down ???? Any one could Help?

About the strange behaviors you are experiencing, maybe it is due to the way I handle the keypresses (pressing left and right keys also jumps - which is a faster and, for me, more convenient way). I should check the code.

Also I need to test this (emulated, as I have no joystick) to see how the sound is affected.

Thanks Chema
I had noticed the jump when both left and right arrows are pressed.
Impossible to emulate with a JS alone
but...
When the JS is pushed on the left while the right arrow is pressed the behavior is as you said : Jump (only)
And... When the JS is pushed on the right while the left arrow is pressed... I get the same strange behavior than if it was the LShift key which were pressed

When I try to press together right key and left shift, the behavior is normal (just jump)
checking in Euphoric debugger shows that the $3BCC value in this case is $90 ( $80 OR $10)
$80 for the right arrow and $10 for the Left shift key.

Unfortunately, I am unable to check which value is in $3BCC when the JS is used because I do not know how to emulate the JS with Euphoric, So I only test the JS routine, on the real oric, which , as you know, has no debugger