Commit Graph

238 Commits

Author SHA1 Message Date
Ian Flanigan
a94fdaa065
Fix issue #64 (#66)
During the typescriptification of `disk2.js`
(9d0ec5489c), `drive`, a parameter
reference, was changed into `this.drive`, the current active disk, by
mistake. This change fixes that error.
2021-03-21 09:10:55 -07:00
Will Scullin
db36ca4553
type vidoemodes 2021-03-16 19:16:17 -07:00
Will Scullin
4a4d2a2004
lint 2021-03-16 06:33:32 -07:00
Will Scullin
e0ab1f9891
Avoid startup hiccup 2021-03-15 21:08:33 -07:00
Will Scullin
ecef3010fd
stop nibble stream when drive off 2021-03-15 19:27:55 -07:00
Will Scullin
ab3e97e8d1
Convert more cards to typescript (#63)
Convert more cards to typescript
2021-03-15 12:51:40 -07:00
Will Scullin
027b113cd4
reset flag less agressively 2021-03-14 15:15:54 -07:00
Will Scullin
afa33a4710
fix test 2021-03-13 16:54:09 -08:00
Will Scullin
e83fdd999e
Make breakpoints behave better 2021-03-13 16:08:24 -08:00
Will Scullin
b4d6e95ec2
Unenhanded default to non-smartport 2021-03-13 16:07:29 -08:00
Will Scullin
71814744eb
minor cleanup 2021-03-13 13:22:45 -08:00
Will Scullin
a3c7dd136b
Port language card and smartport to TypeScript (#62)
Port language card and smartport to TypeScript.
2021-03-13 13:18:32 -08:00
Will Scullin
bf483e1178
bind this for debugger api 2021-03-13 12:36:19 -08:00
Will Scullin
bb09a1ec33
Improve debug performance, abstract debugger. (#61)
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.
2021-03-11 22:03:05 -08:00
Will Scullin
5f0d07623d
Revert slot 3 rom change 2021-03-09 06:37:34 -08:00
Will Scullin
63e49696b8
Goose slot detection code 2021-03-08 19:28:52 -08:00
Will Scullin
b9bd03b958
correctly report page2 status 2021-03-07 10:48:09 -08:00
Will Scullin
017e152476
fix double cycle when in debug 2021-03-07 10:35:02 -08:00
Will Scullin
2958fe53c1
Fix strobe pass-through 2021-03-07 04:56:41 -08:00
Will Scullin
b687dd9ac3
tweak video7 behaviors 2021-03-06 18:35:55 -08:00
Will Scullin
87b60d4eb4
Type restructuring 2021-03-06 15:07:06 -08:00
Will Scullin
3c5ded7058
Clean up, restructure MMU switches 2021-03-04 06:31:56 -08:00
Will Scullin
24680b989f
fix typo 2021-03-01 21:06:28 -08:00
Will Scullin
774dcf8089
Fix bank 1 bleed-through 2021-03-01 20:47:15 -08:00
Will Scullin
afc5280ac2
Flesh out some state stuff (#59)
Get save and restore state limping along to nearly as well as before I refactored and broke everything.
2021-02-27 19:17:36 -08:00
Will Scullin
983026aa1d
don't watch git 2021-02-23 19:30:57 -08:00
Will Scullin
1802f79769
Add audit disk 2021-02-23 19:23:25 -08:00
Will Scullin
45dfc801fc
still trying to figure out git actions 2021-02-22 03:12:58 -08:00
Will Scullin
3004aa99f2
Fix some edge cases 2021-02-21 21:26:07 -08:00
Will Scullin
be35aa9315
NTSC shader (#58)
Incorporate a real NTSC shader.
2021-02-21 18:38:21 -08:00
Will Scullin
1923d7a71c
Fix gamepad support
Thanks @JasonWoof
2021-02-15 17:55:46 -08:00
Will Scullin
3f966ad608
Basic binary file support. (#56) 2021-02-07 21:58:19 -08:00
Will Scullin
8ddb17202b
fix test typing 2021-02-07 21:54:11 -08:00
Ian Flanigan
279f770e28
Update Typescript and Jest dependencies (#55)
This is a mechanical update to Typescript and Jest dependencies, but
since I also upgraded `npm` to 7.5.2, the `package-lock.json` file has
a lot of churn.
2021-02-07 20:52:16 -08:00
Ian Flanigan
910238bf63
Convert cards/disk2.js to Typescript (#54)
* Convert `cards/disk2.js` to Typescript

This is mostly a straightforward conversion of `cards/disk2.js` to
Typescript, with the following exceptions:

*   `setState()` did not restore the drive light state correctly
    because the callback was called with the old `on` value.

*   `setPhase()` did not work for WOZ images.

*   `getBinary()` did not work for `nib` files.

*   `getBase64()` did not work for `nib` files and maybe didn't work
    right at all.

Even with these fixes, local storage still doesn't work correctly.

I have also added several TODOs where methods don't support WOZ disks.

* Convert most uses of `memory` to `Uint8Array`

There are many places in the existing code where we use `Uint8Array`
directly. This change merely makes the `memory` type equivalent to
`Uint8Array`.

This change also changes most ROM data to be read-only in Typescript
to ensure that it is not modified by mistake. This can't be done just
by applying `as const` to the declaration because `Uint8Array`s are
can not be expressed as literals. Instead, we create a new type,
`ReadonlyUint8Array` that drops the mutation methods and makes indexed
access read-only.

See
https://www.growingwiththeweb.com/2020/10/typescript-readonly-typed-arrays.html
for details.

* Tighten types and document `disk2.ts`

While trying to understand the Disk ][ emulation, I tighted the types
and documented the parts that I could, including references to other
sources, like _Understanding the Apple //e_ by Jim Sather.

The one functional change is the addition of the P6 ROM of DOS 3.2 and
earlier. This is automatically selected if the card is initialized for
13 sector disks.
2021-02-07 20:50:50 -08:00
Ian Flanigan
dc13b6a59a
DOS 13-sector tests and fixes (#53)
Like the DOS 3.3 and ProDOS sector order issues, this change fixes the
physical order of the sectors on 13-sector disks when nibblized.

This change also adds tests for the 13-sector format to verify the
sector order.

One of the crazy things is that _Beneath Apple DOS_ failed me in this
instance because it doesn't discuss what happens to the last byte in
"5 and 3" encoding anywhere (AFAICT). I went back to the DOS 3.1
source released by the Computer History Museum here:

    https://computerhistory.org/blog/apple-ii-dos-source-code/

The code is in `appdos31.lst` in the `POSTNIB` routine on line 4777.
2021-01-03 15:01:30 -08:00
Ian Flanigan
ab748b3aa6
Add JS typing to remaining disk types (#52) 2021-01-03 15:00:40 -08:00
Ian Flanigan
715ea6ffaa
ProDOS image format tests and fixes (#51)
Like the DOS 3.3 sector order issues in #49, this change fixes the
order of the physical sectors on the ProDOS disk when nibblized.

This change also adds tests similar to the DOS 3.3 tests to verify the
sector order.

Because the DOS 3.3 and ProDOS tests are so similar, the utility
methods have been refactored into their own file.
2021-01-03 14:59:42 -08:00
Ian Flanigan
565da09575
Minor type improvements (#50)
* Improve typing for `base64_encode`

* Better typing for `BRA` and `is65C02`
2020-12-29 06:40:58 -08:00
Ian Flanigan
72ecce113a
DOS 3.3 image format tests and fixes (#49)
* Adds an initial test for DOS format (.do) files

* Fix physical sector order when nibblizing DOS 3.3 ordered images

Before, when `.dsk` or `.do` images were nibblized, the resulting
track had the sectors in the wrong physical layout.

Now the nibblized track has the correct physical layout (all sectors
in order) which results in the correct DOS 3.3 layout as well.

There is also a test that verifies the order.

* Add another test for a non-zero sector

The new test checks that the values in physical sector 1 are those for
DOS sector 7.

* Add test for all physical sectors on all tracks

This change also removes a few stray console.log calls in the test.
2020-12-29 06:40:40 -08:00
dependabot[bot]
2f388aab7c
Bump ini from 1.3.5 to 1.3.7 (#48)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-10 18:54:52 -08:00
Will Scullin
1aaa94a8ed
enforce indent case like vscode prefers 2020-11-25 17:28:37 -08:00
Will Scullin
1e58e2c1b8
lint 2020-11-24 08:53:43 -08:00
Ian Flanigan
b80436d99c
More typescript conversion (#46)
* 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.
2020-11-24 08:48:14 -08:00
Will Scullin
e1b807ba9e
minor cleanup 2020-11-15 18:51:05 -08:00
Will Scullin
14b8e13f79
fix test 2020-11-15 18:27:35 -08:00
Will Scullin
231d7d8768
lint 2020-11-15 18:20:58 -08:00
Ian Flanigan
d4478873dd
Make Typescript a bit more strict (#45) 2020-11-15 17:54:37 -08:00
Ian Flanigan
f1b6c51ce7
Fix a "wrong this" bug in cpu6502 (#44) 2020-11-15 17:54:27 -08:00
Ian Flanigan
1e4e8381ec
Fix calls to cpu.cycles() and cpu.sync() (#43)
Apparently, I broke everything when I removed the underscores from the
field names and added them to the method names. The fix is just to
rename the methods `getCycles` and `getSync` and call it a day.
2020-11-15 17:54:13 -08:00