Commit Graph

86 Commits

Author SHA1 Message Date
Will Scullin
4a188a9a5c
Preact UI (#106)
First pass at a Preact UI, still short some major features but full proof of concept.
2022-05-10 06:52:06 -07:00
Will Scullin
a9885dbfbd
Very crude mouse support. (#95) 2021-12-29 15:00:44 -08:00
Will Scullin
2c02567309
lint fixes 2021-12-25 13:35:12 -08:00
Will Scullin
7ceacec28e
Full page improvements (#96)
* Full page improvements

* Update fullscreen api calls, save fullpage state
2021-12-25 07:24:59 -08:00
Will Scullin
ba203498f4
TypeScript remnants (#94)
* Clean up remaining Javascript
* ProDOS to TypeScript.
* NSC to TypeScript
2021-12-22 10:37:21 -08:00
Will Scullin
70ec626dd0
Clean up copyright notices (#93) 2021-12-21 12:35:26 -08:00
Will Scullin
2978b72fec Update eslint, fix issues 2021-11-28 16:20:25 -08:00
Will Scullin
8ab5faee8e
Consistenly use hup to read hash 2021-10-03 11:08:46 -07:00
Will Scullin
2daef8040f
Keep track of disk sides (#87)
Disk side information was being dropped and thus not displayable in the UI. This plumbs the value through various formats and adds some light testing.

Also fixes an issue where URL encoded hashes were not properly interpreted.
2021-10-02 11:45:09 -07:00
Will Scullin
5cd19cb521
Extended debugging ROM 2021-07-17 16:23:49 -07:00
Will Scullin
ce3631f3a2
Refactor disk parsing into webworker (#83)
* Refactor disk handling to allow disk processing to happen in a worker
* Type cleanup
* Convert format handlers to TypeScript
* Convert CFFA to TypeScript
2021-07-06 17:04:02 -07:00
Will Scullin
3abd168627
Fix accelarated default 2021-07-05 09:27:12 -07:00
Will Scullin
389cd857e0
fix acceleration 2021-07-04 19:15:02 -07:00
Will Scullin
b4c13d7620
Use AudioWorklet where available (#82)
Use AudioWorklet where available
2021-06-25 15:38:35 -07:00
Will Scullin
8087294456
Lazy load ROMs (#81)
* Switch modules to `esnext` to allow `webpack` to see import statements
* Pass rom names into Apple2 class
* Move ROMs into `system` and `character` directories to allow webpack bundle appropriate ROMs.
* Wait for ROMs to load before completing initialization.
2021-06-13 17:06:16 -07:00
Will Scullin
af57378852
Videomode refactor 2 (#80)
Remove globals from video implementations to allow further refactoring. Experiment with testing video modes.
2021-05-25 12:08:10 -07:00
Will Scullin
6c4844cb87
Audio context this binding 2021-04-25 12:09:30 -07:00
Will Scullin
66d8fdc2c2
Allow address input (#78)
Allow address input
2021-04-25 09:37:55 -07:00
Will Scullin
09c6d6fbb1
Options modal (#75)
Refactor Options modal, webgl scanline, restore `Apple2.apple2`, other minor fixes.
2021-04-20 17:42:32 -07:00
Ian Flanigan
207bed3d27
Typescriptify ui/apple2.js (#74)
This is mostly a mechanical change; there are still lots of things
about `ui/apple2` that could be improved.  The change also converts a
few dependencies of `ui/apple2`, like `applesoft/compiler`.

Besides the straight conversions, some other packages have changes to
make all of the typing work out.

Lastly, `@types/micromodal` has been added as a development
dependency.
2021-03-30 17:27:44 -07:00
Will Scullin
a7aa5ab902
Oh, Safari 2021-03-28 16:49:09 -07:00
Ian Flanigan
4d7068208a
Typescriptify all of the UI peripherals (#73)
* Typescriptify all of the UI peripherals

This converts the audio, gamepad, keyboard, printer, and tape
peripherals into Typescript. This is a pretty mechanical change.

It does fix issue #72, though.

* Add  and  that were missing
2021-03-28 16:39:18 -07:00
Ian Flanigan
6395a9009e
Converts ui/drive_lights.js to Typescript (#70)
This change also exposes the `Callbacks` and `DriveNumber` types from
`disk2.ts`.
2021-03-26 07:45:51 -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
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
be35aa9315
NTSC shader (#58)
Incorporate a real NTSC shader.
2021-02-21 18:38:21 -08:00
Will Scullin
3f966ad608
Basic binary file support. (#56) 2021-02-07 21:58:19 -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
Will Scullin
1aaa94a8ed
enforce indent case like vscode prefers 2020-11-25 17:28:37 -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
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
Will Scullin
f600f7c6b4
typescript linting 2020-11-07 16:46:27 -08:00
Will Scullin
b3cb64357f
Use class fields instead of binding (#40)
* Use class fields instead of binding
* classy tests
* Fix typing
2020-11-07 08:54:49 -08:00
Ian Flanigan
f5ad2cca16
Track raw parallel port output and allow it to be downloaded (#36)
This change adds a download link to the printer dialog. The contents
of the download will be the raw bytes written to the parallel
interface. Note that often these bytes will have the high-bit set
causing the contents to look like gibberish.

However, this is extremely handy because it allows one to turn the
printer output into a PDF:

1.  In Appleworks (for example) configure an Apple ImageWriter in slot
    1 and print a file.
2.  Download the printer output.
3.  Download the header file from https://github.com/AppleWin/AppleWin/files/1168047/ImageWriterEmulator-NoLF.ps.txt
4.  In Linux, run:
    ```shell
    $ cat ImageWriterEmulator-NoLF.ps.txt raw_printer_output.bin | ps2pdf - printer_output.pdf
    ```

Note that the parallel port emulation in apple2js does not yet support
Print Shop, so I haven't been able to test that out.
2020-10-17 16:53:13 -07:00
Ian Flanigan
ccad317f63
Fix bug where the alert dialog would not close (#32)
Micromodal maintains a reference to the current open dialog in
this.modal. If one dialog is open while opening another, Micromodal
can get confused and maintain a reference to the wrong one.

One of the problems is that the close action is not instantaneous, so
even closing one dialog and opening another immediately after can
cause the problem.

This change adds a small delay before opening the alert dialog to work
around the problem.
2020-10-11 08:53:33 -07:00
Ian Flanigan
f991833d68
Add a "Clear" button to clear the printer paper (#35)
Before, the printer "paper" would just keep accumulating changes. Now
the `printer-modal` dialog has a "clear" button that will the paper.
2020-10-11 08:48:16 -07:00
Will Scullin
ab05e99d81
Simple Smartport (#31)
* Simple Smartport

* Block device support

* turn off verbose debugging

* rom cleanup

* Turn off debugging, again

* Turn off debugging, again, again
2020-09-12 19:42:18 -07:00
Will Scullin
ffe8a76c86
Basic copy and paste. 2020-09-03 22:39:16 -07:00
Will Scullin
05fcc60c2e
Show audio error when loading tape. 2020-08-23 06:36:59 -07:00
Will Scullin
b2afdf7a36
New machine, new lint 2020-07-20 17:12:50 -07:00
Will Scullin
eb6b5620a5
Audio cleanup. 2020-07-20 17:04:55 -07:00
Will Scullin
4046a9dbce
Restore old //e key handling behavior. 2020-06-21 15:52:39 -07:00
Will Scullin
fe2b85f6e3
e e e 2020-06-18 02:34:31 -07:00
Will Scullin
9f34078f30
Fix lint. 2020-04-23 19:50:19 -07:00
Will Scullin
87e8cde031
Style cleanup 2020-04-23 19:48:52 -07:00
Will Scullin
bb6e36f964
Various fixes (#23)
* Sort disks in category order

* Fix saving disk

* Fix keyboard not working after modal

* Make caps lock key on keyboard work, while keeping caps lock on virtual keyboard working too

* Fix delete local storage

* Fix minus key on Mac

* Remove backtick

* Credit.

Co-authored-by: Matthew Hebley <Matthew.Hebley@navico.com>
2020-04-23 19:47:44 -07:00
Will Scullin
8af8cdbbca
Clean up lint. 2020-03-26 20:01:24 -07:00
Will Scullin
91d1d753ad
Eat context menu events. Fixes #21 2020-01-12 11:43:16 -08:00
Will Scullin
ce0a1b59ce
Move most gfx into css. 2020-01-02 21:12:34 -08:00