Changed Qt RAM search logic to skip over RAM mirrors. Changed GUI to allow for searching of RAM, SRAM, and ROM regions to be individually selectable. Issue #446.

This commit is contained in:
mjbudd77 2022-01-15 23:47:42 -05:00
parent 1f1ca26d83
commit 1acdb31490
2 changed files with 94 additions and 33 deletions

View File

@ -61,6 +61,8 @@
#include "Qt/ConsoleWindow.h" #include "Qt/ConsoleWindow.h"
#include "Qt/ConsoleUtilities.h" #include "Qt/ConsoleUtilities.h"
static bool ShowRAM = true;
static bool ShowSRAM = false;
static bool ShowROM = false; static bool ShowROM = false;
static RamSearchDialog_t *ramSearchWin = NULL; static RamSearchDialog_t *ramSearchWin = NULL;
@ -203,7 +205,7 @@ RamSearchDialog_t::RamSearchDialog_t(QWidget *parent)
{ {
QVBoxLayout *mainLayout; QVBoxLayout *mainLayout;
QHBoxLayout *hbox, *hbox1, *hbox2, *hbox3; QHBoxLayout *hbox, *hbox1, *hbox2, *hbox3;
QVBoxLayout *vbox, *vbox1, *vbox2; QVBoxLayout *vbox, *vbox1, *vbox2, *vbox3;
QGridLayout *grid; QGridLayout *grid;
QGroupBox *frame; QGroupBox *frame;
ramSearchInputValidator *inpValidator; ramSearchInputValidator *inpValidator;
@ -287,9 +289,27 @@ RamSearchDialog_t::RamSearchDialog_t(QWidget *parent)
connect(undoButton, SIGNAL(clicked(void)), this, SLOT(undoSearch(void))); connect(undoButton, SIGNAL(clicked(void)), this, SLOT(undoSearch(void)));
undoButton->setEnabled(false); undoButton->setEnabled(false);
searchROMCbox = new QCheckBox(tr("Search ROM")); frame = new QGroupBox( tr("Search Regions") );
vbox->addWidget(searchROMCbox); vbox3 = new QVBoxLayout();
frame->setLayout(vbox3);
vbox->addWidget(frame);
searchRAMCbox = new QCheckBox(tr("RAM"));
vbox3->addWidget(searchRAMCbox);
searchRAMCbox->setChecked(ShowRAM);
searchRAMCbox->setToolTip( tr("Search RAM Address Range: 0x0000 - 0x07FF") );
connect(searchRAMCbox, SIGNAL(stateChanged(int)), this, SLOT(searchRAMChanged(int)));
searchSRAMCbox = new QCheckBox(tr("SRAM"));
vbox3->addWidget(searchSRAMCbox);
searchSRAMCbox->setChecked(ShowSRAM);
searchSRAMCbox->setToolTip( tr("Search SRAM Address Range: 0x6000 - 0x7FFF") );
connect(searchSRAMCbox, SIGNAL(stateChanged(int)), this, SLOT(searchSRAMChanged(int)));
searchROMCbox = new QCheckBox(tr("ROM"));
vbox3->addWidget(searchROMCbox);
searchROMCbox->setChecked(ShowROM); searchROMCbox->setChecked(ShowROM);
searchROMCbox->setToolTip( tr("Search ROM Address Range: 0x8000 - 0xFFFF") );
connect(searchROMCbox, SIGNAL(stateChanged(int)), this, SLOT(searchROMChanged(int))); connect(searchROMCbox, SIGNAL(stateChanged(int)), this, SLOT(searchROMChanged(int)));
elimButton = new QPushButton(tr("Eliminate")); elimButton = new QPushButton(tr("Eliminate"));
@ -582,6 +602,16 @@ void RamSearchDialog_t::vbarChanged(int val)
ramView->update(); ramView->update();
} }
//---------------------------------------------------- //----------------------------------------------------
void RamSearchDialog_t::searchRAMChanged(int state)
{
ShowRAM = (state != Qt::Unchecked);
}
//----------------------------------------------------
void RamSearchDialog_t::searchSRAMChanged(int state)
{
ShowSRAM = (state != Qt::Unchecked);
}
//----------------------------------------------------
void RamSearchDialog_t::searchROMChanged(int state) void RamSearchDialog_t::searchROMChanged(int state)
{ {
ShowROM = (state != Qt::Unchecked); ShowROM = (state != Qt::Unchecked);
@ -1467,9 +1497,30 @@ void RamSearchDialog_t::hexTypeClicked(void)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void RamSearchDialog_t::calcRamList(void) void RamSearchDialog_t::calcRamList(void)
{ {
int addr; int i, addr, startAddr, endAddr;
int dataSize = 1; int numRegions = 0, dataSize = 1;
int endAddr = ShowROM ? 0x10000 : 0x8000; int regionStart[5], regionEnd[5];
if ( ShowRAM )
{
regionStart[ numRegions ] = 0x0000;
regionEnd[ numRegions ] = 0x0800;
numRegions++;
}
if ( ShowSRAM )
{
regionStart[ numRegions ] = 0x6000;
regionEnd[ numRegions ] = 0x8000;
numRegions++;
}
if ( ShowROM )
{
regionStart[ numRegions ] = 0x08000;
regionEnd[ numRegions ] = 0x10000;
numRegions++;
}
if (chkMisAligned) if (chkMisAligned)
{ {
@ -1490,7 +1541,12 @@ void RamSearchDialog_t::calcRamList(void)
actvSrchList.clear(); actvSrchList.clear();
for (addr = 0; addr < endAddr; addr += dataSize) for (i=0; i<numRegions; i++)
{
startAddr = regionStart[i];
endAddr = regionEnd[i];
for (addr = startAddr; addr < endAddr; addr += dataSize)
{ {
switch (dpySize) switch (dpySize)
{ {
@ -1525,6 +1581,7 @@ void RamSearchDialog_t::calcRamList(void)
break; break;
} }
} }
}
vbar->setMaximum(actvSrchList.size()); vbar->setMaximum(actvSrchList.size());
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------

View File

@ -116,6 +116,8 @@ class RamSearchDialog_t : public QDialog
QLineEdit *specAddrEdit; QLineEdit *specAddrEdit;
QLineEdit *numChangeEdit; QLineEdit *numChangeEdit;
QCheckBox *searchRAMCbox;
QCheckBox *searchSRAMCbox;
QCheckBox *searchROMCbox; QCheckBox *searchROMCbox;
QCheckBox *misalignedCbox; QCheckBox *misalignedCbox;
QCheckBox *autoSearchCbox; QCheckBox *autoSearchCbox;
@ -148,6 +150,8 @@ class RamSearchDialog_t : public QDialog
void periodicUpdate(void); void periodicUpdate(void);
void hbarChanged(int val); void hbarChanged(int val);
void vbarChanged(int val); void vbarChanged(int val);
void searchRAMChanged(int state);
void searchSRAMChanged(int state);
void searchROMChanged(int state); void searchROMChanged(int state);
void misalignedChanged(int state); void misalignedChanged(int state);
void ds1Clicked(void); void ds1Clicked(void);