diff --git a/Platform/Apple/virtual/src/plasma/diskops.pla b/Platform/Apple/virtual/src/plasma/diskops.pla index 4dc6d7ee..c3669c58 100644 --- a/Platform/Apple/virtual/src/plasma/diskops.pla +++ b/Platform/Apple/virtual/src/plasma/diskops.pla @@ -176,7 +176,6 @@ def _saveGame() // Perform garbage collection and record the size of the heap so we can restore it correctly global=>w_heapSize = mmgr(HEAP_COLLECT, 0) - HEAP_BOTTOM - printf1("heapSize=$%x\n", global=>w_heapSize) // Copy data to main memory mmgr(FINISH_LOAD, WITH_CLOSE) @@ -234,8 +233,8 @@ def loadInternal() // Init the heap with the correct size p_loaded = $4000 - printf1("Loaded heap size: $%x\n", p_loaded=>w_heapSize) initHeap(p_loaded=>w_heapSize) + global = getGlobals() // Now copy the data back up to the heap space, and we're done copyHeap(1) // main to aux diff --git a/Platform/Apple/virtual/src/plasma/gameloop.pla b/Platform/Apple/virtual/src/plasma/gameloop.pla index efd22f2b..ecc8e6e2 100644 --- a/Platform/Apple/virtual/src/plasma/gameloop.pla +++ b/Platform/Apple/virtual/src/plasma/gameloop.pla @@ -2074,7 +2074,11 @@ def _initHeap(loadedSize) mmgr(HEAP_ADD_TYPE, typeTbls[i]) i = i+1 loop - global = mmgr(HEAP_ALLOC, TYPE_GLOBAL) + if loadedSize <> 0 + global = HEAP_BOTTOM + else + global = mmgr(HEAP_ALLOC, TYPE_GLOBAL) + fin end ///////////////////////////////////////////////////////////////////////////////////////////////////