a work-in-progress emulator that aims to run BASIC programs, not cycle-accurate.
- 6510 CPU a bit modified version of 6502
(instruction accurate independant emulator) - VIC-II
(Video Interface Chip)• 16 KB address space for screen, character, and sprite memory • 320 × 200 pixels video resolution (160 × 200 in multicolor mode) • 40 × 25 characters text resolution • 8 hardware sprites, each 24 × 21 pixels (12 × 21 in multicolor mode) • 16 colors • Raster interrupts for advanced effects and timing control • Smooth scrolling • Three character display modes and two bitmap modes: - Standard Character Mode - Multicolor Character Mode - Extended Background Color Mode - Standard Bitmap Mode - Multicolor Bitmap Mode - CIA-1 & CIA-2
(Complex Interface Adapters)• keyboard input scanning for detecting key presses • timer A & Timer B in each chip for generating delays and timing events • memory management registers for I/O mapping and bank switching • time of Day (TOD) clock
some one line BASIC programs at ./programs/bas/10_print.bas
10 PRINT CHR$(205.5+RND(1)); : GOTO 10
10 PRINT CHR$(32+(INT(RND(1)+.5)*81)); : GOTO 10
it has a small shell that runs in a separate thread for debugging
and general hardware behaviour observation:
| command | description |
|---|---|
LDP [path] |
Load a BASIC program (.prg) into memory. |
LDD [path] |
Load a (.d64) D64 disk image. |
| - | - |
DMP $st $en |
Dump memory from address $st to $en. |
SCR |
Show CPU status/registers. |
SVR |
Show VIC-II status/registers. |
SC1 |
Show CIA#1 status/registers. |
SC2 |
Show CIA#2 status/registers. |
| - | - |
BRD [1-16] |
Change the border color. |
BGR [1-16] |
Change the background color. |
TXT [1-16] |
Change the text color. |
| - | - |
CLR |
Clear the loaded program from memory and perform a hard reset. |
EXT |
Exit the emulator. |
uses SDL3 as the main library.
however the v1.0 branch still uses MLX42, a lightweight library on top of GLFW.
Linux or MacOSreadline (libreadline-dev)cmake >= 3.18- if trying to compile the v1.0 branch mlx42 needs
glfw (libglfw3-dev)
- install dependencies linux
apt update -y && apt install -y libdreadline-dev cmakeor macos
brew install cmake readline- clone this repository and cd to it
git clone https://github.com/beddinao/commodore_64_emulator.git && cd commodore_64_emulator - compile and run
make && ./c64_emuanimated demos
basic games
some art brought from the C64 demoScene
- Full hardware sprite support (partial-progress)
- SID sound emulation (partial-progress)
- C64 Wiki: https://www.c64-wiki.com/wiki/Main_Page
- memory map: https://sta.c64.org/cbm64mem.html
- VIC-II ultimate resource: https://www.zimmers.net/cbmpics/cbm/c64/vic-ii.txt
- 6502 ultimate resource: https://www.masswerk.at/6502/6502_instruction_set.html
- 6502 BCD: http://www.6502.org/tutorials/decimal_mode.html


















