feat: added cpu.h, memory.h and zboy.h
This commit is contained in:
parent
16b355f92b
commit
32a2eab015
3 changed files with 54 additions and 0 deletions
27
hdrs/cpu.h
Normal file
27
hdrs/cpu.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#ifndef CPU_H
|
||||
#define CPU_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct s_cpu
|
||||
{
|
||||
uint8_t a; // Accumulator register
|
||||
uint8_t f; // Flags register (Z, N, H, C)
|
||||
uint8_t b; // General-purpose register B
|
||||
uint8_t c; // General-purpose register C
|
||||
uint8_t d; // General-purpose register D
|
||||
uint8_t e; // General-purpose register E
|
||||
uint8_t h; // General-purpose register H
|
||||
uint8_t l; // General-purpose register L
|
||||
|
||||
uint16_t sp; // Stack pointer
|
||||
uint16_t pc; // Program counter
|
||||
|
||||
uint8_t ime; // Interrupt Master Enable flag
|
||||
uint8_t halted; // Halted state flag
|
||||
uint8_t stopped; // Stopped state flag
|
||||
} t_cpu;
|
||||
|
||||
void cpu_init(t_cpu *cpu);
|
||||
|
||||
#endif CPU_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue