Neo1: neo-layout.asm

Datei neo-layout.asm, 3.5 KB (hinzugefügt von erik, vor 9 Jahren)

Quellen des C64-Treibers von Version 1.0

Zeile 
1;NEO-Layout für C64
2;(C) 2005 Hanno Behrens (pebbles@schattenlauf.de)
3;unter GPL
4;Alpha-Release 0.1
5
6        !to "neo-layout.prg"
7
8        !source <C64/BASIC2.a>
9
10        *=$0801
11
12dest    =$c000
13
14ptr1    =$f7
15ptr2    =$f9
16               
17zp_pkeydec      =$028f
18zp_keymap       =$f5
19k_keydec        =$eb48
20k_keytablen     =$41
21k_keytab1       =$eb81
22k_keytab2       =$ebc2
23k_keytab3       =$ec03
24k_keytab4       =$ec78
25
26k_decode        =$eae0
27       
28;Header generieren
29        !word endline           ;Zeiger auf nächste Zeile
30        !word 2005              ;Zeilennummer
31        +b_SYS
32        !tx "2061",0
33endline !word 0
34;Ende Header
35
36setup: 
37        ldy #0                  ;kopiere neo nach dest
38set1:   lda neoentry,y
39        sta dest,y
40        lda neoentry+$100,y
41        sta dest+$100,y
42        iny
43        bne set1
44
45        sei                     ;setze keydecoder
46        lda #<dest
47        sta zp_pkeydec
48        lda #>dest
49        sta zp_pkeydec+1
50        cli
51        rts     
52
53neoentry:
54        lda $028d               ;Flag Shift CTRL Commodore
55        cmp #$03
56        bne l1                  ;Zeiger auf Dekodiertabellen berechnen
57        cmp $028e
58        beq abfrage_default     
59        lda $0291               ;Shift-Commodore erlaubt?
60        bmi fertig              ;nein, zurück zur Dekodierung
61        lda $d018               ;Shift/Commodore
62        eor #$02                ;Umschaltung Klein/Großschreibung
63        sta $d018
64        jmp fertig
65       
66l1      asl
67        cmp #$08
68        bcc l2
69        lda #$06
70l2      tax
71        lda tableptr-neoentry+dest,x
72        sta zp_keymap           ;Zeiger auf Tastatur-Dekodiertabellen lesen
73        lda tableptr-neoentry+dest+1,x
74        sta zp_keymap+1
75
76fertig: jmp k_decode            ;zurück zur Dekodierung
77
78abfrage_default:
79        lda #$7f
80        sta $dc00
81        rts
82
83tableptr:       
84        !word table1-neoentry+dest, table2-neoentry+dest
85        !word table3-neoentry+dest, table4-neoentry+dest
86
87        !ct pet
88table1  ;Tastatur-Dekodierung, ungeshiftet
89        !by $14, $0d, $1d, $88, $85, $86, $87, $11
90;       !by "3", "w", "a", "4", "z", "s", "e", $01
91        !by "3", "v", "u", "4", "k", "i", "l", $01
92;       !by "5", "r", "d", "6", "c", "f", "t", "x"
93        !by "5", "c", "a", "6", "@", "e", "w", ">"
94;       !by "7", "y", "g", "8", "b", "h", "u", "v"
95        !by "7", "<", "o", "8", "z", "s", "h", "p"
96;       !by "9", "i", "j", "0", "m", "k", "o", "n"
97        !by "9", "g", "n", "0", "m", "r", "f", "b"
98;       !by "+", "p", "l", "-", ".", ":", "@", ","
99        !by "+", "j", "t", "-", ".", "d", "/", ","
100;       !by $5c, "*", ";", $13, $01, "=", $5e, "/"
101        !by $5c, "*", "y", $13, $01, "=", $5e, "x"
102        !by "1", $5f, $04, "2", " ", $02, "q", $03
103        !by $ff
104table2  ;Tastatur-Dekodierung geshifted
105        !by $94, $8d, $9d, $8c, $89, $8a, $8b, $91
106;       !by "#", "W", "A", "$", "Z", "S", "E", $01
107        !by "#", "V", "U", "$", "K", "I", "L", $01
108;       !by "%", "R", "D", "&", "C", "F", "T", "X"
109        !by "%", "C", "A", "&", $ba, "E", "W", "]"
110;       !by "'", "Y", "G", "(", "B", "H", "U", "V"
111        !by "'", "[", "O", "(", "Z", "S", "H", "P"
112;       !by ")", "I", "J", "0", "M", "K", "O", "N"
113        !by ")", "G", "N", "0", "M", "R", "F", "B"
114;       !by $db, $d0, $cc, $dd, ">", "[", $ba, "<"
115        !by $db, $d0, $cc, $dd, ":", "D", "?", ";"
116;       !by $a9, $c0, "]", $93, $01, "=", $de, "?"
117        !by $a9, $c0, "Y", $93, $01, $3d, $de, "X"
118        !by $21, $5f, $04, $22, $a0, $02, "Q", $83
119        !by $ff
120       
121table3  ;Tastatur-Dekodierung mit C=-Taste
122        !by $94, $8d, $9d, $8c, $89, $8a, $8b, $91
123        !by $96, $b3, $b0, $97, $ad, $ae, $b1, $01
124        !by $98, $b2, $ac, $99, $bc, $bb, $a3, $bd
125        !by $9a, $b7, $a5, $9b, $bf, $b4, $b8, $be
126        !by $29, $a2, $b5, $30, $a7, $a1, $b9, $aa
127        !by $a6, $af, $b6, $dc, $3e, $5b, $a4, $3c
128        !by $a8, $df, $5d, $93, $01, $3d, $de, $3f
129        !by $81, $5f, $04, $95, $a0, $02, $ab, $83
130        !by $ff
131
132table4  ;Tastatur-Dekodierung mit CTRL-Taste
133        !by $ff, $ff, $ff, $ff, $ff, $ff, $ff, $ff
134        !by $1c, $17, $01, $9f, $1a, $13, $05, $ff
135        !by $9c, $12, $04, $1e, $03, $06, $14, $18
136        !by $1f, $19, $07, $9e, $02, $08, $15, $16
137        !by $12, $09, $0a, $92, $0d, $0b, $0f, $0e
138        !by $ff, $10, $0c, $ff, $ff, $1b, $00, $ff
139        !by $1c, $ff, $1d, $ff, $ff, $1f, $1e, $ff
140        !by $90, $06, $ff, $05, $ff, $ff, $11, $ff
141        !by $ff