An Apple II emulator originally written in Javascript, now being converted to TypeScript
Go to file
Ian Flanigan 5e224006e4
Make DiskII.drives a Record instead of an array (#154)
Before, the `drives` field was an `array[0..1]` of `Drive`, but all of
the methods took a `DriveNumber`, which was `[1..2]`.  This meant that
code everywhere was always subtracting 1 from the drive number.

Now, `drives` is a `Record<DriveNumber, Drive>`, which means tha it
has indexes `1, 2` and there's no need to subtract 1 everywhere.

This change updates the `DiskII` class and its tests.

The motivation for this change is to slowly split the WOZ disk
implementation from the nibble disk implementation.  I've tried twice,
but the change has always grown too big and hairy, so I'm starting
very small this time and working my way up.
2022-08-31 09:06:38 -07:00
.github/workflows 2IMG Download support. (#137) 2022-06-21 20:34:19 -07:00
asm Very crude mouse support. (#95) 2021-12-29 15:00:44 -08:00
bin Add blank test disks 2022-08-20 08:33:09 -07:00
css Fix copy paste outside of screen (#143) 2022-07-16 20:50:15 -07:00
img
js Make DiskII.drives a Record instead of an array (#154) 2022-08-31 09:06:38 -07:00
json/disks Add blank test disks 2022-08-20 08:33:09 -07:00
test Make DiskII.drives a Record instead of an array (#154) 2022-08-31 09:06:38 -07:00
types Use CSS modules (#123) 2022-06-03 15:30:39 -07:00
workers Clean up copyright notices (#93) 2021-12-21 12:35:26 -08:00
.editorconfig
.eslintignore lint fixes 2021-12-25 13:35:12 -08:00
.eslintrc.json Preact mass storage (#125) 2022-06-05 10:57:04 -07:00
.gitignore Videomode refactor 2 (#80) 2021-05-25 12:08:10 -07:00
.stylelintignore Add stylelint (#139) 2022-06-25 17:40:47 -07:00
.stylelintrc.json Add stylelint (#139) 2022-06-25 17:40:47 -07:00
apple2js.html Fix copy paste outside of screen (#143) 2022-07-16 20:50:15 -07:00
apple2jse.html Fix copy paste outside of screen (#143) 2022-07-16 20:50:15 -07:00
babel.config.js Preact UI (#106) 2022-05-10 06:52:06 -07:00
index.html Fix charset 2022-07-25 19:24:16 -07:00
jest.config.js Use CSS modules (#123) 2022-06-03 15:30:39 -07:00
LICENSE Clean up copyright notices (#93) 2021-12-21 12:35:26 -08:00
package-lock.json Bump terser from 5.6.1 to 5.14.2 (#144) 2022-07-19 18:31:03 -07:00
package.json Add stylelint (#139) 2022-06-25 17:40:47 -07:00
README.md
tsconfig.json Use CSS modules (#123) 2022-06-03 15:30:39 -07:00
webpack.config.js Readable class names for now 2022-06-04 11:08:18 -07:00

apple2js

What is this?

Apple ][js and Apple //jse are Apple ][ and Apple //e emulators written entirely in JavaScript and HTML5.

Things are still a little rough around the edges right now, hopefully I will have more time to clean things up.

First

npm install

To run a development server

npm start

The open either http://localhost:8080/apple2js.html or http://localhost:8080/apple2jse.html

To build a static distribution into dist

npm run build

To add additional disk images, use

./bin/dsk2json -c Category -n Name path/to/image.dsk > json/disks/image.json

then

./bin/index

Updates

2019-03-02

  • Behind the scenes

    A lot of not so visible changes behind the scenes. The website now runs directly off of github, and has a more modern toolchain (Goodbye make, Perl and closure compiler, hello Webpack!) to facilitate development.

  • Performance

    In particular, the screen no longer redraws as quickly as possible.

  • Drag and Drop

    Disk images can be dragged into the window to load them.

  • Contributions

    Thanks to Ian Flanigan for additions to improve ChromeBook behavior.

2017-10-08

  • Better iOS support

    Bluetooth keyboards now work better. Reset is Ctrl-Shift-Delete. iOS now allows loading disks from iCloud and services like Drop Box. Saving locally is still not supported by iOS. I now understand why sound doesn't work, and I'm working on a work-around.

  • Source Maps

    Although the source code has always been available, by default I serve up minified Javascript for performance reasons. But now you can poke around more easily.

Updates (2017-08-31)

(It's been a long time since I updated, so this is a rough list)

  • Videx Videoterm Emulation (][js)

    PR#3 now does something on the Apple ][!.

  • AppleColor RGB Card Emulation (//jse)

    Now supports a bunch of the mostly non-standard video formats found on the AppleColor RGB card, including 16 color text, 16 color hires mode, and mixed black and white and color double hires

  • Machine selection

    You can now select between original, autostart and plus Apple ][s, and unenhanced and enhanced //es.

Updates (2013-07-04)

  • RAMFactor Emulation (//jse)

    I now simulate having a 1 Megabyte RAMFactor card in slot 2.

  • Thunderclock Emulation

    There is cursory emulation of the Thunderclock card, enough to keep ProDOS applications from asking you to enter the date all the time. ProDOS attempts to guess the year from the month, the day and the day of the week, something that needs to be patched every 6 years. This means newer versions think it's 1996, older versions are stuck in the 80s.

  • Firefox Nightly Joystick Support

    Joystick support has yet to officially land, but the latest nightlies support the gamepad API.

Updates (2013-03-20)

  • Animation Frames

    I've switched from using setInterval() to requestAnimationFrame() where supported. This, in conjunction with the graphics re-write, seems to smooth performance and provide a more stable CPU speed.

  • Graphics Re-Write

    This (third) re-write of the graphics system should improve performance with graphics intensive programs. Rather than rendering each graphics update as it happens, updates are rendered each animation frame.

Updates (2013-03-12)

  • Apple //e

    After much flailing, and much staring at MMU emulation code in despair, I've finally published my Apple //e emulator. It's probably a little more rough than I'd hoped, but it has a lot of features that I really wanted to get into it, like basic double hires support, and it uses the enhanced Apple //e ROMs.

Updates (2013-02-25)

  • Joystick Support

    Chrome only so far, the nascent gamepad API has finally allowed me to add basic joystick support. I can now re-live my glory days of Skyfox.

  • Re-written CPU emulator

    I finally got around to applying some of the many lessons I learned along the way writing my first CPU emulator in Javascript. The last re-working gave me about a 100% performance gain.

  • Finally Fixed Oregon Trail

    This seems to have been a major disappointment for many people. I was able to make it as a banker, but I'm embarassed to reveal my score.

  • Competition

    Now in addition to Gil Megidish's Apple2JS, there's a couple of new kids on the block, including David Caldwell's Apple II+ emulator where he's put a lot more thought into the graphics rendering than I have, and appletoo, which I just stumbled across while looking for David's emulator and haven't had much time to look at.

Requirements

  • A Browser with HTML5 Support

    The most recent versions of Google Chrome, Safari, Firefox, and Opera all seem to work reasonably well these days,although variations in HTML5 support pop up, and occasionally a major release will move things around out from under me. IE prior to 9 lacks canvas tag support and is unsupported. IE 9+ renders nicely on a modern machine.

  • Basic Knowledge of the Apple ][

    If you don't know how to use an Apple ][, this won't be much fun for you.

Acknowledgements