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

1.0.0 • Public • Published

CHIP8 Typescript Implementation

Build Status Codacy Badge Coverage Status

Usage

import { createCpu } from "typescript-chip8";
  let cpu = createCpu();

  // Roms are buffers of big-endian 2-byte instructions. You can hard code these...
  const rom = Buffer.from([0x60, 0xaa, 0x61, 0xbb, 0x62, 0xcc]);
  /*
  // Or fetch from a remote source somewhere...
  const rom = await fetch(`http://example.com/roms/HelloWorld.ch8`)
    .then((r) => r.arrayBuffer())
    .then((data) => new Uint8Array(data));
  */
  cpu.load(rom);

  // perform 1 CPU cycle (you could put this in a loop/interval to "run" the cpu forever) 
  cpu.cycle();

Thank you

This would not have been possible if not for these excellent guides;

Readme

Keywords

none

Package Sidebar

Install

npm i typescript-chip8

Weekly Downloads

0

Version

1.0.0

License

GPL-3.0

Unpacked Size

229 kB

Total Files

62

Last publish

Collaborators

  • mikeyhogarth