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 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". |
SIMPLE PROGRAM LOADER:
99 DATA#48 |
DISASSEMLY:
0402 48 PHA |
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 |
DISASSEMBLY:
0402 48 PHA |
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 |
Downsway Programmable Interface
© Copyright 2000 by S.D.Marshall email me