#pragma once #include typedef uint8_t byte; typedef uint16_t address; extern byte acc; extern byte X; extern byte Y; extern byte P; extern byte S; extern address PC; extern byte* Memory; extern byte ROM[]; enum Addressing { eImmediate, eAccumulator, eZeroPage, eZeroPageIndexedX, eZeroPageIndexedY, eAbsolute, eAbsoluteIndexedX, eAbsoluteIndexedY, eIndexedIndirect, eIndirectIndexed, eImplied, eIndirectAbsolute, eRelative }; typedef int Addressing; struct State { int cycles; int length; address address; byte value; }; extern struct State state; extern void (*Instruction)(Addressing);