0.1.0 • Published 2 years ago

@sfotty-pie/sfotty v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@sfotty-pie/sfotty

Sfotty is a cycle-exact 6502 (Sixty Five Oh Two) emulator that can run on Node.js or in the browser.

Usage

Import Sfotty from the @sfotty-pie/sfotty package and create a new instance with new Sfotty(memory) where memory is an object implementing the Memory interface:

interface Memory {
	read(address: number): number;
	write(address: number, value: number): void;
}

The CPU starts with a pending reset interrupt. You can execute instructions by repeatedly calling run(). The crashed property returns true if the CPU crashes (by executing an undefined opcode).

Ideas for future versions

  • Serialize/deserialize CPU state
  • Implement undocumented NMOS instructions
  • Implement CMOS (65C02) instruction set