Skip to content

Commit 95b1da1

Browse files
committed
[debugger] Improve memory editor
1 parent 6ad87b7 commit 95b1da1

File tree

12 files changed

+1318
-409
lines changed

12 files changed

+1318
-409
lines changed

platforms/desktop-shared/Makefile.sources

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ SOURCES_CXX := \
1010
$(DESKTOP_SRC_DIR)/emu.cpp \
1111
$(DESKTOP_SRC_DIR)/gui.cpp \
1212
$(DESKTOP_SRC_DIR)/gui_debug.cpp \
13+
$(DESKTOP_SRC_DIR)/gui_debug_memory.cpp \
14+
$(DESKTOP_SRC_DIR)/gui_debug_memeditor.cpp \
1315
$(DESKTOP_SRC_DIR)/application.cpp \
1416
$(DESKTOP_SRC_DIR)/config.cpp \
1517
$(DESKTOP_SRC_DIR)/renderer.cpp \
@@ -19,7 +21,6 @@ SOURCES_CXX := \
1921
$(DESKTOP_SRC_DIR)/imgui/imgui_draw.cpp \
2022
$(DESKTOP_SRC_DIR)/imgui/imgui_widgets.cpp \
2123
$(DESKTOP_SRC_DIR)/imgui/imgui_tables.cpp \
22-
$(DESKTOP_SRC_DIR)/imgui/memory_editor.cpp \
2324
$(AUDIO_SRC_DIR)/sound_queue.cpp \
2425
$(SRC_DIR)/Audio.cpp \
2526
$(SRC_DIR)/Cartridge.cpp \

platforms/desktop-shared/gui.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
#include "license.h"
3131
#include "backers.h"
3232
#include "gui_debug.h"
33-
#include "imgui/colors.h"
33+
#include "gui_debug_memory.h"
34+
#include "gui_debug_constants.h"
3435
#include "imgui/keyboard.h"
3536

3637
#define GUI_IMPORT
@@ -142,6 +143,8 @@ void gui_init(void)
142143

143144
emu_enable_bootrom_dmg(config_emulator.dmg_bootrom);
144145
emu_enable_bootrom_gbc(config_emulator.gbc_bootrom);
146+
147+
gui_debug_memory_init();
145148
}
146149

147150
void gui_destroy(void)
@@ -210,7 +213,10 @@ void gui_shortcut(gui_ShortCutEvent event)
210213
break;
211214
case gui_ShortcutDebugNextFrame:
212215
if (config_debug.debug)
216+
{
213217
emu_debug_next_frame();
218+
gui_debug_memory_step_frame();
219+
}
214220
break;
215221
case gui_ShortcutDebugBreakpoint:
216222
if (config_debug.debug)
@@ -226,11 +232,11 @@ void gui_shortcut(gui_ShortCutEvent event)
226232
break;
227233
case gui_ShortcutDebugCopy:
228234
if (config_debug.debug)
229-
gui_debug_copy_memory();
235+
gui_debug_memory_copy();
230236
break;
231237
case gui_ShortcutDebugPaste:
232238
if (config_debug.debug)
233-
gui_debug_paste_memory();
239+
gui_debug_memory_paste();
234240
break;
235241
case gui_ShortcutShowMainMenu:
236242
config_emulator.show_menu = !config_emulator.show_menu;
@@ -857,6 +863,7 @@ static void main_menu(void)
857863
if (ImGui::MenuItem("Step Frame", "CTRL + F6", (void*)0, config_debug.debug))
858864
{
859865
emu_debug_next_frame();
866+
gui_debug_memory_step_frame();
860867
}
861868

862869
if (ImGui::MenuItem("Continue", "CTRL + F5", (void*)0, config_debug.debug))

0 commit comments

Comments
 (0)