From 94b687a626b8275a626f44f9f51d1b7d2294461f Mon Sep 17 00:00:00 2001 From: robxnano <89391914+robxnano@users.noreply.github.com> Date: Mon, 26 Aug 2024 23:30:59 +0100 Subject: [PATCH] GTK3: Support RAM size in megabytes If ramsize is 1000 or less, it is interpreted as a megabyte value. --- BasiliskII/src/Unix/prefs_editor_gtk3.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BasiliskII/src/Unix/prefs_editor_gtk3.cpp b/BasiliskII/src/Unix/prefs_editor_gtk3.cpp index 5558d7e8..5147f87c 100644 --- a/BasiliskII/src/Unix/prefs_editor_gtk3.cpp +++ b/BasiliskII/src/Unix/prefs_editor_gtk3.cpp @@ -348,7 +348,8 @@ void cb_screen_mode(GtkWidget *widget) static void set_ramsize_combo_box(void) { const char *name = "ramsize"; - int size_mb = PrefsFindInt32(name) >> 20; + int ramsize = PrefsFindInt32(name); + int size_mb = (ramsize <= 1000) ? ramsize : ramsize >> 20; GtkComboBoxText *combo = GTK_COMBO_BOX_TEXT(gtk_builder_get_object(builder, name)); char *id = g_strdup_printf("%d MB", size_mb); if (!gtk_combo_box_set_active_id(GTK_COMBO_BOX(combo), id))