mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-05-25 23:48:29 +00:00
added palette viewer debugger to the drop down menu of debuggers
This commit is contained in:
@@ -7,9 +7,8 @@
|
||||
#include <QColor>
|
||||
#include <iostream>
|
||||
#include <bitset>
|
||||
#include <string>
|
||||
#include "../Utility/Utility.hpp"
|
||||
#include "../Exceptions/InvalidAction.hpp"
|
||||
#include "../Exceptions/InvalidAddress.hpp"
|
||||
|
||||
namespace ComSquare::Debugger
|
||||
{
|
||||
@@ -26,7 +25,7 @@ namespace ComSquare::Debugger
|
||||
|
||||
this->_ui.setupUi(this->_window);
|
||||
this->_ui.cgram_view->setModel(&this->_model);
|
||||
|
||||
updateInfoTile(0);
|
||||
this->_window->show();
|
||||
}
|
||||
|
||||
@@ -49,6 +48,22 @@ namespace ComSquare::Debugger
|
||||
{
|
||||
return this->_ppu.cgramRead(addr);
|
||||
}
|
||||
|
||||
void CGramDebug::updateInfoTile(uint8_t addr)
|
||||
{
|
||||
uint16_t cgramValue = this->_ppu.cgramRead(addr);
|
||||
std::cout << "val " << cgramValue << std::endl;
|
||||
uint8_t blue = (cgramValue & 0x7D00U) >> 10U;
|
||||
uint8_t green = (cgramValue & 0x03E0U) >> 5U;
|
||||
uint8_t red = (cgramValue & 0x001FU);
|
||||
|
||||
this->_ui.indexLineEdit->setText(std::to_string(addr).c_str());
|
||||
this->_ui.valueLineEdit->setText(std::to_string(cgramValue).c_str());
|
||||
this->_ui.rLineEdit->setText(std::to_string(red).c_str());
|
||||
this->_ui.gLineEdit->setText(std::to_string(green).c_str());
|
||||
this->_ui.bLineEdit->setText(std::to_string(blue).c_str());
|
||||
this->_ui.hexLineEdit->setText(Utility::to_hex(cgramValue).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
CGramModel::CGramModel(ComSquare::PPU::PPU &ppu) : _ppu(ppu) {}
|
||||
|
||||
Reference in New Issue
Block a user