Minor performance improvements to Qt Ram Search window.
This commit is contained in:
parent
14b07ab5f2
commit
67752c1ea2
|
@ -95,6 +95,7 @@ struct memoryLocation_t
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
static struct memoryLocation_t memLoc[0x10000];
|
static struct memoryLocation_t memLoc[0x10000];
|
||||||
|
static uint8_t lclMemBuf[0x10000];
|
||||||
|
|
||||||
static std::list <struct memoryLocation_t*> actvSrchList;
|
static std::list <struct memoryLocation_t*> actvSrchList;
|
||||||
static std::list <struct memoryLocation_t*> deactvSrchList;
|
static std::list <struct memoryLocation_t*> deactvSrchList;
|
||||||
|
@ -481,9 +482,12 @@ void RamSearchDialog_t::periodicUpdate(void)
|
||||||
{
|
{
|
||||||
int selAddr = -1;
|
int selAddr = -1;
|
||||||
|
|
||||||
fceuWrapperLock();
|
|
||||||
if ( currFrameCounter != frameCounterLastPass )
|
if ( currFrameCounter != frameCounterLastPass )
|
||||||
{
|
{
|
||||||
|
fceuWrapperLock();
|
||||||
|
copyRamToLocalBuffer();
|
||||||
|
fceuWrapperUnLock();
|
||||||
|
|
||||||
//if ( currFrameCounter != (frameCounterLastPass+1) )
|
//if ( currFrameCounter != (frameCounterLastPass+1) )
|
||||||
//{
|
//{
|
||||||
// printf("Warning: Ram Search Missed Frame: %i \n", currFrameCounter );
|
// printf("Warning: Ram Search Missed Frame: %i \n", currFrameCounter );
|
||||||
|
@ -496,8 +500,9 @@ void RamSearchDialog_t::periodicUpdate(void)
|
||||||
}
|
}
|
||||||
frameCounterLastPass = currFrameCounter;
|
frameCounterLastPass = currFrameCounter;
|
||||||
}
|
}
|
||||||
fceuWrapperUnLock();
|
|
||||||
|
|
||||||
|
if ( (cycleCounter % 10) == 0)
|
||||||
|
{
|
||||||
undoButton->setEnabled( deactvFrameStack.size() > 0 );
|
undoButton->setEnabled( deactvFrameStack.size() > 0 );
|
||||||
|
|
||||||
selAddr = ramView->getSelAddr();
|
selAddr = ramView->getSelAddr();
|
||||||
|
@ -517,8 +522,6 @@ void RamSearchDialog_t::periodicUpdate(void)
|
||||||
hexEditButton->setEnabled(false);
|
hexEditButton->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (cycleCounter % 10) == 0)
|
|
||||||
{
|
|
||||||
ramView->update();
|
ramView->update();
|
||||||
}
|
}
|
||||||
cycleCounter++;
|
cycleCounter++;
|
||||||
|
@ -1020,7 +1023,7 @@ static unsigned int ReadValueAtHardwareAddress(int address, unsigned int size)
|
||||||
if ( address < maxAddr )
|
if ( address < maxAddr )
|
||||||
{
|
{
|
||||||
value <<= 8;
|
value <<= 8;
|
||||||
value |= GetMem(address);
|
value |= lclMemBuf[address];
|
||||||
address++;
|
address++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1053,8 +1056,22 @@ void RamSearchDialog_t::runSearch(void)
|
||||||
undoButton->setEnabled( deactvFrameStack.size() > 0 );
|
undoButton->setEnabled( deactvFrameStack.size() > 0 );
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
void RamSearchDialog_t::copyRamToLocalBuffer(void)
|
||||||
|
{
|
||||||
|
for (unsigned int addr=0; addr<0x10000; addr++)
|
||||||
|
{
|
||||||
|
lclMemBuf[addr] = GetMem(addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
void RamSearchDialog_t::resetSearch(void)
|
void RamSearchDialog_t::resetSearch(void)
|
||||||
{
|
{
|
||||||
|
memset( lclMemBuf, 0, sizeof(lclMemBuf));
|
||||||
|
|
||||||
|
fceuWrapperLock();
|
||||||
|
copyRamToLocalBuffer();
|
||||||
|
fceuWrapperUnLock();
|
||||||
|
|
||||||
actvSrchList.clear();
|
actvSrchList.clear();
|
||||||
deactvSrchList.clear();
|
deactvSrchList.clear();
|
||||||
deactvFrameStack.clear();
|
deactvFrameStack.clear();
|
||||||
|
@ -1063,7 +1080,7 @@ void RamSearchDialog_t::resetSearch(void)
|
||||||
{
|
{
|
||||||
memLoc[addr].hist.clear();
|
memLoc[addr].hist.clear();
|
||||||
memLoc[addr].addr = addr;
|
memLoc[addr].addr = addr;
|
||||||
memLoc[addr].val.v8.u = GetMem(addr);
|
memLoc[addr].val.v8.u = lclMemBuf[addr];
|
||||||
memLoc[addr].val.v16.u = ReadValueAtHardwareAddress(addr, 2);
|
memLoc[addr].val.v16.u = ReadValueAtHardwareAddress(addr, 2);
|
||||||
memLoc[addr].val.v32.u = ReadValueAtHardwareAddress(addr, 4);
|
memLoc[addr].val.v32.u = ReadValueAtHardwareAddress(addr, 4);
|
||||||
memLoc[addr].elimMask = 0;
|
memLoc[addr].elimMask = 0;
|
||||||
|
@ -1227,9 +1244,13 @@ void RamSearchDialog_t::addCheatClicked(void)
|
||||||
}
|
}
|
||||||
strcpy( desc, "Quick Cheat Add");
|
strcpy( desc, "Quick Cheat Add");
|
||||||
|
|
||||||
|
fceuWrapperLock();
|
||||||
|
|
||||||
FCEUI_AddCheat( desc, addr, GetMem(addr), -1, 1 );
|
FCEUI_AddCheat( desc, addr, GetMem(addr), -1, 1 );
|
||||||
|
|
||||||
updateCheatDialog();
|
updateCheatDialog();
|
||||||
|
|
||||||
|
fceuWrapperUnLock();
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void RamSearchDialog_t::addRamWatchClicked(void)
|
void RamSearchDialog_t::addRamWatchClicked(void)
|
||||||
|
@ -1459,7 +1480,7 @@ void RamSearchDialog_t::updateRamValues(void)
|
||||||
{
|
{
|
||||||
loc = *it;
|
loc = *it;
|
||||||
|
|
||||||
val.v8.u = GetMem(loc->addr);
|
val.v8.u = lclMemBuf[loc->addr];
|
||||||
val.v16.u = ReadValueAtHardwareAddress(loc->addr, 2);
|
val.v16.u = ReadValueAtHardwareAddress(loc->addr, 2);
|
||||||
val.v32.u = ReadValueAtHardwareAddress(loc->addr, 4);
|
val.v32.u = ReadValueAtHardwareAddress(loc->addr, 4);
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,7 @@ class RamSearchDialog_t : public QDialog
|
||||||
void SearchSpecificValue(void);
|
void SearchSpecificValue(void);
|
||||||
void SearchSpecificAddress(void);
|
void SearchSpecificAddress(void);
|
||||||
void SearchNumberChanges(void);
|
void SearchNumberChanges(void);
|
||||||
|
void copyRamToLocalBuffer(void);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void closeWindow(void);
|
void closeWindow(void);
|
||||||
|
|
Loading…
Reference in New Issue