initial commit
This commit is contained in:
commit
ff8389a76b
46 changed files with 9118 additions and 0 deletions
38
src/Bus.hpp
Normal file
38
src/Bus.hpp
Normal 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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue