

If you don't want to use Z, you can provide your own header with the types and macros used by the emulator. If defined, it replaces the inclusion of any external header with this one.

There are some predefined macros that control the compilation: Name Static library with a generic CPU emulator ABI to be used in monolithic multi-machine emulators. Shared library with a generic module ABI to be used in modular multi-machine emulators. There is also an Xcode project in development/Xcode with several targets: Target If you preffer to build the emulator as a library, you can use premake4: Then add 6502.h and 6502.c to your project and configure its build system so that CPU_6502_STATIC and CPU_6502_USE_LOCAL_HEADER are predefined when compiling the sources. This is the only dependency, the emulator does not use the C standard library or its headers.
#6502 EMULATOR C SOURCE CODE INSTALL#
You must first install Z, a header-only library that provides types and macros. I use this core in the Nintendo Entertainment System emulator I started as hobby. If you are looking for a MOS 6502 CPU emulator for your project maybe you have found the correct one.
#6502 EMULATOR C SOURCE CODE CODE#
It is fast, small (17 KB when compiled as a x86-64 dynamic library), easy to understand, and the code is commented. It has been used in several machine emulators by other people and it has been extensivelly tested. This is a very accurate 6502 emulator I wrote many years ago. Released under the terms of the GNU General Public License v3. Copyright © 1999-2018 Manuel Sainz de Baranda y Goñi.
