pcjs/modules/pcjs/lib
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2014-11-28 13:35:01 -08:00
..
.jshintrc my_modules is simply modules now 2014-11-11 08:19:48 -08:00
bus.js Added CLTS support, TSS dumping, proper setting of the NT and IOPL flag bits, and more 2014-11-19 10:38:58 -08:00
chipset.js More protected-mode improvements 2014-11-25 17:21:20 -08:00
computer.js Protected-mode interrupt/trap gate fixes 2014-11-28 13:35:01 -08:00
cpu.js Protected-mode interrupt/trap gate fixes 2014-11-28 13:35:01 -08:00
debugger.js Protected-mode interrupt/trap gate fixes 2014-11-28 13:35:01 -08:00
defines.js Some debugging improvements 2014-11-22 09:31:15 -08:00
disk.js Protected-mode interrupt/trap gate fixes 2014-11-28 13:35:01 -08:00
fdc.js Some debugging improvements 2014-11-22 09:31:15 -08:00
hdc.js Assorted RTC and Debugger improvements 2014-11-21 18:05:53 -08:00
keyboard.js Improved control of CPU, INT, SEG and FAULT messages 2014-11-17 17:59:55 -08:00
mem.js 80286 triple-fault happily resets now 2014-11-17 17:26:19 -08:00
mouse.js Turn live register updates OFF by default (gives browsers less reason to bog down) 2014-11-16 11:16:56 -08:00
nodebugger.js my_modules is simply modules now 2014-11-11 08:19:48 -08:00
panel.js Removed useless sHTMLClass parameter from all setBinding() methods 2014-11-15 18:16:48 -08:00
ram.js my_modules is simply modules now 2014-11-11 08:19:48 -08:00
README.md my_modules is simply modules now 2014-11-11 08:19:48 -08:00
rom.js my_modules is simply modules now 2014-11-11 08:19:48 -08:00
serial.js Removed useless sHTMLClass parameter from all setBinding() methods 2014-11-15 18:16:48 -08:00
state.js 80286 triple-fault happily resets now 2014-11-17 17:26:19 -08:00
video.js Protected-mode interrupt/trap gate fixes 2014-11-28 13:35:01 -08:00
x86.js Protected-mode interrupt/trap gate fixes 2014-11-28 13:35:01 -08:00
x86cpu.js Protected-mode interrupt/trap gate fixes 2014-11-28 13:35:01 -08:00
x86grps.js Fixed INT and RETF when stack switches occur 2014-11-26 16:34:54 -08:00
x86help.js Protected-mode interrupt/trap gate fixes 2014-11-28 13:35:01 -08:00
x86mods.js my_modules is simply modules now 2014-11-11 08:19:48 -08:00
x86op0f.js Protected-mode interrupt/trap gate fixes 2014-11-28 13:35:01 -08:00
x86opxx.js Fixed INT and RETF when stack switches occur 2014-11-26 16:34:54 -08:00
x86seg.js Protected-mode interrupt/trap gate fixes 2014-11-28 13:35:01 -08: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.