nes_rust_wasm
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

nes_rust_wasm

npm version

nes_rust_wasm is a WebAssembly NES emulator based on nes-rust.

How to install

$ npm install nes_rust_wasm

How to use

const nes = require('nes_rust_wasm').WasmNes.new();
nes.set_rom(new Uint8Array(romArrayBuffer));
 
const pixels = new Uint8Array(256 * 240 * 4);
 
// Audio example code is T.B.D.
const audioBuffer = new Float32Array(4096);
 
const runFrame = () => {
  setTimeout(runFrame, 0);
  nes.step_frame();
  nes.update_pixels(pixels);
  // Render pixels
};
 
nes.bootup();
runFrame();

API

Refer to the comments in WasmNes

How to build WebAssembly RISC-V emulator locally

Prerequirements

$ git clone https://github.com/takahirox/nes-rust.git
cd nes-rust/wasm
$ bash build.sh

Package Sidebar

Install

npm i nes_rust_wasm

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

184 kB

Total Files

11

Last publish

Collaborators

  • takahirox