A MOS Technology 65(c)02 emulator written in C99. It was made with readability in mind. You can use it easily in your own projects (see m6502_tests.c for an example) just by including m6502.c and m6502.h.
Note that undocumented instructions are not supported, and cycles are counted at instruction level. You can disable decimal mode by setting enable_bcd
to false.
The emulator currently passes the following tests:
- AllSuiteA
- 6502_functional_test
- 6502_decimal_test
- 65C02_extended_opcodes_test
- 65C02_decimal_test
- 6502_interrupt_test
- timingtest
To run the tests, run make && ./m6502_tests
(don't forget to clone the repo with its submodules).