Initial Commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#ifndef CPU_H
|
||||
#define CPU_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
|
||||
typedef struct {
|
||||
uint16_t ProgrammeCounter;
|
||||
uint8_t StackPointer;
|
||||
|
||||
uint8_t Accumulator;
|
||||
uint8_t X;
|
||||
uint8_t Y;
|
||||
|
||||
union {
|
||||
uint8_t FlagsByte;
|
||||
struct {
|
||||
uint8_t CarryFlag : 1;
|
||||
uint8_t ZeroFlag : 1;
|
||||
uint8_t InterruptDisable : 1;
|
||||
uint8_t DecimalMode : 1;
|
||||
uint8_t BreakCommand : 1;
|
||||
uint8_t UNUSED : 1;
|
||||
uint8_t OverflowFlag : 1;
|
||||
uint8_t NegativeFlag : 1;
|
||||
} Flags;
|
||||
};
|
||||
} CPU;
|
||||
|
||||
void initCPU(CPU *cpu);
|
||||
void resetCPU(CPU *cpu, uint8_t *rom);
|
||||
useconds_t runCycle(CPU *cpu, uint8_t *ram, uint8_t *rom);
|
||||
|
||||
#endif // CPU_H
|
||||
Reference in New Issue
Block a user