pcejs-macplus
Mac Plus emulator for the browser
Last updated 5 years ago by jsdf .
GPL · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install pcejs-macplus 
SYNC missed versions from official npm registry.

pcejs-macplus

a classic mac emulator for the browser

getting started

given a commonjs module

npm init

install dependencies

npm install --save pcejs-macplus pcejs-util

add some js index.js

var macplus = require('pcejs-macplus')
var utils = require('pcejs-util')

// add a loading progress bar. not required, but good ux
var 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 { cursor: none }
    </style>
  </head>
  <body>
    <div class="pcejs pcejs-container">
      <div class="pcejs pcejs-loading-status">Downloading...</div>
      <div class="pcejs">
        <canvas class="pcejs pcejs-canvas" oncontextmenu="event.preventDefault()"></canvas>
      </div>
    </div>
    <script type="text/javascript" src="bundle.js"></script>
  </body>
</html>

add some files

curl -O http://jamesfriend.com.au/pce-js/dist/macplus-system.zip
unzip macplus-system.zip

grab the extension rom file from the npm package

cp node_modules/pcejs-macplus/macplus-pcex.rom ./macplus-pcex.rom

bundle it with browserify

npm install -g browserify@4.x
browserify index.js \
  --noparse="node_modules/pcejs-macplus/lib/pcejs-macplus.js" \
  > bundle.js

serve it up

npm install -g http-server
open http://localhost:8080
http-server .

done

Current Tags

  • 0.1.5                                ...           latest (5 years ago)

6 Versions

  • 0.1.5                                ...           5 years ago
  • 0.1.4                                ...           5 years ago
  • 0.1.3                                ...           5 years ago
  • 0.1.2                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |