P.A.S.E Joystick Interface

Made in Cheshire, before the Altai. It was grey, whilst the Asian Altai was black!
The similar Altai made this one of the most popular interfaces, though this one is seldom seen.

JOYSTICK INTERFACE FOR ORIC 1 PRINTER PORT ORIC'S VIA
The Oric 1 provides limited access to the 6522 Versatile Interface Adapter through the printer port but its use is not covered in the manual. Using BASIC programs to investigate what is in Oric's memory, it is relatively easy to find that the VIA(6522) is configured in the address block #0300-#03FF. It is equally easy to find that Oric already makes full use of the device. Any attempt to use the available A Port by POKING from BASIC is likely to result in a system crash, disabling part of the keyboard even if the original contents of the Data Direction Register are restored by POKING. It appears that the contents of the registers are changed, probably within the interrupt service routine which runs the WAIT clock and checks the keyboard. By stacking the contents of Port A and DDRA at the beginning and restoring at the end, the A Port can be accessed using machine code. Using bit 2 as input results in a clicking of the loudspeaker so this should be avoided. A particularly safe technique for using port A for input is to incorporate the machine code as a patch within the system interrupt routine. Because Port A is used to drive the sound generator, using the port for input will corrupt the sound when a switch is closed in the same way that it is when a keyboard key is pressed.
JOYSTICK INTERFACE.
The Double Joystick interface is configured to use Port A as follows: PAO - LEFT PA1 - RIGHT PA2 - not used PA3 - DOWN PA4 - UP PA5 - FIRE PA6 - SELECT LEFT STICK PA7 - SELECT RIGHT STICK SOFTWARE Two sample programs are presented in the forms of BASIC loading routine and disassembly. These are loaded into tne spare block of memory at #0400. They are transportable except for the JSR destination of the second program. Each program is used as a patch within the interrupt routine and updates bytes #0400 and #0401 with numbers which are dependent on the switch closures of the two joysticks. The patches are introduced by DOKE #0229, #0402 and the system should be restored to normal by DOKE #0229,#EC03 COPYRIGHT IAN DYSON (C) 1983 INTERFACE MARKETED BY P.A.S.E. Ltd., HYDE. CHESHIRE.

