]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Increase max natmem RAM location to include possible G-REX PCI VRAM space
authorToni Wilen <twilen@winuae.net>
Sat, 10 Dec 2022 11:24:06 +0000 (13:24 +0200)
committerToni Wilen <twilen@winuae.net>
Sat, 10 Dec 2022 11:24:06 +0000 (13:24 +0200)
include/memory.h
od-win32/mman.cpp
od-win32/picasso96_win.cpp

index 601b696b58f5222317f3fe3e793a4ecbd4accdf6..9946d7d6e32ca14f12c3b0fde7f7ff388f9452f1 100644 (file)
@@ -50,7 +50,7 @@ typedef void (REGPARAM3 *mem_put_func)(uaecptr, uae_u32) REGPARAM;
 typedef uae_u8 *(REGPARAM3 *xlate_func)(uaecptr) REGPARAM;
 typedef int (REGPARAM3 *check_func)(uaecptr, uae_u32) REGPARAM;
 
-extern uae_u32 max_z3fastmem;
+extern uae_u32 max_z3fastmem, max_physmem;
 
 extern uae_u32 wait_cpu_cycle_read (uaecptr addr, int mode);
 extern void wait_cpu_cycle_write (uaecptr addr, int mode, uae_u32 v);
index fc212404ce6fff86111f0d0e55692f541808d0f8..64eb6d4de058deadbf107a562ebd15f3b85f191d 100644 (file)
@@ -25,6 +25,7 @@
 #define WIN32_NATMEM_TEST 0
 
 uae_u32 max_z3fastmem;
+uae_u32 max_physmem;
 
 /* BARRIER is used in case Amiga memory is access across memory banks,
  * for example move.l $1fffffff,d0 when $10000000-$1fffffff is mapped and
@@ -148,15 +149,10 @@ bool preinit_shm (void)
 #endif
        GetSystemInfo (&si);
        max_allowed_mman = 512 + 256;
-#if 1
        if (os_64bit) {
-//#ifdef WIN64
-//             max_allowed_mman = 3072;
-//#else
-               max_allowed_mman = 2048;
-//#endif
+               // Higher than 2G to support G-REX PCI VRAM
+               max_allowed_mman = 2560;
        }
-#endif
        if (maxmem > max_allowed_mman)
                max_allowed_mman = maxmem;
 
@@ -207,8 +203,8 @@ bool preinit_shm (void)
        natmem_size = WIN32_NATMEM_TEST * 1024 * 1024;
 #endif
 
-       if (natmem_size > 0x80000000) {
-               natmem_size = 0x80000000;
+       if (natmem_size > 0xc0000000) {
+               natmem_size = 0xc0000000;
        }
 
        write_log (_T("MMAN: Total physical RAM %llu MB, all RAM %llu MB\n"),
@@ -263,6 +259,7 @@ bool preinit_shm (void)
        } else {
                max_z3fastmem = natmem_size;
        }
+       max_physmem = natmem_size;
        write_log (_T("MMAN: Reserved %p-%p (0x%08x %dM)\n"),
                           natmem_reserved, (uae_u8 *) natmem_reserved + natmem_reserved_size,
                           natmem_reserved_size, natmem_reserved_size / (1024 * 1024));
index 76ed7a64147685b50bfae3a366d0a0ce988bb6b6..85769282579d4296fa1f2e2396f00ac4441b69b9 100644 (file)
@@ -2412,8 +2412,12 @@ int picasso_getwritewatch (int index, int offset, uae_u8 ***gwwbufp, uae_u8 **st
        ULONG ps;
        writewatchcount[index] = gwwbufsize[index];
        watch_offset[index] = offset;
+       if (gfxmem_banks[index]->start + offset >= max_physmem) {
+               writewatchcount[index] = 0;
+               return -1;
+       }
        uae_u8 *start = gfxmem_banks[index]->start + natmem_offset + offset;
-       if (GetWriteWatch (WRITE_WATCH_FLAG_RESET, gfxmem_banks[index]->start + natmem_offset + offset, (gwwbufsize[index] - 1) * gwwpagesize[index], gwwbuf[index], &writewatchcount[index], &ps)) {
+       if (GetWriteWatch (WRITE_WATCH_FLAG_RESET, start, (gwwbufsize[index] - 1) * gwwpagesize[index], gwwbuf[index], &writewatchcount[index], &ps)) {
                write_log (_T("picasso_getwritewatch %d\n"), GetLastError ());
                writewatchcount[index] = 0;
                return -1;