From 24bcafeea3896022704904815d263f69f22e5096 Mon Sep 17 00:00:00 2001
From: Anonymus Raccoon
Date: Thu, 14 May 2020 18:12:29 +0200
Subject: [PATCH] Removing unintended logs to the bus's debugger
---
sources/Debugger/CPU/CPUDebug.cpp | 2 +-
sources/Debugger/CPU/Disassembly.cpp | 10 +++++-----
sources/Debugger/MemoryBusDebug.cpp | 2 +-
sources/SNES.cpp | 1 -
4 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/sources/Debugger/CPU/CPUDebug.cpp b/sources/Debugger/CPU/CPUDebug.cpp
index 6bcb800..d677158 100644
--- a/sources/Debugger/CPU/CPUDebug.cpp
+++ b/sources/Debugger/CPU/CPUDebug.cpp
@@ -414,7 +414,7 @@ QVariant StackModel::data(const QModelIndex &index, int role) const
return QVariant();
uint16_t addr = index.row() * 2 + index.column();
try {
- uint8_t value = this->_bus->read(addr);
+ uint8_t value = this->_bus->read(addr, true);
return (ComSquare::Utility::to_hex(value, ComSquare::Utility::NoPrefix).c_str());
} catch (std::exception &) {
return "??";
diff --git a/sources/Debugger/CPU/Disassembly.cpp b/sources/Debugger/CPU/Disassembly.cpp
index 7541dd7..75aefd2 100644
--- a/sources/Debugger/CPU/Disassembly.cpp
+++ b/sources/Debugger/CPU/Disassembly.cpp
@@ -42,13 +42,13 @@ namespace ComSquare::Debugger
ctx.mFlag = true;
ctx.xFlag = true;
} else {
- uint8_t m = this->_bus->read(pc - 1);
+ uint8_t m = this->_bus->read(pc - 1, true);
ctx.mFlag &= ~m & 0b00100000u;
ctx.xFlag &= ~m & 0b00010000u;
}
}
if (instruction.opcode == 0xE2) { // SEP
- uint8_t m = this->_bus->read(pc - 1);
+ uint8_t m = this->_bus->read(pc - 1, true);
ctx.mFlag |= m & 0b00100000u;
ctx.xFlag |= m & 0b00010000u;
}
@@ -150,7 +150,7 @@ namespace ComSquare::Debugger
std::string CPUDebug::_getAbsoluteValue(uint24_t pc)
{
- uint24_t value = this->_bus->read(pc) + (this->_bus->read(pc + 1, true) << 8u);
+ uint24_t value = this->_bus->read(pc, true) + (this->_bus->read(pc + 1, true) << 8u);
return Utility::to_hex(value, Utility::HexString::AsmPrefix);
}
@@ -193,13 +193,13 @@ namespace ComSquare::Debugger
std::string CPUDebug::_getAbsoluteIndexByXValue(uint24_t pc)
{
- uint24_t value = this->_bus->read(pc) + (this->_bus->read(pc + 1, true) << 8u);
+ uint24_t value = this->_bus->read(pc, true) + (this->_bus->read(pc + 1, true) << 8u);
return Utility::to_hex(value, Utility::HexString::AsmPrefix) + ", x";
}
std::string CPUDebug::_getAbsoluteIndexByYValue(uint24_t pc)
{
- uint24_t value = this->_bus->read(pc) + (this->_bus->read(pc + 1, true) << 8u);
+ uint24_t value = this->_bus->read(pc, true) + (this->_bus->read(pc + 1, true) << 8u);
return Utility::to_hex(value, Utility::HexString::AsmPrefix) + ", y";
}
diff --git a/sources/Debugger/MemoryBusDebug.cpp b/sources/Debugger/MemoryBusDebug.cpp
index 670f484..51bbc4c 100644
--- a/sources/Debugger/MemoryBusDebug.cpp
+++ b/sources/Debugger/MemoryBusDebug.cpp
@@ -150,7 +150,7 @@ namespace ComSquare::Debugger
uint8_t MemoryBusDebug::read(uint24_t addr, bool silence)
{
- if (!silence && !forceSilence) {
+ if (!silence && !this->forceSilence) {
auto accessor = this->getAccessor(addr);
if (!accessor) {
this->_model.log(BusLog(true, addr, accessor, this->_openBus, this->_openBus));
diff --git a/sources/SNES.cpp b/sources/SNES.cpp
index a57cd5a..bb6d7aa 100644
--- a/sources/SNES.cpp
+++ b/sources/SNES.cpp
@@ -3,7 +3,6 @@
//
#include
-#include
#include "SNES.hpp"
#ifdef DEBUGGER_ENABLED
#include "Debugger/CPU/CPUDebug.hpp"