pcjs/my_modules/pcjs-client/lib
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2014-10-12 13:41:37 -07:00
..
bus.js Final preparations for open source roll-out 2014-10-12 00:08:15 -07:00
chipset.js Final preparations for open source roll-out 2014-10-12 00:08:15 -07:00
computer.js Make memory state platform-independent 2014-10-12 10:09:55 -07:00
cpu.js Disable TypedArray support for now (still slower than the default Memory implementation) 2014-10-12 13:41:37 -07:00
debugger.js Final preparations for open source roll-out 2014-10-12 00:08:15 -07:00
defines.js Disable TypedArray support for now (still slower than the default Memory implementation) 2014-10-12 13:41:37 -07:00
disk.js Final preparations for open source roll-out 2014-10-12 00:08:15 -07:00
fdc.js Final preparations for open source roll-out 2014-10-12 00:08:15 -07:00
hdc.js Final preparations for open source roll-out 2014-10-12 00:08:15 -07:00
keyboard.js Preparing web server for update to v1.15.4 2014-10-10 16:36:50 -07:00
mem.js Enable TypedArray support at runtime (IE9 is still the outlier) 2014-10-12 13:09:20 -07:00
mouse.js Final preparations for open source roll-out 2014-10-12 00:08:15 -07:00
nodebugger.js Initial commit (a clone of the jsmachines project as of v1.15.3) 2014-09-27 14:52:57 -07:00
panel.js Final preparations for open source roll-out 2014-10-12 00:08:15 -07:00
ram.js Final preparations for open source roll-out 2014-10-12 00:08:15 -07:00
README.md README updates (and some code inspection fixes) 2014-09-28 18:18:53 -07:00
rom.js Final preparations for open source roll-out 2014-10-12 00:08:15 -07:00
serial.js The 5170 AT hard disk controller is limping along now, so I'm getting ready for a 1.15.4 release 2014-10-08 16:15:12 -07:00
state.js Initial commit (a clone of the jsmachines project as of v1.15.3) 2014-09-27 14:52:57 -07:00
video.js Final preparations for open source roll-out 2014-10-12 00:08:15 -07:00
x86.js Final preparations for open source roll-out 2014-10-12 00:08:15 -07:00
x86cpu.js Disable TypedArray support for now (still slower than the default Memory implementation) 2014-10-12 13:41:37 -07:00
x86grps.js Initial commit (a clone of the jsmachines project as of v1.15.3) 2014-09-27 14:52:57 -07:00
x86help.js README updates (and some code inspection fixes) 2014-09-28 18:18:53 -07:00
x86mods.js Initial commit (a clone of the jsmachines project as of v1.15.3) 2014-09-27 14:52:57 -07:00
x86op0f.js Initial commit (a clone of the jsmachines project as of v1.15.3) 2014-09-27 14:52:57 -07:00
x86opxx.js Final preparations for open source roll-out 2014-10-12 00:08:15 -07:00
x86seg.js Final preparations for open source roll-out 2014-10-12 00:08:15 -07:00

PCjs Sources

Structure

All the code for PCjs is contained in the following JavaScript files, which roughly divide the functionality into major PC components, aka "devices". However, not every file implements a device, and "component" is an overloaded term, since Component is also the name of the shared base class used for most PCjs devices (see component.js). So it's best to refer to these files generically as "modules", and more specifically as "device modules" whenever they implement a specific device (or set of devices, in the case of Chipset).

Examples of non-device modules include UI modules like panel.js and debugger.js, and sub-modules like x86opxx.js, x86mods.js and x86help.js that separate the CPU functionality of x86.js into more manageable pieces.

These modules should always be loaded or compiled in the order listed by the pcJSFiles property in package.json, which includes all the necessary shared modules as well. At the time of this writing, the order is:

Some of the modules can be reordered or even omitted (eg, debugger.js or embed.js), but you should observe the following:

  • component.js must be listed before any module that extends Component
  • panel.js should be loaded early to initialize the Control Panel (if any) as soon as possible
  • computer.js should be the last device module, as it supervises and notifies all the other device modules

To minimize ordering requirements, the init() handlers and constructors of all modules should avoid referencing other modules. Device modules should define an initBus() notification handler, which the Computer will call after it has created/initialized the Bus object.