Forgot One

This commit is contained in:
scientiist
2023-01-30 01:17:40 -06:00
parent 6cef1c2f2d
commit a4f4e77754

26
Bus.cpp Normal file
View File

@@ -0,0 +1,26 @@
//
// Created by josh on 1/22/23.
//
#include "Bus.h"
Bus::Bus()
{
cpu.ConnectBus(this);
// Clear ram contents
for (auto &i : ram) i = 0x00;
}
Bus::~Bus()
{
}
void Bus::write(uint16_t addr, uint8_t data)
{
if (addr >= 0x0000 && addr <= 0xFFFF)
ram[addr] = data;
}
uint8_t Bus::read(uint16_t addr, bool readOnly)
{
if (addr >= 0x0000 && addr <= 0xFFFF)
return ram[addr];
}