GithubHelp home page GithubHelp logo

dede2007 / pce Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jsdf/pce

1.0 0.0 0.0 10.78 MB

Emulates Mac Plus, PC, & Atari ST in the browser using WebAssembly

Home Page: https://jamesfriend.com.au/pce-js

License: GNU General Public License v2.0

Shell 0.78% JavaScript 0.34% HTML 0.21% C 95.37% Assembly 1.22% C++ 0.25% Objective-C 0.01% Makefile 1.32% Roff 0.51%

pce's Introduction

PCE.js

PCE.js runs classic computers in the browser. It's a port of Hampa Hug's excellent PCE emulator, put together by James Friend.

PCE.js currently emulates Mac Plus, IBM PC/XT and Atari ST functionally in recent versions of Chrome and Firefox.

More info:

PCE.js Mac Plus

How to run PCE.js on your own website

See this CodePen example.

I recommend installing the native version of PCE on your computer to create your own disk images. Alternatively, you could use Mini vMac.

Installing from npm

PCE.js is available from npm as a set of browserify compatible node packages, which also include UMD bundles.

There is one for each emulator build:

See each of the above links for install and usage instructions

How to build PCE.js from source

Note: I recommend instead just using the npm packages listed above, unless you want to hack on the C source of the emulators themselves (which is not necessary if you just want to get them running on a page).

Make sure you've installed node.js

These instructions assume you're working with my fork of PCE on the pcejs branch. Presumably that's where you're reading this right now.

Run npm install in this directory (the source root). This should install the required node.js tools to build the commonjs modules and run the examples.

Install the Emscripten SDK.

Install and activate version 1.38.48 of the SDK

cd ../path/to/emsdk/
./emsdk install 1.38.48
./emsdk activate 1.38.48
source ./emsdk_env.sh

Check that running emcc -v successfully returns current Emscripten version. Detailed installation instructions are on the Emscripten SDK page.

In the same terminal, return to the pcejs repository. Run ./pcejs_build env once which will create a pcejs_build_conf.sh file if it doesn't already exist.

Most of the build process involves running the ./pcejs_build bash script in the root of the repo. Commands should be run like ./pcejs_build [command] or pcejs_build [command] [arg]

Run ./pcejs_build build [target] to build the emulator, where [target] is macplus, ibmpc or atarist. This will output a pce-[target].js file to dist/.

After the output file for the target you're interested in has been built, you can:

  • run the examples in the example/ directory with ./pcejs_build example [target] or example/run_example.sh [target]
  • build the npm packages in the commonjs/[target]/ directories by running npm run prepublish in the respective directory.

Commands you might be interested in:

  • build [target]: Configure, build and compile emulator to JS. [target] is either one of macplus, ibmpc, atarist or native. Specifiying an emulator arch builds the in-browser emulator JS file for that architecture. native builds all PCE executables normally. If you don't specify a [target] then all JS targets will be built.
  • rebuild: Build last again (eg. after modifying C source)
  • clean: Clean source tree
  • [nothing]: Build all emulator JS targets and (commonjs modules for each)

Other commands (used internally by build scripts)

  • env: Print build environment variables
  • configure: Configure emulator build
  • make: Compile emulator source to LLVM bitcode (used by 'build')
  • remake: Recompile only changed files of emulator source to LLVM bitcode
  • afterbuild: Convert LLVM bitcode to JS
  • module: Build commonjs module (used by commonjs module prepublish scripts)

pce's People

Contributors

apmah avatar jsdf avatar drjosh9000 avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.