mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-01-23 16:31:50 +00:00
Merge pull request #230 from jgharston/main
Merged in $60+n ABD keycodes
This commit is contained in:
commit
758f010645
@ -36,6 +36,7 @@
|
|||||||
* 12-Dec-2022 Test code to write *KEY data to mainmem.
|
* 12-Dec-2022 Test code to write *KEY data to mainmem.
|
||||||
* 24-Dec-2022 Minor bit of tidying.
|
* 24-Dec-2022 Minor bit of tidying.
|
||||||
* 26-Dec-2022 Integrated ADB extended keyboard keys.
|
* 26-Dec-2022 Integrated ADB extended keyboard keys.
|
||||||
|
* 27-Dec-2022 Bobbi's keyboard uses $60+n extended keys.
|
||||||
|
|
||||||
|
|
||||||
* Hardware locations
|
* Hardware locations
|
||||||
@ -120,7 +121,7 @@ KBDINIT LDX #DEFBYTEEND-DEFBYTE-1
|
|||||||
LDA #$80 ; Keypad keys are function keys
|
LDA #$80 ; Keypad keys are function keys
|
||||||
STA FXKEYPADBASE
|
STA FXKEYPADBASE
|
||||||
JSR SOFTKEYCHK ; Clear soft keys
|
JSR SOFTKEYCHK ; Clear soft keys
|
||||||
LDX #$C3 ; Default KBD=Native, MODE=3
|
LDX #$83 ; Default KBD=Native, MODE=3
|
||||||
STX FX254VAR ; b7-b4=default KBD map, b3-b0=default MODE
|
STX FX254VAR ; b7-b4=default KBD map, b3-b0=default MODE
|
||||||
BIT SETV ; Set V
|
BIT SETV ; Set V
|
||||||
JSR KBDTEST ; Test if key being pressed
|
JSR KBDTEST ; Test if key being pressed
|
||||||
@ -501,7 +502,8 @@ KEYREAD2 JSR KBDREAD ; Fetch character from KBD "buffer"
|
|||||||
BPL KEYREADOK ; Not top-bit key
|
BPL KEYREADOK ; Not top-bit key
|
||||||
AND #$CF ; Drop Shift/Ctrl bits
|
AND #$CF ; Drop Shift/Ctrl bits
|
||||||
CMP #$C9
|
CMP #$C9
|
||||||
BCC KEYSOFTY ; Not cursor key
|
BCC KEYSOFTHI ; Not cursor key
|
||||||
|
* BCC KEYSOFTY ; Not cursor key
|
||||||
LDX FX4VAR
|
LDX FX4VAR
|
||||||
BEQ KEYCURSOR ; *FX4,0 - editing keys
|
BEQ KEYCURSOR ; *FX4,0 - editing keys
|
||||||
CPY #$C9
|
CPY #$C9
|
||||||
@ -518,7 +520,8 @@ KEYSOFTHI LDX FX254VAR
|
|||||||
CPX #$C0
|
CPX #$C0
|
||||||
BCC KEYSOFTY
|
BCC KEYSOFTY
|
||||||
TYA
|
TYA
|
||||||
AND #$BF
|
EOR #$40 ; Toggle keyboard map
|
||||||
|
* AND #$BF
|
||||||
TAY
|
TAY
|
||||||
KEYSOFTY TYA ; Get key including Shift/Ctrl
|
KEYSOFTY TYA ; Get key including Shift/Ctrl
|
||||||
LSR A
|
LSR A
|
||||||
@ -564,7 +567,7 @@ KEYCURSOR CMP #$C9
|
|||||||
JSR GETCHRC ; Save char under cursor
|
JSR GETCHRC ; Save char under cursor
|
||||||
STA OLDCHAR
|
STA OLDCHAR
|
||||||
KEYNONE SEC
|
KEYNONE SEC
|
||||||
RTS
|
KBDDONE2 RTS
|
||||||
|
|
||||||
KEYCOPY BIT VDUSTATUS
|
KEYCOPY BIT VDUSTATUS
|
||||||
KEYCOPYTAB LDA FXTABCHAR ; Prepare TAB if no copy cursor
|
KEYCOPYTAB LDA FXTABCHAR ; Prepare TAB if no copy cursor
|
||||||
@ -600,8 +603,8 @@ KBDREAD CLV ; VC=return keypress
|
|||||||
KBDTEST LDA KBDDATA ; VS here to test for keypress
|
KBDTEST LDA KBDDATA ; VS here to test for keypress
|
||||||
EOR #$80 ; Toggle bit 7
|
EOR #$80 ; Toggle bit 7
|
||||||
CMP #$80
|
CMP #$80
|
||||||
BCS KBDDONE ; No key pressed
|
BCS KBDDONE2 ; No key pressed
|
||||||
BVS KBDDONE ; VS=test for keypress
|
BVS KBDDONE2 ; VS=test for keypress
|
||||||
STA KBDACK ; Ack. keypress
|
STA KBDACK ; Ack. keypress
|
||||||
KBDREAD2 TAX ; X=raw keypress
|
KBDREAD2 TAX ; X=raw keypress
|
||||||
*
|
*
|
||||||
@ -636,7 +639,13 @@ KBDREAD2B AND #$10
|
|||||||
BEQ KBDREAD5 ; Not keypad
|
BEQ KBDREAD5 ; Not keypad
|
||||||
PLP ; Drop NoALT
|
PLP ; Drop NoALT
|
||||||
TXA ; A=raw keypress
|
TXA ; A=raw keypress
|
||||||
LDX FXKEYPADBASE
|
BMI KBDREADPAD ; Translate keypad
|
||||||
|
CMP #$60
|
||||||
|
BCC KBDREADPAD
|
||||||
|
LDA KBDADBKEYS-$60,X ; Translate $60-$7E keys
|
||||||
|
BRA KBDREAD6
|
||||||
|
|
||||||
|
KBDREADPAD LDX FXKEYPADBASE
|
||||||
BEQ KBDCHKESC ; $00=use unchanged
|
BEQ KBDCHKESC ; $00=use unchanged
|
||||||
BPL KBDREAD4 ; Keypad not function keys
|
BPL KBDREAD4 ; Keypad not function keys
|
||||||
CMP #$20
|
CMP #$20
|
||||||
@ -699,6 +708,10 @@ KBDCURSR CLC
|
|||||||
ADC #$C4 ; Cursor keys $C0+x
|
ADC #$C4 ; Cursor keys $C0+x
|
||||||
BRA KBDFUNC
|
BRA KBDFUNC
|
||||||
|
|
||||||
|
KBDADBKEYS DB $85,$86,$87,$83,$88,$89,$80,$8B
|
||||||
|
DB $80,$8D,$80,$8E,$80,$8A,$80,$8C
|
||||||
|
DB $80,$8F,$C6,$C8,$CB,$C7,$84,$87
|
||||||
|
DB $82,$CA,$81,$CC,$CD,$CE,$C4,$7F
|
||||||
|
|
||||||
* Poll the keyboard to update Escape state
|
* Poll the keyboard to update Escape state
|
||||||
* On exit, MI=Escape state pending
|
* On exit, MI=Escape state pending
|
||||||
|
119
docs/Keyboard.txt
Normal file
119
docs/Keyboard.txt
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
Apple II Keyboard
|
||||||
|
=================
|
||||||
|
|
||||||
|
<----------------------------------------------------Apple IIgs---------------------------------------------------->
|
||||||
|
<-------------------------------------Apple IIc/IIe------------------------------------->
|
||||||
|
+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+---------+ +-----+-----+-----+-----+
|
||||||
|
| | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | | | | | | |
|
||||||
|
| ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | DELETE | |CLEAR| = | / | * |
|
||||||
|
+-----+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+------+ +-----+-----+-----+-----+
|
||||||
|
| | Q | W | E | R | T | Y | U | I | O | P | { | } | | | | | | |
|
||||||
|
| TAB | q | w | e | r | t | y | u | i | o | p | [ | ] | | | 7 | 8 | 9 | + |
|
||||||
|
+--------+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+ | +-----+-----+-----+-----+
|
||||||
|
| | A | S | D | F | G | H | J | K | L | : | " | | | | | | |
|
||||||
|
| CONTROL | a | s | d | f | g | h | j | k | l | ; | ' | RETURN | | 4 | 5 | 6 | - |
|
||||||
|
+----------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+----------+ +-----+-----+-----+-----+
|
||||||
|
| | Z | X | C | V | B | N | M | < | > | ? | | | | | | E |
|
||||||
|
| SHIFT | z | x | c | v | b | n | m | , | . | / | SHIFT | | 1 | 2 | 3 | N |
|
||||||
|
+-----+-----+-+-----+--+--+--+--+-----+-----+-----+-----+-+---+-+---+-+---+-+-----+-----+ +-----+-----+-----+ T |
|
||||||
|
|CAPS |SOLID| OPEN | ~ | | | | | | | | | | | E |
|
||||||
|
|LOCK |APPLE| APPLE | ` | SPACE | \ | Lft | Rgt | Dwn | Up | | 0 | . | R |
|
||||||
|
+-----+-----+----------+-----+----------------------------+-----+-----+-----+-----+-----+ +-----------+-----+-----+
|
||||||
|
|
||||||
|
|
||||||
|
Native AppleII Keycodes
|
||||||
|
-----------------------
|
||||||
|
<----------------------------------------------------Apple IIgs---------------------------------------------------->
|
||||||
|
<-------------------------------------Apple IIc/IIe------------------------------------->
|
||||||
|
+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+---------+ +-----+-----+-----+-----+
|
||||||
|
ctrl | $1B | 1 | $00 | 3 | 4 | 5 | $1E | 7 | 8 | 9 | 0 | $1F | = | $7F | | ??? | ??? | ??? | ??? |
|
||||||
|
shift | $1B | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | $7F | | ??? | ??? | ??? | ??? |
|
||||||
|
key | $1B | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | $7F | | ??? |K+'='|K+'/'|K+'*'|
|
||||||
|
+-----+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+------+ +-----+-----+-----+-----+
|
||||||
|
ctrl | $09 | $11 | $17 | $05 | $12 | $14 | $19 | $15 | $09 | $0F | $10 | $1B | $1D | | | ??? | ??? | ??? | ??? |
|
||||||
|
shift | $09 | Q | W | E | R | T | Y | U | I | O | P | { | } | | | ??? | ??? | ??? | ??? |
|
||||||
|
key | $09 | q | w | e | r | t | y | u | i | o | p | [ | ] | | |K+'7'|K+'8'|K+'9'|K+'+'|
|
||||||
|
+--------+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+ | +-----+-----+-----+-----+
|
||||||
|
ctrl | | $01 | $13 | $04 | $06 | $07 | $08 | $0A | $0B | $0C | ; | ' | $0D | | ??? | ??? | ??? | ??? |
|
||||||
|
shift | | A | S | D | F | G | H | J | K | L | : | @ | $0D | | ??? | ??? | ??? | ??? |
|
||||||
|
key | CONTROL | a | s | d | f | g | h | j | k | l | ; | ' | $0D | |K+'4'|K+'5'|K+'6'|K+'-'|
|
||||||
|
+----------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+----------+ +-----+-----+-----+-----+
|
||||||
|
ctrl | | $1A | $18 | $03 | $16 | $02 | $0E | $0D | , | . | / | | | ??? | ??? | ??? | |
|
||||||
|
shift | | Z | X | C | V | B | N | M | < | > | ? | | | ??? | ??? | ??? | |
|
||||||
|
key | SHIFT | z | x | c | v | b | n | m | , | . | / | SHIFT | |K+'1'|K+'2'|K+'3'| |
|
||||||
|
+-----+-----+-+-----+--+--+--+--+-----+-----+-----+-----+-+---+-+---+-+---+-+-----+-----+ +-----+-----+-----+ |
|
||||||
|
ctrl | | | | ` | $20 | $1C | $08 | $15 | $0A | $0B | | ??? | ??? | ??? |
|
||||||
|
shift |CAPS |SOLID| OPEN | ~ | $20 | | | $08 | $15 | $0A | $0B | | ??? | ??? | ??? |
|
||||||
|
key |LOCK |APPLE| APPLE | ` | $20 | \ | $08 | $15 | $0A | $0B | | K+'0' |K+'.'|K+'='|
|
||||||
|
+-----+-----+----------+-----+----------------------------+-----+-----+-----+-----+-----+ +-----------+-----+-----+
|
||||||
|
|
||||||
|
K+'x' indicates KPAD bit in KBDMOD register is set, 'x' is value returned in KBDDATA register.
|
||||||
|
|
||||||
|
|
||||||
|
Keycodes when running Applecorn MOS
|
||||||
|
-----------------------------------
|
||||||
|
<----------------------------------------------------Apple IIgs---------------------------------------------------->
|
||||||
|
<-------------------------------------Apple IIc/IIe------------------------------------->
|
||||||
|
+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+---------+ +-----+-----+-----+-----+
|
||||||
|
L+R | $1B | $A1 | $A2 | $A3 | $A4 | $A5 | $A6 | $A7 | $A8 | $A9 | $A0 | - | = | $1F | | ??? | $AC | $AF | $AA |
|
||||||
|
Rapp | $1B | $91 | $92 | $93 | $94 | $95 | $96 | $97 | $98 | $99 | $90 | - | = | $1F | | ??? | $9C | $9F | $9A |
|
||||||
|
Lapp | $1B | $81 | $82 | $83 | $84 | $85 | $86 | $87 | $88 | $89 | $80 | - | = | $1F | | ??? | $8C | $8F | $8A |
|
||||||
|
ctrl | $1B | ! | $00 | 3 | 4 | 5 | $1E | 7 | * | ( | ) | $1F | = | $7F | | ??? | $AC | $AF | $AA |
|
||||||
|
shift | $1B | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | $7F | | ??? | $9C | $9F | $9A |
|
||||||
|
key | $1B | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | $7F | | ??? | $8C | $8F | $8A |
|
||||||
|
+-----+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+------+ +-----+-----+-----+-----+
|
||||||
|
L+R | $09 | $11 | $17 | $05 | $12 | $14 | $19 | $15 | $09 | $0F | $10 | $1B | $1D | | | $A7 | $A8 | $A9 | $AB |
|
||||||
|
Rapp | $09 | $11 | $17 | $05 | $12 | $14 | $19 | $15 | $09 | $0F | $10 | $1B | $1D | | | $97 | $98 | $99 | $9B |
|
||||||
|
Lapp | $09 | $11 | $17 | $05 | $12 | $14 | $19 | $15 | $09 | $0F | $10 | $1B | $1D | | | $87 | $88 | $89 | $8B |
|
||||||
|
ctrl | $E9 | $11 | $17 | $05 | $12 | $14 | $19 | $CD | $C9 | $0F | $10 | $1B | $1D | | | $A7 | $A8 | $A9 | $AB |
|
||||||
|
shift | $D9 | Q | W | E | R | T | Y | U | I | O | P | { | } | | | $97 | $98 | $99 | $9B |
|
||||||
|
key | $C9 | q | w | e | r | t | y | u | i | o | p | [ | ] | | | $87 | $88 | $89 | $8B |
|
||||||
|
+--------+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+-+---+ | +-----+-----+-----+-----+
|
||||||
|
L+R | | $01 | $13 | $04 | $06 | $07 | $08 | $0A | $0B | $0C | ; | ' | $0D | | $A4 | $A5 | $A6 | $AD |
|
||||||
|
Rapp | | $01 | $13 | $04 | $06 | $07 | $08 | $0A | $0B | $0C | ; | ' | $0D | | $94 | $95 | $96 | $9D |
|
||||||
|
Lapp | | $01 | $13 | $04 | $06 | $07 | $08 | $0A | $0B | $0C | ; | ' | $0D | | $84 | $85 | $86 | $8D |
|
||||||
|
ctrl | | $01 | $13 | $04 | $06 | $07 | $CC | $CE | $CF | $0C | ; | ' | $0D | | $A4 | $A5 | $A6 | $AD |
|
||||||
|
shift | | A | S | D | F | G | H | J | K | L | : | " | $0D | | $94 | $95 | $96 | $9D |
|
||||||
|
key | CONTROL | a | s | d | f | g | h | j | k | l | ; | ' | $0D | | $84 | $85 | $86 | $8D |
|
||||||
|
+----------+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+----------+ +-----+-----+-----+-----+
|
||||||
|
L+R | | $1A | $18 | $03 | $16 | $02 | $0E | $0D | , | . | / | | | &A1 | $A2 | $A3 | |
|
||||||
|
Rapp | | $1A | $18 | $03 | $16 | $02 | $0E | $0D | , | . | / | | | &91 | $92 | $93 | |
|
||||||
|
Lapp | | $1A | $18 | $03 | $16 | $02 | $0E | $0D | , | . | / | | | &81 | $82 | $83 | |
|
||||||
|
ctrl | | $1A | $18 | $03 | $16 | $02 | $0E | $0D | , | . | / | | | &A1 | $A2 | $A3 | |
|
||||||
|
shft | | Z | X | C | V | B | N | M | < | > | ? | | | &91 | $92 | $93 | |
|
||||||
|
key | SHIFT | z | x | c | v | b | n | m | , | . | / | SHIFT | | &81 | $82 | $83 | |
|
||||||
|
+-----+-----+-+-----+--+--+--+--+-----+-----+-----+-----+-+---+-+---+-+---+-+-----+-----+ +-----+-----+-----+ |
|
||||||
|
L+R | | | | ??? | $20 | $1C | $08 | $15 | $0A | $0B | | $A0 | $AE | ??? |
|
||||||
|
Rapp | | | | ??? | $20 | $1C | $08 | $15 | $0A | $0B | | $90 | $9E | ??? |
|
||||||
|
Lapp | | | | ??? | $20 | $1C | $08 | $15 | $0A | $0B | | $80 | $8E | ??? |
|
||||||
|
ctrl | | | | ` | $20 | $1C | $DC | $DD | $EE | $EF | | $A0 | $AE | ??? |
|
||||||
|
shift |CAPS |SOLID| OPEN | ~ | $20 | | | $DC | $DD | $DE | $DF | | $90 | $9E | ??? |
|
||||||
|
key |LOCK |APPLE| APPLE | ` | $20 | \ | $CC | $CD | $CE | $CF | | $80 | $8E | ??? |
|
||||||
|
+-----+-----+----------+-----+----------------------------+-----+-----+-----+-----+-----+ +-----------+-----+-----+
|
||||||
|
|
||||||
|
|
||||||
|
Applecorn BBC MOS keyboard API calls
|
||||||
|
====================================
|
||||||
|
OSBYTE 4 (237) - Cursor keys: 0:editing, 1:&88-&8A, 2:topbit &xC-&xF with ctrl+shift
|
||||||
|
OSBYTE 126 - Acknowledge Escape effects set by OSBYTE 230 will be actioned
|
||||||
|
OSBYTE 200 - Break/Escape response: b0=ignore Escape entirely, b1=clear memory on RESET
|
||||||
|
OSBYTE 202 - Keyboard state: b5=ctrl, b4=shift at last keypress
|
||||||
|
OSBYTE 219 - TAB Character: character for TAB key to return
|
||||||
|
OSBYTE 220 - ESC Character: character to match as Escape key
|
||||||
|
OSBYTE 221-228 - Top-set interpretation: 0:ignore, 1:soft key, 2:key base
|
||||||
|
OSBYTE 229 - Escape enable: 0:Escape key, <>0:return character
|
||||||
|
OSBYTE 230 - Escape effects: 0:Escape closes and flushes, <>0 no Escape effects
|
||||||
|
OSBYTE 238 - Keypad base: character to add to keypad key offset
|
||||||
|
OSBYTE 254 - Keyboard map: <&C0:map that matches OSBYTE 0, &C0+n:semi-regular
|
||||||
|
|
||||||
|
Applecorn BBC MOS character read API calls
|
||||||
|
==========================================
|
||||||
|
OSBYTE 176 - VSync counter for flashing cursor
|
||||||
|
OSBYTE 198 - *EXEC handle
|
||||||
|
OSBYTE 199 - *SPOOL handle
|
||||||
|
OSBYTE 216 - Length of current soft key
|
||||||
|
OSBYTE 233 - Offset to current soft key
|
||||||
|
OSBYTE 244 - Soft keys not unstable
|
||||||
|
|
||||||
|
OSBYTE 128,255 - Return XY<>0 if keypresses pending
|
||||||
|
OSBYTE 128,127 - Return raw low-level keycode
|
Loading…
x
Reference in New Issue
Block a user