1
0
mirror of https://github.com/jborza/emu6502.git synced 2024-11-22 14:32:27 +00:00

cpu state definition

This commit is contained in:
jborza 2019-04-13 10:02:18 +02:00
commit d0230f435c
2 changed files with 26 additions and 0 deletions

13
flags.h Normal file
View File

@ -0,0 +1,13 @@
#pragma once
#include <cstdint>
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;

13
state.h Normal file
View File

@ -0,0 +1,13 @@
#pragma once
#include <cstdint>
#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;