From: Toni Wilen Date: Sat, 10 Dec 2022 11:24:06 +0000 (+0200) Subject: Increase max natmem RAM location to include possible G-REX PCI VRAM space X-Git-Tag: 41000~12 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=494704feac1c4fe74f155a4480fa4bc631554f32;p=francis%2Fwinuae.git Increase max natmem RAM location to include possible G-REX PCI VRAM space --- diff --git a/include/memory.h b/include/memory.h index 601b696b..9946d7d6 100644 --- a/include/memory.h +++ b/include/memory.h @@ -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); diff --git a/od-win32/mman.cpp b/od-win32/mman.cpp index fc212404..64eb6d4d 100644 --- a/od-win32/mman.cpp +++ b/od-win32/mman.cpp @@ -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)); diff --git a/od-win32/picasso96_win.cpp b/od-win32/picasso96_win.cpp index 76ed7a64..85769282 100644 --- a/od-win32/picasso96_win.cpp +++ b/od-win32/picasso96_win.cpp @@ -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;