ac6502 1.7.0 → 1.9.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 +9 -9
- package/dist/components/IO/ACIA.d.ts +1 -1
- package/dist/components/IO/ACIA.js +1 -1
- package/dist/components/IO/Attachments/LCDAttachment.d.ts +1 -1
- package/dist/components/IO/Attachments/LCDAttachment.js +1 -1
- package/dist/components/IO/RTC.d.ts +3 -5
- package/dist/components/IO/RTC.js +35 -49
- package/dist/components/IO/RTC.js.map +1 -1
- package/dist/components/IO/Storage.js +5 -1
- package/dist/components/IO/Storage.js.map +1 -1
- package/dist/components/IO/VIA.d.ts +2 -2
- package/dist/components/IO/VIA.js +2 -2
- package/dist/components/IO/Video.js +3 -2
- package/dist/components/IO/Video.js.map +1 -1
- package/dist/components/IO.d.ts +1 -1
- package/dist/components/Machine.js +30 -20
- package/dist/components/Machine.js.map +1 -1
- package/dist/index.js +9 -34
- package/dist/index.js.map +1 -1
- package/dist/lib.d.ts +0 -1
- package/dist/lib.js +1 -3
- package/dist/lib.js.map +1 -1
- package/dist/tests/IO/ACIA.test.js +1 -1
- package/dist/tests/IO/ACIA.test.js.map +1 -1
- package/dist/tests/IO/RTC.test.js +5 -8
- package/dist/tests/IO/RTC.test.js.map +1 -1
- package/dist/tests/IO/VIA.test.js +1 -1
- package/dist/tests/IO/VIA.test.js.map +1 -1
- package/dist/tests/IO/Video.test.js +1 -1
- package/dist/tests/Machine.test.js +1 -1
- package/package.json +1 -1
- package/src/components/IO/ACIA.ts +1 -1
- package/src/components/IO/Attachments/LCDAttachment.ts +1 -1
- package/src/components/IO/RTC.ts +38 -51
- package/src/components/IO/Storage.ts +4 -1
- package/src/components/IO/VIA.ts +2 -2
- package/src/components/IO/Video.ts +3 -2
- package/src/components/IO.ts +1 -1
- package/src/components/Machine.ts +32 -20
- package/src/index.ts +10 -36
- package/src/lib.ts +0 -1
- package/src/tests/IO/ACIA.test.ts +1 -1
- package/src/tests/IO/RTC.test.ts +5 -9
- package/src/tests/IO/VIA.test.ts +1 -1
- package/src/tests/IO/Video.test.ts +1 -1
- package/src/tests/Machine.test.ts +1 -1
- package/src/components/IO/Terminal.ts +0 -34
package/src/tests/IO/VIA.test.ts
CHANGED
|
@@ -49,7 +49,7 @@ const createMockAttachment = (options: {
|
|
|
49
49
|
} as Attachment & { setPortAValue: (v: number) => void; setPortBValue: (v: number) => void }
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
describe('VIA (
|
|
52
|
+
describe('VIA (6522 VIA)', () => {
|
|
53
53
|
let gpio: VIA
|
|
54
54
|
|
|
55
55
|
beforeEach(() => {
|
|
@@ -78,7 +78,7 @@ const setupTextMode = (vdp: Video): void => {
|
|
|
78
78
|
* Must not overshoot into the next frame (scanline 0 of the next
|
|
79
79
|
* frame clears the status register during sprite processing).
|
|
80
80
|
*/
|
|
81
|
-
const renderOneFrame = (vdp: Video, frequency: number =
|
|
81
|
+
const renderOneFrame = (vdp: Video, frequency: number = 1000000): void => {
|
|
82
82
|
// At 2MHz: cyclesPerFrame ≈ 33333, each tick = 128 cycles → ~261 ticks/frame
|
|
83
83
|
const ticksPerFrame = Math.ceil((frequency / 60) / 128)
|
|
84
84
|
for (let i = 0; i < ticksPerFrame; i++) {
|
|
@@ -24,7 +24,7 @@ describe('Machine', () => {
|
|
|
24
24
|
|
|
25
25
|
test('Machine initializes with correct default properties', () => {
|
|
26
26
|
expect(machine.isRunning).toBe(false)
|
|
27
|
-
expect(machine.frequency).toBe(
|
|
27
|
+
expect(machine.frequency).toBe(1000000)
|
|
28
28
|
expect(machine.scale).toBe(2)
|
|
29
29
|
expect(machine.frames).toBe(0)
|
|
30
30
|
})
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { IO } from '../IO'
|
|
2
|
-
import { VTAC } from 'vtac-terminal'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Terminal - Emulates the VTAC fantasy terminal
|
|
6
|
-
*
|
|
7
|
-
* Register Map:
|
|
8
|
-
* $00: Data / Status Register
|
|
9
|
-
* Write: sends byte to VTAC for processing
|
|
10
|
-
* Read: always returns 0 (bit 7 is a busy flag on the real device; busy is never set here)
|
|
11
|
-
*/
|
|
12
|
-
export class Terminal implements IO {
|
|
13
|
-
|
|
14
|
-
raiseIRQ = () => {}
|
|
15
|
-
raiseNMI = () => {}
|
|
16
|
-
|
|
17
|
-
readonly vtac: VTAC = new VTAC()
|
|
18
|
-
|
|
19
|
-
read(address: number): number {
|
|
20
|
-
// Status register: bit 7 is busy flag on real device, never busy in emulation
|
|
21
|
-
return 0
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
write(address: number, data: number): void {
|
|
25
|
-
const register = address & 0x00
|
|
26
|
-
if (register === 0x00) {
|
|
27
|
-
this.vtac.parse(data)
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
tick(frequency: number): void {}
|
|
32
|
-
reset(coldStart: boolean): void {}
|
|
33
|
-
|
|
34
|
-
}
|