#ifndef CPU_CORE_H #define CPU_CORE_H typedef unsigned char byte; typedef unsigned short 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; typedef struct AddData { int cycles; int length; address add; byte value; } AddData; // getMemory and setMemory are declared here, but defined in apple.c // This is because memory access of particular memory locations is influenced by the Apple I's specific setup, not by the CPU alone. byte getMemory(address x); void setMemory(address x, byte y); extern void *current_instruction; extern AddData idata; extern void (*func)(Addressing, address); #endif