What is it?
6502.ts strives to be a collection of emulators for 6502 based systems written in Typescript. It currently provides
- A cycle-exact CPU emulator and a generic debugging environment any attached hardware.
- A minimal hardware monitor for executing the EhBasic interpreter and Klaus Dormann's 6502 testsuite
- A full-featured Atari 2600 emulator, including sound, CRT phosphor simulation, debugging environment and a more user oriented "stellerator" frontend.
The projects targets both NodeJS and the browser as runtime environments (no video or audio on node, of course).
You can find recent builds of the various applications on the project's github.io page.
- vanilla debugger
- hardware monitor frontend / debugger
- Atari 2600 debugger frontend
- Atari 2600 stellerator, development build
- Atari 2600 stellerator, production build
Atari 2600 emulation
6502.ts implements a full-fledged emulator for the Atari 2600 VCS. Apart from the debugger, there are two ways to use the emulator
- Stellerator allows to import, manage and play VCS ROMs in the browser. ROMs are stored locally in the browser. Stellerator is hosted on github.io here.
- Stellerator embedded offers a rich API to embed VCS emulation into web sites and web applications. Please check out the documentation for more information.
Building and development
6502.ts uses Yarn for package management, so you'll have to install it first. After checking out the repos, doing
yarn install grunt initial
will initialize the development environment. You can then do a development build of all
apps with a simple
grunt. Production versions can be build with
grunt build (currently
grunt test will run the testsuite. A web server can be fired up with
After building, additional NodeJS applications for commandline debugging can be found in
Please check the
Gruntfile.js for more build targets.
The core parts of the emulator are available as
The package includes TypeScript typings and can be used directly in TypeScript projects.
Most APIs are pretty stable by now, but not documented yet, with the exception of Stellerator embedded. Please check out the documentation of Stellerator embedded for more details.
License and credits
GNU General Public License
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Third party code
These license conditions do not apply to the contents of the
aux directory which
mostly were written by folks other than me. Specifically:
ehBasicwas taken from Jeff Tranters repository here
- Klaus Dormann's 6502 testsuite (found in
aux/6502_suite) was taken from his repository on github here and is licensed under the GPL.
red_linesample was taken from Kirk Israel's 2600 programming tutorial on AtariAge. The
line_testis a modified version of this code.
playfield_1sample was taken from Kirk Israel's 2600 cookbook.
playfield_2was taken from Andrew Davie's 2600 programming excercises on AtariAge.
vcs.hheaders can be found free-floating on the internet
flappingis a homebrew game written by Kirk Israel available here.
2600 cartridge type detection code (and some of the more exotic cartridge types) were modelled after the excellent Stella emulator. Initial 2600 audio code was contributed by Martin Schröder. ARM support in DPC+ is powered by David Welch's thumbulator, transpiled to JS with emscripten. Cycle-accurate PCM audio is derives from work done by Chris Brenner.