GithubHelp home page GithubHelp logo

jsdf / pce Goto Github PK

View Code? Open in Web Editor NEW
847.0 44.0 86.0 10.83 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%
emulator emscripten pce classic-mac-os ibm-pc atari-st

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 drjosh9000 avatar jsdf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pce's Issues

Interaction between page and simulated PC

First, it is Amazing! Great work. Thank you very much, it is the best web x86 simulator I have ever seen, really. Runs well enough on a netbook with Atom N270 CPU, nothing else to wish =).

I would like to propose 2 features.

  1. Highlevel JS API to simulate keyboard events using characters or scancodes. Will be useful to create simulators running on devices with touchscreens.
  2. Some API to interact with simulator. Preferably virtual auxilary port which can be handled in JS or something like it, so software inside simulator can interact with surrounding web page. There is a lot of great DOS software using fax-modems or even null-modems, but now all those programs are "ex-communicated". Providing such a feature can help to link them again.

Feature request: Merge current PCE into PCE.js

I really like how PCE.js allows me to demonstrate different computers and operating systems to people with only a web browser.

However, the PCE emulator itself was significantly enhanced in the last few years -- after PCE.js was forked. Is it possible to have the current source code of PCE merged into PCE.js?

browserify not found when running run_example.sh

Hi,

first off, i'm not a great expert in JavaSscript. I just recently tried to install & run pce.js.

I works great when using the checked in version of bundle.js. However when i try to rebuild using run_example.sh, i get the error:

./run_example.sh: line 43: <pce.js>/node_modules/.bin//browserify: No such file or directory

Looks like that script is expecting the browserify tool in a path that does not exist.

But there are still problems when i try to fix that, and use the one from emscripten SDK.

  • installing the xtend prerequisite installed it into the node_modules directory of the EMSDK. But that directory is not part of NODE_PATH, so running browserify failed.
  • when if add the directory to NODE_PATH, it works, but the generated bundle.js seems to be broken. It is also much smaller than the original one, so i think it is missing a lot of required things. Any idea what is going wrong?

I use EMSDK 1.39.1 (latest-upstream) and npm 12.9.1 (the one that comes with that SDK). And i'm trying to build the atarist version.

IBMPC DOS Emulator Running Windows 3.0

The mouse does not work. I tried loading Microsoft mouse driver, ct mouse etc. No go. I think mouse support is disabled in the emulator.

Dear James, please fix this. I want to see mouse work in Windows 3.0

Pipe key isn't mapped?

When trying to input the | character by pressing shift + \ the log displays:

sdl: key = 0x00dc

Then nothing else happens.

This is rad โ€” great work! You think it could run A/UX?

So I've been meaning forever to try to get an emulator up and running with A/UX, but kept putting it off; and now it looks like aux-penelope is shutting its doors in a couple of weeks. So I'm scrambling a bit. I was able to wget most of the site, but there are a bunch of weird errors with jagubox directory.

So anyway, my question. Before I just dive in head first here: how much of a "Mac Plus" is this? It seems like the "hardware" requirements might be too steep. And in my head I think of a Mac Plus as terribly slow compared to what was my first computer, an SE/30, though I'm not sure how accurate that impression is considering I was maybe five years old when I made it. (Damned Plus couldn't run my HyperCard stacks.)

So anyway, what's your assessment? Any suggestions?

Remap command?

Is there a way to re-map command so that it goes to the emulator? That is, could option or control be sent as command to the emulated mac?

no mouse?

Hello again.
I found that PC emulation probably does not support mouse?
When I try to use mouse.com, then error is returned: "Microsoft mouse not found".
Tried also your Monkey Island demo and see that cursor is moving by arrows only.

no sound?

Hello.
Is sound going to be emulated in future updates?

Atari ST demo

Hello,

Is there a web page demoing the Atari ST?

Thanks!

Cannot run self build image

Hi!

I cloned this repository and followed the readme.
Finally i got everything to build.

I used the image files from http://jamesfriend.com.au/pce-js/pcejs20131028.zip .
Especially i tried to build the romsplus image.

After grunt afterbuild (and grunt ui), I have some files in the dist folder.

Now I run grunt run and access http://localhost:8080/pce-macplus.html

But i cannot get the image to run.
I get the following failure:

pce-macplus version 20140115-63acfb6
Copyright (C) 2007-2012 Hampa Hug <[email protected]>
CONFIG:   file="roms/pce-config.cfg"
*** loading config file failed

What can I do to fix this?
I added some debug output to the afterbuild step.
This are the packaged files:

Packaging file "/app/pcejs/romsplus/macplus-pcex.rom" to VFS in path "/macplus-pcex.rom".
Packaging file "/app/pcejs/romsplus/pram-mac-plus.dat" to VFS in path "/pram-mac-plus.dat".
Packaging file "/app/pcejs/romsplus/mac-plus.rom" to VFS in path "/mac-plus.rom".
Packaging file "/app/pcejs/romsplus/ser_b.out" to VFS in path "/ser_b.out".
Packaging file "/app/pcejs/romsplus/pce-config.cfg" to VFS in path "/pce-config.cfg".
Packaging file "/app/pcejs/romsplus/games10.dsk" to VFS in path "/games10.dsk".
Packaging file "/app/pcejs/romsplus/ser_a.out" to VFS in path "/ser_a.out".

Can you help?

Node.js support

Could it be possible to run this using node-canvas as video output? This would allow to exec it from the terminal...

Updated npm package or information for assembling the -data file

Hello @jsdf,

Thanks a lot for your work on making emulation on the web possible!

I am interested in trying out pce-js together with some old OS 6 software I've written. I got it to run using the published npm module and instructions, but it seems it is not quite fast enough (I am seeing system to slow messages in the console).

Since the npm module was last updated five years ago, and I don't see the message

Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!`

on https://jamesfriend.com.au/pce-js/system6/, I am wondering whether this repo has some updates that the version on npm is lacking?

I've tried to build this repo myself, but my version of macOS didn't come with LLVM, and I wasn't able to modify /usr/bin to link the version installed by brew.

If you have some time to publish an updated npm package, that'd be greatly appreciated. (If it'd be straightforward to re-build the -data file that is used on your website with a custom config and custom image files, that'd be super helpful too.)

Thanks,
gohai

Atari program won't run in PCE.js , but fine in Hatari

When I try to run "MOM.PRG" on the Internet Archive version of "Mom and Me", the emulated Atari gives the error dialog box for Data on the disk in drive A: may be damaged.

In the browser console, I see several identical errors:
WD179X: READ CRC ERROR (48E2 0000)

However if I download the .ST disk image from IA, then try to run it locally in the Hatari emulator with TOS 1.0, MOM.PRG loads and runs fine.

Anyway, is this something fixable in PCE.js? Or do I need to do something to the disk image?

https://archive.org/details/mom-and-me

Ability to download data from within the emulated OS

In #5 @dluciv explored ways to upload data into the emulated OS, and there are some working examples. I'm curious about the opposite; if, say, we create a HyperCard stack inside the emulator, could we copy it onto a disk and then download the disk in the browser environment?

@DrJosh9000 as you seem to have set up the very cool https://hypercardadventures.com/ with the ability to upload a disk at runtime, maybe you had thoughts about downloading data too? Thanks, all.

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.