initial commit

This commit is contained in:
Lauchmelder 2022-02-28 16:04:25 +01:00
commit ff8389a76b
No known key found for this signature in database
GPG key ID: C2403C69D78F011D
46 changed files with 9118 additions and 0 deletions

38
src/Bus.hpp Normal file
View file

@ -0,0 +1,38 @@
#pragma once
#include <vector>
#include "Types.hpp"
#include "CPU.hpp"
#include "PPU.hpp"
#include "Cartridge.hpp"
class Bus
{
friend class Debugger;
friend class MemoryViewer;
friend class NametableViewer;
public:
Bus();
void Reboot();
void Reset();
uint8_t Tick();
bool Instruction();
bool Frame();
Byte ReadCPU(Word addr);
Byte ReadPPU(Word addr);
void WriteCPU(Word addr, Byte val);
void WritePPU(Word addr, Byte val);
inline void NMI() { cpu.NMI(); }
private:
std::vector<Byte> RAM, VRAM;
CPU cpu;
PPU ppu;
Cartridge cartridge;
};