]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Store highest RAM address
authorToni Wilen <twilen@winuae.net>
Sun, 4 Dec 2022 19:19:13 +0000 (21:19 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 4 Dec 2022 19:19:13 +0000 (21:19 +0200)
include/memory.h
memory.cpp

index 71e1ae630c5d0f61bd5b36339fb73c987165d7ab..601b696b58f5222317f3fe3e793a4ecbd4accdf6 100644 (file)
@@ -28,6 +28,7 @@ void free_shm (void);
 bool preinit_shm (void);
 extern bool canbang;
 extern bool jit_direct_compatible_memory;
+extern uaecptr highest_ram;
 
 #define Z3BASE_UAE 0x10000000
 #define Z3BASE_REAL 0x40000000
index 3b4cf78a104acba66aa2db3f8268a02032258148..916782dab3cdcf3b8a9eec76700e45c16846058f 100644 (file)
@@ -44,6 +44,7 @@
 #include "casablanca.h"
 
 bool canbang;
+uaecptr highest_ram;
 static bool rom_write_enabled;
 #ifdef JIT
 /* Set by each memory handler that does not simply access real memory. */
@@ -2789,6 +2790,7 @@ void memory_reset (void)
        int bnk, bnk_end;
        bool gayleorfatgary;
 
+       highest_ram = 0;
        alg_flag = 0;
        need_hardreset = false;
        rom_write_enabled = true;
@@ -3401,6 +3403,9 @@ void map_banks (addrbank *bank, int start, int size, int realsize)
 #ifdef WITH_PPC
        ppc_generate_map_banks(bank, start, size);
 #endif
+       if ((bank->flags & ABFLAG_RAM) && !(bank->flags & ABFLAG_RTG) && ((start + size) << 16) > highest_ram) {
+               highest_ram = (start + size) << 16;
+       }
 }
 
 bool validate_banks_z3(addrbank *bank, int start, int size)