From f1d7c895c6cff06b676ba74a1f48e7c6a4e31c4c Mon Sep 17 00:00:00 2001 From: mtabachenko Date: Wed, 29 May 2013 15:09:32 +0000 Subject: [PATCH] winport: - removing duplicate addresses from list in memview tool; --- desmume/src/windows/memView.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/desmume/src/windows/memView.cpp b/desmume/src/windows/memView.cpp index 1cfe981b5..bd91da021 100644 --- a/desmume/src/windows/memView.cpp +++ b/desmume/src/windows/memView.cpp @@ -479,10 +479,23 @@ INT_PTR CALLBACK MemView_DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPa wnd->selPart = 0; wnd->selNewVal = 0x00000000; + // ====================== add address in list if (ComboBox_GetCount(gAddress) == MAX_ADDRESS_SAVE) ComboBox_DeleteString(gAddress, ComboBox_GetCount(gAddress) - 1); + // remove duplicate address + u16 num = ComboBox_GetCount(gAddress); + for (u16 i = 0; i < num; i++) + { + char hex[16] = {0}; + ComboBox_GetLBText(gAddress, i, (LPCTSTR)&hex[0]); + if (strcmp(addrstr, hex) == 0) + ComboBox_DeleteString(gAddress, i); + } + // add to list ComboBox_InsertString(gAddress, 0, addrstr); + ComboBox_SetText(gAddress, addrstr); + SetScrollPos(GetDlgItem(hDlg, IDC_MEMVIEWBOX), SB_VERT, (((wnd->address - region.hardwareAddress) >> 4) & 0x000FFFFF), TRUE); wnd->Refresh();