This simulator is based on the simualator of AK6502 CPU.
NMOS version of the CPU is simulated, cycle accurate. There's no undocumented intructions support,
invalid opcodes are decoded as nop
.
There're no dependencies, only make
and gcc
are needed. Simply type make
to build the library.
It can be installed to /usr/local/lib
via sudo make install
, along with the api header (to /usr/local/include
).
Library interface is available in simak65.h
header.
This structure holds CPU bus read/write callback, that are need to provided by the library user.
This structure holds internal CPU state. It is stored by the library user and needs to be passed to the library functions.
Execute the next instruction.
- cpu - cpu state,
- cycles - optional (can be NULL), number of cycles passed for the execution of the instruction is added to this variable.
Perform the CPU reset. This operation must be performed pefored before executing first instruction.
- cpu - cpu state,
- cycles - optional (can be NULL), number of cycles passed for the execution of the instruction is added to this variable.
Execute the non-maskable interrupt.
- cpu - cpu state,
- cycles - optional (can be NULL), number of cycles passed for the execution of the instruction is added to this variable.
Execute the interrupt.
- cpu - cpu state,
- cycles - optional (can be NULL), number of cycles passed for the execution of the instruction is added to this variable.
Initialize the library and the cpu state.
- cpu - cpu state,
- ops - CPU memory bus callbacks.
See LICENSE for details.