1
0
mirror of https://github.com/mist64/perfect6502.git synced 2024-12-27 05:32:45 +00:00
perfect6502, a MOS 6502 CPU emulator that performs a simulation of the original NMOS 6502 netlist
Go to file
Michael Steil e49ca0be5f cleanups
2014-12-01 12:23:47 +01:00
.gitattributes Introduce end-of-line normalization 2010-09-18 16:38:22 +00:00
.gitignore added object files to .gitignore 2014-11-28 07:56:51 +01:00
apple1basic.bin added apple1basic 2010-10-12 14:29:11 +00:00
apple1basic.c ... 2010-10-20 07:49:51 +00:00
broken_transistors.c fixed "broken transistors" test 2010-10-06 16:53:40 +00:00
cbmbasic.bin cbmbasic does stuff! panics at FF9C (which does not exist!) 2010-09-22 09:53:46 +00:00
cbmbasic.c The state pointer is no longer global, but passed down to every function. 2014-12-01 11:00:30 +01:00
compare.c cleanup 2010-10-05 16:18:28 +00:00
console.c added KERNAL runtime 2010-09-22 10:05:49 +00:00
console.h added KERNAL runtime 2010-09-22 10:05:49 +00:00
emu.c optimizations (~25%) and cleanup 2014-11-28 07:04:07 +01:00
glue.h added KERNAL runtime 2010-09-22 10:05:49 +00:00
Makefile cleanups 2014-12-01 12:23:47 +01:00
Makefile.apple1basic added apple1basic 2010-10-12 14:29:11 +00:00
measure.c rename 2010-10-06 16:34:57 +00:00
nodenames.h cleaned up node names 2014-12-01 11:48:01 +01:00
perfect6502.c cleanups 2014-12-01 12:23:47 +01:00
perfect6502.h cleanups 2014-12-01 12:23:47 +01:00
plugin.c added KERNAL runtime 2010-09-22 10:05:49 +00:00
plugin.h added KERNAL runtime 2010-09-22 10:05:49 +00:00
readdir.c added KERNAL runtime 2010-09-22 10:05:49 +00:00
readdir.h added KERNAL runtime 2010-09-22 10:05:49 +00:00
README.md added README 2014-11-28 08:31:36 +01:00
runtime_init.c The state pointer is no longer global, but passed down to every function. 2014-12-01 11:00:30 +01:00
runtime_init.h debug code; eliminate more duplicate transistors (with c1 and c2 reversed) 2010-10-07 02:19:44 +00:00
runtime.c fixed line endings 2014-11-28 07:57:38 +01:00
runtime.h debug code; eliminate more duplicate transistors (with c1 and c2 reversed) 2010-10-07 02:19:44 +00:00
segdefs.h added node number comments 2010-09-24 10:01:36 +00:00
stat.h added KERNAL runtime 2010-09-22 10:05:49 +00:00
transdefs.h some C 2010-09-22 01:51:38 +00:00

perfect6502

perfect6502 is a MOS 6502 CPU emulator that performs a simulation of the original NMOS 6502 netlist that was extracted by the visual6502.org project.

Consequently, perfect6502 is

  • perfect: It is not a reimplementation of the 6502, but a simulation of the original transistors. Its complete behavior, its internal state and its outputs are half-cycle exact.
  • slow: Even though perfect6502 is highly optimized C code, achieves only 1/150 of the speed of a 1 MHz 6502 on a high-end CPU of 2014.

perfect6502 is useful for

  • understanding and reverse engineering the 6502
  • debugging 6502 emulators by running them side by side with perfect6502

Usage

As a demonstration and as a performance/regression test, perfect6502 is hooked up to Commodore BASIC (cbmbasic).

You can compile the project with

$ make

and run it with

$ ./cbmbasic

You should get the following output:

	**** COMMODORE 64 BASIC V2 ****

 64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.

Credits

perfect6502 is is written by Michael Steil and derived from the JavaScript visual6502 implementation by Greg James, Brian Silverman and Barry Silverman.

Contributing

Further performance optimizations are gladly accepted.