Fixes regarding RAM Search and RAM Watch dialogs. (#323)

* FIX: invalid size of watch region after adding it from RAM Search dialog.

* FIX: endianness of 2 byte value not same for same address in RAM Search and RAM Watch dialogs.

* FIX: RAM Watch dialog not suppot 4 byte values.
This commit is contained in:
Oleg V. Polivets 2021-02-09 03:28:20 +03:00 committed by GitHub
parent 23db1b35b0
commit 766aa1e8fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View File

@ -1243,7 +1243,14 @@ void RamSearchDialog_t::addRamWatchClicked(void)
}
strcpy( desc, "Quick Watch Add");
ramWatchList.add_entry( desc, addr, dpyType, dpySize, 0 );
int size = 1;
switch (dpySize) {
case 'd': size = 4; break;
case 'w': size = 2; break;
case 'b': size = 1; break;
default: break;
}
ramWatchList.add_entry( desc, addr, dpyType, size, 0 );
openRamWatchWindow(consoleWindow);
}

View File

@ -728,14 +728,17 @@ void ramWatch_t::updateMem (void)
}
else if (size == 2)
{
val.u16 = GetMem (addr) | (GetMem (addr + 1) << 8);
val.u16 = (GetMem (addr) << 8) | GetMem (addr + 1);
}
else
else if (size == 4)
{
val.u8 = GetMem (addr);
val.u32 = GetMem (addr + 3);
val.u32 |= GetMem (addr + 2) << 8;
val.u32 |= GetMem (addr + 1) << 16;
val.u32 |= GetMem (addr ) << 24;
}
}
//----------------------------------------------------------------------------
//------------------------------------------------------------------------.----
void RamWatchDialog_t::openWatchEditWindow( ramWatch_t *rw, int mode)
{
int ret, isSep = 0;