diff options
Diffstat (limited to 'cpu.h')
-rw-r--r-- | cpu.h | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -1,5 +1,29 @@ +#ifndef CPU_H +#define CPU_H + #include <stdint.h> +struct cpu_flags { + uint8_t carry : 1; + uint8_t zero : 1; + uint8_t interrupt_disable : 1; + uint8_t decimal_mode : 1; + uint8_t brk : 1; + uint8_t unused : 1; + uint8_t overflow : 1; + uint8_t negative : 1; +}; + +struct registers { + uint8_t a, x, y, sp; + struct cpu_flags status; + uint16_t pc; +}; +struct registers regs = {0}; + +/* 64K address space, 16bit words */ +uint8_t memory[0x16000]; + /* OFFICIAL OPCODES */ void ADC(uint16_t arg); void AND(uint16_t arg); @@ -87,3 +111,5 @@ void SYA(uint16_t arg); void TOP(uint16_t arg); void XAA(uint16_t arg); void XAS(uint16_t arg); + +#endif /* CPU_H */ |