6502 chip family simulator in OCaml. Created for use in a NES emulator in OCaml.
Documentation containing simple examples and reference is available online.
Assuming you have opam
installed with an existing switch, either:
-
add a pin to this repo:
opam pin add nes-ml https://github.com/Firobe/6502-ml.git
-
or clone and run
opam install .
Furthermore, you can run the tests with dune runtest
. To use the library in other programs, see the online documentation.
Its zero page starts at address 0x0000
.
The CPU passes all functional tests of Klaus Dormann's test suite (klaus.bin
is an assembly of 6502_functional_test.a65
) and the Nestest ROM as compared to Nintendulator.
Cycles count is accurate even for supported unofficial instructions, and tested.
Great ressources used: