Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 793 Bytes

readme.md

File metadata and controls

22 lines (15 loc) · 793 Bytes

@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