24 lines
330 B
C
24 lines
330 B
C
|
#ifndef CPU_H
|
||
|
#define CPU_H
|
||
|
|
||
|
#include <stdint.h>
|
||
|
|
||
|
typedef struct {
|
||
|
// program counter
|
||
|
uint16_t pc;
|
||
|
// stack pointer
|
||
|
uint16_t sp;
|
||
|
|
||
|
// accumulator register
|
||
|
uint8_t a;
|
||
|
// x index register
|
||
|
uint8_t x;
|
||
|
// y index register
|
||
|
uint8_t y;
|
||
|
// processor statuc register
|
||
|
uint8_t p;
|
||
|
|
||
|
uint8_t memory[4096];
|
||
|
} cpu;
|
||
|
|
||
|
#endif
|