Initial commit
This commit is contained in:
commit
5aa8a64871
11 changed files with 243 additions and 0 deletions
23
NES Emulator/cpu.c
Normal file
23
NES Emulator/cpu.c
Normal 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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue