var macplus = require('pcejs-macplus')var utils = require('pcejs-util')// add a loading progress bar. not required, but good uxvar loadingStatus = utils.loadingStatus(document.querySelector('.pcejs-loading-status'))macplus({ 'arguments': ['-c','pce-config.cfg','-r'], autoloadFiles: [ 'macplus-pcex.rom', 'mac-plus.rom', 'hd1.qed', 'pce-config.cfg', ], print: console.log.bind(console), printErr: console.warn.bind(console), canvas: document.querySelector('.pcejs-canvas'), monitorRunDependencies: function (remainingDependencies) { loadingStatus.update(remainingDependencies) },})
add some html index.html
<!DOCTYPE html><html> <head> <style type="text/css"> .pcejs { margin-left: auto; margin-right: auto; text-align: center; font-family: sans-serif; /* the canvas *must not* have any border or padding, or mouse coords will be wrong */ border: 0px none; padding: 0; } .pcejs-container { margin-top: 32px } /* macplus has mouse integration, so we can hide the host mouse */ .pcejs-canvas
add a mac os disk image, rom, and pce-config.cfg config file.
the pce-config.cfg config file should reference the disk images you've loaded (in the autoloadFiles array). in this example the disk image is called hd1.qed, but you can replace it with your own hard drive and floppy disk images in .img, .dsk or .qed format. if you change the disk image, make sure update both pce-config.cfg and the autoloadFiles array.
copy the pce rom patch file and wasm file from the npm package to your project