Skip to content

Commit ca39877

Browse files
committed
[debugger] Move memory editor options to global settings. Fix #37
1 parent 869896b commit ca39877

File tree

6 files changed

+127
-81
lines changed

6 files changed

+127
-81
lines changed

platforms/shared/desktop/config.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,16 @@ void config_read(void)
209209
config_debug.single_instance = read_bool("Debug", "SingleInstance", false);
210210
config_debug.auto_debug_settings = read_bool("Debug", "AutoDebugSettings", false);
211211

212+
for (int i = 0; i < config_memory_editor_count; i++)
213+
{
214+
std::string section = "MemEditor_" + std::to_string(i);
215+
config_debug.mem_editor_bytes_per_row[i] = read_int(section.c_str(), "BytesPerRow", 16);
216+
config_debug.mem_editor_preview_data_type[i] = read_int(section.c_str(), "PreviewDataType", 0);
217+
config_debug.mem_editor_preview_endianess[i] = read_int(section.c_str(), "PreviewEndianess", 0);
218+
config_debug.mem_editor_uppercase_hex[i] = read_bool(section.c_str(), "UppercaseHex", true);
219+
config_debug.mem_editor_gray_out_zeros[i] = read_bool(section.c_str(), "GrayOutZeros", true);
220+
}
221+
212222
config_emulator.maximized = read_bool("Emulator", "Maximized", false);
213223
config_emulator.fullscreen = read_bool("Emulator", "FullScreen", false);
214224
config_emulator.fullscreen_mode = read_int("Emulator", "FullScreenMode", 0);
@@ -387,6 +397,16 @@ void config_write(void)
387397
write_bool("Debug", "SingleInstance", config_debug.single_instance);
388398
write_bool("Debug", "AutoDebugSettings", config_debug.auto_debug_settings);
389399

400+
for (int i = 0; i < config_memory_editor_count; i++)
401+
{
402+
std::string section = "MemEditor_" + std::to_string(i);
403+
write_int(section.c_str(), "BytesPerRow", config_debug.mem_editor_bytes_per_row[i]);
404+
write_int(section.c_str(), "PreviewDataType", config_debug.mem_editor_preview_data_type[i]);
405+
write_int(section.c_str(), "PreviewEndianess", config_debug.mem_editor_preview_endianess[i]);
406+
write_bool(section.c_str(), "UppercaseHex", config_debug.mem_editor_uppercase_hex[i]);
407+
write_bool(section.c_str(), "GrayOutZeros", config_debug.mem_editor_gray_out_zeros[i]);
408+
}
409+
390410
write_bool("Emulator", "Maximized", config_emulator.maximized);
391411
write_bool("Emulator", "FullScreen", config_emulator.fullscreen);
392412
write_int("Emulator", "FullScreenMode", config_emulator.fullscreen_mode);

platforms/shared/desktop/config.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
static const int config_version = 2;
3636
static const int config_max_recent_roms = 10;
37+
static const int config_memory_editor_count = 9;
3738

3839
struct config_Emulator
3940
{
@@ -198,6 +199,11 @@ struct config_Debug
198199
bool multi_viewport = false;
199200
bool single_instance = false;
200201
bool auto_debug_settings = false;
202+
int mem_editor_bytes_per_row[config_memory_editor_count] = {16, 16, 16, 16, 16, 16, 16, 16, 16};
203+
int mem_editor_preview_data_type[config_memory_editor_count] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
204+
int mem_editor_preview_endianess[config_memory_editor_count] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
205+
bool mem_editor_uppercase_hex[config_memory_editor_count] = {true, true, true, true, true, true, true, true, true};
206+
bool mem_editor_gray_out_zeros[config_memory_editor_count] = {true, true, true, true, true, true, true, true, true};
201207
};
202208

203209
EXTERN mINI::INIFile* config_ini_file;

platforms/shared/desktop/gui_debug.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void gui_debug_windows(void)
118118
}
119119
}
120120

121-
static const char* GLDEBUG_MAGIC = "GLDEBUG1";
121+
static const char* GLDEBUG_MAGIC = "GLDEBUG2";
122122
static const int GLDEBUG_MAGIC_LEN = 8;
123123

124124
void gui_debug_save_settings(const char* file_path)

0 commit comments

Comments
 (0)