From: Toni Wilen Date: Sun, 25 Jan 2026 14:09:39 +0000 (+0200) Subject: Adjusting RAM panel memory range that is also used for expansion panel accelerator... X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=7656a4f02d442f2f0518b1a1138f60d348a0d0e7;p=francis%2Fwinuae.git Adjusting RAM panel memory range that is also used for expansion panel accelerator RAM: copy new value to accelerator RAM. --- diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 60748893..5c048a25 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -10267,28 +10267,47 @@ static void setmax32bitram (HWND hDlg) SetDlgItemText (hDlg, IDC_MAX32RAM, tmp); } -static void setcpuboardmemsize(HWND hDlg) +static void copycpuboardmem(bool tomem) { - if (workprefs.cpuboardmem1.size > cpuboard_maxmemory(&workprefs)) - workprefs.cpuboardmem1.size = cpuboard_maxmemory(&workprefs); + int maxmem = cpuboard_maxmemory(&workprefs); - if (cpuboard_memorytype(&workprefs) == BOARD_MEMORY_Z2) { - workprefs.fastmem[0].size = workprefs.cpuboardmem1.size; - } - if (cpuboard_memorytype(&workprefs) == BOARD_MEMORY_25BITMEM) { - workprefs.mem25bit.size = workprefs.cpuboardmem1.size; - } - if (workprefs.cpuboard_type == 0) { - workprefs.mem25bit.size = 0; + if (tomem) { + if (cpuboard_memorytype(&workprefs) == BOARD_MEMORY_Z2) { + workprefs.cpuboardmem1.size = workprefs.fastmem[0].size; + } + if (cpuboard_memorytype(&workprefs) == BOARD_MEMORY_25BITMEM) { + workprefs.cpuboardmem1.size = workprefs.mem25bit.size; + } + if (cpuboard_memorytype(&workprefs) == BOARD_MEMORY_HIGHMEM) { + workprefs.cpuboardmem1.size = workprefs.mbresmem_high.size; + } + if (workprefs.cpuboardmem1.size > maxmem) { + workprefs.cpuboardmem1.size = maxmem; + } + } else { + if (workprefs.cpuboardmem1.size > maxmem) { + workprefs.cpuboardmem1.size = maxmem; + } + if (cpuboard_memorytype(&workprefs) == BOARD_MEMORY_Z2) { + workprefs.fastmem[0].size = workprefs.cpuboardmem1.size; + } + if (cpuboard_memorytype(&workprefs) == BOARD_MEMORY_25BITMEM) { + workprefs.mem25bit.size = workprefs.cpuboardmem1.size; + } + if (cpuboard_memorytype(&workprefs) == BOARD_MEMORY_HIGHMEM) { + workprefs.mbresmem_high.size = workprefs.cpuboardmem1.size; + } + if (workprefs.cpuboard_type == 0) { + workprefs.mem25bit.size = 0; + } } +} - if (cpuboard_memorytype(&workprefs) == BOARD_MEMORY_HIGHMEM) - workprefs.mbresmem_high.size = workprefs.cpuboardmem1.size; +static void setcpuboardmemsize(HWND hDlg) +{ + copycpuboardmem(false); int maxmem = cpuboard_maxmemory(&workprefs); - if (workprefs.cpuboardmem1.size > maxmem) { - workprefs.cpuboardmem1.size = maxmem; - } if (maxmem <= 8 * 1024 * 1024) xSendDlgItemMessage (hDlg, IDC_CPUBOARDMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_CB_MEM, MAX_CB_MEM_Z2)); else if (maxmem <= 16 * 1024 * 1024) @@ -10471,6 +10490,7 @@ static void values_to_memorydlg (HWND hDlg) SetDlgItemText (hDlg, IDC_CPUSLOTRAM, memsize_names[msi_cpuboard[mem_size]]); setmax32bitram (hDlg); + copycpuboardmem(true); } static void fix_values_memorydlg (void)