Initial commit

This commit is contained in:
Lauchmelder 2021-10-20 22:39:29 +02:00
commit 5aa8a64871
11 changed files with 243 additions and 0 deletions

23
NES Emulator/cpu.c Normal file
View file

@ -0,0 +1,23 @@
#include "cpu.h"
#include <stdlib.h>
#include <stdio.h>
#include "bus.h"
struct CPU* createCPU(struct Bus* parent)
{
struct CPU* cpu = (struct CPU*)malloc(sizeof(struct CPU));
if (cpu == NULL)
{
fprintf(stderr, "Failed to create CPU, aborting.\n");
exit(1);
}
cpu->bus = parent;
return cpu;
}
void destroyCPU(struct CPU* cpu)
{
free(cpu);
}