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);
#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
#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;
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"),
} 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));
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;