apple2js/js
Ian Flanigan 6923d43873
Fix issue #187 (and upgrade jest) (#188)
* Update jest to v29.5.0

This updates jest to the latest version (29.5.0) and fixes everything
that the upgrade breaks.  One of the biggest differences is that the
mock types changed and I'm once again confused as to the "proper" way
to create mocks in jest.  Whatever.

* Fix issue #187 were bank writing was not working correctly

Before, `mmu.ts` would deactivate writing to the language card if
`prewrite` was reset.  However, it is totally possible to reset
`prewrite` and leave writing enabled, as shown my Sather in
_Understanding the Apple IIe_, table 5.5, p. 5-24.  For example:

```assembly_x86
    sta  $c08a  ; WRITE DISABLE; READ DISABLE
    lda  $c08b  ; PRE-WRITE set
    lda  $c08b  ; WRITE enabled
    sta  $c08a  ; PRE-WRITE reset; WRITE still enabled!
    lda  $c08b  ; PRE-WRITE set; WRITE still enabled!
```

would not work correctly because the last line would clear `_writebsr`
before setting `_prewrite`, which is incorrect.

Now, `_writebsr` is only set when `_prewrite` is set and thus only
cleared when `writeSwitch` is false.  This matches Table 5.5.

* Fix pre-write for the language card

This is the same issue as the `MMU`, namely that `langcard.ts` would
deactivate writing to the language card if `prewrite` was reset.
However, it is totally possible to reset `prewrite` and leave writing
enabled, as shown my Sather in _Understanding the Apple II_, table
5.4, p. 5-30. See the previous commit for an example.

This change also adds a test for the `LanguageCard` class.
2023-07-08 11:18:38 -07:00
..
applesoft Debugger disk info groundwork (#145) 2022-07-23 12:00:38 -07:00
cards Fix issue #187 (and upgrade jest) (#188) 2023-07-08 11:18:38 -07:00
components Fix scss linting (#178) 2023-01-31 17:49:07 -08:00
formats Fix disk format type checks (#176) 2023-01-28 09:06:03 -08:00
intbasic Fix numbers 2022-07-26 18:46:39 -07:00
roms Add the recommended eslint plugins for TypeScript (#121) 2022-05-31 08:38:40 -07:00
ui Shorter touch delay, delay on release (#186) 2023-06-11 16:02:01 -07:00
apple2.ts More debugger panels (#141) 2022-07-13 20:34:50 -07:00
apple2io.ts More debugger panels (#141) 2022-07-13 20:34:50 -07:00
base64.ts Add the recommended eslint plugins for TypeScript (#121) 2022-05-31 08:38:40 -07:00
canvas.ts Add hires preview (#146) 2022-07-23 15:51:12 -07:00
cpu6502.ts More debugger panels (#141) 2022-07-13 20:34:50 -07:00
debugger.ts More debugger panels (#141) 2022-07-13 20:34:50 -07:00
entry2.ts TypeScript remnants (#94) 2021-12-22 10:37:21 -08:00
entry2e.ts TypeScript remnants (#94) 2021-12-22 10:37:21 -08:00
entry.tsx Add the recommended eslint plugins for TypeScript (#121) 2022-05-31 08:38:40 -07:00
gl.ts More debugger panels (#141) 2022-07-13 20:34:50 -07:00
main2.ts Floppy controller refactorings 1 (#155) 2022-08-31 18:55:01 -07:00
main2e.ts Preact mass storage (#125) 2022-06-05 10:57:04 -07:00
mmu.ts Fix issue #187 (and upgrade jest) (#188) 2023-07-08 11:18:38 -07:00
options.ts Apply semi rule to interfaces (#109) 2022-05-10 08:04:20 -07:00
prefs.ts Preact UI (#106) 2022-05-10 06:52:06 -07:00
ram.ts Clean up copyright notices (#93) 2021-12-21 12:35:26 -08:00
symbols.ts More typescript conversion (#46) 2020-11-24 08:48:14 -08:00
types.ts Add the recommended eslint plugins for TypeScript (#121) 2022-05-31 08:38:40 -07:00
util.ts 2IMG Download support. (#137) 2022-06-21 20:34:19 -07:00
videomodes.ts More debugger panels (#141) 2022-07-13 20:34:50 -07:00