mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-06-03 02:23:49 +00:00
fixed the updateInfoTile
This commit is contained in:
@@ -52,17 +52,20 @@ namespace ComSquare::Debugger
|
|||||||
void CGramDebug::updateInfoTile(uint8_t addr)
|
void CGramDebug::updateInfoTile(uint8_t addr)
|
||||||
{
|
{
|
||||||
uint16_t cgramValue = this->_ppu.cgramRead(addr);
|
uint16_t cgramValue = this->_ppu.cgramRead(addr);
|
||||||
std::cout << "val " << cgramValue << std::endl;
|
|
||||||
uint8_t blue = (cgramValue & 0x7D00U) >> 10U;
|
uint8_t blue = (cgramValue & 0x7D00U) >> 10U;
|
||||||
uint8_t green = (cgramValue & 0x03E0U) >> 5U;
|
uint8_t green = (cgramValue & 0x03E0U) >> 5U;
|
||||||
uint8_t red = (cgramValue & 0x001FU);
|
uint8_t red = (cgramValue & 0x001FU);
|
||||||
|
uint24_t hexColorValue = 0;
|
||||||
|
|
||||||
this->_ui.indexLineEdit->setText(std::to_string(addr).c_str());
|
this->_ui.indexLineEdit->setText(std::to_string(addr).c_str());
|
||||||
this->_ui.valueLineEdit->setText(std::to_string(cgramValue).c_str());
|
this->_ui.valueLineEdit->setText(std::to_string(cgramValue).c_str());
|
||||||
this->_ui.rLineEdit->setText(std::to_string(red).c_str());
|
this->_ui.rLineEdit->setText(std::to_string(red).c_str());
|
||||||
this->_ui.gLineEdit->setText(std::to_string(green).c_str());
|
this->_ui.gLineEdit->setText(std::to_string(green).c_str());
|
||||||
this->_ui.bLineEdit->setText(std::to_string(blue).c_str());
|
this->_ui.bLineEdit->setText(std::to_string(blue).c_str());
|
||||||
this->_ui.hexLineEdit->setText(Utility::to_hex(cgramValue).c_str());
|
hexColorValue += (red * 255U / 31U) << 16U;
|
||||||
|
hexColorValue += (green * 255U / 31U) << 8U;
|
||||||
|
hexColorValue += (blue * 255U / 31U);
|
||||||
|
this->_ui.hexLineEdit->setText(Utility::to_hex(hexColorValue).c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -103,7 +103,7 @@
|
|||||||
<widget class="QLineEdit" name="indexLineEdit">
|
<widget class="QLineEdit" name="indexLineEdit">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>70</width>
|
<width>75</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
<widget class="QLineEdit" name="valueLineEdit">
|
<widget class="QLineEdit" name="valueLineEdit">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>70</width>
|
<width>75</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
<widget class="QLineEdit" name="rLineEdit">
|
<widget class="QLineEdit" name="rLineEdit">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>70</width>
|
<width>75</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@@ -181,7 +181,7 @@
|
|||||||
<widget class="QLineEdit" name="gLineEdit">
|
<widget class="QLineEdit" name="gLineEdit">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>70</width>
|
<width>75</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@@ -207,7 +207,7 @@
|
|||||||
<widget class="QLineEdit" name="bLineEdit">
|
<widget class="QLineEdit" name="bLineEdit">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>70</width>
|
<width>75</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@@ -233,7 +233,7 @@
|
|||||||
<widget class="QLineEdit" name="hexLineEdit">
|
<widget class="QLineEdit" name="hexLineEdit">
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>70</width>
|
<width>75</width>
|
||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user