A C++ implementation of a 6502 CPU emulator.
- CMake (version 3.10 or higher)
- C++ compiler with C++17 support
- GCC 7 or higher
- Clang 5 or higher
- MSVC 2017 or higher
- Create a build directory:
mkdir build
cd build- Generate build files:
cmake ..- Build the project:
cmake --build .- To build in Debug mode:
cmake -DCMAKE_BUILD_TYPE=Debug ..- To treat warnings as errors:
cmake -DWARNINGS_AS_ERRORS=ON ..After building, the executable will be created in your build directory. You can run it with:
./6502cpumain.cpp- Main program entry pointCPU65C02.h- CPU class declarationCPU65C02.cpp- CPU class implementationCMakeLists.txt- CMake build configuration
- Implements basic 6502 CPU instructions
- Supports various addressing modes
- Memory management
- Register operations
- Status flag handling
This project is an emulator for the 6502 microprocessor. It is written in C++ and is designed to be easy to understand and modify.
The project is inspired by Ben Eater's 6502 tutorial. The final goal is to create a fully functional emulator that can run any 6502 program.
All parameters for 6502 cpu can be found here: text
g++ main.cpp -o main
./main
Add -DDEBUG to the command line to enable debug mode.
Add -DSINGLE_STEP to the command line to enable single step mode.
g++ main.cpp -o main -DDEBUG -DSINGLE_STEP