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 .

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,7 +61,9 @@
#include "Qt/ConsoleWindow.h"
#include "Qt/ConsoleUtilities.h"
static bool ShowROM = false;
static bool ShowRAM = true;
static bool ShowSRAM = false;
static bool ShowROM = false;
static RamSearchDialog_t *ramSearchWin = NULL;
struct memoryState_t
@ -203,7 +205,7 @@ RamSearchDialog_t::RamSearchDialog_t(QWidget *parent)
{
QVBoxLayout *mainLayout;
QHBoxLayout *hbox, *hbox1, *hbox2, *hbox3;
QVBoxLayout *vbox, *vbox1, *vbox2;
QVBoxLayout *vbox, *vbox1, *vbox2, *vbox3;
QGridLayout *grid;
QGroupBox *frame;
ramSearchInputValidator *inpValidator;
@ -287,9 +289,27 @@ RamSearchDialog_t::RamSearchDialog_t(QWidget *parent)
connect(undoButton, SIGNAL(clicked(void)), this, SLOT(undoSearch(void)));
undoButton->setEnabled(false);
searchROMCbox = new QCheckBox(tr("Search ROM"));
vbox->addWidget(searchROMCbox);
frame = new QGroupBox( tr("Search Regions") );
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->setToolTip( tr("Search ROM Address Range: 0x8000 - 0xFFFF") );
connect(searchROMCbox, SIGNAL(stateChanged(int)), this, SLOT(searchROMChanged(int)));
elimButton = new QPushButton(tr("Eliminate"));
@ -582,6 +602,16 @@ void RamSearchDialog_t::vbarChanged(int val)
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)
{
ShowROM = (state != Qt::Unchecked);
@ -1467,9 +1497,30 @@ void RamSearchDialog_t::hexTypeClicked(void)
//----------------------------------------------------------------------------
void RamSearchDialog_t::calcRamList(void)
{
int addr;
int dataSize = 1;
int endAddr = ShowROM ? 0x10000 : 0x8000;
int i, addr, startAddr, endAddr;
int numRegions = 0, dataSize = 1;
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)
{
@ -1490,39 +1541,45 @@ void RamSearchDialog_t::calcRamList(void)
actvSrchList.clear();
for (addr = 0; addr < endAddr; addr += dataSize)
for (i=0; i<numRegions; i++)
{
switch (dpySize)
startAddr = regionStart[i];
endAddr = regionEnd[i];
for (addr = startAddr; addr < endAddr; addr += dataSize)
{
case 'd':
if ((addr + 3) < endAddr)
switch (dpySize)
{
if ((memLoc[addr].elimMask == 0) &&
(memLoc[addr + 1].elimMask == 0) &&
(memLoc[addr + 2].elimMask == 0) &&
(memLoc[addr + 3].elimMask == 0))
case 'd':
if ((addr + 3) < endAddr)
{
if ((memLoc[addr].elimMask == 0) &&
(memLoc[addr + 1].elimMask == 0) &&
(memLoc[addr + 2].elimMask == 0) &&
(memLoc[addr + 3].elimMask == 0))
{
actvSrchList.push_back(&memLoc[addr]);
}
}
break;
case 'w':
if ((addr + 1) < endAddr)
{
if ((memLoc[addr].elimMask == 0) &&
(memLoc[addr + 1].elimMask == 0))
{
actvSrchList.push_back(&memLoc[addr]);
}
}
break;
default:
case 'b':
if (memLoc[addr].elimMask == 0)
{
actvSrchList.push_back(&memLoc[addr]);
}
break;
}
break;
case 'w':
if ((addr + 1) < endAddr)
{
if ((memLoc[addr].elimMask == 0) &&
(memLoc[addr + 1].elimMask == 0))
{
actvSrchList.push_back(&memLoc[addr]);
}
}
break;
default:
case 'b':
if (memLoc[addr].elimMask == 0)
{
actvSrchList.push_back(&memLoc[addr]);
}
break;
}
}
vbar->setMaximum(actvSrchList.size());

View File

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