Commit 26a160c7 authored by Neil Turton's avatar Neil Turton
Browse files

Version Spin_merge taken

parent 1c9cf366
......@@ -6,8 +6,8 @@
GBLS VString
GBLS Date
Version SETA 0022 ; 0021
VString SETS "0.22" ; "0.21"
Date SETS "07 Mar 1995" ; "07 Mar 1995"
Version SETA 0024 ; 0021
VString SETS "0.24" ; "0.21"
Date SETS "18 Jan 1996" ; "07 Mar 1995"
END
......@@ -28,6 +28,7 @@
;; for Kryten/Morris joystick interface board.
;; 0.10 12-May-94 WT Analogue support altered to support optional returning
;; of the full 16-bit value for analogue joysticks.
;; 0.20 2-Feb-95 JRH Changed addresses and bit patterns for Falcon
;;
;;-----------------------------------------------------------------------------
......@@ -36,6 +37,7 @@ Module_BaseAddr
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr:Machine.<Machine>
GET Hdr:ModHand
GET Hdr:MsgTrans
GET Hdr:NdrDebug
......@@ -56,11 +58,24 @@ hostvdu SETL false
; ----------------------------------------------------------------------------------------------------------------------
DigitalJoystickAddress * &0302B800 ; NetCS
; On Omega machines there is no digital joystick and hence no auto-detect support.
;
[ IOMD_C_JoystickDetectBits <> 0
DigitalJoystickAddress * &88c00004 ; hardwired to podule 0 EASI space
AnaDigiDetect * &0302B000 ; NetROM
AnaDigiDetect * &0320000c
DetectAnaDigiBit * 1 :SHL: 5
DetectHardwareBit * 1 :SHL: 6
AnalogueJoyFire * DigitalJoystickAddress
|
AnalogueJoyFire * &03220000
]
AnalogueIrqReg * &032000e0 ; Provisional MORRIS address
AnalogueStatusReg * &032000e4 ; " " "
AnalogueControlReg * &032000e8 ; " " "
......@@ -93,14 +108,18 @@ Chn3_Completed * 1 :SHL: 6
Chn4_Completed * 1 :SHL: 7
Any_Completed * 15 :SHL: 4
[ IOMD_C_JoystickDetectBits <> 0
DigitalUpBit * 1 :SHL: 0
DigitalDownBit * 1 :SHL: 1
DigitalLeftBit * 1 :SHL: 2
DigitalRightBit * 1 :SHL: 3
DigitalFireBit * 1 :SHL: 4
AnalogueJoy0Fire * 3 :SHL: 0
AnalogueJoy1Fire * 3 :SHL: 8
]
AnalogueJoy0Fire * &0f :SHL: 0
AnalogueJoy1Fire * &0f :SHL: 8
AnalogueAdvalFireA * 1 :SHL: 0
AnalogueAdvalFireB * 1 :SHL: 8
......
......@@ -58,12 +58,15 @@ Init
MOV r0,#0
STR r0,message_file_open
[ IOMD_C_JoystickDetectBits <> 0
; Test for existance & type of hardware. Read from the Type detection address
; If bit 3 is set, then digital. If bits 4-7 = 1000 then present
Debug mod,"Checking hardware"
; LDR r0, =AnaDigiDetect
; LDRB r1,[r0]
LDR r0, =AnaDigiDetect
LDRB r1, [r0] ; Read the port
[ False
MOV r0, #1<<5
ADR r1, magic_chan_one ;safe to use this temporarily
MOV r2, #4
......@@ -71,16 +74,25 @@ Init
SWI XPodule_ReadInfo
MOVVS r1, #0
LDRVC r1, magic_chan_one ;r1 contains the podule id byte in bits 0->7
]
Debug wt,"Read back from type detect:",r1
AND r0, r1, #&f0 ; Check for hardware first
CMP r0, #&10
TST r1, #DetectHardwareBit ; Check for hardware first
BNE NoHware
ANDS r1, r1, #AnalogueFlag ; Pick out the Ana/Digi flag
ANDS r1, r1, #DetectAnaDigiBit ; Pick out the Ana/Digi flag from hardware
MOVNE r1, #AnalogueFlag ; Set the (different) bit in misc_flags if analogue
; ORR r1, r1, #RstFlags ; Set the reset flags too
STRB r1, misc_flags ; And store it away, zeroing the rest of the misc flags too.
BLNE init_analogue ; And then go set it in action...
|
MOV r1, #AnalogueFlag
STRB r1, misc_flags
BL init_analogue
]
;Initialise any other flags
LDRB r1, misc_flags
ORR r1, r1, #FirstTimeFlag ; Set the first-time flag
......@@ -103,6 +115,8 @@ Init
Pull "pc" ; Hardware is there so initialise successfully.
[ IOMD_C_JoystickDetectBits <> 0
NoHware
Debug mod,"No hardware"
ADR r0,ErrorBlock_NoHardware
......@@ -116,6 +130,8 @@ ErrorBlock_NoHardware
DCB "NoHWare",0
ALIGN
]
; ---------------------------------------------------------------------------------------------------
; RMKill'ing the module
Die
......
......@@ -65,9 +65,13 @@ AreWeAnaOrDigi
TST r2, #CalibrateFlag
BNE %FT05
[ IOMD_C_JoystickDetectBits <> 0
TST r2, #AnalogueFlag ; Check the ana/digi flag
BEQ Joystick_ReadDigSWICode ; Bleugh. Digital sticks are no good for flight-sims!
]
Debug wt,"Analogue-read code"
TST r2, #FirstTimeFlag ; Check the first time flag if we're analogue
BEQ %FT20 ; Not first time, so don't set the ticky thing going
......@@ -146,6 +150,8 @@ Joystick_ReadAnaSWICode
MOV r1, r4, LSR #16 ; Put switch bits in R1, bottom byte
Pull "r2-r5,pc" ; End of story
[ IOMD_C_JoystickDetectBits <> 0
;----------------------------------------------------------------------------------------
Joystick_ReadDigSWICode
; In: r0 = Joystick number - can't get 16-bit values from digital
......@@ -179,6 +185,7 @@ Joystick_ReadDigSWICode
Pull "r1"
Pull "r2-r5,pc" ; All done, let's go
]
;----------------------------------------------------------------------------------------
StartTickyRoutine
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment