* 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.
This adds both the recommended TypeScript checks, plus the recommended
TypeScript checks that require type checking. This latter addition
means that eslint essentially has to compile all of the TypeScript in
the project, causing it to be slower. This isn't much of a problem in
VS Code because there's a lot of caching being done, but it's clearly
slower when run on the commandline.
All of the errors are either fixed or suppressed. Some errors are
suppressed because fixing them would be too laborious for the little
value gained.
The eslint config is also slightly refactored to separate the strictly
TypeScript checks from the JavaScript checks.
Stop stringifying opcodes during runtime and only do so upon inspection. Moves all the debugging logic to a common place to allow building an interface.
* Convert js/ram to a class
* Convert js/mmu to Typescript
* Convert js/apple2io to Typescript
* Convert js/canvas to Typescript
* Use new types in js/mmu
* Rename js/symbols.js to js/symbols.ts
* Remove the difference between readPages and writePages
As @whscullin said in PR #38, there's no need to have both readable
and writable pages since all implementations are currently both. This
change combines them into `Page`. Likewise, `PageHandler` now extends
`Page`.
`Apple2IO` now implements `PageHandler`. This caught a bug where `end`
had been renamed `endend` by mistake.
There are a few other formatting changes as well.
* Convert js/apple2 to Typescript
* Convert js/prefs to Typescript
* Convert all of the ROMs in js/roms to Typescript
Now all of the ROMs are classes that extend the ROM class. There is
some rudamentary checking to make sure that the length of the ROM
matches the declared start and end pages. (This caught what looks to
be an error in roms/apple2e, but it's hard for me to tell.)
The typing also caught an error where the character ROM was being
used for the main ROM for the apple2j version.
* Convert js/roms/cards/* to Typescript
* Convert js/formats/format_utils to Typescript
This change also seems to fix a bug with `.po` image files that
weren't being read correctly.