The first program is short and simply stores the contents of the port in the respective memory locations. That number must then be compared with expected values within the BASIC program e.g. IF (PEEK (#400) AND32)=0 THEN GOSUB???:REM FIRE IF (PEEK (#400) AND 1)=0 THEN GOSUB ???:REM LEFT IF (PEEK (#400) AND17)=0 THEN GOSUB ???:REM NORTHWEST The second program tidies up the stored byte by masking the bits which are not used as inputs and shifting bits 3, 4 and 5 to bits 2, 3 and 4. This simplifies the Basic interpretation e.g. IF PEEK(#400)AND 16 THEN GOSUB???REM FIRE ON(PEEK(#400)AND15)GOSUBA,B,C etc Just remember that some numbers won't be returned; you should direct to a return for those. The numbers returned by ANDing with 15 are:

..................UP
.............9...8...10
LEFT ...1...0...2... RIGHT
.............5...4...6
...............DOWN

The examples use #400 for the left hand JOYSTICK; use #401 for the right hand JOYSTICK. The rate of updating the memory contents using the interrupt routine is probably suitable for games written in BASIC but for fast games or machine code games the routines may be called as a subroutines by substituting a RTS for the JMP $EC03 (#60 instead of #4C). The line "DOKE#229,#402" must be omitted and a line "CALL#402" should be inserted prior to PEEKing #400 and #401. If a program appears to be acting twice on the same sampling of the port then using "DOKE#400,0" after each cycle of the program is an alternative. The machine code Ioader does not have to be part of each game program. It may be loaded and RUN first and patched into the interrupt routine by the statement "DOKE#229,#402" within the main program. Always restore the system by "DOKE#229,#EC03" before loading or saving. SAVE BEFORE RUN If, as is probable, you make a mistake in writing a machine code loading program and run it, the chances are very high that the computer will crash in such a way that it may only be reset by interrupting the power (your program is then lost). Always CSAVE every stage of writing a program before trying to RUN it; if it went wrong you can then CLOAD it and look for the mistake. This is good practice for any program which includes "POKE" or "DOKE".


Please let me go to the top

SIMPLE PROGRAM LOADER:

99 DATA#48
100 DATA#AD,#0l,#03,#48
105 DATA#AD, #03,#03,#48,#A9,#C0
110 DATA#8D,#03, #03,#A9,#80,#8D,#0F,#03,#AD,#0F,#03,#8D,#00,#04
115 DATA#A9,#40,#8D,#0F,#03,#AD,#01,#03
120 DATA#8D,#01,#04,#68,#8D,#03,#03
125 DATA#68,#8D,#0F,#03
130 DATA#68,#4C,#03,#EC
200 MEM=#0402
210 READDTA:POKE MEM,DTA
220 I FDTA<>#EC THEN MEM=MEM+1: GOTO 210
225 DOKE#0229,#402
230 PRINT PEEK(#0400) ,PEEK(#0401) : GOTO 230
Altai used essentially the same program as this. See that page for modifications for Use with the Atmos. Click here to go there

DISASSEMLY:

0402 48 PHA
0403 ADO103 LDA $0301
0406 48 PHA
0407 AD0303 LDA $0303
040A 48 PHA
040B A9CO LDA#$C0
040D 8D0303 STA#0303
Thanks to Stefan A. Haubenthal
For completing the code from 0423

0410 A98O LDA #$80
0412 8D0F03 STA $030F
0415 AD0F03 LDA $030F
0418 8D0004 STA $0400
041B A940 LDA #$40
041D 8D0F03 STA $030F
0420 AD0103 LDA $030l
0423 8D0104 STA $0401
0426 68 PLA
0427 8D0303 STA $0303
042A 68 PLA
042B 8D0F03 STA $030F
042E 68 PLA
042F 4C03EC JMP $EC03
SIMPLE TO USE PROGRAM LOADER:

100 DATA#48,#AD,1,3,#4D,#AD,3,3,#48,#A9,#C0,#8D,3,3,#A9,#80
110 DATA#8D,#F,3,#20,#32,#04,#AD,0,#04,#8D,1, 4 ,#A9,#40,#8D,#F, 3
120 DATA#20,#32.4,#68,#8D,3,3,#68,#8D,#F,3,#68,#4C, 3,#EC
130 DATA#A9,0,#8D,0,4,#AD,#F,3,#49,#3B,#0A,#0A,#0A,#2E,0,4,#0A
140 DATA#2E,0,4,#0A,#2E,0,4,#0A,#0A,#2E,0,4,#0A,#2E,0,4,#60
150 FORAD=#402TO#453:READDTA:POKEAD,DTA:NEXT
160 IFDTA<>#60THEN STOP
200 DOKE#229,#402
205 REM DOKE #EC03 TO RESTORE NORMAL INTERUPT ROUTINE
210 PRINT PEEK(#400) ,PEEK(#401)
220 GOTO 210

DISASSEMBLY:

0402 48 PHA
0403 AD0103 LDA $0301
0406 48 PHA
0407 AD0303 LDA $0303
040A 48 PHA
040B A9CO LDA #$CO
040D 8D0303 STA $0303
0410 A980 LDA #$80
0412 8D0F03 STA $030F
0415 203204 JSR $0432
0418 AD0004 LDA $0400
041B 8D0104 STA $0401
041E A940 LDA #$40
0420 8D0F03 STA $030F
0423 203204 JSR $0432
0426 68 PLA
0427 8D0303 STA $0303
042A 68 PLA
042B 8D0F03 STA $030F
042E 68 PLA

042F 4C03EC JMP $EC03
0432 A900 LDA #$00
0434 8D0004 STA $0400
0437 AD0F03 LDA $030F
043A 493B EOR #$3B
043C 0A ASL A
043D 0A ASL A
043E 0A ASL A
043F 2E0004 ROL $0400
0442 0A ASL A
0443 2E0004 ROL $0400
0446 0A ASL A
0447 2E0004 ROL $0400
044A 0A ASL A
044B 0A ASL A
044C 2E0004 ROL $0400
044F 0A ASL A
0450 2E0004 ROL $0400
0453 60 RTS


Altai Interface

IJK and MCP Interfaces

O.P.E.L Interface

Dk'tronics Interface

Protek programmable Interface

Downsway Programmable Interface

Joysticks & Rare Orics

 

back to main page


© Copyright 2000 by S.D.Marshall email me