• Stars
    star
    294
  • Rank 141,303 (Top 3 %)
  • Language
    C
  • License
    MIT License
  • Created over 12 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

perfect6502, a MOS 6502 CPU emulator that performs a simulation of the original NMOS 6502 netlist

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/30 of the speed of a 1 MHz 6502 on a high-end CPU of 2020.

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/cbmbasic

You should get the following output:

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

 64K RAM SYSTEM  38911 BASIC BYTES FREE

READY.

Benchmarking

You can use the UNIX time tool to measure the performance of the emulator. Run time cbmbasic/cbmbasic and press Ctrl+C once it has reached READY. – the "user" time is the effective time that was required to reach character input. On a 1 MHz 6502, this takes 0.05 sec.

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.

More Repositories

1

c64ref

Ultimate Commodore 64 Reference: ROM Disassembly, Memory Map, ...
Python
454
star
2

hvdos

hvdos, a simple DOS emulator based on the OS X Hypervisor.framework
C
442
star
3

cbmsrc

Original source code of various Commodore computers and peripherals.
Roff
435
star
4

cbmbasic

cbmbasic, a portable version of Commodore's version of Microsoft BASIC 6502 as found on the Commodore 64
C
434
star
5

geos

Source code of GEOS 2.0 for the Commodore 64 and 128
Assembly
400
star
6

msbasic

Microsoft BASIC for 6502 (Commodore, Apple, KIM-1, AIM-65, OSI, ...)
Assembly
320
star
7

c64rom

Commodore 64 BASIC and KERNAL Source
Assembly
194
star
8

msdos1

A collection of disassembled and commented source of parts of MS-DOS 1.0
Assembly
182
star
9

visualize_1541

A tool that creates visualizations of the data layout on Commodore 1541 disk images
Python
69
star
10

64er-magazin.de

HTML
68
star
11

80columns

80x25 text mode for the Commodore 64 BASIC/KERNAL environment
Assembly
65
star
12

ccgmsterm

CCGMS Future, a terminal program for the Commodore 64
Assembly
64
star
13

pucrunch

pucrunch, an Optimizing Hybrid LZ77 RLE Data Compression Program for C64/C128/VIC-20/Plus4
C
56
star
14

geowrite

Source code of geoWrite 2.1 for the Commodore 64
Assembly
55
star
15

final_cartridge

Assembly
53
star
16

ctools

ctools, programs for accessing C64 and C128 CP/M disk images (*.D64).
C++
48
star
17

kernalemu

Commodore KERNAL emulator, to run C64/C128 etc. command line applications on UNIX
C
40
star
18

fc3-geos

Final Cartridge III with GEOS
Assembly
33
star
19

extract-adf

extract-adf, a tool that extracts files from (broken) Amiga OFS ADF/ADZ/DMS disk images
C
30
star
20

c64_kernal

Assembly
29
star
21

cbm6502asm

Commodore 6502ASM, the original 6502/65C02/65CE02 Assembler used by Commodore for C65 project
C
28
star
22

cbmbus_doc

HTML
26
star
23

fastboot1541

fastboot1541, an autostart fastloader for the Commodore 64 and 1541 that fits into a single sector.
Assembly
26
star
24

dos1541

The Commodore 1541 DOS ROM, buildable with cc65
Assembly
24
star
25

mxass

mxass, a cross assembler that targets Commodore 64-like platforms (6502/65816/Z80)
Assembly
23
star
26

TopDesk

The TopDesk file manager for the C64/C128 GEOS operating system
Assembly
22
star
27

thewave

The Wave Web Browser for C64/C128 GEOS Wheels
Assembly
19
star
28

datasette_load

A minimal Commodore 64 Datasette program loader
Assembly
16
star
29

nes_snes_controller_6502

NES & SNES Controller Driver for 6502 (Commodore 64)
Assembly
16
star
30

c64bs

C64 KERNAL patch to support ACIA hardware serial, parallel IEEE-488 and more
Assembly
15
star
31

defrag1541

A visual Commodore 64/1541 disk defragmentation program
Visual Basic
15
star
32

ted_kernal

The Commodore TED (C16, C116, Plus/4) KERNAL, buildable with cc65
Assembly
14
star
33

geowrite2rtf

geowrite2txt, a simple tool to convert C64/C128 GEOS GeoWrite documents into plain text
C
14
star
34

static6502

Roff
11
star
35

cbmfs

cbmfs, a Commodore 1541 file system driver for MacFUSE
C
10
star
36

ultimatetron2

Ultimate Tron II is a game for the Commodore 64
Assembly
9
star
37

vis2ascii

vis2ascii, a tool to convert VisAss/F8 AssBlaster C64 assembly into ASCII
C
9
star
38

combine_d64

combine_d64 D64 File Reconstruction Tool
Python
9
star
39

anatomy-4040

Reconstruction of the book "Anatomy of the 4040 Disk Drive" (1988) by Hilaire Gagne from the original files
HTML
8
star
40

extract-md

extract-md, a tool to extract text and graphics from disk images of issues of the German Commodore 64 disk magazine "Magic Disk 64"
C
5
star
41

ps2keyboard

Assembly
4
star
42

darmok

darmok.com: Memes in the Tamarian language
Shell
3
star