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.
Files changed (32) hide show
  1. package/README.md +2 -2
  2. package/dist/components/IO/EmptyCard.js +17 -0
  3. package/dist/components/IO/EmptyCard.js.map +1 -0
  4. package/dist/components/IO/GPIOAttachments/GPIOKeypadAttachment.js +141 -0
  5. package/dist/components/IO/GPIOAttachments/GPIOKeypadAttachment.js.map +1 -0
  6. package/dist/components/IO/GPIOAttachments/GPIOLCDAttachment.js +716 -0
  7. package/dist/components/IO/GPIOAttachments/GPIOLCDAttachment.js.map +1 -0
  8. package/dist/components/IO/SerialCard.js +4 -4
  9. package/dist/components/IO/SerialCard.js.map +1 -1
  10. package/dist/components/Machine.js +84 -45
  11. package/dist/components/Machine.js.map +1 -1
  12. package/dist/index.js +175 -52
  13. package/dist/index.js.map +1 -1
  14. package/dist/tests/IO/GPIOAttachments/GPIOKeypadAttachment.test.js +323 -0
  15. package/dist/tests/IO/GPIOAttachments/GPIOKeypadAttachment.test.js.map +1 -0
  16. package/dist/tests/IO/GPIOAttachments/GPIOLCDAttachment.test.js +627 -0
  17. package/dist/tests/IO/GPIOAttachments/GPIOLCDAttachment.test.js.map +1 -0
  18. package/dist/tests/IO/SerialCard.test.js +4 -4
  19. package/dist/tests/IO/SerialCard.test.js.map +1 -1
  20. package/dist/tests/Machine.test.js +9 -3
  21. package/dist/tests/Machine.test.js.map +1 -1
  22. package/package.json +3 -3
  23. package/src/components/IO/EmptyCard.ts +16 -0
  24. package/src/components/IO/GPIOAttachments/GPIOKeypadAttachment.ts +153 -0
  25. package/src/components/IO/GPIOAttachments/GPIOLCDAttachment.ts +791 -0
  26. package/src/components/IO/SerialCard.ts +4 -4
  27. package/src/components/Machine.ts +107 -61
  28. package/src/index.ts +179 -87
  29. package/src/tests/IO/GPIOAttachments/GPIOKeypadAttachment.test.ts +389 -0
  30. package/src/tests/IO/GPIOAttachments/GPIOLCDAttachment.test.ts +795 -0
  31. package/src/tests/IO/SerialCard.test.ts +4 -4
  32. 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 0 on read (write-only)', () => {
119
+ it('should return data on read', () => {
120
120
  serialCard.write(0x02, 0xFF)
121
121
  const data = serialCard.read(0x02)
122
- expect(data).toBe(0)
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 0 on read (write-only)', () => {
162
+ it('should return data on read', () => {
163
163
  serialCard.write(0x03, 0xFF)
164
164
  const data = serialCard.read(0x03)
165
- expect(data).toBe(0)
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('onJoystick() routes button state to joystick attachment', () => {
296
- const spy = jest.spyOn(machine.joystickAttachment, 'updateJoystick')
297
- machine.onJoystick(0xFF)
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
  })