ac6502 1.0.0 → 1.1.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 +2 -2
- package/dist/components/IO/EmptyCard.js +17 -0
- package/dist/components/IO/EmptyCard.js.map +1 -0
- package/dist/components/IO/GPIOAttachments/GPIOKeypadAttachment.js +141 -0
- package/dist/components/IO/GPIOAttachments/GPIOKeypadAttachment.js.map +1 -0
- package/dist/components/IO/GPIOAttachments/GPIOLCDAttachment.js +716 -0
- package/dist/components/IO/GPIOAttachments/GPIOLCDAttachment.js.map +1 -0
- package/dist/components/IO/SerialCard.js +4 -4
- package/dist/components/IO/SerialCard.js.map +1 -1
- package/dist/components/Machine.js +84 -45
- package/dist/components/Machine.js.map +1 -1
- package/dist/index.js +175 -52
- package/dist/index.js.map +1 -1
- package/dist/tests/IO/GPIOAttachments/GPIOKeypadAttachment.test.js +323 -0
- package/dist/tests/IO/GPIOAttachments/GPIOKeypadAttachment.test.js.map +1 -0
- package/dist/tests/IO/GPIOAttachments/GPIOLCDAttachment.test.js +627 -0
- package/dist/tests/IO/GPIOAttachments/GPIOLCDAttachment.test.js.map +1 -0
- package/dist/tests/IO/SerialCard.test.js +4 -4
- package/dist/tests/IO/SerialCard.test.js.map +1 -1
- package/dist/tests/Machine.test.js +9 -3
- package/dist/tests/Machine.test.js.map +1 -1
- package/package.json +3 -3
- package/src/components/IO/EmptyCard.ts +16 -0
- package/src/components/IO/GPIOAttachments/GPIOKeypadAttachment.ts +153 -0
- package/src/components/IO/GPIOAttachments/GPIOLCDAttachment.ts +791 -0
- package/src/components/IO/SerialCard.ts +4 -4
- package/src/components/Machine.ts +107 -61
- package/src/index.ts +179 -87
- package/src/tests/IO/GPIOAttachments/GPIOKeypadAttachment.test.ts +389 -0
- package/src/tests/IO/GPIOAttachments/GPIOLCDAttachment.test.ts +795 -0
- package/src/tests/IO/SerialCard.test.ts +4 -4
- package/src/tests/Machine.test.ts +10 -3
|
@@ -116,10 +116,10 @@ describe('SerialCard (6551 ACIA)', () => {
|
|
|
116
116
|
})
|
|
117
117
|
|
|
118
118
|
describe('Command Register (0x02)', () => {
|
|
119
|
-
it('should return
|
|
119
|
+
it('should return data on read', () => {
|
|
120
120
|
serialCard.write(0x02, 0xFF)
|
|
121
121
|
const data = serialCard.read(0x02)
|
|
122
|
-
expect(data).toBe(
|
|
122
|
+
expect(data).toBe(0xFF)
|
|
123
123
|
})
|
|
124
124
|
|
|
125
125
|
it('should mask command data to 8 bits', () => {
|
|
@@ -159,10 +159,10 @@ describe('SerialCard (6551 ACIA)', () => {
|
|
|
159
159
|
})
|
|
160
160
|
|
|
161
161
|
describe('Control Register (0x03)', () => {
|
|
162
|
-
it('should return
|
|
162
|
+
it('should return data on read', () => {
|
|
163
163
|
serialCard.write(0x03, 0xFF)
|
|
164
164
|
const data = serialCard.read(0x03)
|
|
165
|
-
expect(data).toBe(
|
|
165
|
+
expect(data).toBe(0xFF)
|
|
166
166
|
})
|
|
167
167
|
|
|
168
168
|
it('should mask control data to 8 bits', () => {
|
|
@@ -292,9 +292,16 @@ describe('Machine', () => {
|
|
|
292
292
|
encoderSpy.mockRestore()
|
|
293
293
|
})
|
|
294
294
|
|
|
295
|
-
test('
|
|
296
|
-
const spy = jest.spyOn(machine.
|
|
297
|
-
machine.
|
|
295
|
+
test('onJoystickA() routes button state to joystick A attachment', () => {
|
|
296
|
+
const spy = jest.spyOn(machine.joystickAttachmentA, 'updateJoystick')
|
|
297
|
+
machine.onJoystickA(0xFF)
|
|
298
|
+
expect(spy).toHaveBeenCalledWith(0xFF)
|
|
299
|
+
spy.mockRestore()
|
|
300
|
+
})
|
|
301
|
+
|
|
302
|
+
test('onJoystickB() routes button state to joystick B attachment', () => {
|
|
303
|
+
const spy = jest.spyOn(machine.joystickAttachmentB, 'updateJoystick')
|
|
304
|
+
machine.onJoystickB(0xFF)
|
|
298
305
|
expect(spy).toHaveBeenCalledWith(0xFF)
|
|
299
306
|
spy.mockRestore()
|
|
300
307
|
})
|