Thanks to visit codestin.com
Credit goes to github.com

Skip to content

agkaminski/simak65

Repository files navigation

simak65 - 6502 CPU simulator library

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.

Build

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).

API

Library interface is available in simak65.h header.

struct simak65_cpu

This structure holds the whole CPU state and callbacks to the bus operations. Fields bus.read() and bus.write() has to be implemented and populated by the user.

void simak65_step(struct simak65_cpu *cpu)

Execute the next instruction.

void simak65_rst(struct simak65_cpu)

Perform the CPU reset. This operation must be performed pefored before executing first instruction.

void simak65_nmi(struct simak65_cpu)

Execute the non-maskable interrupt.

void simak65_irq(struct simak65_cpu)

Execute the interrupt.

void simak65_init(struct simak65_cpu *cpu)

Initialize the library and the cpu state. The bus substructure of the CPU state has to be populated by the user.

License

See LICENSE for details.