c-simple-emu-cbm
Here is a simple Commodore 64 and 6502 Emulator I wrote from scratch, ported to C (and some C++) from my C# simple-emu-c64 project. Runs in a text console window. Optionally can specify a binary Commodore program to load, BASIC programs will auto-run. Requires Commodore 64 ROMs (not included) present in the current directory (chargen, kernal and basic). More details may be relevant from the simple-emu-c64 project.
This portable version has been tested with:
- Microsoft Windows 10 (Visual Studio 2017) x64
- cygwin (gcc) x64
- Ubuntu Linux (gcc) x64
- Raspberry Pi 4 (gcc, Linux ARM)
- NXP LPC1768 (ARM MBED): forked
- STM32F429 (ARM MBED, note must rename ADC() method)
- Arduino branched from master
- Teensy_LCD branched from master
Only CHRIN/CHROUT/READY(for startup program)/SETLFS/SETNAM/LOAD/SAVE are hooked, so no, it won't run your favorite games, only maybe simple ASCII text adventures or such. Sorry no PETSCII either. The base portable version (Windows, Linux) also has D64 support for simple emulation of 1541 disk images so you can have a persistant collection of files that should be compatible with other emulators (WARNING: new, only lightly tested).
Usage:
c-simple-emu-cbm
c-simple-emu-cbm samples.d64
c-simple-emu-cbm hello.prg
If a .prg is loaded from the command line, it will create a new disk with the same name and extension .d64 unless it already exists.
Credits:
Thanks to Lars Gregori for clock changes, using system time as available on Windows, Linux, etc.
gettimeofday.c is also under MIT License:
- Copyright (c) 2003 SRA, Inc.
- Copyright (c) 2003 SKC, Inc.