Merge pull request #14 from AnonymusRaccoon/Debugger

Fixing ??? message on the bus's debugger
This commit is contained in:
Anonymus Raccoon
2020-05-18 19:19:43 +02:00
committed by GitHub
3 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -165,12 +165,12 @@ namespace ComSquare::Debugger
void MemoryBusDebug::write(uint24_t addr, uint8_t data) void MemoryBusDebug::write(uint24_t addr, uint8_t data)
{ {
auto accessor = this->getAccessor(addr); auto accessor = this->getAccessor(addr);
uint8_t value = 0; std::optional<uint8_t> value = std::nullopt;
try { try {
if (accessor) if (accessor)
value = accessor->read(addr - accessor->getStart()); value = accessor->read(addr - accessor->getStart());
} catch (InvalidAddress &) { } catch (InvalidAddress &) {
value = 0; value = std::nullopt;
} }
if (!forceSilence) if (!forceSilence)
this->_model.log(BusLog(true, addr, accessor, value, data)); this->_model.log(BusLog(true, addr, accessor, value, data));
+5 -1
View File
@@ -15,7 +15,11 @@ namespace ComSquare::Debugger
{ {
//! @brief The struct used to represent memory bus logs. //! @brief The struct used to represent memory bus logs.
struct BusLog { struct BusLog {
BusLog(bool write, uint24_t addr, std::shared_ptr<Memory::AMemory> &accessor, std::optional<uint8_t> oldData, uint8_t newData); BusLog(bool write,
uint24_t addr,
std::shared_ptr<Memory::AMemory> &accessor,
std::optional<uint8_t> oldData,
uint8_t newData);
bool write; bool write;
uint24_t addr; uint24_t addr;
-2
View File
@@ -10,8 +10,6 @@
#include "Debugger/APUDebug.hpp" #include "Debugger/APUDebug.hpp"
#include "Debugger/MemoryBusDebug.hpp" #include "Debugger/MemoryBusDebug.hpp"
#include "Debugger/CGramDebug.hpp" #include "Debugger/CGramDebug.hpp"
#endif #endif
namespace ComSquare namespace ComSquare