diff --git a/sources/Debugger/CGramDebug.cpp b/sources/Debugger/CGramDebug.cpp index e8efde0..9c3e4e3 100644 --- a/sources/Debugger/CGramDebug.cpp +++ b/sources/Debugger/CGramDebug.cpp @@ -6,6 +6,7 @@ #include "../SNES.hpp" #include #include +#include #include "../Utility/Utility.hpp" #include "../Exceptions/InvalidAction.hpp" #include "../Exceptions/InvalidAddress.hpp" @@ -68,27 +69,19 @@ QVariant CGramModel::data(const QModelIndex &index, int role) const uint8_t red; uint8_t green; uint8_t blue; - //std::cout << "test1" << std::endl; + if (role == Qt::TextAlignmentRole) return Qt::AlignCenter; - //std::cout << "test2" << std::endl; - - //std::cout << "test3" << std::endl; - if (role != Qt::DisplayRole) + if (role != Qt::BackgroundRole) return QVariant(); - if (role == Qt::BackgroundRole) { - // std::cout << "test" << std::endl; - //unreachable - return 1; - } addressValue = this->_ppu.cgramRead(index.column() * 16 + index.row()); blue = (addressValue & 0x7D00U) >> 10U; green = (addressValue & 0x03E0U) >> 5U; red = (addressValue & 0x001FU); - red = (red * 255U / 31U) << 24U; - green = (green * 255U / 31U) << 16U; - blue = (blue * 255U / 31U) << 8U; + red = red * 255U / 31U; + green = green * 255U / 31U; + blue = blue * 255U / 31U; return QColor(red, green, blue); } \ No newline at end of file diff --git a/ui/cgramView.ui b/ui/cgramView.ui index 73c9102..efefb37 100644 --- a/ui/cgramView.ui +++ b/ui/cgramView.ui @@ -6,8 +6,8 @@ 0 0 - 461 - 346 + 472 + 380 @@ -26,16 +26,34 @@ - 300 - 300 + 324 + 324 - 300 - 300 + 324 + 324 + + false + + + QFrame::Box + + + QFrame::Sunken + + + 0 + + + QAbstractItemView::NoEditTriggers + + + QAbstractItemView::SingleSelection + true @@ -49,9 +67,27 @@ false + + 20 + + + 20 + + + false + false + + 20 + + + 20 + + + false + @@ -221,7 +257,7 @@ 0 0 - 461 + 472 22