]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Adjusting RAM panel memory range that is also used for expansion panel accelerator...
authorToni Wilen <twilen@winuae.net>
Sun, 25 Jan 2026 14:09:39 +0000 (16:09 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 25 Jan 2026 14:09:39 +0000 (16:09 +0200)
od-win32/win32gui.cpp

index 607488937000c86fec256ba71b350a0fd41b46e0..5c048a252878d389751c40cb780ecc822e130ba4 100644 (file)
@@ -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)