Commit 0ecf2666 authored by Kevin Bracey's avatar Kevin Bracey
Browse files

32-bit compatible.

FN key change broke hexadecimal keypad entry - now fixed.

Version 0.71. Tagged as 'IntKey-0_71'
parent ecfacf61
......@@ -36,7 +36,7 @@ In: R0->handler
R7=PendingAltType
R12->fixed workspace (allocated by kernel) - approx 170 bytes, not aligned
Out: All registers preserved, except R5 and R7 can be updated.
Out: All registers preserved, except R5 and R7 can be updated, R8 corrupted.
This is called once on initialisation of the keyboard driver.
......@@ -109,6 +109,7 @@ Out: R0-R4 preserved
R5 updated
R6->output (first byte=length, subsequent bytes to insert into buffer)
R7 updated
R8 corrupted
Alternative exits can be taken by branching to:
......@@ -131,5 +132,11 @@ In: R0->handler
R7=PendingAltType
R12->fixed workspace (allocated by kernel) - approx 170 bytes, not aligned
Out: R0-R4 preserved
R5 updated
R6->output (first byte=length, subsequent bytes to insert into buffer)
R7 updated
R8 corrupted
This code is called if a simple key is pressed while the PendingAlt bit is set, instead
of the character in the simple table being generated.
......@@ -54,6 +54,8 @@
; LatinAm, Russia, Switzerland and Turkey; and Ctrl-Alt-F1/F2 use a callback.
; Also fixed Japan delete key to be special.
; 26-Aug-99 Software support for "FN" key.
; 28-Apr-00 FN key broke hexadecimal keypad entry - now fixed.
; 32-bit compatible.
;
GBLL PCDel ; option to have Delete key return &8B (Copy) instead
......@@ -372,19 +374,19 @@ KeyUTFReturn # 13 ; length byte (up to 12), 6 * (NUL, value)
KeyUTFReturnEnd # 0
; Handy macro to do the FN processing. Good for any non-modifier key.
; Corrupts R2 - this relies not only EVERY non-modifier handler not
; using R2, as if we end up calling a different handler, R2 will
; be corrupted.
; Corrupts R8 - always corruptible, and undefined on entry.
GBLA HandleFNsize
GBLA HandleFNsize
MACRO
HandleFN
01 LDRB R2, FNDown ; is FN down?
TEQ R2, #0 ; if not, process as normal
Push "R14", NE
BLNE FindFN
Pull "R14", NE
01 LDRB R8, FNDown ; is FN down?
TEQ R8, #0 ; if not, process as normal
BEQ %FT02
Push "R14"
BL FindFN
Pull "R14"
02
HandleFNsize SETA . - %BT01
MEND
......@@ -401,6 +403,14 @@ Module_BaseAddr
DCD A1Key_Title -Module_BaseAddr
DCD A1Key_HelpStr -Module_BaseAddr
DCD A1Key_HC_Table-Module_BaseAddr
[ :LNOT:No32bitCode
DCD 0
DCD 0
DCD 0
DCD 0
DCD 0
DCD A1Key_Flags -Module_BaseAddr
]
A1Key_Title
= "InternationalKeyboard", 0
......@@ -416,6 +426,11 @@ A1Key_HelpStr
= 0
ALIGN
[ :LNOT:No32bitCode
A1Key_Flags
DCD 1 ; 32-bit compatible
]
; **************************************************************************
A1Key_HC_Table * Module_BaseAddr
......@@ -503,7 +518,7 @@ A1Key_Service ROUT
TEQ r1, #Service_Reset
TEQNE r1, #Service_KeyHandler
TEQNE r1, #Service_International
MOVNES pc, lr
MOVNE pc, lr
[ Ursula
Service2
]
......@@ -517,14 +532,14 @@ Service2
TEQNE r2, #Inter_Keyboard ; or (the only other option) Service_International
; with reason code NewKeyboard
BLEQ SetUpKeyStructureAndHandlerIfUs ; then call routine
EXITS
EXIT
; it's Service_KeyHandler, so claim service if kbid recognised
10
BL SetUpKeyStructureAndHandlerIfUs ; call setup routine
STR r1, [sp] ; r1 on exit = 0 if it was us, else preserved
EXITS
EXIT
; **************************************************************************
;
......@@ -540,9 +555,8 @@ Service2
SetUpKeyStructureAndHandlerIfUs Entry "r0,r1"
MOV r0, lr
ORR r1, r0, #SVC_mode ; switch into SVC mode so we can issue SWIs
TEQP r1, #0
SavePSR r0
SETPSR SVC_mode, r1 ; switch into SVC mode so we can issue
NOP
Push "r0-r4,lr"
......@@ -582,8 +596,7 @@ SetUpKeyStructureAndHandlerIfUs Entry "r0,r1"
BNE %BT05 ; else try next
ADD R0, R0, R3 ; point to found table or default
TEQP pc, #SVC_mode + I_bit ; disable IRQs round this bit
NOP ; needed to get objasm to assemble cleanly
WritePSRc SVC_mode + I_bit, r2 ; disable IRQs round this bit
MOV r2, #KVSize-4
SUB r1, r0, r12 ; offset from workspace to structure
......@@ -617,11 +630,11 @@ SetUpKeyStructureAndHandlerIfUs Entry "r0,r1"
]
Pull "r0-r4,lr"
TEQP r0, #0 ; return to original mode and IRQ state
RestPSR r0 ; return to original mode and IRQ state
MOV r0, #0
STR r0, [sp, #4] ; set stacked r1 to 0, so we claim the service
EXITS
EXIT
; the keyboard id is not recognised by us, so put back old handler if it's
; set to us at the moment
......@@ -634,9 +647,9 @@ SetUpKeyStructureAndHandlerIfUs Entry "r0,r1"
SWIEQ XOS_InstallKeyHandler
Pull "r0-r4,lr"
TEQP r0, #0 ; return to original mode and IRQ state
RestPSR r0 ; return to original mode and IRQ state
NOP
EXITS
EXIT
; **************************************************************************
......@@ -649,9 +662,8 @@ SetUpKeyStructureAndHandlerIfUs Entry "r0,r1"
GetAlphabetTable ROUT
Entry "r0,r1,r12"
MOV r12, r0
MOV r0, lr ; switch into SVC mode so we can issue SWIs
ORR r1, r0, #SVC_mode
TEQP r1, #0
SavePSR r0
SETPSR SVC_mode, r1 ; switch into SVC mode so we can issue SWIs
NOP
Push "r0-r2,lr"
......@@ -664,9 +676,9 @@ GetAlphabetTable ROUT
LDR r4, AlphabetTable
20
Pull "r0-r2,lr"
TEQP r0, #0 ; return to original mode and IRQ state
RestPSR r0 ; return to original mode and IRQ state
NOP
EXITS
EXIT
50 MOV r3, r1
STR r3, CurrentAlphabet
......@@ -860,6 +872,7 @@ IDDTable
& 1222, Country_Wales
& 1, Country_USA
& 2222, Country_Wales2
; & 55, Country_Brazil
& 9944, Country_DvorakUK
& 991, Country_DvorakUSA
......@@ -1274,42 +1287,42 @@ DeadKey
MOV PC, R14
; Silly entry conditions here. Can return normally,
; preserving flags to carry on as normal, can pull PC from the stack
; to carry on as normal, can pull PC from the stack
; to ignore the keypress altogether, or can call a new handler
; in the special table.
;
; Note that as in the HandleFN macro we're merrily scrambling R2.
; Note that as in the HandleFN macro we're merrily scrambling R8.
;
FindFN ROUT
LDR R2, [R0, #KVFNTable] ; if no FN table at all
TEQ R2, #0
MOVEQS PC,R14
LDR R8, [R0, #KVFNTable] ; if no FN table at all
TEQ R8, #0
MOVEQ PC,R14
Push "R1,R3"
ADD R3, R0, R2
LDRB R2, [R3], #1 ; R2 = number of FN entries
TEQ R2, #0
ADD R3, R0, R8
LDRB R8, [R3], #1 ; R2 = number of FN entries
TEQ R8, #0
BEQ NoFN
FNLoop LDRB R1, [R3], #2 ; R1 = base FN key, advance R3 to next entry
CMP R1, R4
LDREQB R4, [R3, #-1] ; if R1 = this key, change R4 to new key
BEQ FNContinue
BHI NoFN ; if R1 > this key, its not there
SUBS R2, R2, #1
SUBS R8, R8, #1
BNE FNLoop
NoFN
Pull "R1,R3,PC" ; no FN entry - output nothing
FNContinue
; Need to call the correct handler...
LDR R2, [R0, #KVSpecialCodeTable]
ADD R2, R2, R0 ; R2 -> special code table
SUB R1, R2, #4 ; 0th entry is for 1st special
LDR R8, [R0, #KVSpecialCodeTable]
ADD R8, R8, R0 ; R2 -> special code table
SUB R1, R8, #4 ; 0th entry is for 1st special
LDR R1, [R1, R4, LSL #2] ; R1 = offset to code
ADD R2, R1, R2 ; R2 = address of code
ADD R2, R2, #HandleFNsize ; Skip past the FN handling code :)
ADD R8, R1, R8 ; R2 = address of code
ADD R8, R8, #HandleFNsize ; Skip past the FN handling code :)
Pull "R1,R3,LR"
MOV PC, R2
MOV PC, R8
; **************************************************************************
;
......@@ -1357,10 +1370,8 @@ HandleKConfiguredKeyboard ROUT
HandleKDefaultKeyboard
MOV R1, #&81 ; select UK keyboard
SelectKeyboard
MOV R3, PC
AND R3, R3, #3
EOR R3, R3, #SVC_mode
TEQP R3, PC ; select SVC mode
SavePSR R3
SETPSR SVC_mode, R0 ; select SVC mode
NOP ; wait for it to happen
Push R14
......@@ -1368,7 +1379,7 @@ SelectKeyboard
SWI XOS_AddCallBack ; R1 already set up
Pull R14
TEQP R3, PC ; reenter previous mode
RestPSR R3 ; reenter previous mode
NOP ; wait for it to happen
ReturnNowt
ADR R6, NowtReturn ; return nowt
......
;
; This file is automatically maintained by srccommit, do not edit manually.
;
GBLS Module_MajorVersion
GBLA Module_Version
GBLS Module_MinorVersion
GBLS Module_Date
GBLS Module_FullVersion
Module_MajorVersion SETS "0.70"
Module_Version SETA 70
Module_MinorVersion SETS ""
Module_Date SETS "12 Oct 1999"
Module_FullVersion SETS "0.70"
GBLS Module_MajorVersion
GBLA Module_Version
GBLS Module_MinorVersion
GBLS Module_Date
GBLS Module_FullVersion
Module_MajorVersion SETS "0.71"
Module_Version SETA 71
Module_MinorVersion SETS ""
Module_Date SETS "28 Apr 2000"
Module_FullVersion SETS "0.71"
END
/* (0.70)
/* (0.71)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.70
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 12 Oct 1999
#define Module_MajorVersion_CMHG 0.71
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 28 Apr 2000
#define Module_MajorVersion "0.70"
#define Module_Version 70
#define Module_MinorVersion ""
#define Module_Date "12 Oct 1999"
#define Module_MajorVersion "0.71"
#define Module_Version 71
#define Module_MinorVersion ""
#define Module_Date "28 Apr 2000"
#define Module_FullVersion "0.70"
#define Module_FullVersion "0.71"
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