@@ -95,7 +95,10 @@ void PCSX::Widgets::MemoryObserver::draw(const char* title) {
95
95
ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV;
96
96
97
97
if (ImGui::BeginTabItem (_ (" Plain search" ))) {
98
- bool gotEnter = ImGui::InputText (_ (" Pattern" ), &m_plainSearchString, ImGuiInputTextFlags_EnterReturnsTrue);
98
+ bool gotEnter = ImGui::InputText (
99
+ _ (" Pattern" ), &m_plainSearchString,
100
+ ImGuiInputTextFlags_EnterReturnsTrue |
101
+ (m_plainHex ? ImGuiInputTextFlags_CharsHexadecimal : ImGuiInputTextFlags_CharsDecimal));
99
102
ImGui::Checkbox (_ (" Hex" ), &m_plainHex);
100
103
auto needleSize = 0 ;
101
104
std::string needle;
@@ -166,9 +169,10 @@ void PCSX::Widgets::MemoryObserver::draw(const char* title) {
166
169
if (!valid) {
167
170
ImGui::EndDisabled ();
168
171
}
169
- if (ImGui::BeginTable (_ (" Found values" ), 2 , tableFlags)) {
172
+ if (ImGui::BeginTable (_ (" Found values" ), 3 , tableFlags)) {
170
173
ImGui::TableSetupColumn (_ (" Address" ));
171
174
ImGui::TableSetupColumn (_ (" Access" ));
175
+ ImGui::TableSetupColumn (_ (" Remove" ));
172
176
ImGui::TableHeadersRow ();
173
177
174
178
ImGuiListClipper clipper;
@@ -187,6 +191,13 @@ void PCSX::Widgets::MemoryObserver::draw(const char* title) {
187
191
g_system->m_eventBus ->signal (
188
192
PCSX::Events::GUI::JumpToMemory{editorAddress, static_cast <unsigned >(needleSize)});
189
193
}
194
+ ImGui::TableSetColumnIndex (2 );
195
+ auto removeButtonName = fmt::format (f_ (" ╳##{}" ), row);
196
+ if (ImGui::Button (removeButtonName.c_str ())) {
197
+ m_plainAddresses.erase (m_plainAddresses.begin () + row);
198
+ clipper.Begin (m_plainAddresses.size ());
199
+ break ;
200
+ }
190
201
}
191
202
}
192
203
ImGui::EndTable ();
@@ -286,6 +297,12 @@ void PCSX::Widgets::MemoryObserver::draw(const char* title) {
286
297
}
287
298
288
299
ImGui::Checkbox (_ (" Hex" ), &m_hex);
300
+
301
+ if (!m_hex && stride > 1 ) {
302
+ ImGui::SameLine ();
303
+ ImGui::Checkbox (_ (" Display as fixed-point values" ), &m_fixedPoint);
304
+ }
305
+
289
306
ImGui::InputScalar (_ (" Value" ), ImGuiDataType_S64, &m_value, NULL , NULL , m_hex ? " %x" : " %i" ,
290
307
m_hex ? ImGuiInputTextFlags_CharsHexadecimal : ImGuiInputTextFlags_CharsDecimal);
291
308
m_value = getValueAsSelectedType (m_value);
@@ -320,17 +337,34 @@ void PCSX::Widgets::MemoryObserver::draw(const char* title) {
320
337
ImGui::EndCombo ();
321
338
}
322
339
323
- if (!m_hex && stride > 1 ) {
324
- ImGui::Checkbox (_ (" Display as fixed-point values" ), &m_fixedPoint);
340
+ ImGui::Separator ();
341
+ if (ImGui::Button (_ (" Freeze all" ))) {
342
+ for (auto & addressValuePair : m_addressValuePairs) {
343
+ addressValuePair.frozen = true ;
344
+ addressValuePair.frozenValue = getValueAsSelectedType (getMemValue (
345
+ addressValuePair.address , memData, memSize, memBase, getStrideFromValueType (m_scanValueType)));
346
+ }
347
+ }
348
+ ImGui::SameLine ();
349
+ if (ImGui::Button (_ (" Unfreeze all" ))) {
350
+ for (auto & addressValuePair : m_addressValuePairs) {
351
+ addressValuePair.frozen = false ;
352
+ }
353
+ }
354
+ ImGui::SameLine ();
355
+ if (ImGui::Button (_ (" Remove all frozen addresses" ))) {
356
+ m_addressValuePairs.erase (std::remove_if (m_addressValuePairs.begin (), m_addressValuePairs.end (),
357
+ [](const AddressValuePair& pair) { return pair.frozen ; }),
358
+ m_addressValuePairs.end ());
325
359
}
326
360
327
361
if (ImGui::BeginTable (_ (" Found values" ), 6 , tableFlags)) {
328
362
ImGui::TableSetupColumn (_ (" Address" ));
329
363
ImGui::TableSetupColumn (_ (" Current value" ));
330
364
ImGui::TableSetupColumn (_ (" Scanned value" ));
331
365
ImGui::TableSetupColumn (_ (" Access" ));
332
- ImGui::TableSetupColumn (_ (" Read breakpoint" ));
333
- ImGui::TableSetupColumn (_ (" Write breakpoint " ));
366
+ ImGui::TableSetupColumn (_ (" Add breakpoint" ));
367
+ ImGui::TableSetupColumn (_ (" Remove " ));
334
368
ImGui::TableHeadersRow ();
335
369
336
370
bool as_uint = (m_scanValueType == ScanValueType::Uint);
@@ -376,17 +410,24 @@ void PCSX::Widgets::MemoryObserver::draw(const char* title) {
376
410
g_system->m_eventBus ->signal (PCSX::Events::GUI::JumpToMemory{editorAddress, stride});
377
411
}
378
412
ImGui::TableSetColumnIndex (4 );
379
- auto addReadBreakpointButtonName = fmt::format (f_ (" Add read breakpoint ##{}" ), row);
413
+ auto addReadBreakpointButtonName = fmt::format (f_ (" Read ##{}" ), row);
380
414
if (ImGui::Button (addReadBreakpointButtonName.c_str ())) {
381
415
g_emulator->m_debug ->addBreakpoint (currentAddress, Debug::BreakpointType::Read, stride,
382
416
_ (" Memory Observer" ));
383
417
}
384
- ImGui::TableSetColumnIndex ( 5 );
385
- auto addWriteBreakpointButtonName = fmt::format (f_ (" Add write breakpoint ##{}" ), row);
418
+ ImGui::SameLine ( );
419
+ auto addWriteBreakpointButtonName = fmt::format (f_ (" Write ##{}" ), row);
386
420
if (ImGui::Button (addWriteBreakpointButtonName.c_str ())) {
387
421
g_emulator->m_debug ->addBreakpoint (currentAddress, Debug::BreakpointType::Write, stride,
388
422
_ (" Memory Observer" ));
389
423
}
424
+ ImGui::TableSetColumnIndex (5 );
425
+ auto removeButtonName = fmt::format (f_ (" ╳##{}" ), row);
426
+ if (ImGui::Button (removeButtonName.c_str ())) {
427
+ m_addressValuePairs.erase (m_addressValuePairs.begin () + row);
428
+ clipper.Begin (m_addressValuePairs.size ());
429
+ break ;
430
+ }
390
431
}
391
432
}
392
433
ImGui::EndTable ();
@@ -399,9 +440,13 @@ void PCSX::Widgets::MemoryObserver::draw(const char* title) {
399
440
if (m_useSIMD) {
400
441
ImGui::TextUnformatted (_ (" Sequence size: " ));
401
442
ImGui::SameLine ();
402
- ImGui::RadioButton (_ (" 8 bytes (fast)" ), &m_sequenceSize, 8 );
443
+ if (ImGui::RadioButton (_ (" 8 bytes (fast)" ), &m_sequenceSize, 8 ) && strlen (m_sequence) > 8 ) {
444
+ m_sequence[8 ] = ' \0 ' ;
445
+ }
403
446
ImGui::SameLine ();
404
- ImGui::RadioButton (_ (" 16 bytes (fast)" ), &m_sequenceSize, 16 );
447
+ if (ImGui::RadioButton (_ (" 16 bytes (fast)" ), &m_sequenceSize, 16 ) && strlen (m_sequence) > 16 ) {
448
+ m_sequence[16 ] = ' \0 ' ;
449
+ }
405
450
ImGui::SameLine ();
406
451
ImGui::RadioButton (_ (" Arbitrary" ), &m_sequenceSize, 255 );
407
452
}
0 commit comments