Debian Codegraph @

src/BitMapViewer.cpp

raw symbols SCIP
1 #cxx . . $ `<file>/src/BitMapViewer.cpp`/include "BitMapViewer.h"cxx . . $ `<file>/src/BitMapViewer.h`/
2 #include "PaletteDialog.h"cxx . . $ `<file>/src/PaletteDialog.h`/
3 #include "VramBitMappedView.h"cxx . . $ `<file>/src/VramBitMappedView.h`/
4 #include "VDPDataStore.h"cxx . . $ `<file>/src/VDPDataStore.h`/
5 #include "Convert.h"cxx . . $ `<file>/src/Convert.h`/
6 #include <QMessageBox>
7
8
9 static uint8_tcxx . . $ uint8_t# currentPalettecxx . . $ currentPalette.[32] = { 0 };
10
11 BitMapViewercxx . . $ BitMapViewer#::BitMapViewercxx . . $ BitMapViewer#BitMapViewer(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget#* parent)
12 : QDialogcxx . . $ QDialog#QDialog(872e7b0c281abd8d).(parent)
13 , pageSizecxx . . $ BitMapViewer#pageSize.(0) // avoid UMR
14 , screenModcxx . . $ BitMapViewer#screenMod.(0)
15 {
16 setupUicxx . . $ Ui_BitMapViewer#setupUi(d194de0c0f68c28b).(this);
17 //no connect slot byname anymore
18 connectcxx . . $ QObject#connect(835f87066c895669).(screenModecxx . . $ Ui_BitMapViewer#screenMode., qOverloadcxx . . $ qOverload.<int>(cxx . . $ QNonConstOverload#`operator()`(a8f97e06674de5d1).&QComboBoxcxx . . $ QComboBox#::currentIndexChangedcxx . . $ QComboBox#currentIndexChanged(d4f767463ce0a6b3).), this, &BitMapViewercxx . . $ BitMapViewer#::on_screenMode_currentIndexChangedcxx . . $ BitMapViewer#on_screenMode_currentIndexChanged(d4f767463ce0a6b3).);
19 connectcxx . . $ QObject#connect(835f87066c895669).(currentPagecxx . . $ Ui_BitMapViewer#currentPage., qOverloadcxx . . $ qOverload.<int>(cxx . . $ QNonConstOverload#`operator()`(a8f97e06674de5d1).&QComboBoxcxx . . $ QComboBox#:: currentIndexChangedcxx . . $ QComboBox#currentIndexChanged(d4f767463ce0a6b3).), this, &BitMapViewercxx . . $ BitMapViewer#::on_currentPage_currentIndexChangedcxx . . $ BitMapViewer#on_currentPage_currentIndexChanged(d4f767463ce0a6b3).);
20 connectcxx . . $ QObject#connect(835f87066c895669).(linesVisiblecxx . . $ Ui_BitMapViewer#linesVisible., qOverloadcxx . . $ qOverload.<int>(cxx . . $ QNonConstOverload#`operator()`(a8f97e06674de5d1).&QComboBoxcxx . . $ QComboBox#:: currentIndexChangedcxx . . $ QComboBox#currentIndexChanged(d4f767463ce0a6b3).), this, &BitMapViewercxx . . $ BitMapViewer#::on_linesVisible_currentIndexChangedcxx . . $ BitMapViewer#on_linesVisible_currentIndexChanged(d4f767463ce0a6b3).);
21 connectcxx . . $ QObject#connect(835f87066c895669).(bgColorcxx . . $ Ui_BitMapViewer#bgColor., qOverloadcxx . . $ qOverload.<int>(cxx . . $ QNonConstOverload#`operator()`(a8f97e06674de5d1).&QSpinBoxcxx . . $ QSpinBox#::valueChangedcxx . . $ QSpinBox#valueChanged(d4f767463ce0a6b3).), this, &BitMapViewercxx . . $ BitMapViewer#::on_bgColor_valueChangedcxx . . $ BitMapViewer#on_bgColor_valueChanged(d4f767463ce0a6b3).);
22
23 connectcxx . . $ QObject#connect(835f87066c895669).(useVDPRegisterscxx . . $ Ui_BitMapViewer#useVDPRegisters., &QCheckBoxcxx . . $ QCheckBox#::stateChangedcxx . . $ QCheckBox#stateChanged(d4f767463ce0a6b3).,this, &BitMapViewercxx . . $ BitMapViewer#::on_useVDPRegisters_stateChangedcxx . . $ BitMapViewer#on_useVDPRegisters_stateChanged(d4f767463ce0a6b3).);
24
25 connectcxx . . $ QObject#connect(835f87066c895669).(saveImageButtoncxx . . $ Ui_BitMapViewer#saveImageButton., &QPushButtoncxx . . $ QPushButton#::clickedcxx . . $ QAbstractButton#clicked(b45ddcbc8423892c)., this, &BitMapViewercxx . . $ BitMapViewer#::on_saveImageButton_clickedcxx . . $ BitMapViewer#on_saveImageButton_clicked(b45ddcbc8423892c).);
26 connectcxx . . $ QObject#connect(835f87066c895669).(editPaletteButtoncxx . . $ Ui_BitMapViewer#editPaletteButton., &QPushButtoncxx . . $ QPushButton#::clickedcxx . . $ QAbstractButton#clicked(b45ddcbc8423892c)., this, &BitMapViewercxx . . $ BitMapViewer#::on_editPaletteButton_clickedcxx . . $ BitMapViewer#on_editPaletteButton_clicked(b45ddcbc8423892c).);
27 connectcxx . . $ QObject#connect(835f87066c895669).(useVDPPalettecxx . . $ Ui_BitMapViewer#useVDPPalette., &QCheckBoxcxx . . $ QCheckBox#::stateChangedcxx . . $ QCheckBox#stateChanged(d4f767463ce0a6b3)., this, &BitMapViewercxx . . $ BitMapViewer#::on_useVDPPalette_stateChangedcxx . . $ BitMapViewer#on_useVDPPalette_stateChanged(d4f767463ce0a6b3).);
28 connectcxx . . $ QObject#connect(835f87066c895669).(zoomLevelcxx . . $ Ui_BitMapViewer#zoomLevel., qOverloadcxx . . $ qOverload.<double>(cxx . . $ QNonConstOverload#`operator()`(a8f97e06674de5d1).&QDoubleSpinBoxcxx . . $ QDoubleSpinBox#::valueChangedcxx . . $ QDoubleSpinBox#valueChanged(ba8836b59fb42830).), this, &BitMapViewercxx . . $ BitMapViewer#::on_zoomLevel_valueChangedcxx . . $ BitMapViewer#on_zoomLevel_valueChanged(ba8836b59fb42830).);
29
30 // hand code entering the actual display widget in the scrollarea With
31 // the designer-qt4 there is an extra scrollAreaWidget between the
32 // imageWidget and the QScrollArea so the scrollbars are not correctly
33 // handled when the image is resized. (since the intermediate widget
34 // stays the same size). I did not try to have this intermediate widget
35 // resize and all, since it was superflous anyway.
36 imageWidgetcxx . . $ BitMapViewer#imageWidget. = new VramBitMappedViewcxx . . $ VramBitMappedView#VramBitMappedView(108f35f7aa7f3cf9).();
37 QSizePolicycxx . . $ QSizePolicy# sizePolicy1cxx . . $ QSizePolicy#QSizePolicy(dc90913e2b9d0ddb).(QSizePolicycxx . . $ QSizePolicy#::Fixedcxx . . $ QSizePolicy#Fixed., QSizePolicycxx . . $ QSizePolicy#::Fixedcxx . . $ QSizePolicy#Fixed.);
38 sizePolicy1.setHorizontalStretchcxx . . $ QSizePolicy#setHorizontalStretch(d4f767463ce0a6b3).(0);
39 sizePolicy1.setVerticalStretchcxx . . $ QSizePolicy#setVerticalStretch(d4f767463ce0a6b3).(0);
40 sizePolicy1.setHeightForWidthcxx . . $ QSizePolicy#setHeightForWidth(9f0ba574c1c44ffc).(imageWidgetcxx . . $ BitMapViewer#imageWidget.->sizePolicycxx . . $ QWidget#sizePolicy(32ae450071346403).().hasHeightForWidthcxx . . $ QSizePolicy#hasHeightForWidth(3482b152b9333168).());
41 imageWidgetcxx . . $ BitMapViewer#imageWidget.->setSizePolicycxx . . $ QWidget#setSizePolicy(41340f53ecd443dd).(sizePolicy1);
42 imageWidgetcxx . . $ BitMapViewer#imageWidget.->setMinimumSizecxx . . $ QWidget#setMinimumSize(1c5f201b4c2f0aba).(QSizecxx . . $ QSize#QSize(c0d38f4800714fae).(256, 212));
43
44 scrollAreacxx . . $ Ui_BitMapViewer#scrollArea.->setWidgetcxx . . $ QScrollArea#setWidget(108f35f7aa7f3cf9).(imageWidgetcxx . . $ BitMapViewer#imageWidget.);
45
46 useVDPcxx . . $ BitMapViewer#useVDP. = useVDPRegisterscxx . . $ Ui_BitMapViewer#useVDPRegisters.->isCheckedcxx . . $ QAbstractButton#isChecked(50ce9a9e25b4a850).();
47
48 const unsigned char* vram = VDPDataStorecxx . . $ VDPDataStore#::instancecxx . . $ VDPDataStore#instance(6179f7cf4255f5b).().getVramPointercxx . . $ VDPDataStore#getVramPointer(7eb257f306f79f97).();
49 imageWidgetcxx . . $ BitMapViewer#imageWidget.->setVramSourcecxx . . $ VramBitMappedView#setVramSource(28caea9380bfac8a).(vram);
50 imageWidgetcxx . . $ BitMapViewer#imageWidget.->setVramAddresscxx . . $ VramBitMappedView#setVramAddress(d4f767463ce0a6b3).(0);
51 // Palette data not received from VDPDataStore yet causing black image, so
52 // we start by using fixed palette until VDPDataStoreDataRefreshed kicks in.
53 imageWidgetcxx . . $ BitMapViewer#imageWidget.->setPaletteSourcecxx . . $ VramBitMappedView#setPaletteSource(28caea9380bfac8a).(VDPDataStorecxx . . $ VDPDataStore#::instancecxx . . $ VDPDataStore#instance(6179f7cf4255f5b).().getDefaultPalettePointercxx . . $ VDPDataStore#getDefaultPalettePointer(7eb257f306f79f97).());
54
55 // now hook up some signals and slots
56 connectcxx . . $ QObject#connect(835f87066c895669).(&VDPDataStorecxx . . $ VDPDataStore#::instancecxx . . $ VDPDataStore#instance(6179f7cf4255f5b).(), &VDPDataStorecxx . . $ VDPDataStore#::dataRefreshedcxx . . $ VDPDataStore#dataRefreshed(49f6e7a06ebc5aa8).,
57 this, &BitMapViewercxx . . $ BitMapViewer#::VDPDataStoreDataRefreshedcxx . . $ BitMapViewer#VDPDataStoreDataRefreshed(49f6e7a06ebc5aa8).);
58 connectcxx . . $ QObject#connect(835f87066c895669).(&VDPDataStorecxx . . $ VDPDataStore#::instancecxx . . $ VDPDataStore#instance(6179f7cf4255f5b).(), &VDPDataStorecxx . . $ VDPDataStore#::dataRefreshedcxx . . $ VDPDataStore#dataRefreshed(49f6e7a06ebc5aa8).,
59 imageWidgetcxx . . $ BitMapViewer#imageWidget., &VramBitMappedViewcxx . . $ VramBitMappedView#::refreshcxx . . $ VramBitMappedView#refresh(49f6e7a06ebc5aa8).);
60 connectcxx . . $ QObject#connect(835f87066c895669).(refreshButtoncxx . . $ Ui_BitMapViewer#refreshButton., &QPushButtoncxx . . $ QPushButton#::clickedcxx . . $ QAbstractButton#clicked(b45ddcbc8423892c).,
61 &VDPDataStorecxx . . $ VDPDataStore#::instancecxx . . $ VDPDataStore#instance(6179f7cf4255f5b).(), &VDPDataStorecxx . . $ VDPDataStore#::refreshcxx . . $ VDPDataStore#refresh(49f6e7a06ebc5aa8).);
62
63 connectcxx . . $ QObject#connect(835f87066c895669).(imageWidgetcxx . . $ BitMapViewer#imageWidget., &VramBitMappedViewcxx . . $ VramBitMappedView#::imageHoveredcxx . . $ VramBitMappedView#imageHovered(deee8b20ba58dd0a).,
64 this, &BitMapViewercxx . . $ BitMapViewer#::updateImagePositioncxx . . $ BitMapViewer#updateImagePosition(deee8b20ba58dd0a).);
65 connectcxx . . $ QObject#connect(835f87066c895669).(imageWidgetcxx . . $ BitMapViewer#imageWidget., &VramBitMappedViewcxx . . $ VramBitMappedView#::imageClickedcxx . . $ VramBitMappedView#imageClicked(deee8b20ba58dd0a).,
66 this, &BitMapViewercxx . . $ BitMapViewer#::updateImagePositioncxx . . $ BitMapViewer#updateImagePosition(deee8b20ba58dd0a).);
67
68 // and now go fetch the initial data
69 VDPDataStorecxx . . $ VDPDataStore#::instancecxx . . $ VDPDataStore#instance(6179f7cf4255f5b).().refreshcxx . . $ VDPDataStore#refresh(49f6e7a06ebc5aa8).();
70 }
71
72 void BitMapViewercxx . . $ BitMapViewer#::updateDisplayAsFramecxx . . $ BitMapViewer#updateDisplayAsFrame(49f6e7a06ebc5aa8).()
73 {
74 screenModcxx . . $ BitMapViewer#screenMod. = screenModecxx . . $ Ui_BitMapViewer#screenMode.->itemTextcxx . . $ QComboBox#itemText(3f3c3d0e9c0eb37f).(screenModecxx . . $ Ui_BitMapViewer#screenMode.->currentIndexcxx . . $ QComboBox#currentIndex(455f465bc33b4cdf).()).toIntcxx . . $ QString#toInt(d7972accae11ee1f).();
75 pageSizecxx . . $ BitMapViewer#pageSize. = screenModcxx . . $ BitMapViewer#screenMod. >= 7 ? 65536 : 32768;
76 }
77
78 void BitMapViewercxx . . $ BitMapViewer#::decodeVDPregscxx . . $ BitMapViewer#decodeVDPregs(49f6e7a06ebc5aa8).()
79 {
80 const unsigned char* regs = VDPDataStorecxx . . $ VDPDataStore#::instancecxx . . $ VDPDataStore#instance(6179f7cf4255f5b).().getRegsPointercxx . . $ VDPDataStore#getRegsPointer(7eb257f306f79f97).();
81
82 // Get the number of lines
83 int v1 = (regs[9] & 128) ? 212 : 192;
84 printf("\nlines acording to the bits %i,: %i\n", (regs[9] & 128), v1);
85 linesLabelcxx . . $ Ui_BitMapViewer#linesLabel.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(QStringcxx . . $ QString#QString(85c52e162fed56f9).("%1").argcxx . . $ QString#arg(64ab2ed17cc11715).(v1, 0, 10));
86 if (useVDPcxx . . $ BitMapViewer#useVDP.) linesVisiblecxx . . $ Ui_BitMapViewer#linesVisible.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).((regs[9] & 128) ? 1 : 0);
87
88 // Get the border color
89 int v2 = regs[7] & 15;
90 printf("\nborder acording to the regs %i,: %i\n", regs[7], v2);
91 if (regs[8] & 32) v2 = 0;
92 printf("\ncolor 0 is pallet regs %i,: %i\n", (regs[8] & 32), v2);
93 borderLabelcxx . . $ Ui_BitMapViewer#borderLabel.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(QStringcxx . . $ QString#QString(85c52e162fed56f9).("%1").argcxx . . $ QString#arg(64ab2ed17cc11715).(v2, 0, 10));
94 if (useVDPcxx . . $ BitMapViewer#useVDP.) bgColorcxx . . $ Ui_BitMapViewer#bgColor.->setValuecxx . . $ QSpinBox#setValue(d4f767463ce0a6b3).(v2);
95
96 // Get current screenmode
97 static const int bits_modetxt[128] = {
98 1, 3, 0, 255, 2, 255, 255, 255,
99 4, 255, 80, 255, 5, 255, 255, 255,
100 6, 255, 255, 255, 7, 255, 255, 255,
101 255, 255, 255, 255, 8, 255, 255, 255,
102
103 255, 255, 255, 255,255, 255, 255, 255,
104 255, 255, 255, 255,255, 255, 255, 255,
105 255, 255, 255, 255,255, 255, 255, 255,
106 255, 255, 255, 255, 12, 255, 255, 255,
107
108 255, 255, 255, 255,255, 255, 255, 255,
109 255, 255, 255, 255,255, 255, 255, 255,
110 255, 255, 255, 255,255, 255, 255, 255,
111 255, 255, 255, 255,255, 255, 255, 255,
112
113 255, 255, 255, 255,255, 255, 255, 255,
114 255, 255, 255, 255,255, 255, 255, 255,
115 255, 255, 255, 255,255, 255, 255, 255,
116 255, 255, 255, 255, 11, 255, 255, 255,
117 };
118 static const int bits_mode[128] = {
119 0, 0, 0, 0, 0, 0, 0, 0,
120 0, 0, 0, 0, 0, 0, 0, 0,
121 1, 0, 0, 0, 2, 0, 0, 0,
122 0, 0, 0, 0, 3, 0, 0, 0,
123
124 0, 0, 0, 0, 0, 0, 0, 0,
125 0, 0, 0, 0, 0, 0, 0, 0,
126 0, 0, 0, 0, 0, 0, 0, 0,
127 0, 0, 0, 0, 6, 0, 0, 0,
128
129 0, 0, 0, 0, 0, 0, 0, 0,
130 0, 0, 0, 0, 0, 0, 0, 0,
131 0, 0, 0, 0, 0, 0, 0, 0,
132 0, 0, 0, 0, 0, 0, 0, 0,
133
134 0, 0, 0, 0, 0, 0, 0, 0,
135 0, 0, 0, 0, 0, 0, 0, 0,
136 0, 0, 0, 0, 0, 0, 0, 0,
137 0, 0, 0, 0, 5, 0, 0, 0,
138 };
139 int v3 = ((regs[0] & 0x0E) << 1) | ((regs[1] & 0x18) >> 3) | ((regs[25] & 0x18) << 2);
140 printf("screenMod according to the bits: %i\n", v3);
141 modeLabelcxx . . $ Ui_BitMapViewer#modeLabel.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(QStringcxx . . $ QString#QString(85c52e162fed56f9).("%1").argcxx . . $ QString#arg(64ab2ed17cc11715).(bits_modetxt[v3], 0, 10));
142
143 if (useVDPcxx . . $ BitMapViewer#useVDP.) {
144 screenModecxx . . $ Ui_BitMapViewer#screenMode.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(bits_mode[v3]);
145 updateDisplayAsFramecxx . . $ BitMapViewer#updateDisplayAsFrame(49f6e7a06ebc5aa8).();
146 }
147 if (useVDPPalettecxx . . $ Ui_BitMapViewer#useVDPPalette.) {
148 imageWidgetcxx . . $ BitMapViewer#imageWidget.->setPaletteSourcecxx . . $ VramBitMappedView#setPaletteSource(28caea9380bfac8a).(VDPDataStorecxx . . $ VDPDataStore#::instancecxx . . $ VDPDataStore#instance(6179f7cf4255f5b).().getPalettePointercxx . . $ VDPDataStore#getPalettePointer(7eb257f306f79f97).());
149 }
150
151 // Get the current visible page
152 unsigned p = (regs[2] >> 5) & 3;
153 unsigned q = 1 << 15;
154 if (bits_modetxt[v3] > 6) {
155 p &= 1;
156 q <<= 1;
157 }
158 printf("visible page according to the bits: %i\n",p);
159
160 setPagescxx . . $ BitMapViewer#setPages(49f6e7a06ebc5aa8).();
161
162 addressLabelcxx . . $ Ui_BitMapViewer#addressLabel.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(hexValuecxx . . $ hexValue(f4fd9db251ca774b).(p * q, 5));
163 if (useVDPcxx . . $ BitMapViewer#useVDP.) currentPagecxx . . $ Ui_BitMapViewer#currentPage.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(p);
164 }
165
166 void BitMapViewercxx . . $ BitMapViewer#::refreshcxx . . $ BitMapViewer#refresh(49f6e7a06ebc5aa8).()
167 {
168 // All of the code is in the VDPDataStore;
169 VDPDataStorecxx . . $ VDPDataStore#::instancecxx . . $ VDPDataStore#instance(6179f7cf4255f5b).().refreshcxx . . $ VDPDataStore#refresh(49f6e7a06ebc5aa8).();
170 }
171
172 void BitMapViewercxx . . $ BitMapViewer#::on_screenMode_currentIndexChangedcxx . . $ BitMapViewer#on_screenMode_currentIndexChanged(d4f767463ce0a6b3).(int /*index*/)
173 {
174 updateDisplayAsFramecxx . . $ BitMapViewer#updateDisplayAsFrame(49f6e7a06ebc5aa8).();
175
176 // change the number of visible pages when this changes
177 imageWidgetcxx . . $ BitMapViewer#imageWidget.->setVramAddresscxx . . $ VramBitMappedView#setVramAddress(d4f767463ce0a6b3).(0);
178
179 // make sure that we are decoding new mode from page 0, imagine viewing
180 // page 3 of screen5 and then switching to screen 8 without changing the
181 // starting vram address....
182 imageWidgetcxx . . $ BitMapViewer#imageWidget.->setScreenModecxx . . $ VramBitMappedView#setScreenMode(d4f767463ce0a6b3).(screenModcxx . . $ BitMapViewer#screenMod.);
183 setPagescxx . . $ BitMapViewer#setPages(49f6e7a06ebc5aa8).();
184 }
185
186 void BitMapViewercxx . . $ BitMapViewer#::setPagescxx . . $ BitMapViewer#setPages(49f6e7a06ebc5aa8).()
187 {
188 if (pageSizecxx . . $ BitMapViewer#pageSize. == 0) return;
189 static const QStringListcxx . . $ QStringList# pageNames = {cxx . . $ QStringList#QStringList(d3efa563c6b2065f)."0", "1", "2", "3", "E0", "E1"};
190 int oldIndex = currentPagecxx . . $ Ui_BitMapViewer#currentPage.->currentIndexcxx . . $ QComboBox#currentIndex(455f465bc33b4cdf).();
191
192 currentPagecxx . . $ Ui_BitMapViewer#currentPage.->clearcxx . . $ QComboBox#clear(49f6e7a06ebc5aa8).();
193 int pageCount = VDPDataStorecxx . . $ VDPDataStore#::instancecxx . . $ VDPDataStore#instance(6179f7cf4255f5b).().getVRAMSizecxx . . $ VDPDataStore#getVRAMSize(fe4d2d262d4164a8).() / pageSizecxx . . $ BitMapViewer#pageSize.;
194 int pages = stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(pageCount, pageNames.countcxx . . $ QList#count(455f465bc33b4cdf).());
195
196 for (int p = 0; p < pages; ++p) {
197 currentPagecxx . . $ Ui_BitMapViewer#currentPage.->insertItemcxx . . $ QComboBox#insertItem(ec79cc9d4020bf15).(p, pageNames[cxx . . $ QList#`operator[]`(e2681f9bb6b2f357).p]);
198 }
199
200 if (!useVDPcxx . . $ BitMapViewer#useVDP. && oldIndex < currentPagecxx . . $ Ui_BitMapViewer#currentPage.->countcxx . . $ QComboBox#count(455f465bc33b4cdf).()) {
201 currentPagecxx . . $ Ui_BitMapViewer#currentPage.->setCurrentIndexcxx . . $ QComboBox#setCurrentIndex(d4f767463ce0a6b3).(oldIndex);
202 }
203 }
204
205 void BitMapViewercxx . . $ BitMapViewer#::on_currentPage_currentIndexChangedcxx . . $ BitMapViewer#on_currentPage_currentIndexChanged(d4f767463ce0a6b3).(int index)
206 {
207 // if this is the consequence of a .clear() in the
208 // on_screenMode_currentIndexChanged we do nothing!
209 if (index == -1) return;
210
211 int vramAddress = pageSizecxx . . $ BitMapViewer#pageSize. * index;
212 imageWidgetcxx . . $ BitMapViewer#imageWidget.->setVramAddresscxx . . $ VramBitMappedView#setVramAddress(d4f767463ce0a6b3).(vramAddress);
213 addressLabelcxx . . $ Ui_BitMapViewer#addressLabel.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(hexValuecxx . . $ hexValue(f4fd9db251ca774b).(vramAddress, 5));
214 }
215
216 void BitMapViewercxx . . $ BitMapViewer#::on_linesVisible_currentIndexChangedcxx . . $ BitMapViewer#on_linesVisible_currentIndexChanged(d4f767463ce0a6b3).(int index)
217 {
218 static const int m[3] = { 192, 212, 256 };
219 int lines = m[index];
220 imageWidgetcxx . . $ BitMapViewer#imageWidget.->setLinescxx . . $ VramBitMappedView#setLines(d4f767463ce0a6b3).(lines);
221 linesLabelcxx . . $ Ui_BitMapViewer#linesLabel.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(QStringcxx . . $ QString#QString(85c52e162fed56f9).("%1").argcxx . . $ QString#arg(64ab2ed17cc11715).(m[index]));
222 }
223
224 void BitMapViewercxx . . $ BitMapViewer#::on_bgColor_valueChangedcxx . . $ BitMapViewer#on_bgColor_valueChanged(d4f767463ce0a6b3).(int value)
225 {
226 imageWidgetcxx . . $ BitMapViewer#imageWidget.->setBorderColorcxx . . $ VramBitMappedView#setBorderColor(d4f767463ce0a6b3).(value);
227 }
228
229 void BitMapViewercxx . . $ BitMapViewer#::on_useVDPRegisters_stateChangedcxx . . $ BitMapViewer#on_useVDPRegisters_stateChanged(d4f767463ce0a6b3).(int state)
230 {
231 useVDPcxx . . $ BitMapViewer#useVDP. = state;
232
233 screenModecxx . . $ Ui_BitMapViewer#screenMode.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(!state);
234 linesVisiblecxx . . $ Ui_BitMapViewer#linesVisible.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(!state);
235 currentPagecxx . . $ Ui_BitMapViewer#currentPage.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(!state);
236 bgColorcxx . . $ Ui_BitMapViewer#bgColor.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(!state);
237 decodeVDPregscxx . . $ BitMapViewer#decodeVDPregs(49f6e7a06ebc5aa8).();
238 imageWidgetcxx . . $ BitMapViewer#imageWidget.->refreshcxx . . $ VramBitMappedView#refresh(49f6e7a06ebc5aa8).();
239 }
240
241 void BitMapViewercxx . . $ BitMapViewer#::on_zoomLevel_valueChangedcxx . . $ BitMapViewer#on_zoomLevel_valueChanged(ba8836b59fb42830).(double d)
242 {
243 imageWidgetcxx . . $ BitMapViewer#imageWidget.->setZoomcxx . . $ VramBitMappedView#setZoom(9364e6e7bff7660).(float(d));
244 }
245
246 void BitMapViewercxx . . $ BitMapViewer#::on_saveImageButton_clickedcxx . . $ BitMapViewer#on_saveImageButton_clicked(b45ddcbc8423892c).(bool /*checked*/)
247 {
248 QMessageBoxcxx . . $ QMessageBox#::informationcxx . . $ QMessageBox#information(a9e3742e6f7b4147).(
249 this,
250 "Not yet implemented"cxx . . $ QString#QString(85c52e162fed56f9).,
251 "Sorry, the save image dialog is not yet implemented"cxx . . $ QString#QString(85c52e162fed56f9).);
252 }
253
254 void BitMapViewercxx . . $ BitMapViewer#::on_editPaletteButton_clickedcxx . . $ BitMapViewer#on_editPaletteButton_clicked(b45ddcbc8423892c).(bool /*checked*/)
255 {
256 auto* p = new PaletteDialogcxx . . $ PaletteDialog#();
257 p->setPalettecxx . . $ PaletteDialog#setPalette(f25546b61a629de7).(currentPalettecxx . . $ currentPalette.);
258 p->setAutoSynccxx . . $ PaletteDialog#setAutoSync(b45ddcbc8423892c).(true);
259 connectcxx . . $ QObject#connect(835f87066c895669).(p, &PaletteDialogcxx . . $ PaletteDialog#::paletteSyncedcxx . . $ PaletteDialog#paletteSynced(49f6e7a06ebc5aa8)., imageWidgetcxx . . $ BitMapViewer#imageWidget., &VramBitMappedViewcxx . . $ VramBitMappedView#::refreshcxx . . $ VramBitMappedView#refresh(49f6e7a06ebc5aa8).);
260 p->showcxx . . $ QWidget#show(49f6e7a06ebc5aa8).();
261 }
262
263 void BitMapViewercxx . . $ BitMapViewer#::on_useVDPPalette_stateChangedcxx . . $ BitMapViewer#on_useVDPPalette_stateChanged(d4f767463ce0a6b3).(int state)
264 {
265 const uint8_tcxx . . $ uint8_t#* palette = VDPDataStorecxx . . $ VDPDataStore#::instancecxx . . $ VDPDataStore#instance(6179f7cf4255f5b).().getPalettePointercxx . . $ VDPDataStore#getPalettePointer(7eb257f306f79f97).();
266 if (state) {
267 imageWidgetcxx . . $ BitMapViewer#imageWidget.->setPaletteSourcecxx . . $ VramBitMappedView#setPaletteSource(28caea9380bfac8a).(palette);
268 } else {
269 // Copy palette from VDP to allow changes.
270 if (palette) memcpy(currentPalettecxx . . $ currentPalette., palette, 32);
271 imageWidgetcxx . . $ BitMapViewer#imageWidget.->setPaletteSourcecxx . . $ VramBitMappedView#setPaletteSource(28caea9380bfac8a).(currentPalettecxx . . $ currentPalette.);
272 }
273 imageWidgetcxx . . $ BitMapViewer#imageWidget.->refreshcxx . . $ VramBitMappedView#refresh(49f6e7a06ebc5aa8).();
274 editPaletteButtoncxx . . $ Ui_BitMapViewer#editPaletteButton.->setEnabledcxx . . $ QWidget#setEnabled(b45ddcbc8423892c).(!state);
275 }
276
277 /*
278 void BitMapViewer::on_refreshButton_clicked(bool checked)
279 {
280 refresh();
281 decodeVDPregs();
282 imageWidget->refresh();
283 }
284 */
285
286 void BitMapViewercxx . . $ BitMapViewer#::VDPDataStoreDataRefreshedcxx . . $ BitMapViewer#VDPDataStoreDataRefreshed(49f6e7a06ebc5aa8).()
287 {
288 decodeVDPregscxx . . $ BitMapViewer#decodeVDPregs(49f6e7a06ebc5aa8).();
289 }
290
291 void BitMapViewercxx . . $ BitMapViewer#::updateImagePositioncxx . . $ BitMapViewer#updateImagePosition(deee8b20ba58dd0a).(
292 int x, int y, int color, unsigned addr, int byteValue)
293 {
294 labelXcxx . . $ Ui_BitMapViewer#labelX.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(QStringcxx . . $ QString#QString(85c52e162fed56f9).("%1").argcxx . . $ QString#arg(64ab2ed17cc11715).(x, 3, 10, QCharcxx . . $ QChar#('0')));
295 labelYcxx . . $ Ui_BitMapViewer#labelY.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(QStringcxx . . $ QString#QString(85c52e162fed56f9).("%1").argcxx . . $ QString#arg(64ab2ed17cc11715).(y, 3, 10, QCharcxx . . $ QChar#('0')));
296 labelColorcxx . . $ Ui_BitMapViewer#labelColor.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(QStringcxx . . $ QString#QString(85c52e162fed56f9).("%1").argcxx . . $ QString#arg(64ab2ed17cc11715).(color, 3, 10, QCharcxx . . $ QChar#('0')));
297 labelBytecxx . . $ Ui_BitMapViewer#labelByte.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(hexValuecxx . . $ hexValue(f4fd9db251ca774b).(byteValue, 2));
298 labelVramAddrcxx . . $ Ui_BitMapViewer#labelVramAddr.->setTextcxx . . $ QLabel#setText(3520e46b33348bf6).(hexValuecxx . . $ hexValue(f4fd9db251ca774b).(addr, 5));
299 }