# pcejs-ibmpc

> IBM PC/XT emulator for the browser

Latest version **0.2.2** (published 2021-02-07) · 0 weekly downloads

## Install

```sh
npm install pcejs-ibmpc
pnpm add pcejs-ibmpc
yarn add pcejs-ibmpc
bun add pcejs-ibmpc
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2021-02-07 |
| First published | 2014-05-25 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 918 |
| Author | James Friend |
| Maintainers | jsdf |
| Keywords | emulator, browserify |

## Links

- npm: https://www.npmjs.com/package/pcejs-ibmpc
- Repository: https://github.com/jsdf/pce
- Issues: https://github.com/jsdf/pce/issues
- npm.io page: https://npm.io/package/pcejs-ibmpc

## Dependencies (1)

- [xtend](https://npm.io/package/xtend.md) ^3.0.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.2.2 (latest) — 2021-02-07
- 0.2.0 — 2021-02-07
- 0.1.8 — 2014-12-04
- 0.1.7 — 2014-12-04
- 0.1.6 — 2014-12-04
- 0.1.5 — 2014-12-04
- 0.1.4 — 2014-09-27
- 0.1.3 — 2014-05-25
- 0.1.2 — 2014-05-25

## README

### pcejs-ibmpc
a classic pc emulator for the browser

#### getting started
given a commonjs module
```bash
npm init
```
install dependencies
```bash
npm install --save pcejs-ibmpc pcejs-util
```

add some js `index.js`
```js
var ibmpc = require('pcejs-ibmpc')
var utils = require('pcejs-util')

// add a load progress bar. not required, but good ux
var loadingStatus = utils.loadingStatus(document.querySelector('.pcejs-loading-status'))

ibmpc({
  'arguments': ['-c','pce-config.cfg','-r', '-g','vga'],
  autoloadFiles: [
    'basic-1.10.rom',
    'ibm-pc-1982.rom',
    'ibm-xt-1982.rom',
    'ibmpc-pcex.rom',
    'ibmvga.rom',
    'hd0.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`
```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 }
    </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
```bash
curl -O https://jamesfriend.com.au/pce-js/dist/ibmpc-system.zip
unzip ibmpc-system.zip
```

grab the extension rom file from the npm package
```bash
cp node_modules/pcejs-ibmpc/ibmpc-pcex.rom ./ibmpc-pcex.rom
```

bundle it with browserify
```bash
npm install -g browserify@4.x
browserify index.js \
  --noparse="node_modules/pcejs-ibmpc/lib/pcejs-ibmpc.js" \
  > bundle.js
```

serve it up
```bash
npm install -g http-server
open http://localhost:8080
http-server .
```

done

---
_Source: https://npm.io/package/pcejs-ibmpc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
