get rid of memory.cc/.hh

also fix bus' shared pointer in cpu
TODO: put cpu in bus not the other way around

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2024-06-14 05:37:10 +05:30
parent ffcdf5f3a7
commit 9397140473
16 changed files with 456 additions and 486 deletions

View File

@@ -5,8 +5,9 @@ using namespace matar;
class CpuFixture {
public:
CpuFixture()
: bus(Memory(std::array<uint8_t, Memory::BIOS_SIZE>(),
std::vector<uint8_t>(Header::HEADER_SIZE)))
: bus(std::shared_ptr<Bus>(
new Bus(std::array<uint8_t, Bus::BIOS_SIZE>(),
std::vector<uint8_t>(Header::HEADER_SIZE))))
, cpu(bus) {}
protected:
@@ -30,7 +31,7 @@ class CpuFixture {
void set_psr(Psr psr, bool spsr = false);
Bus bus;
std::shared_ptr<Bus> bus;
Cpu cpu;
private: