44#include " Convert.h"
55#include < QMessageBox>
66
7- static const uint8_t defaultPalette[32 ] = {
8- // RB G
9- 0x00 , 0 ,
10- 0x00 , 0 ,
11- 0x11 , 6 ,
12- 0x33 , 7 ,
13- 0x17 , 1 ,
14- 0x27 , 3 ,
15- 0x51 , 1 ,
16- 0x27 , 6 ,
17- 0x71 , 1 ,
18- 0x73 , 3 ,
19- 0x61 , 6 ,
20- 0x64 , 6 ,
21- 0x11 , 4 ,
22- 0x65 , 2 ,
23- 0x55 , 5 ,
24- 0x77 , 7 ,
25- };
26-
277BitMapViewer::BitMapViewer (QWidget* parent)
288 : QDialog(parent)
299 , screenMod(0 ) // avoid UMR
@@ -38,7 +18,6 @@ BitMapViewer::BitMapViewer(QWidget* parent)
3818 connect (useVDPRegisters, &QCheckBox::stateChanged,this , &BitMapViewer::on_useVDPRegisters_stateChanged);
3919
4020 connect (saveImageButton, &QPushButton::clicked, this , &BitMapViewer::on_saveImageButton_clicked);
41- connect (editPaletteButton, &QPushButton::clicked, this , &BitMapViewer::on_editPaletteButton_clicked);
4221 connect (useVDPPalette, &QCheckBox::stateChanged, this , &BitMapViewer::on_useVDPPalette_stateChanged);
4322 connect (zoomLevel, qOverload<double >(&QDoubleSpinBox::valueChanged), this , &BitMapViewer::on_zoomLevel_valueChanged);
4423
@@ -61,10 +40,9 @@ BitMapViewer::BitMapViewer(QWidget* parent)
6140 useVDP = useVDPRegisters->isChecked ();
6241
6342 const uint8_t * vram = VDPDataStore::instance ().getVramPointer ();
64- const uint8_t * palette = VDPDataStore::instance ().getPalettePointer ();
6543 imageWidget->setVramSource (vram);
6644 imageWidget->setVramAddress (0 );
67- imageWidget->setPaletteSource (palette );
45+ imageWidget->setPaletteSource (VDPDataStore::instance (). getPalette (paletteVDP) );
6846
6947 // now hook up some signals and slots
7048 connect (&VDPDataStore::instance (), &VDPDataStore::dataRefreshed,
@@ -246,23 +224,13 @@ void BitMapViewer::on_saveImageButton_clicked(bool /*checked*/)
246224 " Sorry, the save image dialog is not yet implemented" );
247225}
248226
249- void BitMapViewer::on_editPaletteButton_clicked (bool /* checked*/ )
250- {
251- useVDPPalette->setChecked (false );
252- QMessageBox::information (
253- this ,
254- " Not yet implemented" ,
255- " Sorry, the palette editor is not yet implemented, "
256- " only disabling 'Use VDP palette registers' for now" );
257- }
258227
259228void BitMapViewer::on_useVDPPalette_stateChanged (int state)
260229{
261230 if (state) {
262- const uint8_t * palette = VDPDataStore::instance ().getPalettePointer ();
263- imageWidget->setPaletteSource (palette);
231+ imageWidget->setPaletteSource (VDPDataStore::instance ().getPalette (paletteVDP));
264232 } else {
265- imageWidget->setPaletteSource (defaultPalette );
233+ imageWidget->setPaletteSource (VDPDataStore::instance (). getPalette (paletteBitmap) );
266234 }
267235 imageWidget->refresh ();
268236}
0 commit comments