Skip to content

Latest commit

 

History

History
67 lines (50 loc) · 1.44 KB

File metadata and controls

67 lines (50 loc) · 1.44 KB

OpenCalc Web Simulator (React + WASM)

A web-based simulator for the OpenCalc calculator, running the actual firmware compiled to WebAssembly.

Prerequisites

Build WASM (firmware)

  1. Install Emscripten SDK:
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
  1. Activate Emscripten in your shell:
source ~/emsdk/emsdk_env.sh
  1. From the repository root, run the build script:
./firmware/wasm/build_wasm.sh

This generates:

  • web-sim/src/wasm/opencalc.js
  • web-sim/src/wasm/opencalc.wasm

Run the Web Simulator

cd web-sim
npm install
npm run dev

Then open the URL shown by Vite (usually http://localhost:5173).

Project Structure

web-sim/
├── src/
│   ├── App.jsx          # Main React component
│   ├── styles.css       # Calculator styling
│   ├── main.jsx         # Entry point
│   └── wasm/            # Compiled WASM files
├── public/
│   └── logo.png         # Splash screen logo
└── package.json

Features

  • Splash screen with OpenCalc logo on startup
  • Interactive calculator buttons
  • Keyboard support
  • Real-time firmware rendering via WASM

This web simulator was developed with assistance from Claude (Anthropic).