ac6502 1.9.3 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CPU.d.ts +4 -0
- package/dist/components/CPU.js +87 -30
- package/dist/components/CPU.js.map +1 -1
- package/dist/components/IO/ACIA.d.ts +13 -21
- package/dist/components/IO/ACIA.js +53 -151
- package/dist/components/IO/ACIA.js.map +1 -1
- package/dist/components/IO/Attachments/KeyboardEncoderAttachment.d.ts +5 -10
- package/dist/components/IO/Attachments/KeyboardEncoderAttachment.js +43 -266
- package/dist/components/IO/Attachments/KeyboardEncoderAttachment.js.map +1 -1
- package/dist/components/IO/Empty.d.ts +1 -3
- package/dist/components/IO/Empty.js +1 -5
- package/dist/components/IO/Empty.js.map +1 -1
- package/dist/components/IO/RAMBank.d.ts +3 -4
- package/dist/components/IO/RAMBank.js +4 -13
- package/dist/components/IO/RAMBank.js.map +1 -1
- package/dist/components/IO/RTC.d.ts +2 -3
- package/dist/components/IO/RTC.js +17 -7
- package/dist/components/IO/RTC.js.map +1 -1
- package/dist/components/IO/Sound.d.ts +1 -3
- package/dist/components/IO/Sound.js +13 -23
- package/dist/components/IO/Sound.js.map +1 -1
- package/dist/components/IO/Storage.d.ts +1 -3
- package/dist/components/IO/Storage.js +1 -3
- package/dist/components/IO/Storage.js.map +1 -1
- package/dist/components/IO/VIA.d.ts +1 -3
- package/dist/components/IO/VIA.js +6 -7
- package/dist/components/IO/VIA.js.map +1 -1
- package/dist/components/IO/Video.d.ts +1 -3
- package/dist/components/IO/Video.js +3 -5
- package/dist/components/IO/Video.js.map +1 -1
- package/dist/components/IO.d.ts +1 -3
- package/dist/components/Machine.d.ts +1 -2
- package/dist/components/Machine.js +21 -74
- package/dist/components/Machine.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tests/IO/ACIA.test.js +57 -108
- package/dist/tests/IO/ACIA.test.js.map +1 -1
- package/dist/tests/IO/Attachments/KeyboardEncoderAttachment.test.js +334 -574
- package/dist/tests/IO/Attachments/KeyboardEncoderAttachment.test.js.map +1 -1
- package/dist/tests/IO/Empty.test.js +2 -14
- package/dist/tests/IO/Empty.test.js.map +1 -1
- package/dist/tests/IO/RAMBank.test.js +5 -12
- package/dist/tests/IO/RAMBank.test.js.map +1 -1
- package/dist/tests/IO/RTC.test.js +7 -16
- package/dist/tests/IO/RTC.test.js.map +1 -1
- package/dist/tests/IO/Sound.test.js +6 -8
- package/dist/tests/IO/Sound.test.js.map +1 -1
- package/dist/tests/IO/Storage.test.js +0 -6
- package/dist/tests/IO/Storage.test.js.map +1 -1
- package/dist/tests/IO/VIA.test.js +6 -10
- package/dist/tests/IO/VIA.test.js.map +1 -1
- package/dist/tests/IO/Video.test.js +7 -7
- package/dist/tests/IO/Video.test.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CPU.ts +94 -31
- package/src/components/IO/ACIA.ts +57 -176
- package/src/components/IO/Attachments/KeyboardEncoderAttachment.ts +45 -217
- package/src/components/IO/Empty.ts +1 -4
- package/src/components/IO/RAMBank.ts +4 -15
- package/src/components/IO/RTC.ts +18 -7
- package/src/components/IO/Sound.ts +14 -27
- package/src/components/IO/Storage.ts +2 -5
- package/src/components/IO/VIA.ts +6 -8
- package/src/components/IO/Video.ts +5 -7
- package/src/components/IO.ts +1 -4
- package/src/components/Machine.ts +22 -90
- package/src/index.ts +1 -1
- package/src/tests/IO/ACIA.test.ts +60 -122
- package/src/tests/IO/Attachments/KeyboardEncoderAttachment.test.ts +342 -676
- package/src/tests/IO/Empty.test.ts +2 -17
- package/src/tests/IO/RAMBank.test.ts +5 -14
- package/src/tests/IO/RTC.test.ts +7 -20
- package/src/tests/IO/Sound.test.ts +6 -8
- package/src/tests/IO/Storage.test.ts +0 -7
- package/src/tests/IO/VIA.test.ts +6 -12
- package/src/tests/IO/Video.test.ts +7 -8
|
@@ -2,6 +2,9 @@ import { IO } from '../IO';
|
|
|
2
2
|
/**
|
|
3
3
|
* ACIA - Emulates a R6551 ACIA (Asynchronous Communications Interface Adapter)
|
|
4
4
|
*
|
|
5
|
+
* Simplified to match real R6551 hardware: single-byte TX/RX registers,
|
|
6
|
+
* no buffers, no baud rate timing (USB serial operates at USB speeds).
|
|
7
|
+
*
|
|
5
8
|
* Register Map:
|
|
6
9
|
* $00: Data Register (read/write)
|
|
7
10
|
* $01: Status Register (read) / Programmed Reset (write)
|
|
@@ -9,22 +12,19 @@ import { IO } from '../IO';
|
|
|
9
12
|
* $03: Control Register (write)
|
|
10
13
|
*/
|
|
11
14
|
export declare class ACIA implements IO {
|
|
12
|
-
raiseIRQ: () => void;
|
|
13
|
-
raiseNMI: () => void;
|
|
14
15
|
transmit?: (data: number) => void;
|
|
15
|
-
private
|
|
16
|
-
private
|
|
16
|
+
private txRegister;
|
|
17
|
+
private rxRegister;
|
|
17
18
|
private commandRegister;
|
|
18
19
|
private controlRegister;
|
|
19
|
-
private
|
|
20
|
-
private
|
|
20
|
+
private txRegEmpty;
|
|
21
|
+
private rxRegFull;
|
|
22
|
+
private txPending;
|
|
23
|
+
private overrun;
|
|
21
24
|
private parityError;
|
|
22
25
|
private framingError;
|
|
23
|
-
private overrun;
|
|
24
26
|
private irqFlag;
|
|
25
27
|
private echoMode;
|
|
26
|
-
private cycleCounter;
|
|
27
|
-
private baudRate;
|
|
28
28
|
/**
|
|
29
29
|
* Read from ACIA register
|
|
30
30
|
*/
|
|
@@ -34,11 +34,11 @@ export declare class ACIA implements IO {
|
|
|
34
34
|
*/
|
|
35
35
|
write(address: number, data: number): void;
|
|
36
36
|
/**
|
|
37
|
-
* Read data from receive
|
|
37
|
+
* Read data from receive register
|
|
38
38
|
*/
|
|
39
39
|
private readData;
|
|
40
40
|
/**
|
|
41
|
-
* Write data to transmit
|
|
41
|
+
* Write data to transmit register
|
|
42
42
|
*/
|
|
43
43
|
private writeData;
|
|
44
44
|
/**
|
|
@@ -54,22 +54,14 @@ export declare class ACIA implements IO {
|
|
|
54
54
|
* Write to command register
|
|
55
55
|
*/
|
|
56
56
|
private writeCommand;
|
|
57
|
-
/**
|
|
58
|
-
* Write to control register
|
|
59
|
-
*/
|
|
60
|
-
private writeControl;
|
|
61
|
-
/**
|
|
62
|
-
* Get baud rate from control register code
|
|
63
|
-
*/
|
|
64
|
-
private getBaudRate;
|
|
65
57
|
/**
|
|
66
58
|
* Programmed reset
|
|
67
59
|
*/
|
|
68
60
|
private programmedReset;
|
|
69
61
|
/**
|
|
70
|
-
* Tick -
|
|
62
|
+
* Tick - process TX/RX each cycle, return interrupt status
|
|
71
63
|
*/
|
|
72
|
-
tick(frequency: number):
|
|
64
|
+
tick(frequency: number): number;
|
|
73
65
|
/**
|
|
74
66
|
* Reset the ACIA
|
|
75
67
|
*/
|
|
@@ -4,6 +4,9 @@ exports.ACIA = void 0;
|
|
|
4
4
|
/**
|
|
5
5
|
* ACIA - Emulates a R6551 ACIA (Asynchronous Communications Interface Adapter)
|
|
6
6
|
*
|
|
7
|
+
* Simplified to match real R6551 hardware: single-byte TX/RX registers,
|
|
8
|
+
* no buffers, no baud rate timing (USB serial operates at USB speeds).
|
|
9
|
+
*
|
|
7
10
|
* Register Map:
|
|
8
11
|
* $00: Data Register (read/write)
|
|
9
12
|
* $01: Status Register (read) / Programmed Reset (write)
|
|
@@ -12,25 +15,20 @@ exports.ACIA = void 0;
|
|
|
12
15
|
*/
|
|
13
16
|
class ACIA {
|
|
14
17
|
constructor() {
|
|
15
|
-
this.raiseIRQ = () => { };
|
|
16
|
-
this.raiseNMI = () => { };
|
|
17
18
|
// Registers
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
19
|
+
this.txRegister = 0;
|
|
20
|
+
this.rxRegister = 0;
|
|
20
21
|
this.commandRegister = 0;
|
|
21
22
|
this.controlRegister = 0;
|
|
22
|
-
// Buffers
|
|
23
|
-
this.transmitBuffer = [];
|
|
24
|
-
this.receiveBuffer = [];
|
|
25
23
|
// Status flags
|
|
24
|
+
this.txRegEmpty = true;
|
|
25
|
+
this.rxRegFull = false;
|
|
26
|
+
this.txPending = false;
|
|
27
|
+
this.overrun = false;
|
|
26
28
|
this.parityError = false;
|
|
27
29
|
this.framingError = false;
|
|
28
|
-
this.overrun = false;
|
|
29
30
|
this.irqFlag = false;
|
|
30
31
|
this.echoMode = false;
|
|
31
|
-
// Timing
|
|
32
|
-
this.cycleCounter = 0;
|
|
33
|
-
this.baudRate = 115200;
|
|
34
32
|
}
|
|
35
33
|
/**
|
|
36
34
|
* Read from ACIA register
|
|
@@ -66,44 +64,28 @@ class ACIA {
|
|
|
66
64
|
this.writeCommand(data);
|
|
67
65
|
break;
|
|
68
66
|
case 0x03: // Control Register
|
|
69
|
-
this.
|
|
67
|
+
this.controlRegister = data & 0xFF;
|
|
70
68
|
break;
|
|
71
69
|
}
|
|
72
70
|
}
|
|
73
71
|
/**
|
|
74
|
-
* Read data from receive
|
|
72
|
+
* Read data from receive register
|
|
75
73
|
*/
|
|
76
74
|
readData() {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (this.receiveBuffer.length === 0) {
|
|
84
|
-
this.overrun = false;
|
|
85
|
-
this.statusRegister &= ~0x04;
|
|
86
|
-
}
|
|
87
|
-
// If more bytes remain in the buffer, re-assert IRQ so the BIOS services them
|
|
88
|
-
if (this.receiveBuffer.length > 0 && !(this.commandRegister & 0x02)) {
|
|
89
|
-
this.irqFlag = true;
|
|
90
|
-
this.statusRegister |= 0x80;
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
this.irqFlag = false;
|
|
94
|
-
this.statusRegister &= ~0x80;
|
|
95
|
-
}
|
|
96
|
-
return data;
|
|
97
|
-
}
|
|
98
|
-
return this.dataRegister;
|
|
75
|
+
// Clear Receive Data Register Full
|
|
76
|
+
this.rxRegFull = false;
|
|
77
|
+
this.overrun = false;
|
|
78
|
+
// Clear IRQ if it was from RX
|
|
79
|
+
this.irqFlag = false;
|
|
80
|
+
return this.rxRegister;
|
|
99
81
|
}
|
|
100
82
|
/**
|
|
101
|
-
* Write data to transmit
|
|
83
|
+
* Write data to transmit register
|
|
102
84
|
*/
|
|
103
85
|
writeData(data) {
|
|
104
|
-
this.
|
|
105
|
-
|
|
106
|
-
this.
|
|
86
|
+
this.txRegister = data & 0xFF;
|
|
87
|
+
this.txRegEmpty = false;
|
|
88
|
+
this.txPending = true;
|
|
107
89
|
}
|
|
108
90
|
/**
|
|
109
91
|
* Read status register
|
|
@@ -125,24 +107,23 @@ class ACIA {
|
|
|
125
107
|
if (this.overrun)
|
|
126
108
|
status |= 0x04;
|
|
127
109
|
// Bit 3: Receive Data Register Full
|
|
128
|
-
if (this.
|
|
110
|
+
if (this.rxRegFull)
|
|
129
111
|
status |= 0x08;
|
|
130
112
|
// Bit 4: Transmit Data Register Empty
|
|
131
|
-
if (this.
|
|
113
|
+
if (this.txRegEmpty)
|
|
132
114
|
status |= 0x10;
|
|
133
|
-
// Bit 5: Data Carrier Detect (DCD)
|
|
115
|
+
// Bit 5: Data Carrier Detect (DCD) - always connected
|
|
134
116
|
status &= ~0x20;
|
|
135
|
-
// Bit 6: Data Set Ready (DSR)
|
|
117
|
+
// Bit 6: Data Set Ready (DSR) - always ready
|
|
136
118
|
status |= 0x40;
|
|
137
119
|
// Bit 7: Interrupt (IRQ)
|
|
138
120
|
if (this.irqFlag)
|
|
139
121
|
status |= 0x80;
|
|
140
|
-
// Clear IRQ and error flags after
|
|
122
|
+
// Clear IRQ and error flags after reading (R6551 spec)
|
|
141
123
|
this.irqFlag = false;
|
|
142
124
|
this.parityError = false;
|
|
143
125
|
this.framingError = false;
|
|
144
126
|
this.overrun = false;
|
|
145
|
-
this.statusRegister = status;
|
|
146
127
|
return status;
|
|
147
128
|
}
|
|
148
129
|
/**
|
|
@@ -150,154 +131,75 @@ class ACIA {
|
|
|
150
131
|
*/
|
|
151
132
|
writeCommand(data) {
|
|
152
133
|
this.commandRegister = data & 0xFF;
|
|
153
|
-
// Bits 0-1: DTR control
|
|
154
|
-
// const dtrControl = data & 0x03
|
|
155
|
-
// Bit 1: Receiver Interrupt Request Disable (RIIE) — 0 = IRQ enabled, 1 = disabled (active low)
|
|
156
|
-
const receiveIRQEnabled = (data & 0x02) === 0;
|
|
157
|
-
// Bits 3-2: Transmitter Interrupt Control (TIC)
|
|
158
|
-
// const transmitControl = (data >> 2) & 0x03
|
|
159
134
|
// Bit 4: Echo Mode Enable (EME)
|
|
160
135
|
this.echoMode = (data & 0x10) !== 0;
|
|
161
|
-
// Bits 6-7: Parity control
|
|
162
|
-
// const parityControl = (data >> 6) & 0x03
|
|
163
|
-
// Handle receive IRQ
|
|
164
|
-
if (receiveIRQEnabled && this.receiveBuffer.length > 0) {
|
|
165
|
-
this.irqFlag = true;
|
|
166
|
-
this.statusRegister |= 0x80;
|
|
167
|
-
this.raiseIRQ();
|
|
168
|
-
}
|
|
169
|
-
else if (!receiveIRQEnabled) {
|
|
170
|
-
this.irqFlag = false;
|
|
171
|
-
this.statusRegister &= ~0x80;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Write to control register
|
|
176
|
-
*/
|
|
177
|
-
writeControl(data) {
|
|
178
|
-
this.controlRegister = data & 0xFF;
|
|
179
|
-
// Bits 0-3: Baud rate
|
|
180
|
-
const baudRateCode = data & 0x0F;
|
|
181
|
-
this.baudRate = this.getBaudRate(baudRateCode);
|
|
182
|
-
// Bit 4: Receiver clock source (internal/external)
|
|
183
|
-
const receiverClockSource = (data & 0x10) !== 0;
|
|
184
|
-
// Bits 5-6: Word length (5, 6, 7, or 8 bits)
|
|
185
|
-
const wordLength = ((data >> 5) & 0x03) + 5;
|
|
186
|
-
// Bit 7: Stop bits (1 or 2)
|
|
187
|
-
const stopBits = (data & 0x80) ? 2 : 1;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Get baud rate from control register code
|
|
191
|
-
*/
|
|
192
|
-
getBaudRate(code) {
|
|
193
|
-
const baudRates = [
|
|
194
|
-
115200, // 0000 (actually 16x external clock, using 115200 as default)
|
|
195
|
-
50, // 0001
|
|
196
|
-
75, // 0010
|
|
197
|
-
110, // 0011
|
|
198
|
-
135, // 0100
|
|
199
|
-
150, // 0101
|
|
200
|
-
300, // 0110
|
|
201
|
-
600, // 0111
|
|
202
|
-
1200, // 1000
|
|
203
|
-
1800, // 1001
|
|
204
|
-
2400, // 1010
|
|
205
|
-
3600, // 1011
|
|
206
|
-
4800, // 1100
|
|
207
|
-
7200, // 1101
|
|
208
|
-
9600, // 1110
|
|
209
|
-
19200 // 1111
|
|
210
|
-
];
|
|
211
|
-
return baudRates[code] || 115200;
|
|
212
136
|
}
|
|
213
137
|
/**
|
|
214
138
|
* Programmed reset
|
|
215
139
|
*/
|
|
216
140
|
programmedReset() {
|
|
217
|
-
this.
|
|
141
|
+
this.txRegEmpty = true;
|
|
142
|
+
this.txPending = false;
|
|
218
143
|
this.parityError = false;
|
|
219
144
|
this.framingError = false;
|
|
220
145
|
this.overrun = false;
|
|
221
146
|
this.irqFlag = false;
|
|
222
147
|
}
|
|
223
148
|
/**
|
|
224
|
-
* Tick -
|
|
149
|
+
* Tick - process TX/RX each cycle, return interrupt status
|
|
225
150
|
*/
|
|
226
151
|
tick(frequency) {
|
|
227
|
-
//
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
if (this.irqFlag) {
|
|
234
|
-
this.raiseIRQ();
|
|
235
|
-
}
|
|
236
|
-
this.cycleCounter++;
|
|
237
|
-
// Calculate cycles per byte: (CPU_CLOCK / baud_rate) * bits_per_frame
|
|
238
|
-
// Assuming 10 bits per frame (1 start + 8 data + 1 stop)
|
|
239
|
-
const cyclesPerByte = Math.floor((frequency / this.baudRate) * 10);
|
|
240
|
-
// Simulate transmission based on actual baud rate
|
|
241
|
-
if (this.cycleCounter >= cyclesPerByte && this.transmitBuffer.length > 0) {
|
|
242
|
-
this.cycleCounter = 0;
|
|
243
|
-
// Transmit one byte
|
|
244
|
-
const byte = this.transmitBuffer.shift();
|
|
245
|
-
if (byte !== undefined && this.transmit) {
|
|
246
|
-
this.transmit(byte);
|
|
152
|
+
// Handle pending transmit - send immediately (no baud timing)
|
|
153
|
+
if (this.txPending) {
|
|
154
|
+
this.txPending = false;
|
|
155
|
+
if (this.transmit) {
|
|
156
|
+
this.transmit(this.txRegister);
|
|
247
157
|
}
|
|
248
|
-
|
|
249
|
-
if (
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
if ((this.commandRegister & 0x0C) === 0x04) {
|
|
253
|
-
this.irqFlag = true;
|
|
254
|
-
this.statusRegister |= 0x80;
|
|
255
|
-
this.raiseIRQ();
|
|
256
|
-
}
|
|
158
|
+
this.txRegEmpty = true;
|
|
159
|
+
// Trigger transmit complete IRQ if enabled (TIC bits 3-2 = 01)
|
|
160
|
+
if ((this.commandRegister & 0x0C) === 0x04) {
|
|
161
|
+
this.irqFlag = true;
|
|
257
162
|
}
|
|
163
|
+
// Echo mode: received data echoed back
|
|
164
|
+
// (echo of transmitted data is handled in onData)
|
|
258
165
|
}
|
|
166
|
+
// Return IRQ status
|
|
167
|
+
return this.irqFlag ? 0x80 : 0;
|
|
259
168
|
}
|
|
260
169
|
/**
|
|
261
170
|
* Reset the ACIA
|
|
262
171
|
*/
|
|
263
172
|
reset(coldStart) {
|
|
264
|
-
this.
|
|
265
|
-
this.
|
|
173
|
+
this.txRegister = 0;
|
|
174
|
+
this.rxRegister = 0;
|
|
266
175
|
this.commandRegister = 0;
|
|
267
176
|
this.controlRegister = 0;
|
|
268
|
-
this.
|
|
269
|
-
this.
|
|
177
|
+
this.txRegEmpty = true;
|
|
178
|
+
this.rxRegFull = false;
|
|
179
|
+
this.txPending = false;
|
|
180
|
+
this.overrun = false;
|
|
270
181
|
this.parityError = false;
|
|
271
182
|
this.framingError = false;
|
|
272
|
-
this.overrun = false;
|
|
273
183
|
this.irqFlag = false;
|
|
274
184
|
this.echoMode = false;
|
|
275
|
-
this.cycleCounter = 0;
|
|
276
|
-
this.baudRate = 115200;
|
|
277
185
|
}
|
|
278
186
|
/**
|
|
279
187
|
* Receive data from external source
|
|
280
188
|
*/
|
|
281
189
|
onData(data) {
|
|
282
|
-
if (this.
|
|
190
|
+
if (this.rxRegFull) {
|
|
283
191
|
// Overrun: new data arrived before the previous byte was read
|
|
284
192
|
this.overrun = true;
|
|
285
|
-
this.statusRegister |= 0x04;
|
|
286
193
|
}
|
|
287
|
-
this.
|
|
288
|
-
|
|
289
|
-
this.statusRegister |= 0x08;
|
|
194
|
+
this.rxRegister = data & 0xFF;
|
|
195
|
+
this.rxRegFull = true;
|
|
290
196
|
// Trigger receive IRQ if enabled (bit 1 = 0 means enabled, active low)
|
|
291
197
|
if (!(this.commandRegister & 0x02)) {
|
|
292
198
|
this.irqFlag = true;
|
|
293
|
-
this.statusRegister |= 0x80;
|
|
294
|
-
this.raiseIRQ();
|
|
295
199
|
}
|
|
296
200
|
// Echo mode: automatically transmit received data
|
|
297
|
-
if (this.echoMode) {
|
|
298
|
-
this.
|
|
299
|
-
// Clear Transmit Data Register Empty flag
|
|
300
|
-
this.statusRegister &= ~0x10;
|
|
201
|
+
if (this.echoMode && this.transmit) {
|
|
202
|
+
this.transmit(data & 0xFF);
|
|
301
203
|
}
|
|
302
204
|
}
|
|
303
205
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ACIA.js","sourceRoot":"","sources":["../../../src/components/IO/ACIA.ts"],"names":[],"mappings":";;;AAEA
|
|
1
|
+
{"version":3,"file":"ACIA.js","sourceRoot":"","sources":["../../../src/components/IO/ACIA.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACH,MAAa,IAAI;IAAjB;QAIE,YAAY;QACJ,eAAU,GAAW,CAAC,CAAA;QACtB,eAAU,GAAW,CAAC,CAAA;QACtB,oBAAe,GAAW,CAAC,CAAA;QAC3B,oBAAe,GAAW,CAAC,CAAA;QAE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CAAC,UAAU,GAAG,CAAC,CAAA;QACnB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAA;QACxB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAA;QAExB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAA;QACtB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;QACtB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAA;QACtB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,WAAW,GAAG,KAAK,CAAA;QACxB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAA;QACzB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAA;IACvB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAY;QACjB,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,8DAA8D;YAC9D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QACrB,CAAC;QAED,IAAI,CAAC,UAAU,GAAG,IAAI,GAAG,IAAI,CAAA;QAC7B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAA;QAErB,uEAAuE;QACvE,IAAI,CAAC,CAAC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,EAAE,CAAC;YACnC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QACrB,CAAC;QAED,kDAAkD;QAClD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnC,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;CACF;AAlOD,oBAkOC"}
|
|
@@ -9,13 +9,11 @@ import { AttachmentBase } from './Attachment';
|
|
|
9
9
|
* - CA1 interrupt signals data ready on Port A
|
|
10
10
|
* - CB1 interrupt signals data ready on Port B
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* -
|
|
15
|
-
* - Ctrl
|
|
16
|
-
* -
|
|
17
|
-
* - Alt: Extended character set 0xE0-0xFF
|
|
18
|
-
* - Shift: Uppercase letters and shifted symbols
|
|
12
|
+
* Letters are always output as uppercase ASCII (0x41-0x5A).
|
|
13
|
+
* Supported modifier combinations:
|
|
14
|
+
* - Ctrl+letter: Control codes 0x01-0x1A
|
|
15
|
+
* - Ctrl+special: Ctrl+2=NUL, Ctrl+6=RS, Ctrl+-=US, Ctrl+[=ESC, Ctrl+\=FS, Ctrl+]=GS
|
|
16
|
+
* - Shift+number/symbol: Standard US keyboard shifted symbols
|
|
19
17
|
*/
|
|
20
18
|
export declare class KeyboardEncoderAttachment extends AttachmentBase {
|
|
21
19
|
activePort: 'A' | 'B' | 'both';
|
|
@@ -29,9 +27,6 @@ export declare class KeyboardEncoderAttachment extends AttachmentBase {
|
|
|
29
27
|
private enabledB;
|
|
30
28
|
private shiftPressed;
|
|
31
29
|
private ctrlPressed;
|
|
32
|
-
private altPressed;
|
|
33
|
-
private menuPressed;
|
|
34
|
-
private capsLockActive;
|
|
35
30
|
private stateCA1;
|
|
36
31
|
private stateCA2;
|
|
37
32
|
private stateCB1;
|