#pragma once 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 const 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);