commit d0230f435c57af4680540dc8f6ba3b27d6d55ad4 Author: jborza Date: Sat Apr 13 10:02:18 2019 +0200 cpu state definition diff --git a/flags.h b/flags.h new file mode 100644 index 0000000..fe66ccf --- /dev/null +++ b/flags.h @@ -0,0 +1,13 @@ +#pragma once +#include + +typedef struct Flags { + uint8_t c : 1; + uint8_t z : 1; + uint8_t i : 1; + uint8_t d : 1; + uint8_t b : 1; + uint8_t pad : 1; + uint8_t v : 1; + uint8_t n : 1; +} Flags; \ No newline at end of file diff --git a/state.h b/state.h new file mode 100644 index 0000000..105777c --- /dev/null +++ b/state.h @@ -0,0 +1,13 @@ +#pragma once +#include +#include "flags.h" + +typedef struct State6502 { + uint8_t A; //accumulator + uint8_t X; //x index + uint8_t Y; //y index + uint8_t SP; //stack pointer, 256 byte stack between $0100 and $01FF + uint16_t PC; //program counter, points to the next instruction to be executed + uint8_t* Memory; + Flags Flags; //CPU flags +} State6502; \ No newline at end of file