]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Adjustable OCS Agnus max chip ram size.
authorToni Wilen <twilen@winuae.net>
Sun, 9 Jul 2023 17:23:29 +0000 (20:23 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 9 Jul 2023 17:23:29 +0000 (20:23 +0300)
memory.cpp

index a266f4c2b492cee6ae98517c53d7b6672b791add..678bd0ac7de830970ebb98002f7a4bcab73de577 100644 (file)
@@ -2432,10 +2432,21 @@ static void allocate_memory (void)
        }
 
        if (currprefs.cs_agnussize > AGNUSSIZE_AUTO) {
-               if (currprefs.cs_agnussize <= AGNUSSIZE_512) {
-                       chipmem_full_mask = 0x80000 - 1;
-               } else if (currprefs.cs_agnussize == AGNUSSIZE_1M && chipmem_full_mask > 0x100000) {
-                       chipmem_full_mask = 0x100000 - 1;
+               if (currprefs.chipset_mask & CSMASK_ECS_AGNUS) {
+                       // if ECS: allow smaller than select chip RAM size DMA range
+                       if (currprefs.cs_agnussize <= AGNUSSIZE_512) {
+                               chipmem_full_mask = 0x80000 - 1;
+                       } else if (currprefs.cs_agnussize == AGNUSSIZE_1M && chipmem_full_mask > 0x100000) {
+                               chipmem_full_mask = 0x100000 - 1;
+                       }
+               } else {
+                       // if OCS: allow larger than 512k DMA range
+                       if (currprefs.cs_agnussize == AGNUSSIZE_1M && chipmem_bank.allocated_size >= 0x100000) {
+                               chipmem_full_mask = 0x100000 - 1;
+                       }
+                       if (currprefs.cs_agnussize == AGNUSSIZE_2M && chipmem_bank.allocated_size >= 0x180000) {
+                               chipmem_full_mask = 0x200000 - 1;
+                       }
                }
        }