Enabling the memory bus debugger

This commit is contained in:
Zoe Roux
2021-07-05 00:23:48 +02:00
parent f16815c36f
commit cb6fb8a240
20 changed files with 475 additions and 418 deletions

View File

@@ -2,7 +2,6 @@
// Created by anonymus-raccoon on 1/23/20.
//
#include <algorithm>
#include <iostream>
#include "SNES.hpp"
#include "Memory/MemoryBus.hpp"
@@ -36,7 +35,7 @@ namespace ComSquare::Memory
return data;
}
uint8_t MemoryBus::peek(uint24_t addr)
std::optional<uint8_t> MemoryBus::peek(uint24_t addr)
{
IMemory *handler = this->getAccessor(addr);
@@ -45,7 +44,7 @@ namespace ComSquare::Memory
try {
return handler->read(handler->getRelativeAddress(addr));
} catch (const InvalidAddress &) {
return 0;
return std::nullopt;
}
}