| 1 | #cxx . . $ `<file>/src/SlotViewer.cpp`/include "SlotViewer.h"cxx . . $ `<file>/src/SlotViewer.h`/ |
| 2 | #include "DebuggerData.h"cxx . . $ `<file>/src/DebuggerData.h`/ |
| 3 | #include "OpenMSXConnection.h"cxx . . $ `<file>/src/OpenMSXConnection.h`/ |
| 4 | #include "CommClient.h"cxx . . $ `<file>/src/CommClient.h`/ |
| 5 | #include <QPainter> |
| 6 | #include <QPaintEvent> |
| 7 | #include <QStyleOptionHeader> |
| 8 | |
| 9 | |
| 10 | class DebugMemMapperHandlercxx . . $ DebugMemMapperHandler# : public SimpleCommandcxx . . $ SimpleCommand# |
| 11 | { |
| 12 | public: |
| 13 | DebugMemMapperHandlercxx . . $ DebugMemMapperHandler#DebugMemMapperHandler(21e5cb46de99d45).(SlotViewercxx . . $ SlotViewer#& viewer_) |
| 14 | : SimpleCommandcxx . . $ SimpleCommand#("debug_memmapper"cxx . . $ QString#QString(85c52e162fed56f9).) |
| 15 | , viewercxx . . $ DebugMemMapperHandler#viewer.(viewer_) |
| 16 | { |
| 17 | } |
| 18 | |
| 19 | void replyOkcxx . . $ DebugMemMapperHandler#replyOk(3520e46b33348bf6).(const QStringcxx . . $ QString#& message) override |
| 20 | { |
| 21 | viewercxx . . $ DebugMemMapperHandler#viewer..updateSlotscxx . . $ SlotViewer#updateSlots(3520e46b33348bf6).(message); |
| 22 | delete this; |
| 23 | } |
| 24 | |
| 25 | private: |
| 26 | SlotViewercxx . . $ SlotViewer#& viewercxx . . $ DebugMemMapperHandler#viewer.; |
| 27 | }; |
| 28 | |
| 29 | |
| 30 | SlotViewercxx . . $ SlotViewer#::SlotViewercxx . . $ SlotViewer#SlotViewer(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget#* parent) |
| 31 | : QFramecxx . . $ QFrame#(parent) |
| 32 | { |
| 33 | setFrameStylecxx . . $ QFrame#setFrameStyle(d4f767463ce0a6b3).(WinPanelcxx . . $ QFrame#WinPanel. |cxx . . $ `operator|`(44af6e16e9fc6bb). Sunkencxx . . $ QFrame#Sunken.); |
| 34 | setFocusPolicycxx . . $ QWidget#setFocusPolicy(84f385f4ea7c1696).(Qtcxx . . $ Qt/::StrongFocuscxx . . $ Qt/StrongFocus.); |
| 35 | setBackgroundRolecxx . . $ QWidget#setBackgroundRole(656661f550a99654).(QPalettecxx . . $ QPalette#::Basecxx . . $ QPalette#Base.); |
| 36 | setSizePolicycxx . . $ QWidget#setSizePolicy(41340f53ecd443dd).(QSizePolicycxx . . $ QSizePolicy#QSizePolicy(dc90913e2b9d0ddb).(QSizePolicycxx . . $ QSizePolicy#::Fixedcxx . . $ QSizePolicy#Fixed., QSizePolicycxx . . $ QSizePolicy#::Minimumcxx . . $ QSizePolicy#Minimum.)); |
| 37 | |
| 38 | memLayoutcxx . . $ SlotViewer#memLayout. = nullptr; |
| 39 | for (int p = 0; p < 4; ++p) { |
| 40 | slotsChangedcxx . . $ SlotViewer#slotsChanged.[p] = false; |
| 41 | segmentsChangedcxx . . $ SlotViewer#segmentsChanged.[p] = false; |
| 42 | } |
| 43 | |
| 44 | frameRcxx . . $ SlotViewer#frameR. = frameLcxx . . $ SlotViewer#frameL. = frameTcxx . . $ SlotViewer#frameT. = frameBcxx . . $ SlotViewer#frameB. = frameWidthcxx . . $ QFrame#frameWidth(455f465bc33b4cdf).(); |
| 45 | |
| 46 | headerSize1cxx . . $ SlotViewer#headerSize1. = 8 + fontMetricscxx . . $ QWidget#fontMetrics(ee264e9e8967f9a7).().horizontalAdvancecxx . . $ QFontMetrics#horizontalAdvance(91f46685ef4c12b5).("Page"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 47 | headerSize2cxx . . $ SlotViewer#headerSize2. = 8 + fontMetricscxx . . $ QWidget#fontMetrics(ee264e9e8967f9a7).().horizontalAdvancecxx . . $ QFontMetrics#horizontalAdvance(91f46685ef4c12b5).("Address"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 48 | headerSize3cxx . . $ SlotViewer#headerSize3. = 8 + fontMetricscxx . . $ QWidget#fontMetrics(ee264e9e8967f9a7).().horizontalAdvancecxx . . $ QFontMetrics#horizontalAdvance(91f46685ef4c12b5).("Slot"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 49 | headerSize4cxx . . $ SlotViewer#headerSize4. = 8 + fontMetricscxx . . $ QWidget#fontMetrics(ee264e9e8967f9a7).().horizontalAdvancecxx . . $ QFontMetrics#horizontalAdvance(91f46685ef4c12b5).("Segment"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 50 | headerHeightcxx . . $ SlotViewer#headerHeight. = 8 + fontMetricscxx . . $ QWidget#fontMetrics(ee264e9e8967f9a7).().heightcxx . . $ QFontMetrics#height(455f465bc33b4cdf).(); |
| 51 | } |
| 52 | |
| 53 | void SlotViewercxx . . $ SlotViewer#::resizeEventcxx . . $ SlotViewer#resizeEvent(eeeec21cf8dc0387).(QResizeEventcxx . . $ QResizeEvent#* e) |
| 54 | { |
| 55 | QFramecxx . . $ QFrame#::resizeEventcxx . . $ QWidget#resizeEvent(eeeec21cf8dc0387).(e); |
| 56 | } |
| 57 | |
| 58 | void SlotViewercxx . . $ SlotViewer#::paintEventcxx . . $ SlotViewer#paintEvent(f239c9e85d61a220).(QPaintEventcxx . . $ QPaintEvent#* e) |
| 59 | { |
| 60 | // call parent for drawing the actual frame |
| 61 | QFramecxx . . $ QFrame#::paintEventcxx . . $ QFrame#paintEvent(f239c9e85d61a220).(e); |
| 62 | |
| 63 | QPaintercxx . . $ QPainter# pcxx . . $ QPainter#QPainter(dd2eedc069b0ab5f).(this); |
| 64 | |
| 65 | // calc and set drawing bounds |
| 66 | QRectcxx . . $ QRect# r(e->rectcxx . . $ QPaintEvent#rect(f4023511c62cad66).()); |
| 67 | if (r.leftcxx . . $ QRect#left(ea6fe5115c70a13f).() < frameLcxx . . $ SlotViewer#frameL.) r.setLeftcxx . . $ QRect#setLeft(f349c77f591a7878).(frameLcxx . . $ SlotViewer#frameL.); |
| 68 | if (r.topcxx . . $ QRect#top(ea6fe5115c70a13f).() < frameTcxx . . $ SlotViewer#frameT.) r.setTopcxx . . $ QRect#setTop(f349c77f591a7878). (frameTcxx . . $ SlotViewer#frameT.); |
| 69 | if (r.rightcxx . . $ QRect#right(ea6fe5115c70a13f).() > widthcxx . . $ QWidget#width(455f465bc33b4cdf).() - frameRcxx . . $ SlotViewer#frameR. - 1) r.setRightcxx . . $ QRect#setRight(f349c77f591a7878). (widthcxx . . $ QWidget#width(455f465bc33b4cdf).() - frameRcxx . . $ SlotViewer#frameR. - 1); |
| 70 | if (r.bottomcxx . . $ QRect#bottom(ea6fe5115c70a13f).() > heightcxx . . $ QWidget#height(455f465bc33b4cdf).() - frameBcxx . . $ SlotViewer#frameB. - 1) r.setBottomcxx . . $ QRect#setBottom(f349c77f591a7878).(heightcxx . . $ QWidget#height(455f465bc33b4cdf).() - frameBcxx . . $ SlotViewer#frameB. - 1); |
| 71 | p.setClipRectcxx . . $ QPainter#setClipRect(2f5004bd5eb598d2).(r); |
| 72 | |
| 73 | // redraw background |
| 74 | p.fillRectcxx . . $ QPainter#fillRect(b5c43933f089f858).(r, palettecxx . . $ QWidget#palette(a7bd6a16d2c88209).().colorcxx . . $ QPalette#color(a08a5ea14130e12).(QPalettecxx . . $ QPalette#::Basecxx . . $ QPalette#Base.)); |
| 75 | |
| 76 | QStyleOptionHeadercxx . . $ QStyleOptionHeader# socxx . . $ QStyleOptionHeader#QStyleOptionHeader(49f6e7a06ebc5aa8).; |
| 77 | so.initcxx . . $ QStyleOption#init(20cdb7fa2a1349c7).(this); |
| 78 | so.statecxx . . $ QStyleOption#state. |=cxx . . $ QFlags#`operator|=`(fd64b2b07d6098e0). QStylecxx . . $ QStyle#::State_Raisedcxx . . $ QStyle#State_Raised.; |
| 79 | so.orientationcxx . . $ QStyleOptionHeader#orientation. = Qtcxx . . $ Qt/::Horizontalcxx . . $ Qt/Horizontal.; |
| 80 | so.positioncxx . . $ QStyleOptionHeader#position. = QStyleOptionHeadercxx . . $ QStyleOptionHeader#::Beginningcxx . . $ QStyleOptionHeader#Beginning.; |
| 81 | so.sortIndicatorcxx . . $ QStyleOptionHeader#sortIndicator. = QStyleOptionHeadercxx . . $ QStyleOptionHeader#::Nonecxx . . $ QStyleOptionHeader#None.; |
| 82 | so.textAlignmentcxx . . $ QStyleOptionHeader#textAlignment. =cxx . . $ QFlags#`operator=`(4ecc59e2b610c490). Qtcxx . . $ QFlags#QFlags(93d577a3e9528307).::AlignHCentercxx . . $ Qt/AlignHCenter.; |
| 83 | so.rectcxx . . $ QStyleOption#rect..setTopcxx . . $ QRect#setTop(f349c77f591a7878).(frameTcxx . . $ SlotViewer#frameT.); |
| 84 | so.rectcxx . . $ QStyleOption#rect..setHeightcxx . . $ QRect#setHeight(f349c77f591a7878).(headerHeightcxx . . $ SlotViewer#headerHeight.); |
| 85 | so.rectcxx . . $ QStyleOption#rect..setLeftcxx . . $ QRect#setLeft(f349c77f591a7878).(frameLcxx . . $ SlotViewer#frameL.); |
| 86 | so.rectcxx . . $ QStyleOption#rect..setWidthcxx . . $ QRect#setWidth(f349c77f591a7878).(headerSize1cxx . . $ SlotViewer#headerSize1.); |
| 87 | so.sectioncxx . . $ QStyleOptionHeader#section. = 0; |
| 88 | so.textcxx . . $ QStyleOptionHeader#text. =cxx . . $ QString#`operator=`(d02845eef0c33901). "Page"; |
| 89 | stylecxx . . $ QWidget#style(5bbb00d3017c281f).()->drawControlcxx . . $ QStyle#drawControl(474ae36165ae066e).(QStylecxx . . $ QStyle#::CE_Headercxx . . $ QStyle#CE_Header., &so, &p, this); |
| 90 | so.rectcxx . . $ QStyleOption#rect..setLeftcxx . . $ QRect#setLeft(f349c77f591a7878).(so.rectcxx . . $ QStyleOption#rect..leftcxx . . $ QRect#left(ea6fe5115c70a13f).() + headerSize1cxx . . $ SlotViewer#headerSize1.); |
| 91 | so.rectcxx . . $ QStyleOption#rect..setWidthcxx . . $ QRect#setWidth(f349c77f591a7878).(headerSize2cxx . . $ SlotViewer#headerSize2.); |
| 92 | so.sectioncxx . . $ QStyleOptionHeader#section. = 1; |
| 93 | so.textcxx . . $ QStyleOptionHeader#text. =cxx . . $ QString#`operator=`(d02845eef0c33901). "Address"; |
| 94 | stylecxx . . $ QWidget#style(5bbb00d3017c281f).()->drawControlcxx . . $ QStyle#drawControl(474ae36165ae066e).(QStylecxx . . $ QStyle#::CE_Headercxx . . $ QStyle#CE_Header., &so, &p, this); |
| 95 | so.rectcxx . . $ QStyleOption#rect..setLeftcxx . . $ QRect#setLeft(f349c77f591a7878).(so.rectcxx . . $ QStyleOption#rect..leftcxx . . $ QRect#left(ea6fe5115c70a13f).() + headerSize2cxx . . $ SlotViewer#headerSize2.); |
| 96 | so.rectcxx . . $ QStyleOption#rect..setWidthcxx . . $ QRect#setWidth(f349c77f591a7878).(headerSize3cxx . . $ SlotViewer#headerSize3.); |
| 97 | so.sectioncxx . . $ QStyleOptionHeader#section. = 2; |
| 98 | so.textcxx . . $ QStyleOptionHeader#text. =cxx . . $ QString#`operator=`(d02845eef0c33901). "Slot"; |
| 99 | stylecxx . . $ QWidget#style(5bbb00d3017c281f).()->drawControlcxx . . $ QStyle#drawControl(474ae36165ae066e).(QStylecxx . . $ QStyle#::CE_Headercxx . . $ QStyle#CE_Header., &so, &p, this); |
| 100 | so.rectcxx . . $ QStyleOption#rect..setLeftcxx . . $ QRect#setLeft(f349c77f591a7878).(so.rectcxx . . $ QStyleOption#rect..leftcxx . . $ QRect#left(ea6fe5115c70a13f).() + headerSize3cxx . . $ SlotViewer#headerSize3.); |
| 101 | so.rectcxx . . $ QStyleOption#rect..setWidthcxx . . $ QRect#setWidth(f349c77f591a7878).(headerSize4cxx . . $ SlotViewer#headerSize4.); |
| 102 | so.sectioncxx . . $ QStyleOptionHeader#section. = 3; |
| 103 | so.textcxx . . $ QStyleOptionHeader#text. =cxx . . $ QString#`operator=`(d02845eef0c33901). "Segment"; |
| 104 | stylecxx . . $ QWidget#style(5bbb00d3017c281f).()->drawControlcxx . . $ QStyle#drawControl(474ae36165ae066e).(QStylecxx . . $ QStyle#::CE_Headercxx . . $ QStyle#CE_Header., &so, &p, this); |
| 105 | |
| 106 | int mid1 = frameLcxx . . $ SlotViewer#frameL. + headerSize1cxx . . $ SlotViewer#headerSize1. / 2; |
| 107 | int mid2 = frameLcxx . . $ SlotViewer#frameL. + headerSize1cxx . . $ SlotViewer#headerSize1. + headerSize2cxx . . $ SlotViewer#headerSize2. / 2; |
| 108 | int mid3 = frameLcxx . . $ SlotViewer#frameL. + headerSize1cxx . . $ SlotViewer#headerSize1. + headerSize2cxx . . $ SlotViewer#headerSize2. + headerSize3cxx . . $ SlotViewer#headerSize3. / 2; |
| 109 | int mid4 = frameLcxx . . $ SlotViewer#frameL. + headerSize1cxx . . $ SlotViewer#headerSize1. + headerSize2cxx . . $ SlotViewer#headerSize2. + headerSize3cxx . . $ SlotViewer#headerSize3. + headerSize4cxx . . $ SlotViewer#headerSize4. / 2; |
| 110 | int dy = (heightcxx . . $ QWidget#height(455f465bc33b4cdf).() - frameTcxx . . $ SlotViewer#frameT. - frameBcxx . . $ SlotViewer#frameB. - headerHeightcxx . . $ SlotViewer#headerHeight.) / 4; |
| 111 | int y = frameTcxx . . $ SlotViewer#frameT. + headerHeightcxx . . $ SlotViewer#headerHeight. + dy / 2 + fontMetricscxx . . $ QWidget#fontMetrics(ee264e9e8967f9a7).().heightcxx . . $ QFontMetrics#height(455f465bc33b4cdf).() / 2 - |
| 112 | fontMetricscxx . . $ QWidget#fontMetrics(ee264e9e8967f9a7).().descentcxx . . $ QFontMetrics#descent(455f465bc33b4cdf).(); |
| 113 | |
| 114 | int isOn = isEnabledcxx . . $ QWidget#isEnabled(50ce9a9e25b4a850).() && memLayoutcxx . . $ SlotViewer#memLayout. != nullptr; |
| 115 | for (int i = 0; i < 4; ++i) { |
| 116 | QStringcxx . . $ QString# strcxx . . $ QString#QString(ced63f7c635d850d).; |
| 117 | p.setPencxx . . $ QPainter#setPen(129a55e114526ad3).(palettecxx . . $ QWidget#palette(a7bd6a16d2c88209).().colorcxx . . $ QPalette#color(a08a5ea14130e12).(QPalettecxx . . $ QPalette#::Textcxx . . $ QPalette#Text.)); |
| 118 | |
| 119 | // print page nr |
| 120 | str =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(85c52e162fed56f9).("$%1").argcxx . . $ QString#arg(64ab2ed17cc11715).(i); |
| 121 | p.drawTextcxx . . $ QPainter#drawText(c89d651b24440698).(mid1 - fontMetricscxx . . $ QWidget#fontMetrics(ee264e9e8967f9a7).().horizontalAdvancecxx . . $ QFontMetrics#horizontalAdvance(91f46685ef4c12b5).(str) / 2, y, str); |
| 122 | |
| 123 | // print address |
| 124 | str =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(85c52e162fed56f9).("$%1").argcxx . . $ QString#arg(64ab2ed17cc11715).(i * 0x4000, 4, 16, QCharcxx . . $ QChar#('0')).toUppercxx . . $ QString#toUpper(30b3b70527b1c61a).(); |
| 125 | p.drawTextcxx . . $ QPainter#drawText(c89d651b24440698).(mid2 - fontMetricscxx . . $ QWidget#fontMetrics(ee264e9e8967f9a7).().horizontalAdvancecxx . . $ QFontMetrics#horizontalAdvance(91f46685ef4c12b5).(str) / 2, y, str); |
| 126 | |
| 127 | // print slot |
| 128 | if (isOn) { |
| 129 | if (memLayoutcxx . . $ SlotViewer#memLayout.->isSubslottedcxx . . $ MemoryLayout#isSubslotted.[memLayoutcxx . . $ SlotViewer#memLayout.->primarySlotcxx . . $ MemoryLayout#primarySlot.[i]]) { |
| 130 | str =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(85c52e162fed56f9).("%1-%2").argcxx . . $ QString#arg(64ab2ed17cc11715).(memLayoutcxx . . $ SlotViewer#memLayout.->primarySlotcxx . . $ MemoryLayout#primarySlot.[i]).argcxx . . $ QString#arg(64ab2ed17cc11715).(memLayoutcxx . . $ SlotViewer#memLayout.->secondarySlotcxx . . $ MemoryLayout#secondarySlot.[i]); |
| 131 | } else { |
| 132 | str =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#::numbercxx . . $ QString#number(f4fd9db251ca774b).(memLayoutcxx . . $ SlotViewer#memLayout.->primarySlotcxx . . $ MemoryLayout#primarySlot.[i]); |
| 133 | } |
| 134 | } else { |
| 135 | str =cxx . . $ QString#`operator=`(d02845eef0c33901). "-"; |
| 136 | } |
| 137 | // set pen colour to red if slot was recently changed |
| 138 | if (slotsChangedcxx . . $ SlotViewer#slotsChanged.[i] && isOn) { |
| 139 | p.setPencxx . . $ QPainter#setPen(129a55e114526ad3).(Qtcxx . . $ QColor#QColor(408ec4d5924bfb00).::redcxx . . $ Qt/red.); |
| 140 | } else { |
| 141 | p.setPencxx . . $ QPainter#setPen(129a55e114526ad3).(palettecxx . . $ QWidget#palette(a7bd6a16d2c88209).().colorcxx . . $ QPalette#color(a08a5ea14130e12).(QPalettecxx . . $ QPalette#::Textcxx . . $ QPalette#Text.)); |
| 142 | } |
| 143 | |
| 144 | p.drawTextcxx . . $ QPainter#drawText(c89d651b24440698).(mid3 - fontMetricscxx . . $ QWidget#fontMetrics(ee264e9e8967f9a7).().horizontalAdvancecxx . . $ QFontMetrics#horizontalAdvance(91f46685ef4c12b5).(str) / 2, y, str); |
| 145 | |
| 146 | // print segment |
| 147 | if (isOn) { |
| 148 | int ms; |
| 149 | if (memLayoutcxx . . $ SlotViewer#memLayout.->isSubslottedcxx . . $ MemoryLayout#isSubslotted.[memLayoutcxx . . $ SlotViewer#memLayout.->primarySlotcxx . . $ MemoryLayout#primarySlot.[i] & 3]) { |
| 150 | ms = memLayoutcxx . . $ SlotViewer#memLayout.->mapperSizecxx . . $ MemoryLayout#mapperSize.[memLayoutcxx . . $ SlotViewer#memLayout.->primarySlotcxx . . $ MemoryLayout#primarySlot.[i] & 3] |
| 151 | [memLayoutcxx . . $ SlotViewer#memLayout.->secondarySlotcxx . . $ MemoryLayout#secondarySlot.[i] & 3]; |
| 152 | } else { |
| 153 | ms = memLayoutcxx . . $ SlotViewer#memLayout.->mapperSizecxx . . $ MemoryLayout#mapperSize.[memLayoutcxx . . $ SlotViewer#memLayout.->primarySlotcxx . . $ MemoryLayout#primarySlot.[i] & 3][0]; |
| 154 | } |
| 155 | if (ms > 0) { |
| 156 | str =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(85c52e162fed56f9).("%1").argcxx . . $ QString#arg(64ab2ed17cc11715).(memLayoutcxx . . $ SlotViewer#memLayout.->mapperSegmentcxx . . $ MemoryLayout#mapperSegment.[i]); |
| 157 | } else if (memLayoutcxx . . $ SlotViewer#memLayout.->romBlockcxx . . $ MemoryLayout#romBlock.[2*i] >= 0) { |
| 158 | if (memLayoutcxx . . $ SlotViewer#memLayout.->romBlockcxx . . $ MemoryLayout#romBlock.[2*i] == memLayoutcxx . . $ SlotViewer#memLayout.->romBlockcxx . . $ MemoryLayout#romBlock.[2*i+1]) { |
| 159 | str =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(85c52e162fed56f9).("R%1").argcxx . . $ QString#arg(64ab2ed17cc11715).(memLayoutcxx . . $ SlotViewer#memLayout.->romBlockcxx . . $ MemoryLayout#romBlock.[2*i]); |
| 160 | } else { |
| 161 | str =cxx . . $ QString#`operator=`(4f35bf974e7f8568). QStringcxx . . $ QString#QString(85c52e162fed56f9).("R%1/%2").argcxx . . $ QString#arg(64ab2ed17cc11715).(memLayoutcxx . . $ SlotViewer#memLayout.->romBlockcxx . . $ MemoryLayout#romBlock.[2*i]).argcxx . . $ QString#arg(64ab2ed17cc11715).(memLayoutcxx . . $ SlotViewer#memLayout.->romBlockcxx . . $ MemoryLayout#romBlock.[2*i+1]); |
| 162 | } |
| 163 | } else { |
| 164 | str =cxx . . $ QString#`operator=`(d02845eef0c33901). "-"; |
| 165 | } |
| 166 | } else { |
| 167 | str =cxx . . $ QString#`operator=`(d02845eef0c33901). "-"; |
| 168 | } |
| 169 | // set pen colour to red if slot was recently changed |
| 170 | if (segmentsChangedcxx . . $ SlotViewer#segmentsChanged.[i] && isOn) { |
| 171 | p.setPencxx . . $ QPainter#setPen(129a55e114526ad3).(Qtcxx . . $ QColor#QColor(408ec4d5924bfb00).::redcxx . . $ Qt/red.); |
| 172 | } else { |
| 173 | p.setPencxx . . $ QPainter#setPen(129a55e114526ad3).(palettecxx . . $ QWidget#palette(a7bd6a16d2c88209).().colorcxx . . $ QPalette#color(a08a5ea14130e12).(QPalettecxx . . $ QPalette#::Textcxx . . $ QPalette#Text.)); |
| 174 | } |
| 175 | p.drawTextcxx . . $ QPainter#drawText(c89d651b24440698).(mid4 - fontMetricscxx . . $ QWidget#fontMetrics(ee264e9e8967f9a7).().horizontalAdvancecxx . . $ QFontMetrics#horizontalAdvance(91f46685ef4c12b5).(str) / 2, y, str); |
| 176 | |
| 177 | y += dy; |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | QSizecxx . . $ QSize# SlotViewercxx . . $ SlotViewer#::sizeHintcxx . . $ SlotViewer#sizeHint(4b3b776e5ee2b367).() const |
| 182 | { |
| 183 | return {cxx . . $ QSize#QSize(c0d38f4800714fae).headerSize1cxx . . $ SlotViewer#headerSize1. + headerSize2cxx . . $ SlotViewer#headerSize2. + headerSize3cxx . . $ SlotViewer#headerSize3. + headerSize4cxx . . $ SlotViewer#headerSize4. + frameLcxx . . $ SlotViewer#frameL. + frameRcxx . . $ SlotViewer#frameR., |
| 184 | headerHeightcxx . . $ SlotViewer#headerHeight. + 4*fontMetricscxx . . $ QWidget#fontMetrics(ee264e9e8967f9a7).().heightcxx . . $ QFontMetrics#height(455f465bc33b4cdf).()}; |
| 185 | } |
| 186 | |
| 187 | void SlotViewercxx . . $ SlotViewer#::refreshcxx . . $ SlotViewer#refresh(49f6e7a06ebc5aa8).() |
| 188 | { |
| 189 | CommClientcxx . . $ CommClient#::instancecxx . . $ CommClient#instance(8cca9d0b1334f685).().sendCommandcxx . . $ CommClient#sendCommand(6fe5d9dff2ed3a64).(new DebugMemMapperHandlercxx . . $ DebugMemMapperHandler#(*this)); |
| 190 | } |
| 191 | |
| 192 | void SlotViewercxx . . $ SlotViewer#::setMemoryLayoutcxx . . $ SlotViewer#setMemoryLayout(64b27f19295a45ce).(MemoryLayoutcxx . . $ MemoryLayout#* ml) |
| 193 | { |
| 194 | memLayoutcxx . . $ SlotViewer#memLayout. = ml; |
| 195 | } |
| 196 | |
| 197 | void SlotViewercxx . . $ SlotViewer#::updateSlotscxx . . $ SlotViewer#updateSlots(3520e46b33348bf6).(const QStringcxx . . $ QString#& message) |
| 198 | { |
| 199 | QStringListcxx . . $ QStringList# lines = message.splitcxx . . $ QString#split(92030b8bf74e4227).('\n'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 200 | bool changed = false; |
| 201 | |
| 202 | // parse page slots and segments |
| 203 | for (int p = 0; p < 4; ++p) { |
| 204 | bool subSlotted = (lines[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).p * 2][cxx . . $ QString#`operator[]`(57436120916eb52c).1] !=cxx . . $ `operator!=`(a468b2f18a3afe8). 'X'cxx . . $ QChar#QChar(f349c77f591a7878).); |
| 205 | slotsChangedcxx . . $ SlotViewer#slotsChanged.[p] = (memLayoutcxx . . $ SlotViewer#memLayout.->primarySlotcxx . . $ MemoryLayout#primarySlot. [p] != lines[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).p * 2][cxx . . $ QString#`operator[]`(57436120916eb52c).0].toLatin1cxx . . $ QCharRef#toLatin1(1b8b762cbef9c2c9).()-'0') || |
| 206 | (memLayoutcxx . . $ SlotViewer#memLayout.->secondarySlotcxx . . $ MemoryLayout#secondarySlot.[p] != (subSlotted ? lines[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).p * 2][cxx . . $ QString#`operator[]`(57436120916eb52c).1].toLatin1cxx . . $ QCharRef#toLatin1(1b8b762cbef9c2c9).() - '0' : -1)); |
| 207 | changed |= slotsChangedcxx . . $ SlotViewer#slotsChanged.[p]; |
| 208 | memLayoutcxx . . $ SlotViewer#memLayout.->primarySlotcxx . . $ MemoryLayout#primarySlot. [p] = lines[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).p * 2][cxx . . $ QString#`operator[]`(57436120916eb52c).0].toLatin1cxx . . $ QCharRef#toLatin1(1b8b762cbef9c2c9).()-'0'; |
| 209 | memLayoutcxx . . $ SlotViewer#memLayout.->secondarySlotcxx . . $ MemoryLayout#secondarySlot.[p] = subSlotted |
| 210 | ? lines[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).p * 2][cxx . . $ QString#`operator[]`(57436120916eb52c).1].toLatin1cxx . . $ QCharRef#toLatin1(1b8b762cbef9c2c9).() - '0' : -1; |
| 211 | segmentsChangedcxx . . $ SlotViewer#segmentsChanged.[p] = memLayoutcxx . . $ SlotViewer#memLayout.->mapperSegmentcxx . . $ MemoryLayout#mapperSegment.[p] != |
| 212 | lines[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).p * 2 + 1].toIntcxx . . $ QString#toInt(d7972accae11ee1f).(); |
| 213 | memLayoutcxx . . $ SlotViewer#memLayout.->mapperSegmentcxx . . $ MemoryLayout#mapperSegment.[p] = lines[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).p * 2 + 1].toIntcxx . . $ QString#toInt(d7972accae11ee1f).(); |
| 214 | } |
| 215 | // parse slot layout |
| 216 | int l = 8; |
| 217 | for (int ps = 0; ps < 4; ++ps) { |
| 218 | memLayoutcxx . . $ SlotViewer#memLayout.->isSubslottedcxx . . $ MemoryLayout#isSubslotted.[ps] = lines[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).l++][cxx . . $ QString#`operator[]`(57436120916eb52c).0] ==cxx . . $ `operator==`(a468b2f18a3afe8). '1'cxx . . $ QChar#QChar(f349c77f591a7878).; |
| 219 | if (memLayoutcxx . . $ SlotViewer#memLayout.->isSubslottedcxx . . $ MemoryLayout#isSubslotted.[ps]) { |
| 220 | for (int ss = 0; ss < 4; ++ss) { |
| 221 | memLayoutcxx . . $ SlotViewer#memLayout.->mapperSizecxx . . $ MemoryLayout#mapperSize.[ps][ss] = lines[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).l++].toUShortcxx . . $ QString#toUShort(40a21ca08a7dd778).(); |
| 222 | } |
| 223 | } else { |
| 224 | memLayoutcxx . . $ SlotViewer#memLayout.->mapperSizecxx . . $ MemoryLayout#mapperSize.[ps][0] = lines[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).l++].toUShortcxx . . $ QString#toUShort(40a21ca08a7dd778).(); |
| 225 | } |
| 226 | } |
| 227 | // parse rom blocks |
| 228 | for (int i = 0; i < 8; ++i, ++l) { |
| 229 | if (lines[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).l][cxx . . $ QString#`operator[]`(57436120916eb52c).0] ==cxx . . $ `operator==`(a468b2f18a3afe8). 'X'cxx . . $ QChar#QChar(f349c77f591a7878).) |
| 230 | memLayoutcxx . . $ SlotViewer#memLayout.->romBlockcxx . . $ MemoryLayout#romBlock.[i] = -1; |
| 231 | else |
| 232 | memLayoutcxx . . $ SlotViewer#memLayout.->romBlockcxx . . $ MemoryLayout#romBlock.[i] = lines[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).l].toIntcxx . . $ QString#toInt(d7972accae11ee1f).(); |
| 233 | } |
| 234 | updatecxx . . $ QWidget#update(49f6e7a06ebc5aa8).(); |
| 235 | emitcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:97:10`! slotsUpdatedcxx . . $ SlotViewer#slotsUpdated(b45ddcbc8423892c).(changed); |
| 236 | } |