// addressing.h // Contains definitions relevant to addressing, as well as fAddress() which returns time, length, value, and address for an instruction function call. #ifndef ADDRESSING_H #define ADDRESSING_H #include"core.h" 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; #include"instructions.h" //Holds address of current instruction. void* current_instruction; #define getInstructionLength(c) fAddressGetLength(*getInstructionTableAddressing(c)) int fAddressGetLength(Addressing addr); AddData fAddress(Addressing addr, short x); #endif