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

28
NES Emulator/bus.h Normal file
View file

@ -0,0 +1,28 @@
#ifndef _BUS_H_
#define _BUS_H_
#include "types.h"
struct CPU;
struct Cartridge;
// Main communication path for devices and memory in the NES
struct Bus
{
Byte* ram;
struct CPU* cpu;
struct Cartridge* cartridge;
};
// Sets up the Bus, allocates memory and creates devices
struct Bus* createBus();
// Destroys the bus, cleans up memory and destroys devices on the Bus
void destroyBus(struct Bus* bus);
// Read/Write to and from the bus
Byte Read(struct Bus* bus, Word addr);
void Write(struct Bus* bus, Word addr, Byte val);
#endif // _BUS_H_