ac6502 1.2.0 → 1.4.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/README.md +12 -12
- package/dist/components/CPU.d.ts +162 -0
- package/dist/components/Cart.d.ts +9 -0
- package/dist/components/IO/ACIA.d.ts +76 -0
- package/dist/components/IO/ACIA.js +282 -0
- package/dist/components/IO/ACIA.js.map +1 -0
- package/dist/components/IO/Attachments/Attachment.d.ts +112 -0
- package/dist/components/IO/Attachments/Attachment.js +71 -0
- package/dist/components/IO/Attachments/Attachment.js.map +1 -0
- package/dist/components/IO/Attachments/JoystickAttachment.d.ts +53 -0
- package/dist/components/IO/Attachments/JoystickAttachment.js +90 -0
- package/dist/components/IO/Attachments/JoystickAttachment.js.map +1 -0
- package/dist/components/IO/Attachments/KeyboardEncoderAttachment.d.ts +63 -0
- package/dist/components/IO/Attachments/KeyboardEncoderAttachment.js +489 -0
- package/dist/components/IO/Attachments/KeyboardEncoderAttachment.js.map +1 -0
- package/dist/components/IO/Attachments/KeyboardMatrixAttachment.d.ts +44 -0
- package/dist/components/IO/Attachments/KeyboardMatrixAttachment.js +274 -0
- package/dist/components/IO/Attachments/KeyboardMatrixAttachment.js.map +1 -0
- package/dist/components/IO/Attachments/KeypadAttachment.d.ts +47 -0
- package/dist/components/IO/Attachments/KeypadAttachment.js +141 -0
- package/dist/components/IO/Attachments/KeypadAttachment.js.map +1 -0
- package/dist/components/IO/Attachments/LCDAttachment.d.ts +110 -0
- package/dist/components/IO/Attachments/LCDAttachment.js +716 -0
- package/dist/components/IO/Attachments/LCDAttachment.js.map +1 -0
- package/dist/components/IO/Attachments/SNESAttachment.d.ts +85 -0
- package/dist/components/IO/Attachments/SNESAttachment.js +184 -0
- package/dist/components/IO/Attachments/SNESAttachment.js.map +1 -0
- package/dist/components/IO/DevOutputBoard.d.ts +19 -0
- package/dist/components/IO/DevOutputBoard.js +33 -0
- package/dist/components/IO/DevOutputBoard.js.map +1 -0
- package/dist/components/IO/Empty.d.ts +9 -0
- package/dist/components/IO/Empty.js +5 -7
- package/dist/components/IO/Empty.js.map +1 -1
- package/dist/components/IO/EmptyCard.d.ts +9 -0
- package/dist/components/IO/GPIOAttachments/GPIOAttachment.d.ts +112 -0
- package/dist/components/IO/GPIOAttachments/GPIOJoystickAttachment.d.ts +53 -0
- package/dist/components/IO/GPIOAttachments/GPIOKeyboardEncoderAttachment.d.ts +63 -0
- package/dist/components/IO/GPIOAttachments/GPIOKeyboardMatrixAttachment.d.ts +44 -0
- package/dist/components/IO/GPIOAttachments/GPIOKeypadAttachment.d.ts +47 -0
- package/dist/components/IO/GPIOAttachments/GPIOLCDAttachment.d.ts +110 -0
- package/dist/components/IO/GPIOCard.d.ts +105 -0
- package/dist/components/IO/GPIOCard.js.map +1 -1
- package/dist/components/IO/RAMBank.d.ts +37 -0
- package/dist/components/IO/RAMBank.js +63 -0
- package/dist/components/IO/RAMBank.js.map +1 -0
- package/dist/components/IO/RAMCard.d.ts +37 -0
- package/dist/components/IO/RTC.d.ts +107 -0
- package/dist/components/IO/RTC.js +483 -0
- package/dist/components/IO/RTC.js.map +1 -0
- package/dist/components/IO/RTCCard.d.ts +107 -0
- package/dist/components/IO/SerialCard.d.ts +76 -0
- package/dist/components/IO/Sound.d.ts +120 -0
- package/dist/components/IO/Sound.js +622 -0
- package/dist/components/IO/Sound.js.map +1 -0
- package/dist/components/IO/SoundCard.d.ts +120 -0
- package/dist/components/IO/Storage.d.ts +74 -0
- package/dist/components/IO/Storage.js +409 -0
- package/dist/components/IO/Storage.js.map +1 -0
- package/dist/components/IO/StorageCard.d.ts +74 -0
- package/dist/components/IO/Terminal.d.ts +19 -0
- package/dist/components/IO/Terminal.js +33 -0
- package/dist/components/IO/Terminal.js.map +1 -0
- package/dist/components/IO/VIA.d.ts +105 -0
- package/dist/components/IO/VIA.js +597 -0
- package/dist/components/IO/VIA.js.map +1 -0
- package/dist/components/IO/Video.d.ts +141 -0
- package/dist/components/IO/Video.js +630 -0
- package/dist/components/IO/Video.js.map +1 -0
- package/dist/components/IO/VideoCard.d.ts +141 -0
- package/dist/components/IO.d.ts +8 -0
- package/dist/components/Machine.d.ts +62 -0
- package/dist/components/Machine.js +260 -153
- package/dist/components/Machine.js.map +1 -1
- package/dist/components/RAM.d.ts +9 -0
- package/dist/components/ROM.d.ts +9 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +61 -28
- package/dist/index.js.map +1 -1
- package/dist/lib.d.ts +22 -0
- package/dist/lib.js +47 -0
- package/dist/lib.js.map +1 -0
- package/dist/tests/CPU.test.d.ts +1 -0
- package/dist/tests/Cart.test.d.ts +1 -0
- package/dist/tests/IO/ACIA.test.d.ts +1 -0
- package/dist/tests/IO/ACIA.test.js +423 -0
- package/dist/tests/IO/ACIA.test.js.map +1 -0
- package/dist/tests/IO/Attachments/Attachment.test.d.ts +1 -0
- package/dist/tests/IO/Attachments/Attachment.test.js +339 -0
- package/dist/tests/IO/Attachments/Attachment.test.js.map +1 -0
- package/dist/tests/IO/Attachments/JoystickAttachment.test.d.ts +1 -0
- package/dist/tests/IO/Attachments/JoystickAttachment.test.js +126 -0
- package/dist/tests/IO/Attachments/JoystickAttachment.test.js.map +1 -0
- package/dist/tests/IO/Attachments/KeyboardEncoderAttachment.test.d.ts +1 -0
- package/dist/tests/IO/Attachments/KeyboardEncoderAttachment.test.js +779 -0
- package/dist/tests/IO/Attachments/KeyboardEncoderAttachment.test.js.map +1 -0
- package/dist/tests/IO/Attachments/KeyboardMatrixAttachment.test.d.ts +1 -0
- package/dist/tests/IO/Attachments/KeyboardMatrixAttachment.test.js +355 -0
- package/dist/tests/IO/Attachments/KeyboardMatrixAttachment.test.js.map +1 -0
- package/dist/tests/IO/Attachments/KeypadAttachment.test.d.ts +1 -0
- package/dist/tests/IO/Attachments/KeypadAttachment.test.js +323 -0
- package/dist/tests/IO/Attachments/KeypadAttachment.test.js.map +1 -0
- package/dist/tests/IO/Attachments/LCDAttachment.test.d.ts +1 -0
- package/dist/tests/IO/Attachments/LCDAttachment.test.js +627 -0
- package/dist/tests/IO/Attachments/LCDAttachment.test.js.map +1 -0
- package/dist/tests/IO/Attachments/SNESAttachment.test.d.ts +1 -0
- package/dist/tests/IO/Attachments/SNESAttachment.test.js +331 -0
- package/dist/tests/IO/Attachments/SNESAttachment.test.js.map +1 -0
- package/dist/tests/IO/Empty.test.d.ts +1 -0
- package/dist/tests/IO/Empty.test.js +121 -0
- package/dist/tests/IO/Empty.test.js.map +1 -0
- package/dist/tests/IO/GPIOAttachments/GPIOAttachment.test.d.ts +1 -0
- package/dist/tests/IO/GPIOAttachments/GPIOJoystickAttachment.test.d.ts +1 -0
- package/dist/tests/IO/GPIOAttachments/GPIOKeyboardEncoderAttachment.test.d.ts +1 -0
- package/dist/tests/IO/GPIOAttachments/GPIOKeyboardMatrixAttachment.test.d.ts +1 -0
- package/dist/tests/IO/GPIOAttachments/GPIOKeypadAttachment.test.d.ts +1 -0
- package/dist/tests/IO/GPIOAttachments/GPIOLCDAttachment.test.d.ts +1 -0
- package/dist/tests/IO/GPIOCard.test.d.ts +1 -0
- package/dist/tests/IO/GPIOCard.test.js.map +1 -1
- package/dist/tests/IO/RAMBank.test.d.ts +1 -0
- package/dist/tests/IO/RAMBank.test.js +229 -0
- package/dist/tests/IO/RAMBank.test.js.map +1 -0
- package/dist/tests/IO/RAMCard.test.d.ts +1 -0
- package/dist/tests/IO/RTC.test.d.ts +1 -0
- package/dist/tests/IO/RTC.test.js +177 -0
- package/dist/tests/IO/RTC.test.js.map +1 -0
- package/dist/tests/IO/RTCCard.test.d.ts +1 -0
- package/dist/tests/IO/SerialCard.test.d.ts +1 -0
- package/dist/tests/IO/Sound.test.d.ts +1 -0
- package/dist/tests/IO/Sound.test.js +528 -0
- package/dist/tests/IO/Sound.test.js.map +1 -0
- package/dist/tests/IO/SoundCard.test.d.ts +1 -0
- package/dist/tests/IO/Storage.test.d.ts +1 -0
- package/dist/tests/IO/Storage.test.js +656 -0
- package/dist/tests/IO/Storage.test.js.map +1 -0
- package/dist/tests/IO/StorageCard.test.d.ts +1 -0
- package/dist/tests/IO/VIA.test.d.ts +1 -0
- package/dist/tests/IO/VIA.test.js +503 -0
- package/dist/tests/IO/VIA.test.js.map +1 -0
- package/dist/tests/IO/Video.test.d.ts +1 -0
- package/dist/tests/IO/Video.test.js +549 -0
- package/dist/tests/IO/Video.test.js.map +1 -0
- package/dist/tests/IO/VideoCard.test.d.ts +1 -0
- package/dist/tests/Machine.test.d.ts +1 -0
- package/dist/tests/Machine.test.js +27 -42
- package/dist/tests/Machine.test.js.map +1 -1
- package/dist/tests/RAM.test.d.ts +1 -0
- package/dist/tests/ROM.test.d.ts +1 -0
- package/package.json +5 -3
- package/src/components/IO/{SerialCard.ts → ACIA.ts} +2 -2
- package/src/components/IO/{GPIOAttachments/GPIOAttachment.ts → Attachments/Attachment.ts} +2 -2
- package/src/components/IO/{GPIOAttachments/GPIOJoystickAttachment.ts → Attachments/JoystickAttachment.ts} +3 -3
- package/src/components/IO/{GPIOAttachments/GPIOKeyboardEncoderAttachment.ts → Attachments/KeyboardEncoderAttachment.ts} +3 -3
- package/src/components/IO/{GPIOAttachments/GPIOKeyboardMatrixAttachment.ts → Attachments/KeyboardMatrixAttachment.ts} +5 -5
- package/src/components/IO/{GPIOAttachments/GPIOKeypadAttachment.ts → Attachments/KeypadAttachment.ts} +3 -3
- package/src/components/IO/{GPIOAttachments/GPIOLCDAttachment.ts → Attachments/LCDAttachment.ts} +7 -7
- package/src/components/IO/{EmptyCard.ts → Empty.ts} +1 -1
- package/src/components/IO/{RAMCard.ts → RAMBank.ts} +8 -8
- package/src/components/IO/{RTCCard.ts → RTC.ts} +1 -1
- package/src/components/IO/{SoundCard.ts → Sound.ts} +2 -2
- package/src/components/IO/{StorageCard.ts → Storage.ts} +70 -73
- package/src/components/IO/Terminal.ts +34 -0
- package/src/components/IO/{GPIOCard.ts → VIA.ts} +64 -64
- package/src/components/IO/{VideoCard.ts → Video.ts} +1 -1
- package/src/components/Machine.ts +286 -160
- package/src/index.ts +65 -35
- package/src/lib.ts +27 -0
- package/src/tests/IO/{SerialCard.test.ts → ACIA.test.ts} +5 -5
- package/src/tests/IO/{GPIOAttachments/GPIOAttachment.test.ts → Attachments/Attachment.test.ts} +12 -12
- package/src/tests/IO/{GPIOAttachments/GPIOJoystickAttachment.test.ts → Attachments/JoystickAttachment.test.ts} +23 -23
- package/src/tests/IO/{GPIOAttachments/GPIOKeyboardEncoderAttachment.test.ts → Attachments/KeyboardEncoderAttachment.test.ts} +4 -4
- package/src/tests/IO/{GPIOAttachments/GPIOKeyboardMatrixAttachment.test.ts → Attachments/KeyboardMatrixAttachment.test.ts} +5 -5
- package/src/tests/IO/{GPIOAttachments/GPIOKeypadAttachment.test.ts → Attachments/KeypadAttachment.test.ts} +38 -38
- package/src/tests/IO/{GPIOAttachments/GPIOLCDAttachment.test.ts → Attachments/LCDAttachment.test.ts} +12 -12
- package/src/tests/IO/Empty.test.ts +143 -0
- package/src/tests/IO/{RAMCard.test.ts → RAMBank.test.ts} +33 -33
- package/src/tests/IO/{RTCCard.test.ts → RTC.test.ts} +6 -6
- package/src/tests/IO/{SoundCard.test.ts → Sound.test.ts} +6 -6
- package/src/tests/IO/{StorageCard.test.ts → Storage.test.ts} +34 -25
- package/src/tests/IO/{GPIOCard.test.ts → VIA.test.ts} +7 -7
- package/src/tests/IO/{VideoCard.test.ts → Video.test.ts} +13 -13
- package/src/tests/Machine.test.ts +31 -38
- package/tsconfig.json +1 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { IO } from '../IO';
|
|
2
|
+
/**
|
|
3
|
+
* StorageCard - Emulates a Compact Flash card in 8-bit IDE mode
|
|
4
|
+
*
|
|
5
|
+
* Emulates a 128MB CF card with ATA-style register interface.
|
|
6
|
+
* Uses LBA (Logical Block Addressing) for sector access.
|
|
7
|
+
*
|
|
8
|
+
* Register Map (address & 0x07):
|
|
9
|
+
* $00: Data Register (read/write)
|
|
10
|
+
* $01: Error Register (read) / Feature Register (write)
|
|
11
|
+
* $02: Sector Count Register (read/write)
|
|
12
|
+
* $03: LBA0 Register (read/write) - bits 0-7 of LBA
|
|
13
|
+
* $04: LBA1 Register (read/write) - bits 8-15 of LBA
|
|
14
|
+
* $05: LBA2 Register (read/write) - bits 16-23 of LBA
|
|
15
|
+
* $06: LBA3 Register (read/write) - bits 24-27 of LBA + mode bits
|
|
16
|
+
* $07: Status Register (read) / Command Register (write)
|
|
17
|
+
*
|
|
18
|
+
* Supported Commands:
|
|
19
|
+
* 0x20, 0x21: Read Sector(s)
|
|
20
|
+
* 0x30, 0x31: Write Sector(s)
|
|
21
|
+
* 0xC0: Erase Sector
|
|
22
|
+
* 0xEC: Identify Drive
|
|
23
|
+
* 0xEF: Set Features (accepted but not implemented)
|
|
24
|
+
*/
|
|
25
|
+
export declare class StorageCard implements IO {
|
|
26
|
+
private static readonly STORAGE_SIZE;
|
|
27
|
+
private static readonly SECTOR_SIZE;
|
|
28
|
+
private static readonly SECTOR_COUNT;
|
|
29
|
+
private static readonly STATUS_ERR;
|
|
30
|
+
private static readonly STATUS_DRQ;
|
|
31
|
+
private static readonly STATUS_RDY;
|
|
32
|
+
private static readonly ERR_AMNF;
|
|
33
|
+
private static readonly ERR_ABRT;
|
|
34
|
+
private static readonly ERR_IDNF;
|
|
35
|
+
private storage;
|
|
36
|
+
private identity;
|
|
37
|
+
private buffer;
|
|
38
|
+
private bufferIndex;
|
|
39
|
+
private commandDataSize;
|
|
40
|
+
private sectorOffset;
|
|
41
|
+
private error;
|
|
42
|
+
private feature;
|
|
43
|
+
private sectorCount;
|
|
44
|
+
private lba0;
|
|
45
|
+
private lba1;
|
|
46
|
+
private lba2;
|
|
47
|
+
private lba3;
|
|
48
|
+
private status;
|
|
49
|
+
private command;
|
|
50
|
+
private isIdentifying;
|
|
51
|
+
private isTransferring;
|
|
52
|
+
raiseIRQ: () => void;
|
|
53
|
+
raiseNMI: () => void;
|
|
54
|
+
constructor();
|
|
55
|
+
read(address: number): number;
|
|
56
|
+
write(address: number, data: number): void;
|
|
57
|
+
tick(frequency: number): void;
|
|
58
|
+
reset(coldStart: boolean): void;
|
|
59
|
+
private executeCommand;
|
|
60
|
+
private readBuffer;
|
|
61
|
+
private writeBuffer;
|
|
62
|
+
private sectorIndex;
|
|
63
|
+
private sectorValid;
|
|
64
|
+
private generateIdentity;
|
|
65
|
+
/**
|
|
66
|
+
* Load storage data from a file
|
|
67
|
+
* If the file doesn't exist, storage remains empty (initialized to 0x00)
|
|
68
|
+
*/
|
|
69
|
+
loadFromFile(filePath: string): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Save storage data to a file
|
|
72
|
+
*/
|
|
73
|
+
saveToFile(filePath: string): Promise<void>;
|
|
74
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IO } from '../IO';
|
|
2
|
+
import { VTAC } from 'vtac-terminal';
|
|
3
|
+
/**
|
|
4
|
+
* Terminal - Emulates the VTAC fantasy terminal
|
|
5
|
+
*
|
|
6
|
+
* Register Map:
|
|
7
|
+
* $00: Data / Status Register
|
|
8
|
+
* Write: sends byte to VTAC for processing
|
|
9
|
+
* Read: always returns 0 (bit 7 is a busy flag on the real device; busy is never set here)
|
|
10
|
+
*/
|
|
11
|
+
export declare class Terminal implements IO {
|
|
12
|
+
raiseIRQ: () => void;
|
|
13
|
+
raiseNMI: () => void;
|
|
14
|
+
readonly vtac: VTAC;
|
|
15
|
+
read(address: number): number;
|
|
16
|
+
write(address: number, data: number): void;
|
|
17
|
+
tick(frequency: number): void;
|
|
18
|
+
reset(coldStart: boolean): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Terminal = void 0;
|
|
4
|
+
const vtac_terminal_1 = require("vtac-terminal");
|
|
5
|
+
/**
|
|
6
|
+
* Terminal - Emulates the VTAC fantasy terminal
|
|
7
|
+
*
|
|
8
|
+
* Register Map:
|
|
9
|
+
* $00: Data / Status Register
|
|
10
|
+
* Write: sends byte to VTAC for processing
|
|
11
|
+
* Read: always returns 0 (bit 7 is a busy flag on the real device; busy is never set here)
|
|
12
|
+
*/
|
|
13
|
+
class Terminal {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.raiseIRQ = () => { };
|
|
16
|
+
this.raiseNMI = () => { };
|
|
17
|
+
this.vtac = new vtac_terminal_1.VTAC();
|
|
18
|
+
}
|
|
19
|
+
read(address) {
|
|
20
|
+
// Status register: bit 7 is busy flag on real device, never busy in emulation
|
|
21
|
+
return 0;
|
|
22
|
+
}
|
|
23
|
+
write(address, data) {
|
|
24
|
+
const register = address & 0x00;
|
|
25
|
+
if (register === 0x00) {
|
|
26
|
+
this.vtac.parse(data);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
tick(frequency) { }
|
|
30
|
+
reset(coldStart) { }
|
|
31
|
+
}
|
|
32
|
+
exports.Terminal = Terminal;
|
|
33
|
+
//# sourceMappingURL=Terminal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Terminal.js","sourceRoot":"","sources":["../../../src/components/IO/Terminal.ts"],"names":[],"mappings":";;;AACA,iDAAoC;AAEpC;;;;;;;GAOG;AACH,MAAa,QAAQ;IAArB;QAEE,aAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;QACnB,aAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,CAAA;QAEV,SAAI,GAAS,IAAI,oBAAI,EAAE,CAAA;IAiBlC,CAAC;IAfC,IAAI,CAAC,OAAe;QAClB,8EAA8E;QAC9E,OAAO,CAAC,CAAA;IACV,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,IAAY;QACjC,MAAM,QAAQ,GAAG,OAAO,GAAG,IAAI,CAAA;QAC/B,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACvB,CAAC;IACH,CAAC;IAED,IAAI,CAAC,SAAiB,IAAS,CAAC;IAChC,KAAK,CAAC,SAAkB,IAAS,CAAC;CAEnC;AAtBD,4BAsBC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { IO } from '../IO';
|
|
2
|
+
import { Attachment } from './Attachments/Attachment';
|
|
3
|
+
/**
|
|
4
|
+
* VIA - Emulates the 65C22 VIA (Versatile Interface Adapter)
|
|
5
|
+
*
|
|
6
|
+
* The 65C22 VIA provides:
|
|
7
|
+
* - Two 8-bit bidirectional I/O ports (Port A and Port B)
|
|
8
|
+
* - Two 16-bit timers with interrupt generation
|
|
9
|
+
* - Shift register for serial I/O
|
|
10
|
+
* - Handshaking lines for data transfer
|
|
11
|
+
*/
|
|
12
|
+
export declare class VIA implements IO {
|
|
13
|
+
private static readonly VIA_ORB;
|
|
14
|
+
private static readonly VIA_ORA;
|
|
15
|
+
private static readonly VIA_DDRB;
|
|
16
|
+
private static readonly VIA_DDRA;
|
|
17
|
+
private static readonly VIA_T1CL;
|
|
18
|
+
private static readonly VIA_T1CH;
|
|
19
|
+
private static readonly VIA_T1LL;
|
|
20
|
+
private static readonly VIA_T1LH;
|
|
21
|
+
private static readonly VIA_T2CL;
|
|
22
|
+
private static readonly VIA_T2CH;
|
|
23
|
+
private static readonly VIA_SR;
|
|
24
|
+
private static readonly VIA_ACR;
|
|
25
|
+
private static readonly VIA_PCR;
|
|
26
|
+
private static readonly VIA_IFR;
|
|
27
|
+
private static readonly VIA_IER;
|
|
28
|
+
private static readonly VIA_ORA_NH;
|
|
29
|
+
private static readonly IRQ_CA2;
|
|
30
|
+
private static readonly IRQ_CA1;
|
|
31
|
+
private static readonly IRQ_SR;
|
|
32
|
+
private static readonly IRQ_CB2;
|
|
33
|
+
private static readonly IRQ_CB1;
|
|
34
|
+
private static readonly IRQ_T2;
|
|
35
|
+
private static readonly IRQ_T1;
|
|
36
|
+
private static readonly IRQ_IRQ;
|
|
37
|
+
private static readonly MAX_ATTACHMENTS_PER_PORT;
|
|
38
|
+
private regORB;
|
|
39
|
+
private regORA;
|
|
40
|
+
private regDDRB;
|
|
41
|
+
private regDDRA;
|
|
42
|
+
private regT1C;
|
|
43
|
+
private regT1L;
|
|
44
|
+
private regT2C;
|
|
45
|
+
private regT2L;
|
|
46
|
+
private regSR;
|
|
47
|
+
private regACR;
|
|
48
|
+
private regPCR;
|
|
49
|
+
private regIFR;
|
|
50
|
+
private regIER;
|
|
51
|
+
private CA1;
|
|
52
|
+
private CA2;
|
|
53
|
+
private CB1;
|
|
54
|
+
private CB2;
|
|
55
|
+
private T1_running;
|
|
56
|
+
private T2_running;
|
|
57
|
+
private T1_IRQ_enabled;
|
|
58
|
+
private T2_IRQ_enabled;
|
|
59
|
+
private tickCounter;
|
|
60
|
+
private ticksPerMicrosecond;
|
|
61
|
+
private portA_attachments;
|
|
62
|
+
private portB_attachments;
|
|
63
|
+
private portA_attachmentCount;
|
|
64
|
+
private portB_attachmentCount;
|
|
65
|
+
raiseIRQ: () => void;
|
|
66
|
+
raiseNMI: () => void;
|
|
67
|
+
constructor();
|
|
68
|
+
reset(coldStart: boolean): void;
|
|
69
|
+
read(address: number): number;
|
|
70
|
+
write(address: number, data: number): void;
|
|
71
|
+
tick(frequency: number): void;
|
|
72
|
+
private updateIRQ;
|
|
73
|
+
private setIRQFlag;
|
|
74
|
+
private clearIRQFlag;
|
|
75
|
+
private readPortA;
|
|
76
|
+
private readPortB;
|
|
77
|
+
private writePortA;
|
|
78
|
+
private writePortB;
|
|
79
|
+
private updateCA2;
|
|
80
|
+
private updateCB2;
|
|
81
|
+
private notifyAttachmentsControlLines;
|
|
82
|
+
private sortAttachmentsByPriority;
|
|
83
|
+
/**
|
|
84
|
+
* Attach a GPIO device to Port A
|
|
85
|
+
* @param attachment - The attachment to add
|
|
86
|
+
*/
|
|
87
|
+
attachToPortA(attachment: Attachment): void;
|
|
88
|
+
/**
|
|
89
|
+
* Attach a GPIO device to Port B
|
|
90
|
+
* @param attachment - The attachment to add
|
|
91
|
+
*/
|
|
92
|
+
attachToPortB(attachment: Attachment): void;
|
|
93
|
+
/**
|
|
94
|
+
* Get a Port A attachment by index
|
|
95
|
+
* @param index - The attachment index
|
|
96
|
+
* @returns The attachment or null if not found
|
|
97
|
+
*/
|
|
98
|
+
getPortAAttachment(index: number): Attachment | null;
|
|
99
|
+
/**
|
|
100
|
+
* Get a Port B attachment by index
|
|
101
|
+
* @param index - The attachment index
|
|
102
|
+
* @returns The attachment or null if not found
|
|
103
|
+
*/
|
|
104
|
+
getPortBAttachment(index: number): Attachment | null;
|
|
105
|
+
}
|