JavaScript Machines

PCjs is an IBM PC simulator written entirely in JavaScript. The configuration below specifies a clock speed of 4.77Mhz, with 64Kb of RAM and a monochrome display, using the original IBM PC Model 5150 ROM BIOS and MDA font ROM. For greater control, there's a configuration with a Control Panel and the PCjs Debugger.

PCjs now saves your machine state using browser local storage, so any changes will be preserved when your browser closes, including diskette changes. To restore a diskette's original contents, press "Load Drive" again.

Configurations

PCjs is highly configurable. Each configuration is a separate XML file that specifies the CPU, RAM, ROMs, diskette drives, hard drives, video adapter, serial ports, etc. Configurations also specify which disk images to automatically load. An entire machine state can be pre-loaded as well.

Below are some examples from our growing list of PCjs configurations, including Windows 1.01 running on an IBM PC XT.

IBM PC w/CGA, PC-DOS 1.0, DONKEY.BAS
IBM PC w/CGA
PC-DOS 1.0, DONKEY.BAS
IBM PC XT w/CGA, 10Mb Hard Drive
IBM PC XT w/CGA
PC-DOS 2.0
IBM PC XT w/CGA, Windows 1.01
IBM PC XT w/CGA
Windows 1.01
IBM PC w/MDA, CP/M-86
IBM PC w/MDA
CP/M-86
IBM PC w/MDA, Microsoft Adventure
IBM PC w/MDA
Microsoft Adventure
IBM PC w/CGA, Zork I
IBM PC w/CGA
Zork I

Any changes you make within these simulations are completely private to the computer and web browser being used. Most modern web browsers are supported, including IE9/IE10, Safari, Firefox, Chrome and Opera, and no JavaScript extensions (typed arrays) or third-party libraries are required. Safari is recommended for OS X and iOS users, Firefox or Chrome for others.

The simulations do not send any information back to the server, unless a problem is detected and you explicitly agree to send your simulation state, to help the author diagnose the problem.

Documentation

Documentation is now available that explains how to create custom PCjs simulations and embed them on your own web pages. The process is similar to embedding the C1Pjs simulation created in 2012.

Updates

PCjs v1.08 adds soft-keyboard support, which isn't quite finished (sticky-shift and auto-repeat will be added in a future version), but it's good enough for use on iPads. See the list of PCjs configurations for those that include a soft keyboard. In addition, 1.08 adds support for server-side machine state storage, which allows you to save your machine states remotely and access them from any computer using the same server key. However, server-side storage is still a "work-in-progress," so for now, server keys will be distributed on an extremely limited basis.

PCjs v1.06c adds support for user-defined diskette images. Select "User-defined URL..." from the diskette list and click "Load Drive". Please see Creating PCjs-Compatible Disk Images in the documentation for more information about supported disk images.

PCjs v1.05b adds support for webkitAudioContext, bringing your simulated IBM PC's speaker to life. Relive the thrill of running MUSIC.BAS and listening to those classic tunes.

Questions? jeffpar@mac.com

@jeffpar
February 2013

Other Machine Simulations