| 177 | } |
| 178 | |
| 179 | void Update_RAM_Watch() |
| 180 | { |
| 181 | BOOL watchChanged[MAX_WATCH_COUNT] = {0}; |
| 182 | |
| 183 | if(WatchCount) |
| 184 | { |
| 185 | // update cached values and detect changes to displayed listview items |
| 186 | |
| 187 | for(int i = 0; i < WatchCount; i++) |
| 188 | { |
| 189 | if (rswatches[i].Type != 'S') |
| 190 | { |
| 191 | unsigned int prevCurValue = rswatches[i].CurValue; |
| 192 | unsigned int newCurValue = GetCurrentValue(rswatches[i]); |
| 193 | if (prevCurValue != newCurValue) |
| 194 | { |
| 195 | rswatches[i].CurValue = newCurValue; |
| 196 | watchChanged[i] = TRUE; |
| 197 | } |
| 198 | } |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | // refresh any visible parts of the listview box that changed |
| 203 | HWND lv = GetDlgItem(RamWatchHWnd,IDC_WATCHLIST); |
| 204 | int top = ListView_GetTopIndex(lv); |
| 205 | int bottom = top + ListView_GetCountPerPage(lv) + 1; // +1 is so we will update a partially-displayed last item |
| 206 | if(top < 0) top = 0; |
| 207 | if(bottom > WatchCount) bottom = WatchCount; |
| 208 | int start = -1; |
| 209 | for(int i = top; i <= bottom; i++) |
| 210 | { |
| 211 | if(start == -1) |
| 212 | { |
| 213 | if(i != bottom && watchChanged[i]) |
| 214 | { |
| 215 | start = i; |
| 216 | //somethingChanged = true; |
| 217 | } |
| 218 | } |
| 219 | else |
| 220 | { |
| 221 | if(i == bottom || !watchChanged[i]) |
| 222 | { |
| 223 | ListView_RedrawItems(lv, start, i-1); |
| 224 | start = -1; |
| 225 | } |
| 226 | } |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | bool AskSaveRamWatch() |
| 231 | { |
no test coverage detected